Skip to content
Snippets Groups Projects
Commit 4a4a41d0 authored by Erin Mullaney's avatar Erin Mullaney Committed by Todd Dembrey
Browse files

#962 move opinion check out of context and into template for all reviews page

parent b20f94ab
No related branches found
No related tags found
No related merge requests found
{% load wagtailimages_tags %} {% load wagtailimages_tags %}
<ul> {% if opinions %}
{% for opinion in opinions %} <ul>
<li> {% for opinion in opinions %}
{{ opinion.author }} <li>
{% if opinion.get_author_assignment %}{% image opinion.get_author_assignment.icon max-12x12 %}{% endif %} {{ opinion.author }}
{{ opinion.get_opinion_display }}s {% if opinion.get_author_assignment %}{% image opinion.get_author_assignment.icon max-12x12 %}{% endif %}
</li> {{ opinion.get_opinion_display }}s
{% endfor %} </li>
</ul> {% endfor %}
\ No newline at end of file </ul>
{% endif %}
\ No newline at end of file
...@@ -243,12 +243,9 @@ class ReviewListView(ListView): ...@@ -243,12 +243,9 @@ class ReviewListView(ListView):
for i, review in enumerate(self.object_list): for i, review in enumerate(self.object_list):
review_data['title']['answers'].append('<a href="{}">{}</a>'.format(review.get_absolute_url(), review.author)) review_data['title']['answers'].append('<a href="{}">{}</a>'.format(review.get_absolute_url(), review.author))
if review.opinions: opinions_template = get_template('review/includes/review_opinions_list.html')
opinions_template = get_template('review/includes/review_opinions_list.html') opinions_html = opinions_template.render({'opinions': review.opinions.select_related('author').all()})
opinions_html = opinions_template.render({'opinions': review.opinions.all()}) review_data['opinions']['answers'].append(opinions_html)
review_data['opinions']['answers'].append(opinions_html)
else:
review_data['opinions']['answers'].append("")
review_data['score']['answers'].append(str(review.get_score_display())) review_data['score']['answers'].append(str(review.get_score_display()))
review_data['recommendation']['answers'].append(review.get_recommendation_display()) review_data['recommendation']['answers'].append(review.get_recommendation_display())
review_data['comments']['answers'].append(review.get_comments_display(include_question=False)) review_data['comments']['answers'].append(review.get_comments_display(include_question=False))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment