aboutsummaryrefslogtreecommitdiff
path: root/app/templates
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2020-07-09 05:22:58 +0100
committerrubenwardy <rw@rubenwardy.com>2020-07-09 05:30:13 +0100
commit75ab56cad1afa4e179977344b103bbf523f2baac (patch)
treee99388aeccc81597013f2ca4c35fa1fd9024d651 /app/templates
parent25b481ac0a5426f5a23869fd3a92b13cca35b0db (diff)
downloadcheatdb-75ab56cad1afa4e179977344b103bbf523f2baac.tar.xz
Add recent positive reviews to homepage
Diffstat (limited to 'app/templates')
-rw-r--r--app/templates/index.html19
-rw-r--r--app/templates/macros/reviews.html18
-rw-r--r--app/templates/packages/review_create_edit.html2
3 files changed, 19 insertions, 20 deletions
diff --git a/app/templates/index.html b/app/templates/index.html
index a7574d6..84c1d06 100644
--- a/app/templates/index.html
+++ b/app/templates/index.html
@@ -20,20 +20,6 @@
{% endblock %}
{% block content %}
-<!-- <header class="jumbotron">
- <div class="container">
- <h1 class="display-3">{{ config.USER_APP_NAME }}</h1>
-
- <p class="lead">
- Minetest's official content repository.
- Browse {{ count }} packages,
- the majority of which are available under a free
- and open source license.
- </p>
- </div>
-</header>
-
-<main class="container"> -->
{% from "macros/packagegridtile.html" import render_pkggrid %}
@@ -64,6 +50,11 @@
<h2 class="my-3">{{ _("Top Texture Packs") }}</h2>
{{ render_pkggrid(pop_txp) }}
+
+ <h2 class="my-3">{{ _("Recent Positive Reviews") }}</h2>
+ {% from "macros/reviews.html" import render_reviews %}
+ {{ render_reviews(reviews, True) }}
+
<div class="text-center">
<small>
{{ _("CDB has %(count)d packages, with a total of %(downloads)d downloads.", count=count, downloads=downloads) }}
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>
diff --git a/app/templates/packages/review_create_edit.html b/app/templates/packages/review_create_edit.html
index a49398f..a53bbd7 100644
--- a/app/templates/packages/review_create_edit.html
+++ b/app/templates/packages/review_create_edit.html
@@ -9,7 +9,7 @@
{% endblock %}
{% block content %}
-<h1>{{ _("Post a review for %(name)s by %(author)s", name=self.link(), author=package.author.display_name) }}</h1>
+<h1>{{ _("Post a review for %(title)s by %(author)s", title=self.link(), author=package.author.display_name) }}</h1>
{% from "macros/forms.html" import render_field, render_submit_field, render_radio_field %}
<form method="POST" action="" enctype="multipart/form-data">