Skip to content

Commit

Permalink
Fix for show username in member permissions page
Browse files Browse the repository at this point in the history
The issue #626 suggest that if full name is empty
then username should be set in member permission page. This pull request contains fix for it as well as
member list page, when full name is empty member column gets blank. So I include to display username if full name is not
present
  • Loading branch information
kavindya89 committed Sep 10, 2016
1 parent 0fe8f50 commit f30b9f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cadasta/templates/organization/organization_members.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ <h2>{% trans "Members" %}</h2>
<tbody>
{% for user in organization.users.all %}
<tr class="linked" onclick="window.document.location='{% url 'organization:members_edit' slug=organization.slug username=user.username %}';">
<td>{{ user.get_full_name }}
<td>{% if user.get_full_name %}
{{ user.get_full_name }}
{% else %}
{{ user.username }}
{% endif %}
<div class="hidden-sm hidden-md hidden-lg">
{{ user.username }}<br />
{{ user.email }}
Expand Down
10 changes: 9 additions & 1 deletion cadasta/templates/organization/organization_members_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
<div class="row">
<!-- Main text -->
<div class="col-md-12 main-text">
<h2>{% trans "Member" %}: <span class="text-capitalize">{{ object.get_full_name }}</span></h2>
<h2>{% trans "Member" %}:
<span class="text-capitalize">
{% if object.get_full_name %}
{{ object.get_full_name }}
{% else %}
{{ object.username }}
{% endif %}
</span>
</h2>
<form method="POST" action="" class="org-member-edit" novalidate>
{% csrf_token %}
<div class="row">
Expand Down

0 comments on commit f30b9f7

Please sign in to comment.