Skip to content

Commit

Permalink
Merge pull request #43 from Upasanadhameliya/chapterprofile
Browse files Browse the repository at this point in the history
Add members count to Chapter profile
  • Loading branch information
Brylie Christopher Oxley authored Nov 23, 2021
2 parents a9bb049 + cd51b08 commit 1959bd6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions project/chapters/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def get_context(self, request, *args, **kwargs):

# Check whether request user is a member of current group
context["member"] = request.user in self.members.all()
context["member_count"] = self.members.count()

return context

Expand Down
2 changes: 2 additions & 0 deletions project/chapters/templates/chapters/chapter.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ <h1>{{ page.title }}</h1>

{{ page.introduction | richtext }}

<div class="float-end"><h2>Members: {{ member_count }}</h2></div>

<ul class="nav flex-column">
{% for link in page.links %}
{% if link.block_type == 'website_link' %}
Expand Down

0 comments on commit 1959bd6

Please sign in to comment.