diff --git a/bartab/admin.py b/bartab/admin.py index 5cfaa67..913142d 100644 --- a/bartab/admin.py +++ b/bartab/admin.py @@ -83,12 +83,20 @@ def get_context(): for user in BarTabUser.objects.exclude(hidden_from_tab=True): tab_parts[not user.is_active][0].append(user) + latest_tab_update = BarTabSnapshot.objects.first() + guide_path = settings.MEDIA_ROOT + f"guides/krydsliste.pdf" + try: + with open(guide_path, "rb") as f: + pass + except FileNotFoundError: + guide_path = None + return { "tab_parts": tab_parts, "pizza_lines": range(33), - "latest_shift": BarTabSnapshot.objects.first().date, + "latest_tab_update": latest_tab_update, "logo_path": settings.STATIC_ROOT + f"images/logo_gray.png", - "guide_path": settings.MEDIA_ROOT + f"guides/krydsliste.pdf", + "guide_path": guide_path, } diff --git a/bartab/templates/bartab.html b/bartab/templates/bartab.html index df47604..4528e61 100644 --- a/bartab/templates/bartab.html +++ b/bartab/templates/bartab.html @@ -7,7 +7,11 @@

{% translate "Krydslisteaktivitet" %}

-

{% translate "Krydslisten er gjort op til og med barvagten d." %} {{ update_date }}.

+{% if latest_tab_update %} +

{% translate "Krydslisten er gjort op til og med barvagten d." %} {{ latest_tab_update.date }}.

+{% else %} +

{% translate "Krydslisten er endnu ikke opdateret." %}

+{% endif %} {% if object %}

{% translate "Saldo" %}: {{ object.balance_str }}

