Skip to content

Commit

Permalink
Refactor navigation links in base template and update bartender shift…
Browse files Browse the repository at this point in the history
… query for improved accuracy
  • Loading branch information
AndersSeverinsen committed Jan 4, 2025
1 parent 616ba08 commit b884d7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions web/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ <h1>
<li><a href="{% url 'barplan' %}">{% translate "Barplan" %}</a></li>
<li><a href="{% url 'bartenders' %}">{% translate "Bartendere" %}</a></li>
<li><a href="{% url 'prices' %}">{% translate "Sortiment" %}</a></li>

<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% translate "Udlejning" %}<span class="caret"></span></a>
<ul class="dropdown-menu">
Expand All @@ -85,12 +84,10 @@ <h1>
<li><a href="{% url 'udlejningSpeakers' %}">{% translate "Udlejning af højtalere" %}</a></li>
</ul>
</li>

<li><a href="{% url 'guides' %}">{% translate "Guides" %}</a></li>
<li><a href="{% url 'board' %}">{% translate "Bestyrelsen" %}</a></li>
<li><a href="{% url 'events' %}">{% translate "Events" %}</a></li>
<li><a href="{% url 'gallery_index' %}">{% translate "Gallery" %}</a></li>
<li><a href="{% url 'prices' %}">{% translate "Sortiment" %}</a></li>
<li><a href="{% url 'about' %}">{% translate "Om baren" %}</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% translate "Profil" %}<span class="caret"></span></a>
Expand Down
6 changes: 3 additions & 3 deletions web/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ def get_context_data(self, **kwargs):
bartender_shifts = BartenderShift.objects.defer(
"responsible", "other_bartenders", "period"
)
shifts = bartender_shifts.filter(end_datetime__lte=timezone.now())
current_shift = shifts.filter(
start_datetime__gte=timezone.now() - datetime.timedelta(days=7),
current_shift = bartender_shifts.filter(
start_datetime__lte=timezone.now(),
end_datetime__gte=timezone.now() - datetime.timedelta(days=7),
)
shift_streak = 0
start_date = timezone.now()
Expand Down

0 comments on commit b884d7c

Please sign in to comment.