From b1c349cc3558b4642a700a489482ff95b038ce56 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 11 Jun 2018 22:49:25 +0100 Subject: Add comment system --- app/templates/macros/threads.html | 27 +++++++++++++++++++++++++++ app/templates/packages/view.html | 13 +++++++++++++ app/templates/threads/list.html | 12 ++++++++++++ app/templates/threads/new.html | 19 +++++++++++++++++++ app/templates/threads/view.html | 25 +++++++++++++++++++++++++ 5 files changed, 96 insertions(+) create mode 100644 app/templates/macros/threads.html create mode 100644 app/templates/threads/list.html create mode 100644 app/templates/threads/new.html create mode 100644 app/templates/threads/view.html (limited to 'app/templates') diff --git a/app/templates/macros/threads.html b/app/templates/macros/threads.html new file mode 100644 index 0000000..96e1107 --- /dev/null +++ b/app/templates/macros/threads.html @@ -0,0 +1,27 @@ +{% macro render_thread(thread, current_user) -%} + + + {% if current_user.is_authenticated %} +
+ +
+ +
+ {% endif %} +{% endmacro %} + +{% macro render_threadlist(threads) -%} + + +{% endmacro %} diff --git a/app/templates/packages/view.html b/app/templates/packages/view.html index 56cfd62..3a83995 100644 --- a/app/templates/packages/view.html +++ b/app/templates/packages/view.html @@ -43,6 +43,19 @@ {% endif %}
+ + {% if package.author == current_user or package.checkPerm(current_user, "APPROVE_NEW") %} + {% if review_thread %} + {% from "macros/threads.html" import render_thread %} + {{ render_thread(review_thread, current_user) }} + {% else %} +
+ Privately ask a question or give feedback + + Open Thread +
+ {% endif %} + {% endif %} {% endif %}

{{ package.title }} by {{ package.author.display_name }}

diff --git a/app/templates/threads/list.html b/app/templates/threads/list.html new file mode 100644 index 0000000..7e27325 --- /dev/null +++ b/app/templates/threads/list.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block title %} +Threads +{% endblock %} + +{% block content %} +

Threads

+ + {% from "macros/threads.html" import render_threadlist %} + {{ render_threadlist(threads) }} +{% endblock %} diff --git a/app/templates/threads/new.html b/app/templates/threads/new.html new file mode 100644 index 0000000..22f5b72 --- /dev/null +++ b/app/templates/threads/new.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} + +{% block title %} + New Thread +{% endblock %} + +{% block content %} + {% from "macros/forms.html" import render_field, render_submit_field %} +
+ {{ form.hidden_tag() }} + + {{ render_field(form.title) }} + {{ render_field(form.comment) }} + {{ render_field(form.private) }} + {{ render_submit_field(form.submit) }} + +

Only the you, the package author, and users of Editor rank and above can read private threads.

+
+{% endblock %} diff --git a/app/templates/threads/view.html b/app/templates/threads/view.html new file mode 100644 index 0000000..397fba3 --- /dev/null +++ b/app/templates/threads/view.html @@ -0,0 +1,25 @@ +{% extends "base.html" %} + +{% block title %} +Threads +{% endblock %} + +{% block content %} +

{% if thread.private %}🔒 {% endif %}{{ thread.title }}

+ + {% if thread.package %} +

+ Package: {{ thread.package.title }} +

+ {% endif %} + + {% if thread.private %} + + This thread is only visible to its creator, the package owner, and users of + Editor rank or above. + + {% endif %} + + {% from "macros/threads.html" import render_thread %} + {{ render_thread(thread, current_user) }} +{% endblock %} -- cgit v1.2.3