Merge branch 'devel' into 'main'

Release 8 (devel -> main)

See merge request W13R/drinks-manager!4
This commit is contained in:
Julian Müller 2022-06-16 08:52:08 +00:00
commit d5d2bb5316
11 changed files with 80 additions and 78 deletions

View file

@ -51,7 +51,7 @@ class Drink(models.Model):
self.deleted = True self.deleted = True
super().save() super().save()
def __str__(self): return f"{self.product_name} ({str(self.content_litres).rstrip('0')}l) - {self.price}{settings.CURRENCY_SUFFIX}" def __str__(self): return f"{self.product_name} ({float(self.content_litres):.2f}l) - {self.price}{settings.CURRENCY_SUFFIX}"
class RegisterTransaction(models.Model): class RegisterTransaction(models.Model):
@ -145,7 +145,7 @@ class Order(models.Model):
drink.save() drink.save()
super().delete(*args, **kwargs) super().delete(*args, **kwargs)
def __str__(self): return f"{self.drink.product_name} ({str(self.drink.content_litres).rstrip('0')}l) x {self.amount} - {self.price_sum}{settings.CURRENCY_SUFFIX}" def __str__(self): return f"{self.drink.product_name} ({float(self.drink.content_litres):.2f}l) x {self.amount} - {self.price_sum}{settings.CURRENCY_SUFFIX}"
class Global(models.Model): class Global(models.Model):

View file

@ -2,5 +2,5 @@
<div class="footer"> <div class="footer">
<div>Version {{ app_version }}</div> <div>Version {{ app_version }}</div>
<div>Copyright (C) 2021, <a href="https://gitlab.com/W13R">Julian Müller (W13R)</a></div> <div>Copyright (C) 2021, Julian Müller (W13R)</div>
</div> </div>

View file

@ -82,7 +82,7 @@
{% else %} {% else %}
<div class="centeringFlex"> <div class="centeringFlex">
<p>{% translate "You can't order this, because you have a negative balance." %}</p> <p>{% translate "Your balance is too low to order a drink." %}</p>
<a href="/">{% translate "back" %}</a> <a href="/">{% translate "back" %}</a>
</div> </div>

View file

@ -17,6 +17,7 @@
<div class="horizontalButtonList"> <div class="horizontalButtonList">
<a class="button" id="navBarBtnHome" href="/">Home</a> <a class="button" id="navBarBtnHome" href="/">Home</a>
<a class="button" id="navBarBtnDeposit" href="/deposit">{% translate "Deposit" %}</a> <a class="button" id="navBarBtnDeposit" href="/deposit">{% translate "Deposit" %}</a>
<a class="button" href="/accounts/logout">{% translate "Logout" %}</a>
<div class="dropDownMenu" id="dropDownMenu"> <div class="dropDownMenu" id="dropDownMenu">
<button class="dropDownButton" id="dropDownMenuButton"> <button class="dropDownButton" id="dropDownMenuButton">
<div>{% translate "Account" %}</div> <div>{% translate "Account" %}</div>
@ -28,7 +29,6 @@
<a class="button dropDownChoice" href="/admin/">Admin Panel</a> <a class="button dropDownChoice" href="/admin/">Admin Panel</a>
{% endif %} {% endif %}
<a class="button dropDownChoice" href="/accounts/password_change/">{% translate "Change Password" %}</a> <a class="button dropDownChoice" href="/accounts/password_change/">{% translate "Change Password" %}</a>
<a class="button dropDownChoice" href="/accounts/logout">{% translate "Logout" %}</a>
</div> </div>
</div> </div>
</div> </div>

View file

