mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-08 22:17:34 +01:00
Add /reviews/ to list all reviews
This commit is contained in:
parent
13130a217c
commit
c7a7609763
@ -24,6 +24,13 @@ from wtforms.validators import *
|
||||
from app.models import db, PackageReview, Thread, ThreadReply
|
||||
from app.utils import is_package_page, addNotification
|
||||
|
||||
|
||||
@bp.route("/reviews/")
|
||||
def list_reviews():
|
||||
reviews = PackageReview.query.order_by(db.desc(PackageReview.created_at)).limit(5).all()
|
||||
return render_template("packages/reviews_list.html", reviews=reviews)
|
||||
|
||||
|
||||
class ReviewForm(FlaskForm):
|
||||
title = StringField("Title", [InputRequired(), Length(3,100)])
|
||||
comment = TextAreaField("Comment", [InputRequired(), Length(10, 500)])
|
||||
|
@ -51,6 +51,9 @@
|
||||
{{ render_pkggrid(pop_txp) }}
|
||||
|
||||
|
||||
<a href="{{ url_for('packages.list_reviews') }}" class="btn btn-secondary float-right">
|
||||
{{ _("See more") }}
|
||||
</a>
|
||||
<h2 class="my-3">{{ _("Recent Positive Reviews") }}</h2>
|
||||
{% from "macros/reviews.html" import render_reviews %}
|
||||
{{ render_reviews(reviews, current_user, True) }}
|
||||
|
10
app/templates/packages/reviews_list.html
Normal file
10
app/templates/packages/reviews_list.html
Normal file
@ -0,0 +1,10 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
{{ _("Reviews") }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% from "macros/reviews.html" import render_reviews %}
|
||||
{{ render_reviews(reviews, current_user, True) }}
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user