diff --git a/bartab/templates/bartab/bartab.tex b/bartab/templates/bartab/bartab.tex index f01c7e6..a4acaee 100644 --- a/bartab/templates/bartab/bartab.tex +++ b/bartab/templates/bartab/bartab.tex @@ -38,7 +38,11 @@ \savebox\innertable{% \begin{tabu}{r} {\Large Genereret: {% now "j. F Y" %} } \\ - {\Large Opgjort til og med vagt: {{ latest_shift|date:"j. F Y" }} } + {% if latest_tab_update %} + {\Large Opgjort til og med vagt: {{ latest_tab_update.date|date:"j. F Y" }} } + {% else %} + {\Large Endnu ikke opgjort } + {% endif %} \end{tabu}% } {% else %}\newpage{% endif %} @@ -64,9 +68,7 @@ {% endfor %} -% Make sure Pizza list is on a even page -\mbox{~} -\clearpage +% Make sure guide is on an even page \strictpagechecktrue \checkoddpage @@ -80,7 +82,11 @@ \begin{landscape} -\iffalse +{% if guide_path %} +\includepdf[pages=1, angle=90]{ +{{ guide_path }} +} +{% else %} \LARGE \section*{Pizzabestilling} \begin{tabu} to \linewidth{| X[1] | X[14] |} @@ -90,11 +96,7 @@ \section*{Pizzabestilling} {% for i in pizza_lines %}& \\ \hline{% endfor %} \end{tabu} -\fi - -\includepdf[pages=1, angle=90]{ -{{ guide_path }} -} +{% endif %} \end{landscape} diff --git a/bartab/views.py b/bartab/views.py index 2fc2345..f2e2bc6 100644 --- a/bartab/views.py +++ b/bartab/views.py @@ -17,7 +17,7 @@ def get_object(self): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - context["update_date"] = BarTabSnapshot.objects.first().date + context["latest_tab_update"] = BarTabSnapshot.objects.first() context["credit_hold_limit"] = BarTabUser.CREDIT_HOLD_LIMIT if not self.object: diff --git a/fredagscafeen/settings/base.py b/fredagscafeen/settings/base.py index e2c772d..b675502 100644 --- a/fredagscafeen/settings/base.py +++ b/fredagscafeen/settings/base.py @@ -143,6 +143,8 @@ messages.ERROR: "alert-danger", } +TIMEOUT = 600 + # SECURITY WARNING: don't run with debug turned on in production! # ALLOWED_HOSTS = ['*'] diff --git a/locale/da/LC_MESSAGES/django.po b/locale/da/LC_MESSAGES/django.po index 61f219c..02e5cf5 100644 --- a/locale/da/LC_MESSAGES/django.po +++ b/locale/da/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-27 23:29+0100\n" +"POT-Creation-Date: 2024-12-30 13:04+0100\n" "PO-Revision-Date: 2024-12-23 21:27+0050\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -39,11 +39,11 @@ msgstr "Skal have enten bartendervagt eller tilpasset datetime" msgid "Kontant?" msgstr "Kontant?" -#: bartab/models.py:138 bartab/templates/bartab.html:20 +#: bartab/models.py:138 bartab/templates/bartab.html:24 msgid "Indsat" msgstr "Indsat" -#: bartab/models.py:139 bartab/templates/bartab.html:21 +#: bartab/models.py:139 bartab/templates/bartab.html:25 msgid "Køb" msgstr "Køb" @@ -59,24 +59,28 @@ msgstr "Invalid sum" msgid "Krydslisteaktivitet" msgstr "Krydslisteaktivitet" -#: bartab/templates/bartab.html:10 +#: bartab/templates/bartab.html:11 msgid "Krydslisten er gjort op til og med barvagten d." msgstr "Krydslisten er gjort op til og med barvagten d." -#: bartab/templates/bartab.html:13 bartab/templates/bartab.html:22 +#: bartab/templates/bartab.html:13 +msgid "Krydslisten er endnu ikke opdateret." +msgstr "" + +#: bartab/templates/bartab.html:17 bartab/templates/bartab.html:26 msgid "Saldo" msgstr "Saldo" -#: bartab/templates/bartab.html:14 +#: bartab/templates/bartab.html:18 msgid "Total forbrug" msgstr "Total forbrug" -#: bartab/templates/bartab.html:19 bartenders/templates/barplan.html:31 +#: bartab/templates/bartab.html:23 bartenders/templates/barplan.html:31 #: gallery/models.py:101 msgid "Dato" msgstr "Dato" -#: bartab/templates/bartab.html:37 +#: bartab/templates/bartab.html:41 msgid "er ikke på krydslisten." msgstr "er ikke på krydslisten." @@ -299,7 +303,7 @@ msgstr "" msgid "Tidligere" msgstr "" -#: bartenders/templates/board.html:30 web/templates/base.html:91 +#: bartenders/templates/board.html:30 web/templates/base.html:90 msgid "Bestyrelsen" msgstr "" @@ -515,11 +519,11 @@ msgstr "Ja" msgid "No" msgstr "Nej" -#: fredagscafeen/settings/base.py:271 +#: fredagscafeen/settings/base.py:273 msgid "Danish" msgstr "Dansk" -#: fredagscafeen/settings/base.py:272 +#: fredagscafeen/settings/base.py:274 msgid "English" msgstr "Engelsk" @@ -1401,6 +1405,10 @@ msgstr "" msgid "Forside" msgstr "" +#: web/templates/base.html:77 web/templates/base.html:93 +msgid "Sortiment" +msgstr "" + #: web/templates/base.html:80 msgid "Udlejning" msgstr "" @@ -1421,43 +1429,39 @@ msgstr "" msgid "Udlejning af højtalere" msgstr "" -#: web/templates/base.html:92 +#: web/templates/base.html:91 msgid "Events" msgstr "" -#: web/templates/base.html:93 +#: web/templates/base.html:92 msgid "Gallery" msgstr "Galleri" #: web/templates/base.html:94 -msgid "Sortiment" -msgstr "" - -#: web/templates/base.html:95 msgid "Om baren" msgstr "" -#: web/templates/base.html:97 +#: web/templates/base.html:96 msgid "Profil" msgstr "" -#: web/templates/base.html:99 +#: web/templates/base.html:98 msgid "Krydlistestatus" msgstr "" -#: web/templates/base.html:101 +#: web/templates/base.html:100 msgid "Bartenderprofil" msgstr "" -#: web/templates/base.html:104 +#: web/templates/base.html:103 msgid "Admin" msgstr "" -#: web/templates/base.html:109 +#: web/templates/base.html:108 msgid "Log ud" msgstr "" -#: web/templates/base.html:148 +#: web/templates/base.html:146 msgid "er en fredagsbar for datalogi og IT på Aarhus Universitet." msgstr "" diff --git a/locale/en/LC_MESSAGES/django.mo b/locale/en/LC_MESSAGES/django.mo index 904fbfd..773e7f6 100644 Binary files a/locale/en/LC_MESSAGES/django.mo and b/locale/en/LC_MESSAGES/django.mo differ diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index f55424e..9a59644 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-12-27 23:29+0100\n" -"PO-Revision-Date: 2024-12-27 23:30+0050\n" +"POT-Creation-Date: 2024-12-30 13:04+0100\n" +"PO-Revision-Date: 2024-12-30 13:06+0050\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" "Language: \n" @@ -39,11 +39,11 @@ msgstr "Must have either bartender shift or custom datetime" msgid "Kontant?" msgstr "Cash?" -#: bartab/models.py:138 bartab/templates/bartab.html:20 +#: bartab/models.py:138 bartab/templates/bartab.html:24 msgid "Indsat" msgstr "Deposited" -#: bartab/models.py:139 bartab/templates/bartab.html:21 +#: bartab/models.py:139 bartab/templates/bartab.html:25 msgid "Køb" msgstr "Purchases" @@ -59,24 +59,28 @@ msgstr "Invalid sum" msgid "Krydslisteaktivitet" msgstr "Tab activity" -#: bartab/templates/bartab.html:10 +#: bartab/templates/bartab.html:11 msgid "Krydslisten er gjort op til og med barvagten d." msgstr "The tab is done up to and including the bar shift the" -#: bartab/templates/bartab.html:13 bartab/templates/bartab.html:22 +#: bartab/templates/bartab.html:13 +msgid "Krydslisten er endnu ikke opdateret." +msgstr "The tab has not yet been updated." + +#: bartab/templates/bartab.html:17 bartab/templates/bartab.html:26 msgid "Saldo" msgstr "Balance" -#: bartab/templates/bartab.html:14 +#: bartab/templates/bartab.html:18 msgid "Total forbrug" msgstr "Total consumption" -#: bartab/templates/bartab.html:19 bartenders/templates/barplan.html:31 +#: bartab/templates/bartab.html:23 bartenders/templates/barplan.html:31 #: gallery/models.py:101 msgid "Dato" msgstr "Date" -#: bartab/templates/bartab.html:37 +#: bartab/templates/bartab.html:41 msgid "er ikke på krydslisten." msgstr "is not on the tab." @@ -304,7 +308,7 @@ msgstr "Current" msgid "Tidligere" msgstr "Earlier" -#: bartenders/templates/board.html:30 web/templates/base.html:91 +#: bartenders/templates/board.html:30 web/templates/base.html:90 msgid "Bestyrelsen" msgstr "Board" @@ -542,11 +546,11 @@ msgstr "Yes" msgid "No" msgstr "No" -#: fredagscafeen/settings/base.py:271 +#: fredagscafeen/settings/base.py:273 msgid "Danish" msgstr "Danish" -#: fredagscafeen/settings/base.py:272 +#: fredagscafeen/settings/base.py:274 msgid "English" msgstr "English" @@ -1378,14 +1382,6 @@ msgid "Generel info" msgstr "General info" #: web/templates/about.html:11 -#| msgid "" -#| "\n" -#| "Fredagscaféen er en studenterdrevet bar på Institut for Datalogi, Aarhus Universitet, \n" -#| "som siden 1993 har været et socialt samlingspunkt for studerende og ansatte på instituttet.\n" -#| "Vi er kendt for vores store udvalg af specialøl, der kontinuerligt udskiftes.\n" -#| "Derudover har vi fokus på at have noget for enhver smag og prisklasse, og vi har altid \n" -#| "et stort udvalg af sodavand, cider, shots, glutenfri øl og alkoholfrie alternativer.\n" -#| "Vi er samtidig den eneste fredagsbar i landet, der fast har pilsner fra \n" msgid "" "\n" "Fredagscaféen er en studenterdrevet bar på Institut for Datalogi, Aarhus Universitet,\n" @@ -1404,10 +1400,6 @@ msgstr "" "We are also the only Friday bar in the country that always has lager from\n" #: web/templates/about.html:20 -#| msgid "" -#| " \n" -#| "på fad.\n" -#| "Tag endelig et kig på vores faste sortiment,\n" msgid "" "\n" "på fad.\n" @@ -1522,6 +1514,10 @@ msgstr "Our CVR number is" msgid "Forside" msgstr "Home" +#: web/templates/base.html:77 web/templates/base.html:93 +msgid "Sortiment" +msgstr "Selection" + #: web/templates/base.html:80 msgid "Udlejning" msgstr "Rental" @@ -1542,43 +1538,39 @@ msgstr "Rental of projector" msgid "Udlejning af højtalere" msgstr "Rental of speakers" -#: web/templates/base.html:92 +#: web/templates/base.html:91 msgid "Events" msgstr "Events" -#: web/templates/base.html:93 +#: web/templates/base.html:92 msgid "Gallery" msgstr "Gallery" #: web/templates/base.html:94 -msgid "Sortiment" -msgstr "Selection" - -#: web/templates/base.html:95 msgid "Om baren" msgstr "About" -#: web/templates/base.html:97 +#: web/templates/base.html:96 msgid "Profil" msgstr "Profile" -#: web/templates/base.html:99 +#: web/templates/base.html:98 msgid "Krydlistestatus" msgstr "Tab status" -#: web/templates/base.html:101 +#: web/templates/base.html:100 msgid "Bartenderprofil" msgstr "Bartender profile" -#: web/templates/base.html:104 +#: web/templates/base.html:103 msgid "Admin" msgstr "Admin" -#: web/templates/base.html:109 +#: web/templates/base.html:108 msgid "Log ud" msgstr "Log out" -#: web/templates/base.html:148 +#: web/templates/base.html:146 msgid "er en fredagsbar for datalogi og IT på Aarhus Universitet." msgstr "is a Friday bar for computer science and IT at Aarhus University."