@ -8,11 +8,10 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-22 11:07+0100\n" "POT-Creation-Date: 2022-06-13 19:01+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Julian Müller (W13R)\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language: DE\n"
"Language: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
@ -26,7 +25,7 @@ msgstr "Django Administrator"
msgid "Django administration" msgid "Django administration"
msgstr "Django Administration" msgstr "Django Administration"
#: app/templates/baseLayout.html:43 #: app/templates/baseLayout.html:41
msgid "An error occured. Please log out and log in again." msgid "An error occured. Please log out and log in again."
msgstr "Ein Fehler ist aufgetreten. Bitte ab- und wieder anmelden." msgstr "Ein Fehler ist aufgetreten. Bitte ab- und wieder anmelden."
@ -34,7 +33,7 @@ msgstr "Ein Fehler ist aufgetreten. Bitte ab- und wieder anmelden."
msgid "Drinks - Deposit" msgid "Drinks - Deposit"
msgstr "Getränke - Einzahlen" msgstr "Getränke - Einzahlen"
#: app/templates/deposit.html:14 app/templates/userPanel.html:23 #: app/templates/deposit.html:14 app/templates/userPanel.html:19
msgid "Deposit" msgid "Deposit"
msgstr "Einzahlen" msgstr "Einzahlen"
@ -42,7 +41,7 @@ msgstr "Einzahlen"
msgid "Amount" msgid "Amount"
msgstr "Summe" msgstr "Summe"
#: app/templates/deposit.html:31 app/templates/order.html:71 #: app/templates/deposit.html:31 app/templates/order.html:72
#: app/templates/registration/login.html:56 #: app/templates/registration/login.html:56
msgid "cancel" msgid "cancel"
msgstr "Abbrechen" msgstr "Abbrechen"
@ -55,7 +54,7 @@ msgstr "Bestätigen"
msgid "Drinks - History" msgid "Drinks - History"
msgstr "Getränke - Verlauf" msgstr "Getränke - Verlauf"
#: app/templates/history.html:14 app/templates/userPanel.html:21 #: app/templates/history.html:14 app/templates/userPanel.html:25
msgid "History" msgid "History"
msgstr "Verlauf" msgstr "Verlauf"
@ -63,10 +62,10 @@ msgstr "Verlauf"
msgid "last 30 actions" msgid "last 30 actions"
msgstr "letzte 30 Vorgänge" msgstr "letzte 30 Vorgänge"
#: app/templates/history.html:33 app/templates/statistics.html:69 #: app/templates/history.html:33 app/templates/statistics.html:41
#: app/templates/statistics.html:89 app/templates/statistics.html:109 #: app/templates/statistics.html:61 app/templates/statistics.html:81
#: app/templates/statistics.html:129 app/templates/statistics.html:149 #: app/templates/statistics.html:101 app/templates/statistics.html:121
#: app/templates/statistics.html:169 #: app/templates/statistics.html:141
msgid "No history." msgid "No history."
msgstr "Kein Verlauf verfügbar." msgstr "Kein Verlauf verfügbar."
@ -86,49 +85,47 @@ msgstr "verfügbar"
msgid "No drinks available." msgid "No drinks available."
msgstr "Es sind gerade keine Getränke verfügbar." msgstr "Es sind gerade keine Getränke verfügbar."
#: app/templates/order.html:6 #: app/templates/order.html:7
msgid "Drinks - Order" msgid "Drinks - Order"
msgstr "Getränke - Bestellen" msgstr "Getränke - Bestellen"
#: app/templates/order.html:15 #: app/templates/order.html:16
msgid "Order" msgid "Order"
msgstr "Bestellung" msgstr "Bestellung"
#: app/templates/order.html:28 #: app/templates/order.html:29
msgid "Drink" msgid "Drink"
msgstr "Getränk" msgstr "Getränk"
#: app/templates/order.html:33 #: app/templates/order.html:34
msgid "Price per Item" msgid "Price per Item"
msgstr "Preis pro Getränk" msgstr "Preis pro Getränk"
#: app/templates/order.html:39 #: app/templates/order.html:40
msgid "Available" msgid "Available"
msgstr "Verfügbar" msgstr "Verfügbar"
#: app/templates/order.html:45 #: app/templates/order.html:46
msgid "Count" msgid "Count"
msgstr "Anzahl" msgstr "Anzahl"
#: app/templates/order.html:62 #: app/templates/order.html:63
msgid "Sum" msgid "Sum"
msgstr "Summe" msgstr "Summe"
#: app/templates/order.html:72 #: app/templates/order.html:73
msgid "order" msgid "order"
msgstr "Bestellen" msgstr "Bestellen"
#: app/templates/order.html:84 #: app/templates/order.html:85
msgid "You can't order this, because you have a negative balance." msgid "Your balance is too low to order a drink."
msgstr "" msgstr "Dein Saldo ist zu niedrig um Getränke zu bestellen."
"Sie können momentan keine Bestellungen aufgeben, da Sie einen negativen "
"Saldo haben."
#: app/templates/order.html:85 app/templates/order.html:94 #: app/templates/order.html:86 app/templates/order.html:95
msgid "back" msgid "back"
msgstr "zurück" msgstr "zurück"
#: app/templates/order.html:93 #: app/templates/order.html:94
msgid "This drink is not available." msgid "This drink is not available."
msgstr "Dieses Getränk ist gerade nicht verfügbar." msgstr "Dieses Getränk ist gerade nicht verfügbar."
@ -138,13 +135,12 @@ msgstr "Getränke - Abgemeldet"
#: app/templates/registration/logged_out.html:17 #: app/templates/registration/logged_out.html:17
msgid "Logged out! You will be redirected shortly." msgid "Logged out! You will be redirected shortly."
msgstr "Sie wurden abgemeldet und werden in Kürze weitergeleitet." msgstr "Du wurdest abgemeldet und wirst in Kürze weitergeleitet."
#: app/templates/registration/logged_out.html:19 #: app/templates/registration/logged_out.html:19
msgid "Click here if automatic redirection does not work." msgid "Click here if automatic redirection does not work."
msgstr "" msgstr ""
"Bitte klicken Sie hier, wenn die automatische Weiterleitung nicht " "Bitte klicke hier, wenn die automatische Weiterleitung nicht funktioniert."
"funktionieren sollte."
#: app/templates/registration/login.html:7 #: app/templates/registration/login.html:7
msgid "Drinks - Login" msgid "Drinks - Login"
@ -164,75 +160,75 @@ msgstr "Anmelden"
#: app/templates/registration/login.html:65 #: app/templates/registration/login.html:65
msgid "Choose your account" msgid "Choose your account"
msgstr "Bitte wählen Sie Ihren Account" msgstr "Wähle deinen Account"
#: app/templates/statistics.html:6 #: app/templates/statistics.html:6
msgid "Drinks - Statistics" msgid "Drinks - Statistics"
msgstr "Getränke - Statistiken" msgstr "Getränke - Statistiken"
#: app/templates/statistics.html:15 app/templates/userPanel.html:22 #: app/templates/statistics.html:15 app/templates/userPanel.html:26
msgid "Statistics" msgid "Statistics"
msgstr "Statistiken" msgstr "Statistiken"
#: app/templates/statistics.html:26 #: app/templates/statistics.html:26
msgid "Choose"
msgstr "Auswählen"
#: app/templates/statistics.html:31 app/templates/statistics.html:54
msgid "Your orders per drink" msgid "Your orders per drink"
msgstr "Deine Bestellungen pro Getränk" msgstr "Deine Bestellungen pro Getränk"
#: app/templates/statistics.html:34 app/templates/statistics.html:134 #: app/templates/statistics.html:30 app/templates/statistics.html:50
msgid "Your orders per weekday"
msgstr "Deine Bestellungen pro Wochentag"
#: app/templates/statistics.html:37 app/templates/statistics.html:94
msgid "Your orders per month (last 12 months)"
msgstr "Deine Bestellungen pro Monat (letzte 12 Monate)"
#: app/templates/statistics.html:40 app/templates/statistics.html:74
msgid "All orders per drink"
msgstr "Alle Bestellungen pro Getränk"
#: app/templates/statistics.html:43 app/templates/statistics.html:154
msgid "All orders per weekday"
msgstr "Alle Bestellungen pro Wochentag"
#: app/templates/statistics.html:46 app/templates/statistics.html:114
msgid "All orders per month (last 12 months)"
msgstr "Alle Bestellungen pro Monat (letzte 12 Monate)"
#: app/templates/statistics.html:58 app/templates/statistics.html:78
msgid "drink" msgid "drink"
msgstr "Getränk" msgstr "Getränk"
#: app/templates/statistics.html:59 app/templates/statistics.html:79 #: app/templates/statistics.html:31 app/templates/statistics.html:51
#: app/templates/statistics.html:99 app/templates/statistics.html:119 #: app/templates/statistics.html:71 app/templates/statistics.html:91
#: app/templates/statistics.html:139 app/templates/statistics.html:159 #: app/templates/statistics.html:111 app/templates/statistics.html:131
msgid "count" msgid "count"
msgstr "Anzahl" msgstr "Anzahl"
#: app/templates/statistics.html:98 app/templates/statistics.html:118 #: app/templates/statistics.html:46
msgid "All orders per drink"
msgstr "Alle Bestellungen pro Getränk"
#: app/templates/statistics.html:66
msgid "Your orders per month (last 12 months)"
msgstr "Deine Bestellungen pro Monat (letzte 12 Monate)"
#: app/templates/statistics.html:70 app/templates/statistics.html:90
msgid "month" msgid "month"
msgstr "Monat" msgstr "Monat"
#: app/templates/statistics.html:138 app/templates/statistics.html:158 #: app/templates/statistics.html:86
msgid "All orders per month (last 12 months)"
msgstr "Alle Bestellungen pro Monat (letzte 12 Monate)"
#: app/templates/statistics.html:106
msgid "Your orders per weekday"
msgstr "Deine Bestellungen pro Wochentag"
#: app/templates/statistics.html:110 app/templates/statistics.html:130
msgid "day" msgid "day"
msgstr "Tag" msgstr "Tag"
#: app/templates/userPanel.html:7 app/templates/userPanel.html:9 #: app/templates/statistics.html:126
msgid "All orders per weekday"
msgstr "Alle Bestellungen pro Wochentag"
#: app/templates/userPanel.html:6 app/templates/userPanel.html:8
msgid "User" msgid "User"
msgstr "Benutzer" msgstr "Benutzer"
#: app/templates/userPanel.html:13 app/templates/userPanel.html:15 #: app/templates/userPanel.html:12 app/templates/userPanel.html:14
msgid "Balance" msgid "Balance"
msgstr "Saldo" msgstr "Saldo"
#: app/templates/userPanel.html:27 #: app/templates/userPanel.html:22
msgid "Account"
msgstr "Account"
#: app/templates/userPanel.html:30
msgid "Change Password" msgid "Change Password"
msgstr "Passwort ändern" msgstr "Passwort ändern"
#: app/templates/userPanel.html:29 #: app/templates/userPanel.html:31
msgid "Logout" msgid "Logout"
msgstr "Abmelden" msgstr "Abmelden"

