Skip to content

Commit

Permalink
Render year log with an accordion
Browse files Browse the repository at this point in the history
This is specially useful for many entries
  • Loading branch information
rolandgeider committed Nov 9, 2015
1 parent e152206 commit 3287821
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions wger/manager/templates/calendar/month.html
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,24 @@ <h4>{% trans 'Log' %}</h4>
{% endif %}

{% regroup month_list by year as year_list %}
{% for year in year_list reversed %}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{{ year.grouper }}</h3>
<div class="panel-group" id="accordion">
{% for year in year_list reversed %}
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="heading{{ year.grouper }}">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse{{ year.grouper }}" aria-expanded="true" aria-controls="collapse{{ year.grouper }}">
{{ year.grouper }}
</a>
</h4>
</div>
<div id="collapse{{ year.grouper }}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading{{ year.grouper }}">
<div class="list-group">
{% for month in year.list %}
<a href="{% url 'manager:workout:calendar' owner_user year.grouper month.month %}" class="list-group-item">{{month|date:"F"}}</a>
{% endfor %}
</div>
</div>
</div>

<ul class="list-group">
{% for month in year.list %}
<a href="{% url 'manager:workout:calendar' owner_user year.grouper month.month %}" class="list-group-item">{{month|date:"F"}}</a>
{% endfor %}
</ul>
{% endfor %}
</div>
{% endfor %}
{% endblock %}

0 comments on commit 3287821

Please sign in to comment.