Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Browning <ayleph@thisshitistemp.com>2016-03-02 13:37:36 -0500
committerAndrew Browning <ayleph@thisshitistemp.com>2016-03-05 11:39:57 -0500
commitb1d4973ca4f2d14ea2b17cec269ebd056da2da71 (patch)
tree1bb862059bfe53f24f6670255336439b85dd3a71
parent399272eea5c36f8337621575a498f4f0f2686f8f (diff)
Fix comment ID links on media comment report page
Change the comment ID behaviour and source of user_pages/report.html to match user_pages/media.html as of #5376.
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/report.html30
-rw-r--r--mediagoblin/user_pages/views.py2
2 files changed, 13 insertions, 19 deletions
diff --git a/mediagoblin/templates/mediagoblin/user_pages/report.html b/mediagoblin/templates/mediagoblin/user_pages/report.html
index 09502fcf..4a88f4b7 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/report.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/report.html
@@ -22,37 +22,31 @@
<form action="" method=POST >
{% if comment is defined %}
<h3>{% trans %}Reporting this Comment{% endtrans %}</h3>
- {%- set comment_author = comment.get_actor %}
- {%- set comment_author_url = request.urlgen(
- 'mediagoblin.user_pages.user_home',
- user=comment_author.username) %}
- {%- set comment_url = request.urlgen(
- 'mediagoblin.user_pages.media_home.view_comment',
- comment=comment.id,
- user=media.get_actor.username,
- media=media.slug_or_id) %}
+ {% set comment_object = comment.comment() %}
+ {% set comment_author = comment_object.get_actor %}
<div id="comment-{{ comment.id }}"
class="comment_wrapper">
<div class="comment_author">
- <img
- src="{{ request.staticdirect('/images/icon_comment.png') }}" />
- <a href="{{ comment_author_url }}"
+ <img src="{{ request.staticdirect('/images/icon_comment.png') }}" />
+ <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
+ user=comment_author.username) }}"
class="comment_authorlink">
{{- comment_author.username -}}
</a>
- <a href="{{ comment_url }}"
+ <a href="{{ request.urlgen('mediagoblin.user_pages.media_home.view_comment',
+ comment=comment.id,
+ user=media.get_actor.username,
+ media=media.slug_or_id) }}#comment"
class="comment_whenlink">
- <span
- title='{{- comment.created.strftime("%I:%M%p %Y-%m-%d") -}}'>
-
- {%- trans formatted_time=timesince(comment.created) -%}
+ <span title='{{- comment_object.created.strftime("%I:%M%p %Y-%m-%d") -}}'>
+ {%- trans formatted_time=timesince(comment_object.created) -%}
{{ formatted_time }} ago
{%- endtrans -%}
</span></a>:
</div>
<div class="comment_content">
{% autoescape False -%}
- {{ comment.content_html }}
+ {{ comment_object.content_html }}
{%- endautoescape %}
</div>
</div>
diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py
index ad03e011..6949aaf6 100644
--- a/mediagoblin/user_pages/views.py
+++ b/mediagoblin/user_pages/views.py
@@ -693,7 +693,7 @@ def file_a_report(request, media, comment):
form = user_forms.CommentReportForm(request.form)
context = {'media': comment.target(),
- 'comment':comment.comment(),
+ 'comment':comment,
'form':form}
else:
form = user_forms.MediaReportForm(request.form)