Skip to content

Commit

Permalink
[bug 803484] Linkify usernames on /flagged page.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlr committed Nov 19, 2012
1 parent 2e05179 commit 9781a4f
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 11 deletions.
15 changes: 11 additions & 4 deletions apps/flagit/templates/flagit/includes/flagged_answer.html
@@ -1,13 +1,20 @@
{% from 'flagit/includes/macros.html' import date_by_user with context %}
<h3>{{ _('Content:') }}</h3>
<div class="content">{{ object.content_object.content_parsed }}</div>
<h3>{{ _('Created:') }}</h3>
<p class="created">{{ _('{date} by {user}')|fe(user=object.content_object.creator, date=datetimeformat(object.content_object.created, format='longdatetime')) }}</p>
<p class="created">
{{ date_by_user(object.content_object.created, object.content_object.creator) }}
</p>
{% if object.content_object.updated_by %}
<h3>{{ _('Updated:') }}</h3>
<p class="updated">{{ _('{date} by {user}')|fe(user=object.content_object.updated_by, date=datetimeformat(object.content_object.updated, format='longdatetime')) }}</p>
<p class="updated">
{{ date_by_user(object.content_object.updated, object.content_object.updated_by) }}
</p>
{% endif %}
<h3>{{ _('Flagged:') }}</h3>
<p class="flagged">{{ _('{date} by {user}')|fe(user=object.creator, date=datetimeformat(object.created, format='longdatetime')) }}</p>
<p class="flagged">
{{ date_by_user(object.created, object.creator) }}
</p>
<h3>{{ _('Take Action:') }}</h3>
<div class="actions">
<a href="{{ object.content_object.get_absolute_url() }}">View</a>
Expand All @@ -17,4 +24,4 @@ <h3>{{ _('Take Action:') }}</h3>
{% if user.has_perm('questions.delete_question') %}
<a class="delete" href="{{ url('questions.delete_answer', object.content_object.question.id, object.content_object.id) }}">{{ _('Delete') }}</a>
{% endif %}
</div>
</div>
13 changes: 10 additions & 3 deletions apps/flagit/templates/flagit/includes/flagged_post.html
@@ -1,15 +1,22 @@
{% from 'flagit/includes/macros.html' import date_by_user with context %}
<h3>{{ _('Title:') }}</h3>
<p class="title">{{ object.content_object.thread.title }}</p>
<h3>{{ _('Content:') }}</h3>
<div class="content">{{ object.content_object.content_parsed }}</div>
<h3>{{ _('Created:') }}</h3>
<p class="created">{{ _('{date} by {user}')|fe(user=object.content_object.creator, date=datetimeformat(object.content_object.created, format='longdatetime')) }}</p>
<p class="created">
{{ date_by_user(object.content_object.created, object.content_object.creator) }}
</p>
{% if object.content_object.updated_by %}
<h3>{{ _('Updated:') }}</h3>
<p class="updated">{{ _('{date} by {user}')|fe(user=object.content_object.updated_by, date=datetimeformat(object.content_object.updated, format='longdatetime')) }}</p>
<p class="updated">
{{ date_by_user(object.content_object.updated, object.content_object.updated_by) }}
</p>
{% endif %}
<h3>{{ _('Flagged:') }}</h3>
<p class="flagged">{{ _('{date} by {user}')|fe(user=object.creator, date=datetimeformat(object.created, format='longdatetime')) }}</p>
<p class="flagged">
{{ date_by_user(object.created, object.creator) }}
</p>
<h3>{{ _('Take Action:') }}</h3>
<div class="actions">
<a href="{{ object.content_object.get_absolute_url() }}">View</a>
Expand Down
5 changes: 4 additions & 1 deletion apps/flagit/templates/flagit/includes/flagged_profile.html
@@ -1,10 +1,13 @@
{% from 'flagit/includes/macros.html' import date_by_user with context %}
<h3>{{ _('Content:') }}</h3>
<div class="content">
<h2>{{ object.content_object }}</h2>
{{ object.content_object.bio|wiki_to_html(nofollow=True) }}
</div>
<h3>{{ _('Flagged:') }}</h3>
<p class="flagged">{{ _('{date} by {user}')|fe(user=object.creator, date=datetimeformat(object.created, format='longdatetime')) }}</p>
<p class="flagged">
{{ date_by_user(object.created, object.creator) }}
</p>
<h3>{{ _('Take Action:') }}</h3>
<div class="actions">
<a href="{{ object.content_object.get_absolute_url() }}">View</a>
Expand Down
13 changes: 10 additions & 3 deletions apps/flagit/templates/flagit/includes/flagged_question.html
@@ -1,15 +1,22 @@
{% from 'flagit/includes/macros.html' import date_by_user with context %}
<h3>{{ _('Title:') }}</h3>
<p class="title">{{ object.content_object.title }}</p>
<h3>{{ _('Content:') }}</h3>
<div class="content">{{ object.content_object.content_parsed }}</div>
<h3>{{ _('Created:') }}</h3>
<p class="created">{{ _('{date} by {user}')|fe(user=object.content_object.creator, date=datetimeformat(object.content_object.created, format='longdatetime')) }}</p>
<p class="created">
{{ date_by_user(object.content_object.created, object.content_object.creator) }}
</p>
{% if object.content_object.updated_by %}
<h3>{{ _('Updated:') }}</h3>
<p class="updated">{{ _('{date} by {user}')|fe(user=object.content_object.updated_by, date=datetimeformat(object.content_object.updated, format='longdatetime')) }}</p>
<p class="updated">
{{ date_by_user(object.content_object.updated, object.content_object.updated_by) }}
</p>
{% endif %}
<h3>{{ _('Flagged:') }}</h3>
<p class="flagged">{{ _('{date} by {user}')|fe(user=object.creator, date=datetimeformat(object.created, format='longdatetime')) }}</p>
<p class="flagged">
{{ date_by_user(object.created, object.creator) }}
</p>
<h3>{{ _('Take Action:') }}</h3>
<div class="actions">
<a href="{{ object.content_object.get_absolute_url() }}">View</a>
Expand Down
5 changes: 5 additions & 0 deletions apps/flagit/templates/flagit/includes/macros.html
@@ -0,0 +1,5 @@
{% macro date_by_user(date, user) -%}
{% trans date=datetimeformat(date, format='longdatetime'), user=user.username, url=profile_url(user) %}
{{date}} by <a href="{{url}}">{{user}}</a>
{% endtrans %}
{%- endmacro %}

0 comments on commit 9781a4f

Please sign in to comment.