Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #331: display user name if no full name #391

Merged
merged 1 commit into from
Jul 12, 2016
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
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ def test_get_with_authorized_user(self):
context['organization'] = self.org
context['form'] = forms.EditOrganizationMemberForm(
None, self.org, self.member)
context['user'] = self.member

expected = render_to_string(
'organization/organization_members_edit.html',
Expand Down
8 changes: 7 additions & 1 deletion cadasta/templates/core/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@
<button type="button" class="btn btn-user dropdown-toggle" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<img src="/static/img/avatar.jpg" class="avatar thumbnail">
<span class="visible-sm-inline visible-md-inline visible-lg-inline">{{ user.full_name }}</span>
<span class="visible-sm-inline visible-md-inline visible-lg-inline">
{% if user.full_name %}
{{ user.full_name }}
{% else %}
{{ user.username }}
{% endif %}
</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
Expand Down