Skip to content

Commit

Permalink
Added DarkMode
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersSeverinsen committed Jul 18, 2024
1 parent 9b01e93 commit 0dd5593
Show file tree
Hide file tree
Showing 14 changed files with 439 additions and 104 deletions.
2 changes: 1 addition & 1 deletion bartab/templates/bartab.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h3>{% translate "Total forbrug" %}: {{ total_used }}</h3>
</thead>
<tbody>
{% for entry in entries %}
<tr{% if entry.added > 0 %} class="success-"{% elif entry.balance <= credit_hold_limit %} class="danger-"{% endif %}>
<tr{% if entry.added > 0 %} class="success"{% elif entry.balance <= credit_hold_limit %} class="danger"{% endif %}>
<td>{{ entry.shift }}</td>
<td>{{ entry.added }}</td>
<td>{{ entry.used }}</td>
Expand Down
12 changes: 6 additions & 6 deletions bartenders/templates/barplan.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ <h2>{% translate "Barplan" %}</h2>
</thead>
<tbody>
{% for shift in bartendershifts %}
<tr class="is-user-shift">
<td {% if shift|is_with_user:user %}style="background-color: lightBlue; color: black;"{% endif %}class="col-md-2">{{ shift.display_str }} {% if show_all %} {{ shift.start_datetime.year }}{% endif %}</td>
<td {% if shift|is_with_user:user %}style="background-color: lightBlue; color: black;"{% endif %} class="col-md-3">{{ shift.responsible.name }}</td>
<td {% if shift|is_with_user:user %}style="background-color: lightBlue; color: black;"{% endif %} class="col-md-7">
<tr>
<td {% if shift|is_with_user:user %}style="background-color: rgba(173, 216, 230, 0.462);"{% endif %}class="col-md-2">{{ shift.display_str }} {% if show_all %} {{ shift.start_datetime.year }}{% endif %}</td>
<td {% if shift|is_with_user:user %}style="background-color: rgba(173, 216, 230, 0.462);"{% endif %} class="col-md-3">{{ shift.responsible.name }}</td>
<td {% if shift|is_with_user:user %}style="background-color: rgba(173, 216, 230, 0.462);"{% endif %} class="col-md-7">
{% for bartender in shift.other_bartenders.all %}
{% if bartender.first_bartender_shift == shift %}<b {% if shift|is_with_user:user %}style="color: black;"{% endif %} title="{% translate "Bartender's first shift" %}">{{ bartender.name }}</b>{% else %}{{ bartender.name }}{% endif %}{% if not forloop.last %},{% endif %}
{% if bartender.first_bartender_shift == shift %}<b title="{% translate "Bartender's first shift" %}">{{ bartender.name }}</b>{% else %}{{ bartender.name }}{% endif %}{% if not forloop.last %},{% endif %}
{% endfor %}
</td>
{% if user.is_staff %}
<td {% if shift|is_with_user:user %}style="background-color: lightBlue; color: black;"{% endif %} class="hidden-xs col-md-1"><a href="/admin/bartenders/bartendershift/{{ shift.id }}">{% translate "Edit" %}</a></td>
<td {% if shift|is_with_user:user %}style="background-color: rgba(173, 216, 230, 0.462);"{% endif %} class="hidden-xs col-md-1"><a href="/admin/bartenders/bartendershift/{{ shift.id }}">{% translate "Edit" %}</a></td>
{% endif %}
</tr>
{% endfor %}
Expand Down
7 changes: 6 additions & 1 deletion bartenders/templates/bartender_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
{% block extrahead %}
<script type="text/javascript">
$(function() {
const isDarkMode = document.documentElement.classList.contains("dark");
$('#unavailable_dates_table input').change(function(e) {
$(this).closest('td').toggleClass('danger', this.checked);
if (isDarkMode) {
$(this).closest('td').toggleClass('danger-dark', this.checked);
} else {
$(this).closest('td').toggleClass('danger', this.checked);
}
});

var preventUnload = false;
Expand Down
3 changes: 2 additions & 1 deletion bartenders/templates/board.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{% block extrahead %}
<script src="{% static 'js/timesheet.min.js' %}"></script>
<link rel="stylesheet" href="{% static 'js/timesheet-white.min.css' %}">
<link rel="stylesheet" href="{% static 'js/timesheet-black.min.css' %}">
<style>
#timesheet {
width: auto;
Expand Down Expand Up @@ -68,7 +69,7 @@ <h4 class="panel-title">

<h1>{% translate "Bestyrelsen gennem tiden" %}</h1>

<div class="white">
<div id="timesheet-theme" class="white">
<div id="timesheet"></div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion guides/templates/guides.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h2>{% translate "Guides" %}</h2>

{% for category, guides in guides %}
<div class="panel panel-default">
<div id="black" class="panel-heading">{{ category }}</div>
<div class="panel-heading">{{ category }}</div>
<div class="panel-body">
<ul>
{% for guide in guides %}
Expand Down
Binary file modified locale/da/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit 0dd5593

Please sign in to comment.