From 0833677bbd444ed5a6fabea2019cb4bb67ccb1fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20M=C3=BCller?= <9070224-W13R@users.noreply.gitlab.com> Date: Mon, 13 Jun 2022 18:47:16 +0200 Subject: [PATCH 1/7] #3 Rename pip-dependencies.txt to requirements.txt --- docs/Setup.md | 2 +- install-pip-dependencies.sh | 2 +- pip-dependencies.txt => requirements.txt | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename pip-dependencies.txt => requirements.txt (100%) diff --git a/docs/Setup.md b/docs/Setup.md index 28805cb..bf3d0c4 100644 --- a/docs/Setup.md +++ b/docs/Setup.md @@ -20,7 +20,7 @@ Before the actual setup, you have to satisfy the following dependencies: ### 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 ```bash diff --git a/install-pip-dependencies.sh b/install-pip-dependencies.sh index 8dfc0d2..6c02848 100755 --- a/install-pip-dependencies.sh +++ b/install-pip-dependencies.sh @@ -4,4 +4,4 @@ wd=$(dirname $0) -pip3 install -r "$wd/pip-dependencies.txt" -t "$wd/packages" +pip3 install -r "$wd/requirements.txt" -t "$wd/packages" diff --git a/pip-dependencies.txt b/requirements.txt similarity index 100% rename from pip-dependencies.txt rename to requirements.txt From 96d4652a041846d240a97d3319950806c65d1969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20M=C3=BCller?= <9070224-W13R@users.noreply.gitlab.com> Date: Mon, 13 Jun 2022 19:13:27 +0200 Subject: [PATCH 2/7] #1 improve text and translations --- application/app/templates/order.html | 2 +- application/locale/de/LC_MESSAGES/django.mo | Bin 3583 -> 3469 bytes application/locale/de/LC_MESSAGES/django.po | 128 ++++++++++---------- 3 files changed, 63 insertions(+), 67 deletions(-) diff --git a/application/app/templates/order.html b/application/app/templates/order.html index b4f2263..2f1d58f 100644 --- a/application/app/templates/order.html +++ b/application/app/templates/order.html @@ -82,7 +82,7 @@ {% else %}
-

{% translate "You can't order this, because you have a negative balance." %}

+

{% translate "Your balance is too low to order a drink." %}

