Skip to content

Commit

Permalink
Merge pull request #165 from fsinfuhh/staging
Browse files Browse the repository at this point in the history
add pride month special feature
  • Loading branch information
MarkusNeblung committed May 14, 2024
2 parents 96ff3e5 + 14b7312 commit 3461114
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mafiasi/base/special_day_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
33 changes: 33 additions & 0 deletions mafiasi/dashboard/static/css/pride.css
Original file line number Diff line number Diff line change
@@ -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%)
}
3 changes: 3 additions & 0 deletions mafiasi/dashboard/templates/dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ <h2>{% trans "News and more" %}</h2>
{% if is_snowing_val %}
<link rel="stylesheet" type="text/css" href="{% static "css/dashboard-christmas.css" %}">
{% endif %}
{% if request.session.specialFeature == 'pride' %}
<link rel="stylesheet" type="text/css" href="{% static 'css/pride.css' %}">
{% endif %}
{% endblock css %}
{% block js %}
<script src="{% static 'js/dashboard.js' %}" type="text/javascript"></script>
Expand Down

0 comments on commit 3461114

Please sign in to comment.