Skip to content

Commit

Permalink
WIP: Show summary on user page
Browse files Browse the repository at this point in the history
This commit will be rewritten.

Part of #63
  • Loading branch information
jonatanskogsfors committed Sep 12, 2024
1 parent 8b26cb5 commit b7f683b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
6 changes: 6 additions & 0 deletions batadasen/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ def full_name(self):
else:
return '{} "{}" {}'.format(self.first_name, self.spex_name, self.last_name)

@property
def productions(self):
memberships = self.production_memberships.select_related("group__production")
return {membership.group.production for membership in memberships}


def __str__(self):
return '({}) {}'.format(self.member_number, self.full_name)

Expand Down
18 changes: 17 additions & 1 deletion batadasen/templates/batadasen/person_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h2>Uppsättningshistorik</h2>
<td>{% if membership.title %}{{ membership.title }}{% endif %}</td>
<td>{{ membership.comment }}</td>
</tr>
{% endfor %}
{% endfor %}
</table>

<h2>Föreningsuppdrag</h2>
Expand Down Expand Up @@ -124,4 +124,20 @@ <h2>Medlemskapshistorik</h2>
</tr>
{% endfor %}
</table>

<h2>Sammanfattning</h2>
<table class="table table-sm col-3">
<tr>
<th class="table-active">Aktiva spexår</th>
<td class="text-right"></td>
</tr>
<tr>
<th class="table-active">Antal uppsättningar</th>
<td class="text-right">{{ object.productions | length }}</td>
</tr>
<tr>
<th class="table-active">Antal föreställningar</th>
<td class="text-right">{{ object.performances.all | length }}</td>
</tr>
</table>
{% endblock %}

0 comments on commit b7f683b

Please sign in to comment.