From f8f9b3204f0f17586820136999deaf35196e8177 Mon Sep 17 00:00:00 2001 From: yaemiku Date: Thu, 23 Jun 2022 00:44:06 +0200 Subject: [PATCH] [func] zarzad i skladki --- core/admin.py | 9 + core/migrations/0002_membership.py | 26 ++ core/migrations/0003_administration.py | 29 ++ ...stration_type_alter_administration_year.py | 23 ++ .../0005_alter_administration_year.py | 18 + core/models.py | 30 ++ core/static/css/dist/styles.css | 380 ++++++++++++++++-- core/templates/administration.html | 102 +++++ core/templates/home.html | 2 +- core/templates/membership.html | 15 + core/urls.py | 13 +- core/views.py | 28 ++ 12 files changed, 621 insertions(+), 54 deletions(-) create mode 100644 core/migrations/0002_membership.py create mode 100644 core/migrations/0003_administration.py create mode 100644 core/migrations/0004_alter_administration_type_alter_administration_year.py create mode 100644 core/migrations/0005_alter_administration_year.py create mode 100644 core/templates/administration.html create mode 100644 core/templates/membership.html diff --git a/core/admin.py b/core/admin.py index 548c894..f4b7090 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,4 +1,6 @@ +from django.apps import apps from django.contrib import admin +from django.contrib.admin.sites import AlreadyRegistered from django_summernote.admin import SummernoteModelAdmin from .models import * @@ -11,6 +13,13 @@ class PostModelAdmin(SummernoteModelAdmin): admin.site.register(Post, PostModelAdmin) +app_models = apps.get_app_config('core').get_models() +for model in app_models: + try: + admin.site.register(model) + except AlreadyRegistered: + pass + admin.site.site_header = 'pdlzbs' admin.site.site_title = 'pdlzbs' admin.site.index_title = 'Panel administracyjny' diff --git a/core/migrations/0002_membership.py b/core/migrations/0002_membership.py new file mode 100644 index 0000000..8e08777 --- /dev/null +++ b/core/migrations/0002_membership.py @@ -0,0 +1,26 @@ +# Generated by Django 4.0.5 on 2022-06-22 21:33 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Membership', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('year', models.IntegerField(verbose_name='Rok')), + ('attachment', models.FileField(upload_to='skladki', verbose_name='Plik pdf')), + ], + options={ + 'verbose_name': 'Składka członkowska', + 'verbose_name_plural': 'Składki członkowskie', + 'ordering': ['-year'], + }, + ), + ] diff --git a/core/migrations/0003_administration.py b/core/migrations/0003_administration.py new file mode 100644 index 0000000..d4736e8 --- /dev/null +++ b/core/migrations/0003_administration.py @@ -0,0 +1,29 @@ +# Generated by Django 4.0.5 on 2022-06-22 21:44 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0002_membership'), + ] + + operations = [ + migrations.CreateModel( + name='Administration', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('type', models.IntegerField(choices=[(1, 'Statut'), (2, 'Ogłoszenie'), (3, 'Protokół / Ustawa'), (4, 'Regulamin')])), + ('title', models.CharField(max_length=250, verbose_name='Tytuł')), + ('attachment', models.FileField(upload_to='skladki', verbose_name='Plik pdf')), + ('year', models.IntegerField(verbose_name='Rok')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ], + options={ + 'verbose_name': 'Plik zarządu', + 'verbose_name_plural': 'Pliki zarządu', + 'ordering': ['type', '-created_at'], + }, + ), + ] diff --git a/core/migrations/0004_alter_administration_type_alter_administration_year.py b/core/migrations/0004_alter_administration_type_alter_administration_year.py new file mode 100644 index 0000000..0baaf47 --- /dev/null +++ b/core/migrations/0004_alter_administration_type_alter_administration_year.py @@ -0,0 +1,23 @@ +# Generated by Django 4.0.5 on 2022-06-22 22:41 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0003_administration'), + ] + + operations = [ + migrations.AlterField( + model_name='administration', + name='type', + field=models.IntegerField(choices=[(1, 'Statut'), (2, 'Ogłoszenie'), (3, 'Protokół / Uchwała'), (4, 'Regulamin')]), + ), + migrations.AlterField( + model_name='administration', + name='year', + field=models.IntegerField(blank=True, verbose_name='Rok'), + ), + ] diff --git a/core/migrations/0005_alter_administration_year.py b/core/migrations/0005_alter_administration_year.py new file mode 100644 index 0000000..9396ca1 --- /dev/null +++ b/core/migrations/0005_alter_administration_year.py @@ -0,0 +1,18 @@ +# Generated by Django 4.0.5 on 2022-06-22 22:41 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0004_alter_administration_type_alter_administration_year'), + ] + + operations = [ + migrations.AlterField( + model_name='administration', + name='year', + field=models.IntegerField(blank=True, null=True, verbose_name='Rok'), + ), + ] diff --git a/core/models.py b/core/models.py index 12022c1..71a447c 100644 --- a/core/models.py +++ b/core/models.py @@ -15,3 +15,33 @@ class Post(models.Model): verbose_name = 'Ogłoszenie' verbose_name_plural = 'Ogłoszenia' ordering = ['-created_at'] + + +class Membership(models.Model): + year = models.IntegerField('Rok') + attachment = models.FileField('Plik pdf', upload_to='skladki') + + def __str__(self): + return f'Składki członkowskie {self.year}' + + class Meta: + verbose_name = 'Składka członkowska' + verbose_name_plural = 'Składki członkowskie' + 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) + + def __str__(self): + return self.title + + class Meta: + verbose_name = 'Plik zarządu' + verbose_name_plural = 'Pliki zarządu' + ordering = ['type', '-created_at'] diff --git a/core/static/css/dist/styles.css b/core/static/css/dist/styles.css index 20d3075..9c14284 100644 --- a/core/static/css/dist/styles.css +++ b/core/static/css/dist/styles.css @@ -1081,6 +1081,216 @@ select { margin-bottom: 0; } +.prose-sm { + font-size: 0.875rem; + line-height: 1.7142857; +} + +.prose-sm :where(p):not(:where([class~="not-prose"] *)) { + margin-top: 1.1428571em; + margin-bottom: 1.1428571em; +} + +.prose-sm :where([class~="lead"]):not(:where([class~="not-prose"] *)) { + font-size: 1.2857143em; + line-height: 1.5555556; + margin-top: 0.8888889em; + margin-bottom: 0.8888889em; +} + +.prose-sm :where(blockquote):not(:where([class~="not-prose"] *)) { + margin-top: 1.3333333em; + margin-bottom: 1.3333333em; + padding-left: 1.1111111em; +} + +.prose-sm :where(h1):not(:where([class~="not-prose"] *)) { + font-size: 2.1428571em; + margin-top: 0; + margin-bottom: 0.8em; + line-height: 1.2; +} + +.prose-sm :where(h2):not(:where([class~="not-prose"] *)) { + font-size: 1.4285714em; + margin-top: 1.6em; + margin-bottom: 0.8em; + line-height: 1.4; +} + +.prose-sm :where(h3):not(:where([class~="not-prose"] *)) { + font-size: 1.2857143em; + margin-top: 1.5555556em; + margin-bottom: 0.4444444em; + line-height: 1.5555556; +} + +.prose-sm :where(h4):not(:where([class~="not-prose"] *)) { + margin-top: 1.4285714em; + margin-bottom: 0.5714286em; + line-height: 1.4285714; +} + +.prose-sm :where(img):not(:where([class~="not-prose"] *)) { + margin-top: 1.7142857em; + margin-bottom: 1.7142857em; +} + +.prose-sm :where(video):not(:where([class~="not-prose"] *)) { + margin-top: 1.7142857em; + margin-bottom: 1.7142857em; +} + +.prose-sm :where(figure):not(:where([class~="not-prose"] *)) { + margin-top: 1.7142857em; + margin-bottom: 1.7142857em; +} + +.prose-sm :where(figure > *):not(:where([class~="not-prose"] *)) { + margin-top: 0; + margin-bottom: 0; +} + +.prose-sm :where(figcaption):not(:where([class~="not-prose"] *)) { + font-size: 0.8571429em; + line-height: 1.3333333; + margin-top: 0.6666667em; +} + +.prose-sm :where(code):not(:where([class~="not-prose"] *)) { + font-size: 0.8571429em; +} + +.prose-sm :where(h2 code):not(:where([class~="not-prose"] *)) { + font-size: 0.9em; +} + +.prose-sm :where(h3 code):not(:where([class~="not-prose"] *)) { + font-size: 0.8888889em; +} + +.prose-sm :where(pre):not(:where([class~="not-prose"] *)) { + font-size: 0.8571429em; + line-height: 1.6666667; + margin-top: 1.6666667em; + margin-bottom: 1.6666667em; + border-radius: 0.25rem; + padding-top: 0.6666667em; + padding-right: 1em; + padding-bottom: 0.6666667em; + padding-left: 1em; +} + +.prose-sm :where(ol):not(:where([class~="not-prose"] *)) { + padding-left: 1.5714286em; +} + +.prose-sm :where(ul):not(:where([class~="not-prose"] *)) { + padding-left: 1.5714286em; +} + +.prose-sm :where(li):not(:where([class~="not-prose"] *)) { + margin-top: 0.2857143em; + margin-bottom: 0.2857143em; +} + +.prose-sm :where(ol > li):not(:where([class~="not-prose"] *)) { + padding-left: 0.4285714em; +} + +.prose-sm :where(ul > li):not(:where([class~="not-prose"] *)) { + padding-left: 0.4285714em; +} + +.prose-sm > :where(ul > li p):not(:where([class~="not-prose"] *)) { + margin-top: 0.5714286em; + margin-bottom: 0.5714286em; +} + +.prose-sm > :where(ul > li > *:first-child):not(:where([class~="not-prose"] *)) { + margin-top: 1.1428571em; +} + +.prose-sm > :where(ul > li > *:last-child):not(:where([class~="not-prose"] *)) { + margin-bottom: 1.1428571em; +} + +.prose-sm > :where(ol > li > *:first-child):not(:where([class~="not-prose"] *)) { + margin-top: 1.1428571em; +} + +.prose-sm > :where(ol > li > *:last-child):not(:where([class~="not-prose"] *)) { + margin-bottom: 1.1428571em; +} + +.prose-sm :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~="not-prose"] *)) { + margin-top: 0.5714286em; + margin-bottom: 0.5714286em; +} + +.prose-sm :where(hr):not(:where([class~="not-prose"] *)) { + margin-top: 2.8571429em; + margin-bottom: 2.8571429em; +} + +.prose-sm :where(hr + *):not(:where([class~="not-prose"] *)) { + margin-top: 0; +} + +.prose-sm :where(h2 + *):not(:where([class~="not-prose"] *)) { + margin-top: 0; +} + +.prose-sm :where(h3 + *):not(:where([class~="not-prose"] *)) { + margin-top: 0; +} + +.prose-sm :where(h4 + *):not(:where([class~="not-prose"] *)) { + margin-top: 0; +} + +.prose-sm :where(table):not(:where([class~="not-prose"] *)) { + font-size: 0.8571429em; + line-height: 1.5; +} + +.prose-sm :where(thead th):not(:where([class~="not-prose"] *)) { + padding-right: 1em; + padding-bottom: 0.6666667em; + padding-left: 1em; +} + +.prose-sm :where(thead th:first-child):not(:where([class~="not-prose"] *)) { + padding-left: 0; +} + +.prose-sm :where(thead th:last-child):not(:where([class~="not-prose"] *)) { + padding-right: 0; +} + +.prose-sm :where(tbody td):not(:where([class~="not-prose"] *)) { + padding-top: 0.6666667em; + padding-right: 1em; + padding-bottom: 0.6666667em; + padding-left: 1em; +} + +.prose-sm :where(tbody td:first-child):not(:where([class~="not-prose"] *)) { + padding-left: 0; +} + +.prose-sm :where(tbody td:last-child):not(:where([class~="not-prose"] *)) { + padding-right: 0; +} + +.prose-sm > :where(:first-child):not(:where([class~="not-prose"] *)) { + margin-top: 0; +} + +.prose-sm > :where(:last-child):not(:where([class~="not-prose"] *)) { + margin-bottom: 0; +} + .nav-item { border-top-width: 1px; --tw-border-opacity: 1; @@ -1134,11 +1344,6 @@ select { margin-right: auto; } -.my-4 { - margin-top: 1rem; - margin-bottom: 1rem; -} - .mt-\[40px\] { margin-top: 40px; } @@ -1151,14 +1356,14 @@ select { margin-left: -12px; } -.mb-0 { - margin-bottom: 0px; -} - .mb-4 { margin-bottom: 1rem; } +.mb-0 { + margin-bottom: 0px; +} + .block { display: block; } @@ -1171,6 +1376,10 @@ select { display: table; } +.grid { + display: grid; +} + .contents { display: contents; } @@ -1211,12 +1420,8 @@ select { min-width: 145px; } -.basis-2\/3 { - flex-basis: 66.666667%; -} - -.basis-1\/3 { - flex-basis: 33.333333%; +.max-w-xs { + max-width: 20rem; } .basis-3\/5 { @@ -1235,10 +1440,18 @@ select { transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } +.grid-cols-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)); +} + .flex-col { flex-direction: column; } +.place-items-center { + place-items: center; +} + .items-center { align-items: center; } @@ -1267,6 +1480,10 @@ select { gap: 0.75rem; } +.gap-2 { + gap: 0.5rem; +} + .border { border-width: 1px; } @@ -1275,10 +1492,6 @@ select { border-bottom-width: 1px; } -.border-b-2 { - border-bottom-width: 2px; -} - .border-dashed { border-style: dashed; } @@ -1325,14 +1538,6 @@ select { padding-bottom: 1.5rem; } -.pb-4 { - padding-bottom: 1rem; -} - -.pt-4 { - padding-top: 1rem; -} - .pt-0 { padding-top: 0px; } @@ -1353,21 +1558,6 @@ select { font-size: 15px; } -.text-2xl { - font-size: 1.5rem; - line-height: 2rem; -} - -.text-5xl { - font-size: 3rem; - line-height: 1; -} - -.text-4xl { - font-size: 2.25rem; - line-height: 2.5rem; -} - .text-3xl { font-size: 1.875rem; line-height: 2.25rem; @@ -1378,6 +1568,26 @@ select { line-height: 1.75rem; } +.text-5xl { + font-size: 3rem; + line-height: 1; +} + +.text-2xl { + font-size: 1.5rem; + line-height: 2rem; +} + +.text-4xl { + font-size: 2.25rem; + line-height: 2.5rem; +} + +.text-lg { + font-size: 1.125rem; + line-height: 1.75rem; +} + .font-bold { font-weight: 700; } @@ -1386,6 +1596,14 @@ select { font-weight: 300; } +.font-medium { + font-weight: 500; +} + +.font-semibold { + font-weight: 600; +} + .italic { font-style: italic; } @@ -1445,12 +1663,90 @@ select { display: block; } +.prose-headings\:mb-0 :is(:where(h1, h2, h3, h4, th):not(:where([class~="not-prose"] *))) { + margin-bottom: 0px; +} + +.prose-headings\:mt-0 :is(:where(h1, h2, h3, h4, th):not(:where([class~="not-prose"] *))) { + margin-top: 0px; +} + +.prose-h1\:mb-0 :is(:where(h1):not(:where([class~="not-prose"] *))) { + margin-bottom: 0px; +} + +.prose-h1\:text-xl :is(:where(h1):not(:where([class~="not-prose"] *))) { + font-size: 1.25rem; + line-height: 1.75rem; +} + +.prose-h1\:text-lg :is(:where(h1):not(:where([class~="not-prose"] *))) { + font-size: 1.125rem; + line-height: 1.75rem; +} + +.prose-h1\:text-xs :is(:where(h1):not(:where([class~="not-prose"] *))) { + font-size: 0.75rem; + line-height: 1rem; +} + .prose-h1\:font-light :is(:where(h1):not(:where([class~="not-prose"] *))) { font-weight: 300; } +.prose-h2\:my-0 :is(:where(h2):not(:where([class~="not-prose"] *))) { + margin-top: 0px; + margin-bottom: 0px; +} + +.prose-h2\:mt-0 :is(:where(h2):not(:where([class~="not-prose"] *))) { + margin-top: 0px; +} + +.prose-h2\:bg-black :is(:where(h2):not(:where([class~="not-prose"] *))) { + --tw-bg-opacity: 1; + background-color: rgb(0 0 0 / var(--tw-bg-opacity)); +} + +.prose-h2\:text-xs :is(:where(h2):not(:where([class~="not-prose"] *))) { + font-size: 0.75rem; + line-height: 1rem; +} + +.prose-h2\:text-2xl :is(:where(h2):not(:where([class~="not-prose"] *))) { + font-size: 1.5rem; + line-height: 2rem; +} + +.prose-h2\:font-light :is(:where(h2):not(:where([class~="not-prose"] *))) { + font-weight: 300; +} + +.prose-h3\:bg-black :is(:where(h3):not(:where([class~="not-prose"] *))) { + --tw-bg-opacity: 1; + background-color: rgb(0 0 0 / var(--tw-bg-opacity)); +} + +.prose-h3\:text-xs :is(:where(h3):not(:where([class~="not-prose"] *))) { + font-size: 0.75rem; + line-height: 1rem; +} + +.prose-h3\:text-2xl :is(:where(h3):not(:where([class~="not-prose"] *))) { + font-size: 1.5rem; + line-height: 2rem; +} + @media (min-width: 1024px) { + .lg\:grid-cols-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + .lg\:flex-row { flex-direction: row; } + + .lg\:gap-2 { + gap: 0.5rem; + } } diff --git a/core/templates/administration.html b/core/templates/administration.html new file mode 100644 index 0000000..12b36a2 --- /dev/null +++ b/core/templates/administration.html @@ -0,0 +1,102 @@ +{% extends 'base.html' %} {% block title %}Strona główna | pdlzbs{% endblock %} +{% load static tailwind_tags %} {% block content %} +
+

