Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/apps/profiles/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,11 @@ def get_context_data(self, **kwargs):
membership = self.object.membership_set.filter(user=self.request.user)
if len(membership) == 1:
context['is_editor'] = membership.first().group in Membership.EDITORS_GROUP
context['is_member'] = membership.first().group in Membership.SETTABLE_PERMISSIONS
else:
context['is_editor'] = False
context['is_member'] = False

return context


Expand Down
10 changes: 8 additions & 2 deletions src/templates/profiles/organization_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,21 @@ <h1 class="ui dividing header">Users</h1>
<thead>
<tr>
<th>Name</th>
<th>E-mail</th>
{% if is_editor or is_member %}
<th>E-mail</th>
{% endif %}

</tr>
</thead>
<tbody>
{% for user in organization.users %}
{% if user.id in organization.user_record %}
<tr>
<td><a href="/profiles/user/{{ user.slug }}/">{{ user.name }}</a></td>
<td><a href="mailto:{{ user.email }}">{{ user.email }}</a></td>
{% if is_editor or is_member %}
<td><a href="mailto:{{ user.email }}">{{ user.email }}</a></td>
{% endif %}

</tr>
{% endif %}
{% endfor %}
Expand Down