View file

@ -20,7 +20,7 @@ Before the actual setup, you have to satisfy the following dependencies:
### Python Packages (pip) ### Python Packages (pip)
All required python packages are listed in [pip-dependencies.txt](/pip-dependencies.txt) All required python packages are listed in [requirements.txt](/requirements.txt)
You can install the required python packages with You can install the required python packages with
```bash ```bash

View file

@ -4,4 +4,4 @@
wd=$(dirname $0) wd=$(dirname $0)
pip3 install -r "$wd/pip-dependencies.txt" -t "$wd/packages" pip3 install -r "$wd/requirements.txt" -t "$wd/packages"

View file

@ -60,8 +60,8 @@ main > h1 {
width: fit-content; width: fit-content;
} }
.passwordOverlay > form > h1 { .passwordOverlay > form > h1 {
margin-top: 3rem; margin-top: 2rem;
margin-bottom: 3rem; margin-bottom: 2rem;
} }
form input[type="password"], form input[type="text"] { form input[type="password"], form input[type="text"] {
width: 94%; width: 94%;
@ -110,7 +110,4 @@ form input[type="password"], form input[type="text"] {
font-size: 1.16rem; font-size: 1.16rem;
margin: .2rem; margin: .2rem;
} }
.passwordOverlay {
margin-top: 2rem;
}
} }

View file

@ -349,6 +349,9 @@ h1 {
} }
/* MOBILE OPTIMIZATIONS */ /* MOBILE OPTIMIZATIONS */
@media only screen and (max-width: 700px) { @media only screen and (max-width: 700px) {
main {
margin-top: 1.5rem;
}
.globalMessage span { .globalMessage span {
width: 90%; width: 90%;
} }
@ -361,5 +364,11 @@ h1 {
margin-right: 0; margin-right: 0;
margin-left: 0; margin-left: 0;
margin-top: .5rem; margin-top: .5rem;
justify-content: center;
flex-wrap: wrap;
}
.userPanel > .horizontalButtonList > .button,
.userPanel > .horizontalButtonList > .dropDownMenu {
margin: 0.25rem;
} }
} }