[func] zarzad i skladki

main
yaemiku 2022-06-23 00:44:06 +02:00
parent c55008c6e2
commit f8f9b3204f
Signed by: podlaskizbs
GPG Key ID: ADC039636B3E4AAB
12 changed files with 621 additions and 54 deletions

View File

@ -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'

View File

@ -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'],
},
),
]

View File

@ -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'],
},
),
]

View File

@ -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'),
),
]

View File

@ -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'),
),
]

View File

@ -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']

View File

@ -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;
}
}

View File

@ -0,0 +1,102 @@
{% extends 'base.html' %} {% block title %}Strona główna | pdlzbs{% endblock %}
{% load static tailwind_tags %} {% block content %}
<div class="flex flex-col items-center gap-4">
<h1 class="text-3xl">Ogłoszenia</h1>
{% for file in ogloszenia %}
<article>
<a
href="{{ file.attachment.url }}"
target="_blank"
class="text-xl font-semibold underline"
>
<h2 class="mb-0">{{ file }}</h2>
</a>
</article>
{% empty %}
<span class="py-4 text-xl">Brak ogłoszeń</span>
{% endfor %}
<h1 class="text-3xl">Protokoły / Ustawy</h1>
{% for file in protokoly %}
<article>
<a
href="{{ file.attachment.url }}"
target="_blank"
class="text-xl font-semibold underline"
>
<h2 class="mb-0">{{ file }}</h2>
</a>
</article>
{% empty %}
<span class="py-4 text-xl">Brak protokołów / ustaw</span>
{% endfor %}
<h1 class="text-3xl">Regulaminy</h1>
{% for file in regulaminy %}
<article>
<a
href="{{ file.attachment.url }}"
target="_blank"
class="text-xl font-semibold underline"
>
<h2 class="mb-0">{{ file }}</h2>
</a>
</article>
{% empty %}
<span class="py-4 text-xl">Brak regulaminów</span>
{% endfor %}
<h1 class="text-3xl">Zarząd PodlZBS</h1>
<div
class="grid lg:grid-cols-2 gap-4 text-center items-center place-items-center prose-h1:font-light prose-h3:text-xs prose-h2:text-md prose-h2:my-0 prose-h1:mb-0"
>
<div class="prose">
<h1>Prezes</h1>
<h2>Andrzej Błachno</h2>
<h3>tel. kom. +48 508 190 471 podlaski.wzbs@gmail.com</h3>
</div>
<div class="prose">
<h1>V-c Prezes Zarządu</h1>
<h2>Mirosław Liszewski</h2>
<h3>tel.608 479 096 biuro@roansj.pl</h3>
</div>
<div class="prose">
<h1>Członek Zarządu</h1>
<h2>Adam Szempliński</h2>
<h3>tel. +48 798 270 525 e-mail: as51as@icloud.com</h3>
</div>
<div class="prose">
<h1>Członek Zarządu d/s. Finansowych</h1>
<h2>Anna Tompolska</h2>
<h3>tel. kom. 668 099 992 atompolska@emag.bialystok.pl</h3>
</div>
<div class="prose">
<h1>Członek Zarządu d/s Cezara, odznaczeń</h1>
<h2>Andrzej Raczkowski</h2>
<h3>tel. dom. 85 744 35 03 tel. kom. 886 732 044 arara@wp.pl</h3>
</div>
<div class="prose">
<h1>Członek Zarządu d/s. szkolenia młodzieży</h1>
<h2>Krzysztof Krajewski</h2>
<h3>tel kom. +48 502-543-699 joe1961@wp.pl</h3>
</div>
<div class="prose">
<h1>Członek Zarządu d/s koordynacji sportu młodzieżowego</h1>
<h2>Dariusz Hutnik</h2>
<h3>Tel. 723 443 001 Mail: d.hutnik@wp.pl</h3>
</div>
<div class="prose">
<h1>Członek Zarządu d/s. Drużynowych Mistrzostw Polski (liga)</h1>
<h2>Artur Kozłowski</h2>
<h3>tel. kom. 606 478 314 a.kozlowski@pb.edu.pl</h3>
</div>
<div class="prose">
<h1>Członek Zarządu d/s. techniki informatycznej (IT)</h1>
<h2>Adam Rogowski</h2>
<h3>tel. kom. 512 442 959 rogowiak333@gmail.com</h3>
</div>
</div>
<div class="prose prose-h1:font-light">
<a href="{{ statut.attachment.url }}" target="_blank">
<h1 class="mb-0">{{ statut.title }}</h1>
</a>
</div>
</div>
{% endblock %}

View File

@ -13,7 +13,7 @@
</h1>
{% for post in posts %}
<article
class="prose w-full py-4 {% if forloop.first %}pt-0{% endif %} {% if not forloop.last %}border-b border-stone-400{% endif %}"
class="prose w-full py-4 {% if forloop.first %} pt-0 {% endif %} {% if not forloop.last %} border-b border-stone-400 {% endif %}"
>
<h2 class="mb-0">{{ post.title }}</h2>
{{ post.content | safe }}

View File

@ -0,0 +1,15 @@
{% extends 'base.html' %} {% block title %}Strona główna | pdlzbs{% endblock %}
{% load static tailwind_tags %} {% block content %}
<div class="flex flex-col items-center gap-4 prose-h1:font-light">
{% for membership in memberships %}
<article
class="prose w-full py-4 {% if forloop.first %} pt-0 {% endif %} {% if not forloop.last %} border-b border-stone-400 {% endif %}"
>
<a href="{{ membership.attachment.url }}" target="_blank">
<h2 class="mb-0">{{ membership }}</h2>
</a>
</article>
{% empty %}
<span class="py-4 text-xl">Brak dokumentów</span>
{% endfor %} {% endblock %}
</div>

View File

@ -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'),
]
#
#
#
#
#
#
#
#

View File

@ -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