Merge pull request #690 from jsma/patch-1

Fixes for custom user models support
pull/701/head
Karl Hobley 2014-10-14 18:06:33 +01:00
commit 292b15d82e
5 zmienionych plików z 7 dodań i 7 usunięć

Wyświetl plik

@ -20,7 +20,7 @@
{% endif %}
<div class="col9">
<h1>{% blocktrans %}Welcome to the {{ site_name }} Wagtail CMS{% endblocktrans %}</h1>
<h2>{{ user.get_full_name|default:user.username }}</h2>
<h2>{{ user.get_full_name|default:user.get_username }}</h2>
</div>
</div>
</header>

Wyświetl plik

@ -80,7 +80,7 @@
{% if page.get_latest_revision %}
{% blocktrans with last_mod=page.get_latest_revision.created_at %}Last modified: {{ last_mod }}{% endblocktrans %}
{% if page.get_latest_revision.user %}
{% blocktrans with modified_by=page.get_latest_revision.user.get_full_name|default:page.get_latest_revision.user.username %}by {{ modified_by }}{% endblocktrans %}
{% blocktrans with modified_by=page.get_latest_revision.user.get_full_name|default:page.get_latest_revision.user.get_username %}by {{ modified_by }}{% endblocktrans %}
{% if page.get_latest_revision.user.email %}
<span class="avatar small icon icon-user"><img src="{% gravatar_url page.get_latest_revision.user.email 25 %}" /></span>
{% endif %}

Wyświetl plik

@ -28,4 +28,4 @@ class UserProfile(models.Model):
return cls.objects.get_or_create(user=user)[0]
def __str__(self):
return self.user.username
return self.user.get_username()

Wyświetl plik

@ -1,12 +1,12 @@
{% extends "wagtailadmin/base.html" %}
{% load wagtailimages_tags %}
{% load i18n %}
{% block titletag %}{% trans "Editing" %} {{ user.username}}{% endblock %}
{% block titletag %}{% trans "Editing" %} {{ user.get_username}}{% endblock %}
{% block bodyclass %}menu-users{% endblock %}
{% block content %}
{% trans "Editing" as editing_str %}
{% include "wagtailadmin/shared/header.html" with title=editing_str subtitle=user.username merged=1 tabbed=1 icon="user" %}
{% include "wagtailadmin/shared/header.html" with title=editing_str subtitle=user.get_username merged=1 tabbed=1 icon="user" %}
<ul class="tab-nav merged">
<li class="active"><a href="#account">{% trans "Account" %}</a></li>

Wyświetl plik

@ -29,10 +29,10 @@
<td class="title">
<h2>
<span class="avatar small icon icon-user"><img src="{% gravatar_url user.email 25 %}" /></span>
<a href="{% url 'wagtailusers_users_edit' user.id %}">{{ user.get_full_name|default:user.username }}</a>
<a href="{% url 'wagtailusers_users_edit' user.id %}">{{ user.get_full_name|default:user.get_username }}</a>
</h2>
</td>
<td class="username">{{ user.username }}</td>
<td class="username">{{ user.get_username }}</td>
<td class="level">{% if user.is_superuser %}{% trans "Admin" %}{% endif %}</td>
<td class="status"><div class="status-tag {% if user.is_active %}primary{% endif %}">{% if user.is_active %}{% trans "Active" %}{% else %}{% trans "Inactive" %}{% endif %}</div></td>
</tr>