use User.name instead of User.display_name (bug 591399)
This commit is contained in:
Родитель
df1d19304a
Коммит
75eebbd464
|
@ -203,7 +203,7 @@
|
|||
Meet the Developers
|
||||
{% endtrans %}
|
||||
</h3>
|
||||
<img class="avatar" alt="{{ single_dev.display_name }}" height="64"
|
||||
<img class="avatar" alt="{{ single_dev.name }}" height="64"
|
||||
width="64" src="{{ single_dev.picture_url }}"/>
|
||||
<p>{{ _("Learn why {0} was created and find out what's next for this "
|
||||
'add-on.')|f(addon.name) }}</p>
|
||||
|
@ -212,7 +212,7 @@
|
|||
{% if addon.listed_authors|length > 1 %}
|
||||
{{ _('Meet the Developers') }}
|
||||
{% else %}
|
||||
{{ _('Meet {0}')|f(single_dev.display_name) }}
|
||||
{{ _('Meet {0}')|f(single_dev.name) }}
|
||||
{% endif %}
|
||||
</a>
|
||||
</p>
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
{% endif %}
|
||||
<div class="primary prose">
|
||||
{% if user.bio %}
|
||||
<h3>{{ _('Who is {0}')|f(user.display_name) }}</h3>
|
||||
<h3>{{ _('Who is {0}')|f(user.name) }}</h3>
|
||||
<p class="intro">{{ user.bio }}</p>
|
||||
{% endif %}
|
||||
{% if addon.the_reason %}
|
||||
|
@ -109,7 +109,7 @@
|
|||
<ol>
|
||||
{% for author in authors %}
|
||||
<li>
|
||||
<a href="#t-author-{{ author.id }}">{{ author.display_name }}</a>
|
||||
<a href="#t-author-{{ author.id }}">{{ author.name }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
|
@ -122,7 +122,7 @@
|
|||
src="{{ author.picture_url }}"/>
|
||||
</div>
|
||||
<div class="primary">
|
||||
<h3>{{ author.display_name }}</h3>
|
||||
<h3>{{ author.name }}</h3>
|
||||
<p class="intro">{{ author.bio }}</p>
|
||||
{% with profile = author, about_addons = True,
|
||||
table_class = 'person-info' %}
|
||||
|
|
|
@ -10,11 +10,11 @@
|
|||
{% for author in addon.listed_authors -%}
|
||||
{%- if api_version >= 1.5 -%}
|
||||
<author id="{{ author.id }}">
|
||||
<name>{{ author.display_name }}</name>
|
||||
<name>{{ author.name }}</name>
|
||||
<link>{{ author.get_url_path()|absolutify|urlparams(src='api') }}</link>
|
||||
</author>
|
||||
{%- else -%}
|
||||
<author>{{ author.display_name }}</author>
|
||||
<author>{{ author.name }}</author>
|
||||
{%- endif -%}
|
||||
{%- endfor %}
|
||||
{% endif %}
|
||||
|
|
|
@ -16,7 +16,7 @@ def addon_to_dict(addon):
|
|||
'name': addon.name,
|
||||
'guid': addon.guid,
|
||||
'status': addon.status,
|
||||
'author': (addon.listed_authors[0].display_name if
|
||||
'author': (addon.listed_authors[0].name if
|
||||
addon.listed_authors else ''),
|
||||
'summary': addon.summary,
|
||||
'description': addon.description,
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
{% block content %}
|
||||
{% with crumbs = [(url('collections.list'), _('Collections')), (None, c.name)] %}
|
||||
{% if c.author %}
|
||||
{% do crumbs.insert(1, (url('collections.user', c.author.username), c.author.display_name)) %}
|
||||
{% do crumbs.insert(1, (url('collections.user', c.author.username), c.author.name)) %}
|
||||
{% endif %}
|
||||
{{ breadcrumbs(crumbs) }}
|
||||
{% endwith %}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{# L10n: {0} is a username. #}
|
||||
{% set title = _('Collections by {0}')|f(author.display_name) %}
|
||||
{% set title = _('Collections by {0}')|f(author.name) %}
|
||||
{% block title %}{{ page_title(title) }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="primary">
|
||||
<header>
|
||||
{{ breadcrumbs([(url('collections.list'), _('Collections')),
|
||||
(None, author.display_name)]) }}
|
||||
(None, author.name)]) }}
|
||||
<h2>{{ title }}</h2>
|
||||
</header>
|
||||
<div class="featured listing">
|
||||
|
|
|
@ -29,7 +29,7 @@ class AddonFeedMixin(object):
|
|||
def item_author_name(self, addon):
|
||||
"""Author for a particuar add-on (<item><dc:creator>)"""
|
||||
if addon.listed_authors:
|
||||
return addon.listed_authors[0].display_name
|
||||
return addon.listed_authors[0].name
|
||||
else:
|
||||
return ''
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% extends "reviews/review_list.html" %}
|
||||
|
||||
{% set title = _('Reply to review by {0}')|f(review.user.display_name) %}
|
||||
{% set title = _('Reply to review by {0}')|f(review.user.name) %}
|
||||
|
||||
{% block title %}{{ page_title(title) }}{% endblock %}
|
||||
|
||||
|
|
|
@ -30,10 +30,10 @@
|
|||
{% endwith %}
|
||||
{% elif reply %}
|
||||
{# L10n: {0} is a developer's name. #}
|
||||
<h2>{{ _('Developer reply by {0}')|f(reply.user.display_name) }}</h2>
|
||||
<h2>{{ _('Developer reply by {0}')|f(reply.user.name) }}</h2>
|
||||
{% elif reviews %}
|
||||
<h2>{% trans cnt=reviews.object_list|length, addon=addon.name,
|
||||
user=reviews.object_list[0].user.display_name %}
|
||||
user=reviews.object_list[0].user.name %}
|
||||
Review for {{ addon }} by {{ user }}
|
||||
{% pluralize %}
|
||||
Reviews for {{ addon }} by {{ user }}
|
||||
|
|
|
@ -102,8 +102,8 @@ def delete(request, addon_id, review_id):
|
|||
review = get_object_or_404(Review.objects, pk=review_id, addon=addon_id)
|
||||
review.delete()
|
||||
log.info('DELETE: %s deleted %s by %s ("%s": "%s")' %
|
||||
(request.amo_user.display_name, review_id,
|
||||
review.user.display_name, review.title, review.body))
|
||||
(request.amo_user.name, review_id,
|
||||
review.user.name, review.title, review.body))
|
||||
return http.HttpResponse()
|
||||
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ def _user_link(user):
|
|||
if isinstance(user, basestring):
|
||||
return user
|
||||
return u'<a href="%s">%s</a>' % (
|
||||
user.get_url_path(), unicode(jinja2.escape(user.display_name)))
|
||||
user.get_url_path(), unicode(jinja2.escape(user.name)))
|
||||
|
||||
|
||||
@register.filter
|
||||
|
|
|
@ -73,7 +73,7 @@ def fmt(collections, publishers):
|
|||
jingo.env.autoescape = False
|
||||
template = jingo.env.from_string(u"""\
|
||||
{% macro user(u) %}
|
||||
{{ u.display_name }} {{ u.get_url_path()|absolutify }}
|
||||
{{ u.name }} {{ u.get_url_path()|absolutify }}
|
||||
{% endmacro %}
|
||||
{% for collection in collections %}
|
||||
* {{ collection.name }}
|
||||
|
|
|
@ -130,9 +130,11 @@ class UserProfile(amo.models.ModelBase):
|
|||
addonuser__listed=True)[:1])
|
||||
|
||||
@property
|
||||
def welcome_name(self):
|
||||
def name(self):
|
||||
return self.display_name or self.username
|
||||
|
||||
welcome_name = name
|
||||
|
||||
@amo.cached_property
|
||||
def reviews(self):
|
||||
"""All reviews that are not dev replies."""
|
||||
|
@ -286,5 +288,7 @@ class PersonaAuthor(unicode):
|
|||
return 0
|
||||
|
||||
@property
|
||||
def display_name(self):
|
||||
def name(self):
|
||||
return self
|
||||
|
||||
display_name = name
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{% extends "base_side_categories.html" %}
|
||||
|
||||
{% block title %}{{ page_title(_('User Info for {0}')|f(profile.display_name)) }}{% endblock %}
|
||||
{% block title %}{{ page_title(_('User Info for {0}')|f(profile.name)) }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="vcard">
|
||||
{{ breadcrumbs([(None, profile.display_name)]) }}
|
||||
<h2 class="fn n">{{ profile.display_name }}</h2>
|
||||
{{ breadcrumbs([(None, profile.name)]) }}
|
||||
<h2 class="fn n">{{ profile.name }}</h2>
|
||||
<div class="featured">
|
||||
<div class="featured-inner object-lead">
|
||||
<h3>{{ _('About Me')}}</h3>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
{# TODO msgctxt for table headers #}
|
||||
<tr>
|
||||
<th>{{ _('Name') }}</th>
|
||||
<td class="fn n">{{ profile.display_name }}</td>
|
||||
<td class="fn n">{{ profile.name }}</td>
|
||||
</tr>
|
||||
{% if profile.location %}
|
||||
<tr>
|
||||
|
|
|
@ -57,7 +57,7 @@ class TestEdit(UserViewBase):
|
|||
|
||||
# The email shouldn't change until they confirm, but the name should
|
||||
u = User.objects.get(id='4043307').get_profile()
|
||||
self.assertEquals(u.display_name, 'DJ SurfNTurf')
|
||||
self.assertEquals(u.name, 'DJ SurfNTurf')
|
||||
self.assertEquals(u.email, 'jbalogh@mozilla.com')
|
||||
|
||||
eq_(len(mail.outbox), 1)
|
||||
|
|
|
@ -32,7 +32,7 @@ def ajax(request):
|
|||
"""Query for a user matching a given email."""
|
||||
email = request.GET.get('q', '').strip()
|
||||
u = get_object_or_404(UserProfile, email=email)
|
||||
return dict(id=u.id, name=u.display_name)
|
||||
return dict(id=u.id, name=u.name)
|
||||
|
||||
|
||||
def confirm(request, user_id, token):
|
||||
|
|
|
@ -63,10 +63,10 @@ class VersionsRss(Feed):
|
|||
def item_author_name(self, version):
|
||||
"""Author for a particuar version (<item><dc:creator>)"""
|
||||
# @todo should be able to output a <dc:creator for each author
|
||||
creator = ''
|
||||
if version.addon.listed_authors:
|
||||
creator = version.addon.listed_authors[0].display_name
|
||||
return creator
|
||||
return version.addon.listed_authors[0].name
|
||||
else:
|
||||
return ''
|
||||
|
||||
def item_pubdate(self, version):
|
||||
"""Pubdate for a particuar version (<item><pubDate>)"""
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
</td>
|
||||
{% if addon.approval %}
|
||||
<td>{{ addon.approval.created|datetime('%Y-%m-%d') }}</td>
|
||||
<td>{{ addon.approval.user.display_name }}</td>
|
||||
<td>{{ addon.approval.user.name }}</td>
|
||||
<td>{{ addon.approval.comments }}</td>
|
||||
{% else %}
|
||||
<td colspan="3"></td>
|
||||
|
|
Загрузка…
Ссылка в новой задаче