diff --git a/backend/locale/cs/LC_MESSAGES/django.po b/backend/locale/cs/LC_MESSAGES/django.po index 74c3246..1f91795 100644 --- a/backend/locale/cs/LC_MESSAGES/django.po +++ b/backend/locale/cs/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-26 16:41+0000\n" +"POT-Creation-Date: 2023-12-01 13:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -47,7 +47,7 @@ msgstr "Přidat Kategorii" msgid "Add Song" msgstr "Přidat písničku" -#: backend/menus.py:33 backend/models.py:95 +#: backend/menus.py:33 backend/models.py:70 msgid "Songs" msgstr "Písničky" @@ -63,35 +63,35 @@ msgstr "Změna hesla" msgid "Account" msgstr "Účet" -#: backend/models.py:32 +#: backend/models.py:24 msgid "Name" msgstr "Název písničky" -#: backend/models.py:34 +#: backend/models.py:26 msgid "Capo" msgstr "" -#: backend/models.py:35 +#: backend/models.py:27 msgid "Author" msgstr "Autor" -#: backend/models.py:36 +#: backend/models.py:28 msgid "Youtube Link" msgstr "Odkaz na Youtube" -#: backend/models.py:37 +#: backend/models.py:29 msgid "Categories" msgstr "Kategorie" -#: backend/models.py:38 +#: backend/models.py:30 msgid "Archived" msgstr "Archivovat" -#: backend/models.py:39 +#: backend/models.py:31 msgid "Lyrics" msgstr "Text" -#: backend/models.py:94 +#: backend/models.py:69 msgid "Song" msgstr "Písnička" @@ -118,12 +118,12 @@ msgid "Edit" msgstr "Editor" #: backend/templates/songs/fragments/song.html:20 -#: backend/templates/songs/index.html:47 backend/templates/songs/song.html:18 +#: backend/templates/songs/index.html:49 backend/templates/songs/song.html:18 msgid "Delete" msgstr "Smazat" #: backend/templates/songs/fragments/song.html:34 -#: backend/templates/songs/index.html:60 backend/templates/songs/song.html:30 +#: backend/templates/songs/index.html:64 backend/templates/songs/song.html:30 msgid "Transpose" msgstr "Transponovat" @@ -135,25 +135,25 @@ msgstr "Skrýt akordy" msgid "Prevent sleep" msgstr "Zabránit uspání" -#: backend/templates/songs/index.html:73 +#: backend/templates/songs/index.html:77 msgid "Search" msgstr "Hledat" -#: backend/templates/songs/index.html:75 +#: backend/templates/songs/index.html:79 msgid "Number, text or author" msgstr "Číslo, text nebo autor" -#: backend/views.py:88 +#: backend/views.py:84 #, python-format msgid "Song %(name)s was successfully created" msgstr "Písnička %(name)s byla úspěšně přidána" -#: backend/views.py:104 +#: backend/views.py:100 #, python-format msgid "Song %(name)s was successfully updated" msgstr "Písnička %(name)s byla úspěšně upravena" -#: backend/views.py:120 +#: backend/views.py:116 #, python-format msgid "Song %s was successfully deleted" msgstr "Písnička %s byla úspěšně odstraněna" diff --git a/backend/urls.py b/backend/urls.py index 0f71be4..f4f4d86 100644 --- a/backend/urls.py +++ b/backend/urls.py @@ -6,6 +6,7 @@ SongUpdateView, SongDeleteView, IndexSongListView, + SongListView, ) urlpatterns = [ @@ -13,5 +14,5 @@ path("add", SongCreateView.as_view(), name="add"), path("edit/", SongUpdateView.as_view(), name="edit"), path("delete/", SongDeleteView.as_view(), name="delete"), - # path("api/songs", SongsDatatableView.as_view(), name="songs"), + path("all", SongListView.as_view(), name="all"), ] diff --git a/pdf/locale/cs/LC_MESSAGES/django.po b/pdf/locale/cs/LC_MESSAGES/django.po index 69f924d..76c8e86 100644 --- a/pdf/locale/cs/LC_MESSAGES/django.po +++ b/pdf/locale/cs/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-26 16:41+0000\n" +"POT-Creation-Date: 2023-12-01 13:21+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -164,7 +164,7 @@ msgstr "Přesouvání PDF požadavků do Tenant" msgid "To Tenant" msgstr "Do Tenanta" -#: pdf/templates/pdf/index.html:46 +#: pdf/templates/pdf/index.html:45 msgid "Table of Contents" msgstr "Obsah" diff --git a/tenants/locale/cs/LC_MESSAGES/django.po b/tenants/locale/cs/LC_MESSAGES/django.po index 4b37c49..01c6afd 100644 --- a/tenants/locale/cs/LC_MESSAGES/django.po +++ b/tenants/locale/cs/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-20 18:41+0000\n" +"POT-Creation-Date: 2023-12-01 13:21+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -23,11 +23,15 @@ msgstr "" msgid "Tenant" msgstr "Zpěvník" -#: tenants/menus.py:50 +#: tenants/menus.py:27 +msgid "All songs" +msgstr "" + +#: tenants/menus.py:53 msgid "Files" msgstr "Soubory" -#: tenants/menus.py:60 +#: tenants/menus.py:63 msgid "Categories" msgstr "Kategorie" @@ -65,6 +69,14 @@ msgid "" msgstr "" "Kam by měla úvodní stránka přesměrovat uživatele, většinou URL kategorie" +#: tenants/models.py:24 +msgid "All Songs" +msgstr "Všechny Písničky" + +#: tenants/models.py:25 +msgid "True, if all songs category should be added to navigation" +msgstr "Pokud je zaškrknuto tak se do navigace přidá odkaz na všechny písničky" + #: tenants/templates/tenant/add.html:4 tenants/templates/tenant/add.html:5 msgid "Tenant Editor" msgstr "Uprava Zpěvníku" diff --git a/tenants/menus.py b/tenants/menus.py index 07eaf1c..ea956ef 100644 --- a/tenants/menus.py +++ b/tenants/menus.py @@ -15,7 +15,7 @@ def categories(request): """Returns MenuItems for all Categories""" - return [ + items = [ MenuItem( category["name"], reverse("category:index", kwargs={"slug": category["slug"]}), @@ -23,6 +23,9 @@ def categories(request): ) for category in Category.objects.filter(tenant=request.tenant).values("name", "slug") ] + if request.tenant.all_songs_category: + items.append(MenuItem(title=_("All songs"), url=reverse("backend:all"), separator=True)) + return items def distinct_requests(request): diff --git a/tenants/migrations/0002_tenant_all_songs_category.py b/tenants/migrations/0002_tenant_all_songs_category.py new file mode 100644 index 0000000..3e5f6e1 --- /dev/null +++ b/tenants/migrations/0002_tenant_all_songs_category.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.5 on 2023-12-01 13:17 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('tenants', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='tenant', + name='all_songs_category', + field=models.BooleanField(default=True, help_text='True, if all songs category should be added to navigation', verbose_name='All Songs'), + ), + ] diff --git a/tenants/models.py b/tenants/models.py index 47606ae..63e3e5b 100644 --- a/tenants/models.py +++ b/tenants/models.py @@ -1,6 +1,6 @@ """Tenant models""" from django.contrib.auth import get_user_model -from django.db.models import Model, CharField, ManyToManyField +from django.db.models import Model, CharField, ManyToManyField, BooleanField from django.utils.translation import gettext_lazy as _ # Create your models here. @@ -19,6 +19,11 @@ class Tenant(Model): help_text=_("Where should new tenant redirect from index page, usually a category slug"), max_length=32, ) + all_songs_category = BooleanField( + default=True, + verbose_name=_("All Songs"), + help_text=_("True, if all songs category should be added to navigation"), + ) admins = ManyToManyField(get_user_model()) def __str__(self):