{% translate "back" %}
diff --git a/application/locale/de/LC_MESSAGES/django.mo b/application/locale/de/LC_MESSAGES/django.mo index c387ac73ed38ea0301252191dcda6d025d0be34d..07c684c8c574ed25adf7f9061611ea3ad5285e44 100644 GIT binary patch delta 1247 zcmXZaPe>F|9Ki9nx~{smX{i~k=}S{I%Ri|>(m%m4L?JS=Q#HDSF3!%Uw}LLTZ; z1aqiEL4lVJ5oL9VG(zwo9m*htg2D=fP8LB?WZ&O5kJ=4H8_V`@H2++H}1i#9HsKH9gFY~%Javt5Kmz-j-af+fL!W6oveF|r8tY5 z@J)`I%q;lAgarKR`v)V8BV?C=QQU}4z6bsJK9s-)Zo@cosY`SXc-0?2MLFOLEWo!& z3bhiNRB8i%R+*3lKQN3zqGn?umSZte1l5f7*p70NGgyl*mf=m53OzzuKZk@=^T?$Z z=_K(IO8jN1zf8PGDdCDg{^tAB_b-+Q2%7gl&~~y^u)ZD}@hDbe8YSL!?7&+n2U)2gQlU2FEUFi4$gfWDM*@!HKAiH$v$&J-0&c}MB&G`UzT}ma(rv~nd&-tFMROd@A7P?OSwhGp18 zrjCzkCz;e%GL1T!ikT^G=vXRlkIp1=qk*a(*NPjq?wfyRS=_4|XlXrOAMQ2mVb>To zJ9O6(?^WLAke}gX{%XO%{Pc)r>X;d~z0=_`Z#=v|;LJP^mjo)iT%C5wG3IDvaM(NFSOKim5_z8ZEGX5YgL>J||BS=vf zsAT-FxEO!OR-CO@mFj>8bV%UGiLY@U?YTsifXlH3yA!u3{W+At2k}!ZAw^A4b>L*u z{tacLmvIi>L8eguG*p;`hyUo130`0`))KWATW|#~K$4)=V-Idd*-3z(<1t){Kci&o z8p`;aNJw=XDe5kjO#ClO{703fGuQEi7nWhVi&lQar>F28xP|u{0SxS z49WukLfJ?Il`OOs<^39zOm`tgRd!HIfC1c(9?FWZATiXRC;?_sQuqj2gL;$nH;_;H zMJrGOZ$LRiS(NX-Nwg>#I*RO3{ebPvug>ux0dJtJ{C3iA;lHe-y%d*WFEXe47Afiw z)dDOdpQs6x9iG5WJcSZ>28Zz`%0^dnu-0QAYUWoV4-)t!%F2F3+4*^tz!y<6atY<1 z&7cInj67cT_?OyMDHY$M zPRCDcGpWXSUR{SA`s!h8tBz7?Eiy;-ph?#TskmhF47Y4b4zFDGaa7lqu6f^3@%g$x zrri2lsV%zT*fpUJ#)@W4hb6Dvsq?1bL}jDD3nE=|4jb)gYg{Mvc+5M#V+&^LKw~Dg z`>WwxP7h}H^y_W?d$I$$o!P#=z5PQ&JDPKjbtA_$UHgnP+M{#X!Ck}IU5v}+cKTj- zFy?+7)1%|l>F?upO%Jzbqw@IGb0yzc)$4_!(Md}Wc}5SE#*Ee3LLrE3n7kkHy}}5+ zLtebGd3zI2<-qqtGZi#1N>#rakJy>jPTn=6#xI&sN4BWPjr7K6=iJ*Xp+~MxTg#}? yVAR;qv3kUK*63bS4vp_e)|Cj+A=l)M?bJo58d-+e51C;Nj$aH&SU$cm_wRRD#nA!) diff --git a/application/locale/de/LC_MESSAGES/django.po b/application/locale/de/LC_MESSAGES/django.po index 0cdfbab..22c05b2 100644 --- a/application/locale/de/LC_MESSAGES/django.po +++ b/application/locale/de/LC_MESSAGES/django.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\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" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" +"Last-Translator: Julian Müller (W13R)\n" +"Language: DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -26,7 +25,7 @@ msgstr "Django Administrator" msgid "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." 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" 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" msgstr "Einzahlen" @@ -42,7 +41,7 @@ msgstr "Einzahlen" msgid "Amount" 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 msgid "cancel" msgstr "Abbrechen" @@ -55,7 +54,7 @@ msgstr "Bestätigen" msgid "Drinks - History" 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" msgstr "Verlauf" @@ -63,10 +62,10 @@ msgstr "Verlauf" msgid "last 30 actions" msgstr "letzte 30 Vorgänge" -#: app/templates/history.html:33 app/templates/statistics.html:69 -#: app/templates/statistics.html:89 app/templates/statistics.html:109 -#: app/templates/statistics.html:129 app/templates/statistics.html:149 -#: app/templates/statistics.html:169 +#: app/templates/history.html:33 app/templates/statistics.html:41 +#: app/templates/statistics.html:61 app/templates/statistics.html:81 +#: app/templates/statistics.html:101 app/templates/statistics.html:121 +#: app/templates/statistics.html:141 msgid "No history." msgstr "Kein Verlauf verfügbar." @@ -86,49 +85,47 @@ msgstr "verfügbar" msgid "No drinks available." msgstr "Es sind gerade keine Getränke verfügbar." -#: app/templates/order.html:6 +#: app/templates/order.html:7 msgid "Drinks - Order" msgstr "Getränke - Bestellen" -#: app/templates/order.html:15 +#: app/templates/order.html:16 msgid "Order" msgstr "Bestellung" -#: app/templates/order.html:28 +#: app/templates/order.html:29 msgid "Drink" msgstr "Getränk" -#: app/templates/order.html:33 +#: app/templates/order.html:34 msgid "Price per Item" msgstr "Preis pro Getränk" -#: app/templates/order.html:39 +#: app/templates/order.html:40 msgid "Available" msgstr "Verfügbar" -#: app/templates/order.html:45 +#: app/templates/order.html:46 msgid "Count" msgstr "Anzahl" -#: app/templates/order.html:62 +#: app/templates/order.html:63 msgid "Sum" msgstr "Summe" -#: app/templates/order.html:72 +#: app/templates/order.html:73 msgid "order" msgstr "Bestellen" -#: app/templates/order.html:84 -msgid "You can't order this, because you have a negative balance." -msgstr "" -"Sie können momentan keine Bestellungen aufgeben, da Sie einen negativen " -"Saldo haben." +#: app/templates/order.html:85 +msgid "Your balance is too low to order a drink." +msgstr "Dein Saldo ist zu niedrig um Getränke zu bestellen." -#: app/templates/order.html:85 app/templates/order.html:94 +#: app/templates/order.html:86 app/templates/order.html:95 msgid "back" msgstr "zurück" -#: app/templates/order.html:93 +#: app/templates/order.html:94 msgid "This drink is not available." msgstr "Dieses Getränk ist gerade nicht verfügbar." @@ -138,13 +135,12 @@ msgstr "Getränke - Abgemeldet" #: app/templates/registration/logged_out.html:17 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 msgid "Click here if automatic redirection does not work." msgstr "" -"Bitte klicken Sie hier, wenn die automatische Weiterleitung nicht " -"funktionieren sollte." +"Bitte klicke hier, wenn die automatische Weiterleitung nicht funktioniert." #: app/templates/registration/login.html:7 msgid "Drinks - Login" @@ -164,75 +160,75 @@ msgstr "Anmelden" #: app/templates/registration/login.html:65 msgid "Choose your account" -msgstr "Bitte wählen Sie Ihren Account" +msgstr "Wähle deinen Account" #: app/templates/statistics.html:6 msgid "Drinks - Statistics" 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" msgstr "Statistiken" #: 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" msgstr "Deine Bestellungen pro Getränk" -#: app/templates/statistics.html:34 app/templates/statistics.html:134 -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 +#: app/templates/statistics.html:30 app/templates/statistics.html:50 msgid "drink" msgstr "Getränk" -#: app/templates/statistics.html:59 app/templates/statistics.html:79 -#: app/templates/statistics.html:99 app/templates/statistics.html:119 -#: app/templates/statistics.html:139 app/templates/statistics.html:159 +#: app/templates/statistics.html:31 app/templates/statistics.html:51 +#: app/templates/statistics.html:71 app/templates/statistics.html:91 +#: app/templates/statistics.html:111 app/templates/statistics.html:131 msgid "count" 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" 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" 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" msgstr "Benutzer" -#: app/templates/userPanel.html:13 app/templates/userPanel.html:15 +#: app/templates/userPanel.html:12 app/templates/userPanel.html:14 msgid "Balance" msgstr "Saldo" -#: app/templates/userPanel.html:27 +#: app/templates/userPanel.html:22 +msgid "Account" +msgstr "Account" + +#: app/templates/userPanel.html:30 msgid "Change Password" msgstr "Passwort ändern" -#: app/templates/userPanel.html:29 +#: app/templates/userPanel.html:31 msgid "Logout" msgstr "Abmelden" From f406757468da7aede2b7bbb61f7bd65fef37ce24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20M=C3=BCller?= <9070224-W13R@users.noreply.gitlab.com> Date: Mon, 13 Jun 2022 19:22:36 +0200 Subject: [PATCH 3/7] #2 Fix wrong decimal formatting in Drink and Order models --- application/app/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/app/models.py b/application/app/models.py index 95692b0..7ce9370 100644 --- a/application/app/models.py +++ b/application/app/models.py @@ -51,7 +51,7 @@ class Drink(models.Model): self.deleted = True 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): @@ -145,7 +145,7 @@ class Order(models.Model): drink.save() 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): From bec4fe7bd0d8b3020983012cb482624aea5ab4c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20M=C3=BCller?= <9070224-W13R@users.noreply.gitlab.com> Date: Thu, 16 Jun 2022 10:00:44 +0200 Subject: [PATCH 4/7] Removed link to gitlab repo from footer --- application/app/templates/footer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/app/templates/footer.html b/application/app/templates/footer.html index b490bce..fbfe674 100644 --- a/application/app/templates/footer.html +++ b/application/app/templates/footer.html @@ -2,5 +2,5 @@ From 5893d311fe116996db7e6895bd4dc0aa9bf3c030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20M=C3=BCller?= <9070224-W13R@users.noreply.gitlab.com> Date: Thu, 16 Jun 2022 10:22:37 +0200 Subject: [PATCH 5/7] #4 moved Logout button out of the dropdown menu --- application/app/templates/userPanel.html | 2 +- static/css/main.css | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/application/app/templates/userPanel.html b/application/app/templates/userPanel.html index 4d0bba3..eecaf88 100644 --- a/application/app/templates/userPanel.html +++ b/application/app/templates/userPanel.html @@ -17,6 +17,7 @@ diff --git a/static/css/main.css b/static/css/main.css index d8377b2..b574189 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -361,5 +361,11 @@ h1 { margin-right: 0; margin-left: 0; margin-top: .5rem; + justify-content: center; + flex-wrap: wrap; + } + .userPanel > .horizontalButtonList > .button, + .userPanel > .horizontalButtonList > .dropDownMenu { + margin: 0.25rem; } } \ No newline at end of file From c7866bfefe01a1f2b500ca9aa73d0af2e0cecacb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20M=C3=BCller?= <9070224-W13R@users.noreply.gitlab.com> Date: Thu, 16 Jun 2022 10:28:45 +0200 Subject: [PATCH 6/7] Fixed a display issue with the login overlay --- static/css/login.css | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/static/css/login.css b/static/css/login.css index 0b18a9f..8a7fb03 100644 --- a/static/css/login.css +++ b/static/css/login.css @@ -60,8 +60,8 @@ main > h1 { width: fit-content; } .passwordOverlay > form > h1 { - margin-top: 3rem; - margin-bottom: 3rem; + margin-top: 2rem; + margin-bottom: 2rem; } form input[type="password"], form input[type="text"] { width: 94%; @@ -110,7 +110,4 @@ form input[type="password"], form input[type="text"] { font-size: 1.16rem; margin: .2rem; } - .passwordOverlay { - margin-top: 2rem; - } } \ No newline at end of file From 05698544d7ea613794beb2647fe88f63086681a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20M=C3=BCller?= <9070224-W13R@users.noreply.gitlab.com> Date: Thu, 16 Jun 2022 10:39:29 +0200 Subject: [PATCH 7/7] Small UI enhancement for mobile devices --- static/css/main.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static/css/main.css b/static/css/main.css index b574189..72a412f 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -349,6 +349,9 @@ h1 { } /* MOBILE OPTIMIZATIONS */ @media only screen and (max-width: 700px) { + main { + margin-top: 1.5rem; + } .globalMessage span { width: 90%; }