Skip to content

Commit

Permalink
Removed streak from barplan
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersSeverinsen committed Dec 22, 2024
1 parent 43af3cb commit ec6def9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion bartenders/templates/barplan.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h2 id="barplan">{% translate "Barplan" %}</h2>
<tbody>
{% for shift in bartendershifts %}
<tr style="{% if shift|is_with_user:user %}background-color: skyblue;{% endif %}{% if shift|compare_to_current_week == -1 %}color:gray;{% endif %}">
<td class="col-md-2">{% if shift|compare_to_current_week == 0 %}<b alt="{% translate "This weeks friday" %}">{{ shift.display_str }}{% if show_all_bartendershifts %}, {{ shift.start_datetime.year }}{% endif %}{% else %} {{ shift.display_str }}{% if show_all_bartendershifts %}, {{ shift.start_datetime.year }}{% endif %}{% endif %} {% if shift|compare_to_current_week == 0 %}</b> &nbsp; <b alt="{% translate "Baren har været åben" %} {{ shift_streak }} {% blocktranslate count c=shift_streak %}uge{% plural %}uger{% endblocktranslate %} {% translate "i træk" %}"><i>{{ shift_streak }}{% bs_icon 'fire' size='0.8em' %}</i></b>{% endif %}</td>
<td class="col-md-2">{% if shift|compare_to_current_week == 0 %}<b alt="{% translate "This weeks friday" %}">{{ shift.display_str }}{% if show_all_bartendershifts %}, {{ shift.start_datetime.year }}{% endif %}{% else %} {{ shift.display_str }}{% if show_all_bartendershifts %}, {{ shift.start_datetime.year }}{% endif %}{% endif %}</td>
<td class="col-md-3">{{ shift.responsible.name }}</td>
<td class="col-md-7">
{% for bartender in shift.other_bartenders.all %}
Expand Down
7 changes: 0 additions & 7 deletions bartenders/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,6 @@ def get_context_data(self, **kwargs):
bartendershifts = BartenderShift.objects.all()
depositshifts = BoardMemberDepositShift.objects.all()

current_shift = BartenderShift.objects.all().filter(
start_datetime__lte=timezone.now() + datetime.timedelta(days=2),
end_datetime__gte=timezone.now() - datetime.timedelta(days=5),
)
shift_streak = current_shift[0].streak() if current_shift else 0
context["shift_streak"] = shift_streak

show_all_bartendershifts = self.request.GET.get("show_all_bartendershifts")
if not show_all_bartendershifts:
bartendershifts = bartendershifts.filter(
Expand Down

0 comments on commit ec6def9

Please sign in to comment.