diff --git a/core/admin.py b/core/admin.py index 36e8c01..f79d680 100644 --- a/core/admin.py +++ b/core/admin.py @@ -10,7 +10,7 @@ from admin_ordering.admin import OrderableAdmin @admin.register(Button) class ButtonModelAdmin(OrderableAdmin, admin.ModelAdmin): - list_display = ['__str__', 'ordering'] + list_display = ['__str__', 'published', 'ordering'] list_editable = ['ordering'] ordering_field_hide_input = True exclude = ['ordering'] @@ -18,7 +18,7 @@ class ButtonModelAdmin(OrderableAdmin, admin.ModelAdmin): @admin.register(UpperButton) class UpperButtonModelAdmin(OrderableAdmin, admin.ModelAdmin): - list_display = ['__str__', 'ordering'] + list_display = ['__str__', 'published', 'ordering'] list_editable = ['ordering'] ordering_field_hide_input = True exclude = ['ordering'] diff --git a/core/context_processors.py b/core/context_processors.py index 4ccec35..5b65ffc 100644 --- a/core/context_processors.py +++ b/core/context_processors.py @@ -14,8 +14,8 @@ from db.mbkb.models import * def load_config(request): return { - 'nav': Button.objects.all(), - 'uppernav': UpperButton.objects.all(), + 'nav': Button.objects.filter(published=True), + 'uppernav': UpperButton.objects.filter(published=True), 'gpw': GrandPrixW.load(), 'posts': Post.objects.filter(published=True), 'daneadresowe': Data.load(), diff --git a/core/migrations/0012_button_published_upperbutton_published.py b/core/migrations/0012_button_published_upperbutton_published.py new file mode 100644 index 0000000..287a0a9 --- /dev/null +++ b/core/migrations/0012_button_published_upperbutton_published.py @@ -0,0 +1,23 @@ +# Generated by Django 4.0.5 on 2022-10-21 17:02 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0011_upperbutton_alter_button_options'), + ] + + operations = [ + migrations.AddField( + model_name='button', + name='published', + field=models.BooleanField(default=True, verbose_name='Przycisk opublikowany'), + ), + migrations.AddField( + model_name='upperbutton', + name='published', + field=models.BooleanField(default=True, verbose_name='Przycisk opublikowany'), + ), + ] diff --git a/core/models.py b/core/models.py index 072fbea..afb2209 100644 --- a/core/models.py +++ b/core/models.py @@ -10,6 +10,7 @@ from db.membership.models import Membership class Button(OrderableModel): + published = models.BooleanField('Przycisk opublikowany', default=True) title = models.CharField('Tekst na przycisku', max_length=50) href = models.CharField('Link', max_length=50) blank = models.BooleanField('Otwórz w nowej karcie') @@ -35,6 +36,7 @@ class Button(OrderableModel): class UpperButton(OrderableModel): + published = models.BooleanField('Przycisk opublikowany', default=True) title = models.CharField('Tytuł przycisku', max_length=50) photo = FileBrowseField( 'Ikona', directory='gorneprzyciski/', max_length=200, blank=True) diff --git a/db/calendar/admin.py b/db/calendar/admin.py new file mode 100644 index 0000000..46b82e2 --- /dev/null +++ b/db/calendar/admin.py @@ -0,0 +1,8 @@ + +from django.contrib import admin +from .models import Calendar + + +@admin.register(Calendar) +class CalendarAdmin(admin.ModelAdmin): + list_display = ('__str__', 'published', 'current') diff --git a/db/main/admin.py b/db/main/admin.py index 73c29e0..0bf09a4 100644 --- a/db/main/admin.py +++ b/db/main/admin.py @@ -7,7 +7,7 @@ from .models import * @admin.register(Post) class PostModelAdmin(OrderableAdmin, admin.ModelAdmin): - list_display = ['__str__', 'link', 'ordering'] + list_display = ['__str__', 'link', 'published', 'ordering'] list_editable = ['ordering'] ordering_field_hide_input = True exclude = ['ordering'] diff --git a/db/mbkb/admin.py b/db/mbkb/admin.py index fac2c3b..3782cf1 100644 --- a/db/mbkb/admin.py +++ b/db/mbkb/admin.py @@ -7,7 +7,7 @@ from .models import * @admin.register(MBKB) class MBKBModelAdmin(OrderableAdmin, admin.ModelAdmin): - list_display = ['__str__', 'ordering'] + list_display = ['__str__', 'published', 'ordering'] list_editable = ['ordering'] ordering_field_hide_input = True exclude = ['ordering'] diff --git a/db/membership/admin.py b/db/membership/admin.py new file mode 100644 index 0000000..95edb77 --- /dev/null +++ b/db/membership/admin.py @@ -0,0 +1,7 @@ +from django.contrib import admin +from .models import Membership + + +@admin.register(Membership) +class MembershipAdmin(admin.ModelAdmin): + list_display = ('__str__', 'published', 'current') diff --git a/db/tournaments/admin.py b/db/tournaments/admin.py index 9e209f2..83e22bc 100644 --- a/db/tournaments/admin.py +++ b/db/tournaments/admin.py @@ -7,7 +7,7 @@ from .models import * @admin.register(Tournament) class TournamentModelAdmin(OrderableAdmin, admin.ModelAdmin): - list_display = ['__str__', 'link', 'ordering'] + list_display = ['__str__', 'link', 'published', 'ordering'] list_editable = ['ordering'] ordering_field_hide_input = True exclude = ['ordering'] diff --git a/db/youth/admin.py b/db/youth/admin.py index 84c261d..a37bbb9 100644 --- a/db/youth/admin.py +++ b/db/youth/admin.py @@ -7,7 +7,7 @@ from .models import * @admin.register(Youth) class YouthModelAdmin(OrderableAdmin, admin.ModelAdmin): - list_display = ['__str__', 'link', 'ordering'] + list_display = ['__str__', 'link', 'published', 'ordering'] list_editable = ['ordering'] ordering_field_hide_input = True exclude = ['ordering'] diff --git a/filebrowser/locale/de/LC_MESSAGES/django.mo b/filebrowser/locale/de/LC_MESSAGES/django.mo index 51babf1..25f771c 100644 Binary files a/filebrowser/locale/de/LC_MESSAGES/django.mo and b/filebrowser/locale/de/LC_MESSAGES/django.mo differ diff --git a/filebrowser/locale/it/LC_MESSAGES/django.mo b/filebrowser/locale/it/LC_MESSAGES/django.mo index 39f53c8..ea0ea72 100644 Binary files a/filebrowser/locale/it/LC_MESSAGES/django.mo and b/filebrowser/locale/it/LC_MESSAGES/django.mo differ diff --git a/filebrowser/locale/nl/LC_MESSAGES/django.mo b/filebrowser/locale/nl/LC_MESSAGES/django.mo new file mode 100644 index 0000000..ac571d9 Binary files /dev/null and b/filebrowser/locale/nl/LC_MESSAGES/django.mo differ diff --git a/filebrowser/locale/pl_PL/LC_MESSAGES/django.mo b/filebrowser/locale/pl_PL/LC_MESSAGES/django.mo index ef678d8..bbd00fc 100644 Binary files a/filebrowser/locale/pl_PL/LC_MESSAGES/django.mo and b/filebrowser/locale/pl_PL/LC_MESSAGES/django.mo differ diff --git a/filebrowser/locale/pl_PL/LC_MESSAGES/django.po b/filebrowser/locale/pl_PL/LC_MESSAGES/django.po index 6334618..dcae048 100644 --- a/filebrowser/locale/pl_PL/LC_MESSAGES/django.po +++ b/filebrowser/locale/pl_PL/LC_MESSAGES/django.po @@ -262,7 +262,7 @@ msgstr "Wersje obrazu" #: filebrowser/templates/filebrowser/detail.html:125 #: filebrowser/templates/filebrowser/include/tableheader.html:31 msgid "Thumbnail" -msgstr "Miniatura" +msgstr "Miniatura lub link" #: filebrowser/templates/filebrowser/detail.html:126 #: filebrowser/templates/filebrowser/include/filelisting.html:100 diff --git a/filebrowser/templates/filebrowser/include/filelisting.html b/filebrowser/templates/filebrowser/include/filelisting.html index 3ded655..f82a3c6 100644 --- a/filebrowser/templates/filebrowser/include/filelisting.html +++ b/filebrowser/templates/filebrowser/include/filelisting.html @@ -98,6 +98,8 @@