Ogłoszenia

+ {% for file in ogloszenia %} + + {% empty %} + Brak ogłoszeń + {% endfor %} +

Protokoły / Ustawy

+ {% for file in protokoly %} + + {% empty %} + Brak protokołów / ustaw + {% endfor %} +

Regulaminy

+ {% for file in regulaminy %} + + {% 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/home.html b/core/templates/home.html index 2d9a519..b3cb666 100644 --- a/core/templates/home.html +++ b/core/templates/home.html @@ -13,7 +13,7 @@ {% for post in posts %}

{{ post.title }}

{{ post.content | safe }} diff --git a/core/templates/membership.html b/core/templates/membership.html new file mode 100644 index 0000000..f365cac --- /dev/null +++ b/core/templates/membership.html @@ -0,0 +1,15 @@ +{% extends 'base.html' %} {% block title %}Strona główna | pdlzbs{% endblock %} +{% load static tailwind_tags %} {% block content %} +
+ {% for membership in memberships %} + + {% empty %} + Brak dokumentów + {% endfor %} {% endblock %} +
diff --git a/core/urls.py b/core/urls.py index ea357c1..ea9bdd1 100644 --- a/core/urls.py +++ b/core/urls.py @@ -3,20 +3,11 @@ from .views import * urlpatterns = [ path('', HomeView.as_view(), name='home'), - path('zarzad', HomeView.as_view(), name='administration'), + 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('inneturnieje', HomeView.as_view(), name='others'), - path('skladki', HomeView.as_view(), name='membership'), + path('skladki', MembershipView.as_view(), name='membership'), ] - -# -# -# -# -# -# -# -# diff --git a/core/views.py b/core/views.py index 818766b..b93a06c 100644 --- a/core/views.py +++ b/core/views.py @@ -18,3 +18,31 @@ class HomeView(TemplateView): context['posts'] = posts[1:] if len(posts) > 1 else [] return context + + +class MembershipView(TemplateView): + template_name = 'membership.html' + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + 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