From 3501d6885d3ea1c4fec5d6742379ae8354634417 Mon Sep 17 00:00:00 2001 From: Mark Hoekveen Date: Fri, 1 Mar 2024 20:18:06 +0100 Subject: [PATCH] Some setting panel refactors --- playlist/models/profile.py | 5 +++++ playlist/static/img/gears.png | Bin 0 -> 498 bytes playlist/static/style.css | 17 ++++++++++++++--- playlist/templates/Nominate.html | 2 +- playlist/templates/Settings.html | 13 +++++++++---- 5 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 playlist/static/img/gears.png diff --git a/playlist/models/profile.py b/playlist/models/profile.py index 12a203e..81ae35a 100644 --- a/playlist/models/profile.py +++ b/playlist/models/profile.py @@ -23,6 +23,11 @@ class Profile(models.Model): quota = models.FloatField(default=10.0) quota_last_updated = models.DateTimeField(default=timezone.now, null=False) + + @property + def quota_display(self): + return int(self.quota) + def update_quota(self): elapsed = timezone.now() - self.quota_last_updated if elapsed.seconds > 300: diff --git a/playlist/static/img/gears.png b/playlist/static/img/gears.png new file mode 100644 index 0000000000000000000000000000000000000000..6600aa9878c796b3832eb442f0678ead4aa98773 GIT binary patch literal 498 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfvmUKs7M+SzC{oH>NSwWJ?9znhg z3{`3j3=J&|48MRv4KElNN(~qoUL`OvSj}Ky5HFasE6@fgArasc;tHgJ;Q#;s2M!!) zXlVHVpP_*PNHf^2oYer7U@Qsp3ubV5b|VeMN%D4gVM^n!Nda=$OFVsD*&ne9q-opw!E^m1)oKBTX88R&5Ua-kwujjY_E16YP>O*x?rl|kc zQ}3wLe(>+?`IL7L{_bKjn=|)eRu z=XU-Y5Y4_S{Peny7d))`p9C#aYmQi^QE+0yuBUQ&U5Yot`4%!7B)B%#_;9=Ho$qd{ zv=m}W64kl1Hj{6m--}W|j;QPds~vUcS1X)2{_gn&g?WF){*>(!c%Cc#{w}M8=u<`$ zF>&YZ-;*SMt=|{(Q_1;@XcsWp7*tDKBT7;dOH!?pi&B9UgOP!ug|2~_u8~QIk+GGb sft8_&u7Qb_fx#mA&L1cma`RI%(<*Umxa?%;0@T3Z>FVdQ&MBb@08mn^od5s; literal 0 HcmV?d00001 diff --git a/playlist/static/style.css b/playlist/static/style.css index 9d983ee..8cb8ff5 100644 --- a/playlist/static/style.css +++ b/playlist/static/style.css @@ -203,7 +203,7 @@ iframe { } .clippy .body { - background: lightyellow; + background: #ffffe0; color: black; padding: 10px; border-radius: 10px; @@ -328,8 +328,19 @@ iframe { width: 360px; } -.progress-indicator.segmented > .progress-indicator-bar { +.field-row.settings label { + width: 200px; } -.status-bar-field { +.field-row.settings { + margin-bottom: 8px; +} + +.settings .admin-panel { + background-image: url(img/gears.png); + height: 40px; + background-repeat: no-repeat; + background-position: 50% 50%; + width: 40px; + min-width: 0; } \ No newline at end of file diff --git a/playlist/templates/Nominate.html b/playlist/templates/Nominate.html index 69e391e..35b580e 100644 --- a/playlist/templates/Nominate.html +++ b/playlist/templates/Nominate.html @@ -57,6 +57,6 @@ Nomineren > -

{{user.profile.quota|floatformat:0}} nominaties over.

+

{{user.profile.quota_display}} nominaties over.

{% endblock %} diff --git a/playlist/templates/Settings.html b/playlist/templates/Settings.html index 9b2618e..2654aa1 100644 --- a/playlist/templates/Settings.html +++ b/playlist/templates/Settings.html @@ -5,19 +5,19 @@ Instellingen {% endblock %} {% block main-content %} -

Hoi {{ user.first_name }}!

+

Je bent ingelogd als {{ user.email }}.

{% if user.is_staff %}
-
+
- +
{% endif %}
{% csrf_token %} {% if backgrounds %} -
+