From 704a61184e9d87d0aad33b5f830e075dd7da9e4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= Date: Fri, 6 Jul 2018 18:17:54 +0200 Subject: added templates --- hemiptera | 2 +- templates/bug.html | 41 +++++++++++++++++++++++++++++++++++++++++ templates/buglist.html | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ templates/main_page.html | 25 +++++++++++++++++++++++++ 4 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 templates/bug.html create mode 100644 templates/buglist.html create mode 100644 templates/main_page.html diff --git a/hemiptera b/hemiptera index 7dc0bcf..46bfd57 100755 --- a/hemiptera +++ b/hemiptera @@ -195,7 +195,7 @@ def create_unconfirmed_bug(msg) : bugpath = os.path.join(basedir, "unconfirmed" , confid) fr = "confirm-bug@" + DOMAIN subject, _ = get_message_data(msg) - gen_message(confid,subject,fromaddr,fr) + gen_message("Your bug has been registered. To prevent spam, you need to confirm it by answering to this message with the following confirmation id: " + confid + ". Just hitting reply should work.",subject,fromaddr,fr) os.makedirs(bugpath) m = create_censored_message(msg) write_message(os.path.join(bugpath, "message"), m) diff --git a/templates/bug.html b/templates/bug.html new file mode 100644 index 0000000..7f58780 --- /dev/null +++ b/templates/bug.html @@ -0,0 +1,41 @@ + + + + Hemiptera Bugtracker at {{DOMAIN}} + + + + + +
+

Hemiptera Bugtracker at {{DOMAIN}}

+

{{prname}}

+

+ {{ replies[0]["Subject"] }} +

+ Send replies to {{ bug.id }}@{{ DOMAIN }} +
+ {% for i in replies %} +
+
+ avatar From: {% if i["From"] == replies[0]["From"] %} OP {% elif i["From"] in devs %} Developer {% else %} Someone else {% endif %}
{{ i["Date"] }} +
+
+

{{ i.get_body("plain").get_content().replace("\n", "

") }}

+
+
+ {% endfor %} + {% if bug.closed %} +
+
+ avatar + Status Update
+ {{ bug.closeddate }} +
+
+ This bug was closed. +
+
+ {% endif %} + + diff --git a/templates/buglist.html b/templates/buglist.html new file mode 100644 index 0000000..3e69108 --- /dev/null +++ b/templates/buglist.html @@ -0,0 +1,48 @@ + + + + Hemiptera Bugtracker at {{DOMAIN}} + + + + + +
+

+ Hemiptera Bugtracker at {{DOMAIN}} +

+

+ Bugs in {{prname}} +

+
+ + + + {% for i in bugs %} + + + {% endfor %} +
Id + Name + Number of replies + Created + Last Reply + Status +
+ {{ i.id }} + + {{ i.subject }} + + {{ i.replies }} + + {{ i.nicecreated }} + + {{ i.nicereply }} + + {% if i.closed %} + closed + {% else %} + open + {% endif %} +
+ diff --git a/templates/main_page.html b/templates/main_page.html new file mode 100644 index 0000000..e32cfd4 --- /dev/null +++ b/templates/main_page.html @@ -0,0 +1,25 @@ + + + + Hemiptera Bugtracker at {{DOMAIN}} + + + + + + List of projects + + + + {% for i in projects %} + + + {% endfor %} +
Name + Number of bugs +
+ {{ i.name }} + + {{ i.count }} +
+ -- cgit v1.2.3