Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pride month special feature #165

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading