From 1aab5fa70dbd72b96ef293bcd559881e9eb16a96 Mon Sep 17 00:00:00 2001 From: yaemiku Date: Thu, 7 Jul 2022 02:30:36 +0200 Subject: [PATCH] big update [func] all pages apart from other tournaments --- .worktime | 3 +- core/admin.py | 20 ++- ...ouncement_administrationmember_and_more.py | 132 +++++++++++++++++ .../0007_rodo_rename_thirdleague_league.py | 29 ++++ core/models.py | 134 ++++++++++++++++-- core/static/css/dist/styles.css | 134 +++++++++++++++++- core/templates/administration.html | 86 ++++------- core/templates/base.html | 4 +- core/templates/calendar.html | 14 ++ core/templates/grandprix.html | 7 + core/templates/home.html | 8 +- core/templates/league.html | 16 +++ core/templates/membership.html | 8 +- core/templates/rodo.html | 15 ++ core/urls.py | 8 +- core/views.py | 76 +++++++--- pdlzbs/settings.py | 4 +- pdlzbs/urls.py | 1 + requirements.txt | 4 +- 19 files changed, 597 insertions(+), 106 deletions(-) create mode 100644 core/migrations/0006_administrationannouncement_administrationmember_and_more.py create mode 100644 core/migrations/0007_rodo_rename_thirdleague_league.py create mode 100644 core/templates/calendar.html create mode 100644 core/templates/grandprix.html create mode 100644 core/templates/league.html create mode 100644 core/templates/rodo.html diff --git a/.worktime b/.worktime index 3fc7335..aa66b14 100644 --- a/.worktime +++ b/.worktime @@ -2,4 +2,5 @@ 09.06.2022 - 1h 12.06.2022 - 1h 15 mins 15.06.2022 - 1h 30 mins -23.06.2022 - 1h 30 mins \ No newline at end of file +23.06.2022 - 1h 30 mins +07.07.2022 - 2h 30 mins \ No newline at end of file diff --git a/core/admin.py b/core/admin.py index f4b7090..d2a7e37 100644 --- a/core/admin.py +++ b/core/admin.py @@ -2,16 +2,34 @@ from django.apps import apps from django.contrib import admin from django.contrib.admin.sites import AlreadyRegistered from django_summernote.admin import SummernoteModelAdmin +from admin_ordering.admin import OrderableAdmin from .models import * # Register your models here. +@admin.register(Post) class PostModelAdmin(SummernoteModelAdmin): summernote_fields = ['content'] -admin.site.register(Post, PostModelAdmin) +@admin.register(Calendar) +class CalendarModelAdmin(SummernoteModelAdmin): + summernote_fields = ['content'] + + +@admin.register(GrandPrix) +class GrandPrixModelAdmin(SummernoteModelAdmin): + summernote_fields = ['content'] + + +@admin.register(AdministrationMember) +class AdministrationMemberModelAdmin(OrderableAdmin, admin.ModelAdmin): + list_display = ['__str__', 'ordering'] + list_editable = ['ordering'] + ordering_field_hide_input = True + exclude = ['ordering'] + app_models = apps.get_app_config('core').get_models() for model in app_models: diff --git a/core/migrations/0006_administrationannouncement_administrationmember_and_more.py b/core/migrations/0006_administrationannouncement_administrationmember_and_more.py new file mode 100644 index 0000000..3f9d109 --- /dev/null +++ b/core/migrations/0006_administrationannouncement_administrationmember_and_more.py @@ -0,0 +1,132 @@ +# Generated by Django 4.0.5 on 2022-07-06 23:45 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0005_alter_administration_year'), + ] + + operations = [ + migrations.CreateModel( + name='AdministrationAnnouncement', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('year', models.IntegerField(blank=True, null=True, verbose_name='Rok')), + ('title', models.CharField(max_length=250, verbose_name='Tytuł')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('attachment', models.FileField(upload_to='announcements', verbose_name='Plik pdf')), + ], + options={ + 'verbose_name': 'Zarząd - Ogłoszenie', + 'verbose_name_plural': 'Zarząd - Ogłoszenia', + }, + ), + migrations.CreateModel( + name='AdministrationMember', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('ordering', models.PositiveIntegerField(default=0, verbose_name='ordering')), + ('name', models.CharField(max_length=512, verbose_name='Imię i nazwisko')), + ('contact', models.CharField(max_length=512, verbose_name='Dane kontaktowe')), + ('function', models.CharField(max_length=512, verbose_name='Funkcja')), + ], + options={ + 'verbose_name': 'Zarząd - Członek', + 'verbose_name_plural': 'Zarząd - Członkowie', + 'ordering': ['ordering'], + 'abstract': False, + }, + ), + migrations.CreateModel( + name='AdministrationProtocol', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('year', models.IntegerField(blank=True, null=True, verbose_name='Rok')), + ('title', models.CharField(max_length=250, verbose_name='Tytuł')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('attachment', models.FileField(upload_to='protocols', verbose_name='Plik pdf')), + ], + options={ + 'verbose_name': 'Zarząd - Protokół / Uchwała', + 'verbose_name_plural': 'Zarząd - Protokoły / Uchwały', + }, + ), + migrations.CreateModel( + name='AdministrationRegulation', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('year', models.IntegerField(blank=True, null=True, verbose_name='Rok')), + ('title', models.CharField(max_length=250, verbose_name='Tytuł')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('attachment', models.FileField(upload_to='regulations', verbose_name='Plik pdf')), + ], + options={ + 'verbose_name': 'Zarząd - Regulamin', + 'verbose_name_plural': 'Zarząd - Regulaminy', + }, + ), + migrations.CreateModel( + name='AdministrationStatute', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('year', models.IntegerField(blank=True, null=True, verbose_name='Rok')), + ('title', models.CharField(max_length=250, verbose_name='Tytuł')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('attachment', models.FileField(upload_to='statutes', verbose_name='Plik pdf')), + ], + options={ + 'verbose_name': 'Zarząd - Statut', + 'verbose_name_plural': 'Zarząd - Statuty', + }, + ), + migrations.CreateModel( + name='Calendar', + fields=[ + ('year', models.IntegerField(primary_key=True, serialize=False, verbose_name='Rok')), + ('content', models.TextField(verbose_name='Kalendarz')), + ], + options={ + 'verbose_name': 'Kalendarz', + 'verbose_name_plural': 'Kalendarze', + 'ordering': ['-year'], + }, + ), + migrations.CreateModel( + name='GrandPrix', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('content', models.TextField(verbose_name='Tekst GPB')), + ], + options={ + 'verbose_name': 'Grand Prix Białegostoku', + 'verbose_name_plural': 'Grand Prix Białegostoku', + }, + ), + migrations.CreateModel( + name='ThirdLeague', + fields=[ + ('year', models.IntegerField(primary_key=True, serialize=False, verbose_name='Rok')), + ('link', models.CharField(max_length=512, verbose_name='Link do wyników')), + ], + options={ + 'verbose_name': 'Wyniki III Ligi', + 'verbose_name_plural': 'Wyniki III Ligi', + 'ordering': ['-year'], + }, + ), + migrations.DeleteModel( + name='Administration', + ), + migrations.RemoveField( + model_name='membership', + name='id', + ), + migrations.AlterField( + model_name='membership', + name='year', + field=models.IntegerField(primary_key=True, serialize=False, verbose_name='Rok'), + ), + ] diff --git a/core/migrations/0007_rodo_rename_thirdleague_league.py b/core/migrations/0007_rodo_rename_thirdleague_league.py new file mode 100644 index 0000000..9a026dc --- /dev/null +++ b/core/migrations/0007_rodo_rename_thirdleague_league.py @@ -0,0 +1,29 @@ +# Generated by Django 4.0.5 on 2022-07-06 23:53 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0006_administrationannouncement_administrationmember_and_more'), + ] + + operations = [ + migrations.CreateModel( + name='RODO', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('who', models.CharField(max_length=512, verbose_name='Przez kogo przetwarzane dane osobowe?')), + ('attachment', models.FileField(upload_to='rodo', verbose_name='Plik pdf')), + ], + options={ + 'verbose_name': 'Dokument RODO', + 'verbose_name_plural': 'Dokumenty RODO', + }, + ), + migrations.RenameModel( + old_name='ThirdLeague', + new_name='League', + ), + ] diff --git a/core/models.py b/core/models.py index 71a447c..7e14450 100644 --- a/core/models.py +++ b/core/models.py @@ -1,4 +1,6 @@ from django.db import models +from admin_ordering.models import OrderableModel + # Create your models here. @@ -17,8 +19,83 @@ class Post(models.Model): ordering = ['-created_at'] +class AttachmentModel(models.Model): + year = models.IntegerField('Rok', blank=True, null=True) + title = models.CharField('Tytuł', max_length=250) + created_at = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return self.title + + class Meta: + abstract = True + ordering = ['-created_at'] + + +class SingletonModel(models.Model): + class Meta: + abstract = True + + def save(self, *args, **kwargs): + self.pk = 1 + super(SingletonModel, self).save(*args, **kwargs) + + def delete(self, *args, **kwargs): + pass + + @classmethod + def load(cls): + obj, created = cls.objects.get_or_create(pk=1) + return obj + + +class AdministrationStatute(AttachmentModel): + attachment = models.FileField('Plik pdf', upload_to='statutes') + + class Meta: + verbose_name = 'Zarząd - Statut' + verbose_name_plural = 'Zarząd - Statuty' + + +class AdministrationAnnouncement(AttachmentModel): + attachment = models.FileField('Plik pdf', upload_to='announcements') + + class Meta: + verbose_name = 'Zarząd - Ogłoszenie' + verbose_name_plural = 'Zarząd - Ogłoszenia' + + +class AdministrationProtocol(AttachmentModel): + attachment = models.FileField('Plik pdf', upload_to='protocols') + + class Meta: + verbose_name = 'Zarząd - Protokół / Uchwała' + verbose_name_plural = 'Zarząd - Protokoły / Uchwały' + + +class AdministrationRegulation(AttachmentModel): + attachment = models.FileField('Plik pdf', upload_to='regulations') + + class Meta: + verbose_name = 'Zarząd - Regulamin' + verbose_name_plural = 'Zarząd - Regulaminy' + + +class AdministrationMember(OrderableModel): + name = models.CharField('Imię i nazwisko', max_length=512) + contact = models.CharField('Dane kontaktowe', max_length=512) + function = models.CharField('Funkcja', max_length=512) + + def __str__(self): + return f'{self.function} - {self.name}' + + class Meta(OrderableModel.Meta): + verbose_name = 'Zarząd - Członek' + verbose_name_plural = 'Zarząd - Członkowie' + + class Membership(models.Model): - year = models.IntegerField('Rok') + year = models.IntegerField('Rok', primary_key=True) attachment = models.FileField('Plik pdf', upload_to='skladki') def __str__(self): @@ -30,18 +107,51 @@ class Membership(models.Model): ordering = ['-year'] -class Administration(models.Model): - type = models.IntegerField(choices=[( - 1, 'Statut'), (2, 'Ogłoszenie'), (3, 'Protokół / Uchwała'), (4, 'Regulamin')]) - title = models.CharField('Tytuł', max_length=250) - attachment = models.FileField('Plik pdf', upload_to='skladki') - year = models.IntegerField('Rok', blank=True, null=True) - created_at = models.DateTimeField(auto_now_add=True) +class League(models.Model): + year = models.IntegerField('Rok', primary_key=True) + link = models.CharField('Link do wyników', max_length=512) def __str__(self): - return self.title + return f'III Liga {self.year}' class Meta: - verbose_name = 'Plik zarządu' - verbose_name_plural = 'Pliki zarządu' - ordering = ['type', '-created_at'] + verbose_name = 'Wyniki III Ligi' + verbose_name_plural = 'Wyniki III Ligi' + ordering = ['-year'] + + +class Calendar(models.Model): + year = models.IntegerField('Rok', primary_key=True) + content = models.TextField('Kalendarz') + + def __str__(self): + return f'Kalendarz {self.year}' + + class Meta: + verbose_name = 'Kalendarz' + verbose_name_plural = 'Kalendarze' + ordering = ['-year'] + + +class GrandPrix(SingletonModel): + content = models.TextField('Tekst GPB') + + def __str__(self): + return 'Grand Prix Białegostoku' + + class Meta: + verbose_name = 'Grand Prix Białegostoku' + verbose_name_plural = 'Grand Prix Białegostoku' + + +class RODO(models.Model): + who = models.CharField( + 'Przez kogo przetwarzane dane osobowe?', max_length=512) + attachment = models.FileField('Plik pdf', upload_to='rodo') + + def __str__(self): + return f'RODO - {self.who}' + + class Meta: + verbose_name = 'Dokument RODO' + verbose_name_plural = 'Dokumenty RODO' diff --git a/core/static/css/dist/styles.css b/core/static/css/dist/styles.css index a69f79a..651bf96 100644 --- a/core/static/css/dist/styles.css +++ b/core/static/css/dist/styles.css @@ -1134,6 +1134,11 @@ select { margin-right: auto; } +.my-0 { + margin-top: 0px; + margin-bottom: 0px; +} + .mb-0 { margin-bottom: 0px; } @@ -1262,6 +1267,10 @@ select { gap: 0.75rem; } +.rounded-md { + border-radius: 0.375rem; +} + .border { border-width: 1px; } @@ -1289,6 +1298,26 @@ select { border-color: rgb(168 162 158 / var(--tw-border-opacity)); } +.border-slate-200 { + --tw-border-opacity: 1; + border-color: rgb(226 232 240 / var(--tw-border-opacity)); +} + +.border-slate-100 { + --tw-border-opacity: 1; + border-color: rgb(241 245 249 / var(--tw-border-opacity)); +} + +.border-stone-100 { + --tw-border-opacity: 1; + border-color: rgb(245 245 244 / var(--tw-border-opacity)); +} + +.border-stone-200 { + --tw-border-opacity: 1; + border-color: rgb(231 229 228 / var(--tw-border-opacity)); +} + .bg-white { --tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity)); @@ -1299,11 +1328,51 @@ select { background-color: rgb(249 250 251 / var(--tw-bg-opacity)); } +.bg-slate-600 { + --tw-bg-opacity: 1; + background-color: rgb(71 85 105 / var(--tw-bg-opacity)); +} + +.bg-slate-100 { + --tw-bg-opacity: 1; + background-color: rgb(241 245 249 / var(--tw-bg-opacity)); +} + +.bg-slate-50 { + --tw-bg-opacity: 1; + background-color: rgb(248 250 252 / var(--tw-bg-opacity)); +} + +.bg-stone-50 { + --tw-bg-opacity: 1; + background-color: rgb(250 250 249 / var(--tw-bg-opacity)); +} + .py-4 { padding-top: 1rem; padding-bottom: 1rem; } +.py-8 { + padding-top: 2rem; + padding-bottom: 2rem; +} + +.px-2 { + padding-left: 0.5rem; + padding-right: 0.5rem; +} + +.py-3 { + padding-top: 0.75rem; + padding-bottom: 0.75rem; +} + +.px-4 { + padding-left: 1rem; + padding-right: 1rem; +} + .pb-1 { padding-bottom: 0.25rem; } @@ -1328,9 +1397,9 @@ select { font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; } -.text-3xl { - font-size: 1.875rem; - line-height: 2.25rem; +.text-4xl { + font-size: 2.25rem; + line-height: 2.5rem; } .text-xl { @@ -1338,6 +1407,11 @@ select { line-height: 1.75rem; } +.text-3xl { + font-size: 1.875rem; + line-height: 2.25rem; +} + .text-\[13px\] { font-size: 13px; } @@ -1363,6 +1437,10 @@ select { font-weight: 300; } +.font-medium { + font-weight: 500; +} + .italic { font-style: italic; } @@ -1400,6 +1478,18 @@ select { box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } +.shadow-sm { + --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); + --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +.shadow-md { + --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + .blur { --tw-blur: blur(8px); filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); @@ -1422,10 +1512,44 @@ select { display: block; } +.hover\:border-slate-300:hover { + --tw-border-opacity: 1; + border-color: rgb(203 213 225 / var(--tw-border-opacity)); +} + +.hover\:border-slate-200:hover { + --tw-border-opacity: 1; + border-color: rgb(226 232 240 / var(--tw-border-opacity)); +} + +.hover\:border-stone-200:hover { + --tw-border-opacity: 1; + border-color: rgb(231 229 228 / var(--tw-border-opacity)); +} + +.hover\:bg-slate-200:hover { + --tw-bg-opacity: 1; + background-color: rgb(226 232 240 / var(--tw-bg-opacity)); +} + +.hover\:bg-slate-100:hover { + --tw-bg-opacity: 1; + background-color: rgb(241 245 249 / var(--tw-bg-opacity)); +} + +.hover\:bg-stone-100:hover { + --tw-bg-opacity: 1; + background-color: rgb(245 245 244 / var(--tw-bg-opacity)); +} + .prose-h1\:mb-0 :is(:where(h1):not(:where([class~="not-prose"] *))) { margin-bottom: 0px; } +.prose-h1\:text-center :is(:where(h1):not(:where([class~="not-prose"] *))) { + text-align: center; +} + .prose-h1\:font-light :is(:where(h1):not(:where([class~="not-prose"] *))) { font-weight: 300; } @@ -1435,6 +1559,10 @@ select { margin-bottom: 0px; } +.prose-h2\:font-light :is(:where(h2):not(:where([class~="not-prose"] *))) { + font-weight: 300; +} + .prose-h3\:text-xs :is(:where(h3):not(:where([class~="not-prose"] *))) { font-size: 0.75rem; line-height: 1rem; diff --git a/core/templates/administration.html b/core/templates/administration.html index 12b36a2..0429115 100644 --- a/core/templates/administration.html +++ b/core/templates/administration.html @@ -1,6 +1,35 @@ {% extends 'base.html' %} {% block title %}Strona główna | pdlzbs{% endblock %} {% load static tailwind_tags %} {% block content %}
+

