Skip to content

Commit

Permalink
visual cleanup and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Oppenheimer authored and Aaron Oppenheimer committed Jul 23, 2024
1 parent 939083e commit 895ae8e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion agenda/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def set_default_view(request, val):
@login_required
def get_needplans_count(request, *args, **kw):
c = request.user.future_noplans.count()
return HttpResponse(c if c else "")
return HttpResponse(c if c else 0)


@login_required
Expand Down
6 changes: 6 additions & 0 deletions agenda/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ def get_context_data(self, **kwargs):
layout_band = self.request.user.preferences.agenda_band
context['the_layout'] = layout

# the buttons are an array for the template to chew on:
# * layout type
# * button label
# * band (if it's a band filter otherwise ignored)
# * True if the button is active
# * True if it's the 'needs response' button
context['the_buttons'] = [
[AgendaLayoutChoices.ONE_LIST, _("All Upcoming Gigs"), 0, layout==AgendaLayoutChoices.ONE_LIST, False],
[AgendaLayoutChoices.NEED_RESPONSE, _('Needs Reponse'), 0,
Expand Down
2 changes: 1 addition & 1 deletion templates/agenda/agenda.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
hx-get="{% url 'agenda-gigs' the_type=button.0 the_band=button.2 %}"
hx-target="#the-list">{{button.1}}
{% if button.4 %}
<span class="badge badge-secondary" id="needplan-badge"></span>
<span class="badge badge-secondary" id="needplan-badge">0</span>
{% endif %}
</label>
{% if button.3 %}<span hx-get="{% url 'agenda-gigs' the_type=button.0 the_band=button.2 %}"
Expand Down

0 comments on commit 895ae8e

Please sign in to comment.