diff options
| author | rubenwardy <rw@rubenwardy.com> | 2020-07-09 05:22:58 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2020-07-09 05:30:13 +0100 |
| commit | 75ab56cad1afa4e179977344b103bbf523f2baac (patch) | |
| tree | e99388aeccc81597013f2ca4c35fa1fd9024d651 /app/templates/macros | |
| parent | 25b481ac0a5426f5a23869fd3a92b13cca35b0db (diff) | |
| download | cheatdb-75ab56cad1afa4e179977344b103bbf523f2baac.tar.xz | |
Add recent positive reviews to homepage
Diffstat (limited to 'app/templates/macros')
| -rw-r--r-- | app/templates/macros/reviews.html | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/app/templates/macros/reviews.html b/app/templates/macros/reviews.html index fc6673e..f181492 100644 --- a/app/templates/macros/reviews.html +++ b/app/templates/macros/reviews.html @@ -1,4 +1,4 @@ -{% macro render_reviews(reviews) -%} +{% macro render_reviews(reviews, show_package_link=False) -%} <ul class="comments mt-4 mb-0"> {% for review in reviews %} <li class="row my-2 mx-0"> @@ -37,10 +37,18 @@ {{ reply.comment | markdown }} - <a class="btn btn-primary" href="{{ url_for('threads.view', id=review.thread.id) }}"> - <i class="fas fa-comments mr-2"></i> - {{ _("%(num)d comments", num=review.thread.replies.count() - 1) }} - </a> + <p class="mt-2 mb-0"> + {% if show_package_link %} + <a class="btn btn-primary mr-1" href="{{ review.package.getDetailsURL() }}"> + {{ _("View %(title)s by %(author)s", title=review.package.title, author=review.package.author.display_name) }} + </a> + {% endif %} + + <a class="btn btn-primary" href="{{ url_for('threads.view', id=review.thread.id) }}"> + <i class="fas fa-comments mr-2"></i> + {{ _("%(num)d comments", num=review.thread.replies.count() - 1) }} + </a> + </p> </div> </div> </div> |