Zarząd PodlZBS

+ + {% for member in czlonkowie %} +
+
+

{{ member.function }}

+

{{ member.name }}

+

{{ member.contact }}

+
+
+ {% empty %} + Brak członków + {% endfor %} + + + +
+ Adres Podlaskiego ZBS - 15-057 Białystok + ul. B. Chrobrego 5B m.33 + Konto: PKO SA O/B-tok 43 1240 5211 1111 0000 4919 1721 + NIP: 542 258 14 53 REGON 050816091 +
+

Ogłoszenia

{% for file in ogloszenia %}
@@ -15,6 +44,7 @@ {% empty %} Brak ogłoszeń {% endfor %} +

Protokoły / Ustawy

{% for file in protokoly %}
@@ -29,6 +59,7 @@ {% empty %} Brak protokołów / ustaw {% endfor %} +

Regulaminy

{% for file in regulaminy %}
@@ -43,60 +74,5 @@ {% empty %} Brak regulaminów {% endfor %} -

Zarząd PodlZBS

-
-
-

Prezes

-

Andrzej Błachno

-

tel. kom. +48 508 190 471 podlaski.wzbs@gmail.com

-
-
-

V-c Prezes Zarządu

-

Mirosław Liszewski

-

tel.608 479 096 biuro@roansj.pl

