Homepage: Preload review information in queries
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if review.thread %}
|
||||
{% set reply = review.thread.replies[0] %}
|
||||
{% set reply = review.thread.first_reply %}
|
||||
<div class="col pr-0">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% if current_user == thread.author and thread.review and thread.replies[0] == r %}
|
||||
{% if current_user == thread.author and thread.review and thread.first_reply == r %}
|
||||
<a class="float-right btn btn-primary btn-sm ml-2"
|
||||
href="{{ thread.review.package.getURL('packages.review') }}">
|
||||
<i class="fas fa-pen"></i>
|
||||
@@ -67,7 +67,7 @@
|
||||
|
||||
{{ r.comment | markdown }}
|
||||
|
||||
{% if thread.replies[0] == r and thread.review %}
|
||||
{% if thread.first_reply == r and thread.review %}
|
||||
{{ render_review_vote(thread.review, current_user, thread.getViewURL()) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<h3 class="card-header">{{ self.title() }}</h3>
|
||||
<div class="card-body markdown">
|
||||
{{ thread.replies[0].comment | markdown }}
|
||||
{{ thread.first_reply.comment | markdown }}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>{{ _("Deleting is permanent") }}</p>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if r == r.thread.replies[0] %}
|
||||
{% if r == r.thread.first_reply %}
|
||||
<a class="badge badge-primary" href="{{ r.thread.getViewURL() }}">
|
||||
{{ r.thread.title }}
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user