From cfa21258e6a495d87a2ab47f545dc11dcfe1fc14 Mon Sep 17 00:00:00 2001 From: Markus <9neblung@informatik.uni-hamburg.de> Date: Tue, 14 May 2024 14:14:20 +0200 Subject: [PATCH] add special Feature for pride month --- mafiasi/base/special_day_middleware.py | 7 ++++ mafiasi/dashboard/static/css/pride.css | 33 +++++++++++++++++++ .../dashboard/templates/dashboard/index.html | 3 ++ 3 files changed, 43 insertions(+) create mode 100644 mafiasi/dashboard/static/css/pride.css diff --git a/mafiasi/base/special_day_middleware.py b/mafiasi/base/special_day_middleware.py index d1f7f32a..c3aefcb0 100644 --- a/mafiasi/base/special_day_middleware.py +++ b/mafiasi/base/special_day_middleware.py @@ -58,6 +58,9 @@ def __call__(self, request): # may day (tag der arbeit) if n.month == 5 and n.day == 1: feature = "mayDay" + # pride month + if n.month == 6: + feature = "pride" # make sure session hold the current feature request.session["specialFeature"] = feature @@ -72,6 +75,10 @@ def __call__(self, request): pass elif feature == "winter": pass + elif feature == "pride": + request.session["specialFeatureClasses"] += random.choice( + [" pride-pride", " pride-trans", " pride-bi", " pride-non-binary"] + ) # call view response = self.get_response(request) diff --git a/mafiasi/dashboard/static/css/pride.css b/mafiasi/dashboard/static/css/pride.css new file mode 100644 index 00000000..d5968703 --- /dev/null +++ b/mafiasi/dashboard/static/css/pride.css @@ -0,0 +1,33 @@ +.pride-pride #dashboard #dashboard-services-container .dashboard-service .service .panel-body .service-icon{ + background: linear-gradient(180deg, + #FE000080 16.66%, + #FD8C0080 16.66%, 33.32%, + #FFE50080 33.32%, 49.98%, + #119F0B80 49.98%, 66.64%, + #0644B380 66.64%, 83.3%, + #C22EDC80 83.3%) +} + +.pride-trans #dashboard #dashboard-services-container .dashboard-service .service .panel-body .service-icon{ + background: linear-gradient(180deg, + #5BCEFA80 20%, + #F5A9B880 20%, 40%, + #FFFFFF80 40%, 60%, + #F5A9B880 60%, 80%, + #5BCEFA80 80%) +} + +.pride-bi #dashboard #dashboard-services-container .dashboard-service .service .panel-body .service-icon{ + background: linear-gradient(180deg, + #D6027080 40%, + #9B4F9680 40%, 60%, + #0038A880 60%) +} + +.pride-non-binary #dashboard #dashboard-services-container .dashboard-service .service .panel-body .service-icon{ + background: linear-gradient(180deg, + #FFF43080 25%, + #FFFFFF80 25%, 50%, + #9C59D180 50%, 75%, + #18181880 75%) +} diff --git a/mafiasi/dashboard/templates/dashboard/index.html b/mafiasi/dashboard/templates/dashboard/index.html index 753f6f06..5055b201 100644 --- a/mafiasi/dashboard/templates/dashboard/index.html +++ b/mafiasi/dashboard/templates/dashboard/index.html @@ -90,6 +90,9 @@

{% trans "News and more" %}

{% if is_snowing_val %} {% endif %} +{% if request.session.specialFeature == 'pride' %} + +{% endif %} {% endblock css %} {% block js %}