Skip to content

Commit

Permalink
fix eventtype color badge
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrindt committed Jun 27, 2023
1 parent 666f965 commit f4cd383
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ephios/core/templates/core/event_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

{% block content %}
<style nonce="{{ request.csp_nonce }}">
{% cache 900 "eventtype_colors" %}
{% eventtype_colors %}
{% endcache %}
</style>
{% cache 900 "eventtype_colors" %}
{% eventtype_colors %}
{% endcache %}
</style>

<div class="page-header">
<h1>{% translate "Events" %}
Expand Down
2 changes: 1 addition & 1 deletion ephios/core/templates/core/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h5 class="card-title mb-0">{% trans "Events with requested participations" %}</
{{ shift.event.title }}
</span>
<span class="col-auto col-lg-2">
<span class="badge badge-{{ shift.event.type.pk }}-color">{{ shift.event.type }}</span>
<span class="badge eventtype-{{ shift.event.type.pk }}-color">{{ shift.event.type }}</span>
</span>
<span class="col-lg-4">
{{ shift.start_time|date:"D" }}, {{ shift.start_time|date:"SHORT_DATE_FORMAT" }}, {{ shift.get_time_display }}
Expand Down
2 changes: 1 addition & 1 deletion ephios/extra/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ def get_eventtype_color_style(eventtype: EventType):
)
text_color = get_text_color_for_background(luminance)
return (
f".eventtype-{eventtype.pk}-color{{background-color:{eventtype.color};color:{text_color}}}"
f".eventtype-{eventtype.pk}-color{{background-color:{eventtype.color};color:{text_color};}}"
)

0 comments on commit f4cd383

Please sign in to comment.