-
-
-

Członek Zarządu

-

Adam Szempliński

-

tel. +48 798 270 525 e-mail: as51as@icloud.com

-
-
-

Członek Zarządu d/s. Finansowych

-

Anna Tompolska

-

tel. kom. 668 099 992 atompolska@emag.bialystok.pl

-
-
-

Członek Zarządu d/s Cezara, odznaczeń

-

Andrzej Raczkowski

-

tel. dom. 85 744 35 03 tel. kom. 886 732 044 arara@wp.pl

-
-
-

Członek Zarządu d/s. szkolenia młodzieży

-

Krzysztof Krajewski

-

tel kom. +48 502-543-699 joe1961@wp.pl

-
-
-

Członek Zarządu d/s koordynacji sportu młodzieżowego

-

Dariusz Hutnik

-

Tel. 723 443 001 Mail: d.hutnik@wp.pl

-
-
-

Członek Zarządu d/s. Drużynowych Mistrzostw Polski (liga)

-

Artur Kozłowski

-

tel. kom. 606 478 314 a.kozlowski@pb.edu.pl

-
-
-

Członek Zarządu d/s. techniki informatycznej (IT)

-

Adam Rogowski

-

tel. kom. 512 442 959 rogowiak333@gmail.com

-
-
-
{% endblock %} diff --git a/core/templates/base.html b/core/templates/base.html index 713b51f..f220735 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -47,8 +47,8 @@ - - + + diff --git a/core/templates/calendar.html b/core/templates/calendar.html new file mode 100644 index 0000000..50664dc --- /dev/null +++ b/core/templates/calendar.html @@ -0,0 +1,14 @@ +{% extends 'base.html' %} {% block title %}Strona główna | pdlzbs{% endblock %} +{% load static tailwind_tags %} {% block content %} +
+ {% for calendar in calendars %} +
+

Kalendarz {{ calendar.year }}

+
{{ calendar.content | safe }}
+
+ {% empty %} + Brak dokumentów + {% endfor %} {% endblock %} +
diff --git a/core/templates/grandprix.html b/core/templates/grandprix.html new file mode 100644 index 0000000..69e7360 --- /dev/null +++ b/core/templates/grandprix.html @@ -0,0 +1,7 @@ +{% extends 'base.html' %} {% block title %}Strona główna | pdlzbs{% endblock %} +{% load static tailwind_tags %} {% block content %} +
+

Grand Prix Białegostoku

+
{{ gp.content | safe }}
+
+{% endblock %} diff --git a/core/templates/home.html b/core/templates/home.html index b3cb666..09df809 100644 --- a/core/templates/home.html +++ b/core/templates/home.html @@ -1,14 +1,16 @@ {% extends 'base.html' %} {% block title %}Strona główna | pdlzbs{% endblock %} {% load static tailwind_tags %} {% block content %} -
+
{% if highlight %}

{{ highlight.title }}

{{ highlight.content | safe }}
{% endif %} -
-

+
+

Aktualności PodlZBS

{% for post in posts %} diff --git a/core/templates/league.html b/core/templates/league.html new file mode 100644 index 0000000..449a5ad --- /dev/null +++ b/core/templates/league.html @@ -0,0 +1,16 @@ +{% extends 'base.html' %} {% block title %}Strona główna | pdlzbs{% endblock %} +{% load static tailwind_tags %} {% block content %} +
+ {% for league in leagues %} + + Wyniki III ligi DMP {{ league.year }}-{{ league.year | add:"1" }} + + {% empty %} + Brak wyników + {% endfor %} {% endblock %} +
diff --git a/core/templates/membership.html b/core/templates/membership.html index f365cac..a330ec1 100644 --- a/core/templates/membership.html +++ b/core/templates/membership.html @@ -1,12 +1,10 @@ {% extends 'base.html' %} {% block title %}Strona główna | pdlzbs{% endblock %} {% load static tailwind_tags %} {% block content %} -
+
{% for membership in memberships %} -
+ {% empty %} diff --git a/core/templates/rodo.html b/core/templates/rodo.html new file mode 100644 index 0000000..d9e1a1e --- /dev/null +++ b/core/templates/rodo.html @@ -0,0 +1,15 @@ +{% extends 'base.html' %} {% block title %}Strona główna | pdlzbs{% endblock %} +{% load static tailwind_tags %} {% block content %} +
+ {% for rodo in rodos %} +
+

+ Informacje o przetwarzaniu danych osobowych zawodników przez + {{ rodo.who }} +

+
+ {% empty %} + Brak dokumentów + {% endfor %} +
+{% endblock %} diff --git a/core/urls.py b/core/urls.py index ea9bdd1..9522c73 100644 --- a/core/urls.py +++ b/core/urls.py @@ -4,10 +4,10 @@ from .views import * urlpatterns = [ path('', HomeView.as_view(), name='home'), path('zarzad', AdministrationView.as_view(), name='administration'), - path('rodo', HomeView.as_view(), name='rodo'), - path('liga', HomeView.as_view(), name='league'), - path('kalendarz', HomeView.as_view(), name='calendar'), - path('grandprix', HomeView.as_view(), name='gpx'), + path('rodo', RODOView.as_view(), name='rodo'), + path('liga', LeagueView.as_view(), name='league'), + path('kalendarz', CalendarView.as_view(), name='calendar'), + path('grandprix', GrandPrixView.as_view(), name='gpx'), path('inneturnieje', HomeView.as_view(), name='others'), path('skladki', MembershipView.as_view(), name='membership'), ] diff --git a/core/views.py b/core/views.py index b93a06c..455f077 100644 --- a/core/views.py +++ b/core/views.py @@ -20,6 +20,64 @@ class HomeView(TemplateView): return context +class AdministrationView(TemplateView): + template_name = 'administration.html' + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + + context = { + **context, + 'czlonkowie': AdministrationMember.objects.all(), + 'statut': AdministrationStatute.objects.first(), + 'ogloszenia': AdministrationAnnouncement.objects.all(), + 'protokoly': AdministrationProtocol.objects.all(), + 'regulaminy': AdministrationRegulation.objects.all(), + } + + return context + + +class RODOView(TemplateView): + template_name = 'rodo.html' + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['rodos'] = RODO.objects.all() + + return context + + +class LeagueView(TemplateView): + template_name = 'league.html' + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['leagues'] = League.objects.all() + + return context + + +class CalendarView(TemplateView): + template_name = 'calendar.html' + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['calendars'] = Calendar.objects.all() + + return context + + +class GrandPrixView(TemplateView): + template_name = 'grandprix.html' + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['gp'] = GrandPrix.objects.first() + + return context + + class MembershipView(TemplateView): template_name = 'membership.html' @@ -28,21 +86,3 @@ class MembershipView(TemplateView): context['memberships'] = Membership.objects.all() return context - - -class AdministrationView(TemplateView): - template_name = 'administration.html' - - def get_context_data(self, **kwargs): - context = super().get_context_data(**kwargs) - - files = Administration.objects - context = { - **context, - 'statut': files.filter(type=1).first(), - 'ogloszenia': files.filter(type=2), - 'protokoly': files.filter(type=3), - 'regulaminy': files.filter(type=4) - } - - return context diff --git a/pdlzbs/settings.py b/pdlzbs/settings.py index b8cf555..5050fba 100644 --- a/pdlzbs/settings.py +++ b/pdlzbs/settings.py @@ -45,7 +45,9 @@ INSTALLED_APPS = [ 'core', 'tailwind', 'django_summernote', - 'django_browser_reload' + 'admin_ordering', + 'django_browser_reload', + 'django_cleanup' ] TAILWIND_APP_NAME = 'core' diff --git a/pdlzbs/urls.py b/pdlzbs/urls.py index f1e990c..b9fe790 100644 --- a/pdlzbs/urls.py +++ b/pdlzbs/urls.py @@ -22,6 +22,7 @@ urlpatterns = [ path('', include('core.urls')), path('admin/', admin.site.urls), path('summernote/', include('django_summernote.urls')), + path('editor/', include('django_summernote.urls')), path('__reload__/', include('django_browser_reload.urls')), ] diff --git a/requirements.txt b/requirements.txt index 33d0e2a..b5efdc5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,6 @@ Django django-browser-reload django-tailwind django-summernote -django-htmlmin \ No newline at end of file +django-admin-ordering +django-htmlmin +django-cleanup \ No newline at end of file