summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2018-07-06 18:17:54 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2018-07-06 18:17:54 +0200
commit704a61184e9d87d0aad33b5f830e075dd7da9e4d (patch)
tree501b46e3d61fdcecc3393588c80f378400ac3c2b
parentc35389d77608fa78affe4eee331970897707bc97 (diff)
downloadhemiptera-704a61184e9d87d0aad33b5f830e075dd7da9e4d.zip
hemiptera-704a61184e9d87d0aad33b5f830e075dd7da9e4d.tar.gz
hemiptera-704a61184e9d87d0aad33b5f830e075dd7da9e4d.tar.bz2
added templates
-rwxr-xr-xhemiptera2
-rw-r--r--templates/bug.html41
-rw-r--r--templates/buglist.html48
-rw-r--r--templates/main_page.html25
4 files changed, 115 insertions, 1 deletions
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 @@
+<!DOCTYPE html>
+<head>
+ <title>
+ Hemiptera Bugtracker at {{DOMAIN}}
+ </title>
+ <meta charset="utf-8">
+ <link rel="stylesheet" type="text/css" href="/styles.css" >
+</head>
+<body>
+ <header>
+ <h1><a href="/"> Hemiptera Bugtracker at {{DOMAIN}}</a></h1>
+ <h2><a href="/{{prname}}" >{{prname}}</a></h2>
+ <h3 class="subject" >
+ {{ replies[0]["Subject"] }}
+ </h3>
+ Send replies to <a href="mailto:{{ bug.id }}@{{ DOMAIN }}" >{{ bug.id }}@{{ DOMAIN }}</a>
+ </header>
+ {% for i in replies %}
+ <div class="container">
+ <div class="date {% if i["From"] == replies[0]["From"] %}op{% endif %}{% if i["From"] in devs %}dev{% endif %}">
+ <img class="avatar" src="{{ i["Avatar"] }}" alt="avatar" /> From: {% if i["From"] == replies[0]["From"] %} OP {% elif i["From"] in devs %} Developer {% else %} Someone else {% endif %}<br> {{ i["Date"] }}
+ </div>
+ <div class="reply">
+<p>{{ i.get_body("plain").get_content().replace("\n", "</p><p>") }}</p>
+ </div>
+ </div>
+ {% endfor %}
+ {% if bug.closed %}
+ <div class="container">
+ <div class="status-header date">
+ <img class="avatar" src="/static/excl.png" alt="avatar" />
+ <b>Status Update</b> <br>
+ {{ bug.closeddate }}
+ </div>
+ <div class="status-message reply">
+ <i>This bug was closed.</i>
+ </div>
+ </div>
+ {% endif %}
+</body>
+
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 @@
+<!DOCTYPE html>
+<head>
+ <title>
+ Hemiptera Bugtracker at {{DOMAIN}}
+ </title>
+ <meta charset="utf-8">
+ <link rel="stylesheet" type="text/css" href="/styles.css" >
+</head>
+<body>
+ <header>
+ <h1>
+ <a href="/" >Hemiptera Bugtracker at {{DOMAIN}}</a>
+ </h1>
+ <h3>
+ Bugs in {{prname}}
+ </h3>
+ </header>
+ <table>
+ <thead>
+ <td>Id
+ <td>Name
+ <td>Number of replies
+ <td>Created
+ <td>Last Reply
+ <td>Status
+ </thead>
+ {% for i in bugs %}
+ <tr class="{% if i.closed %} closed {% endif %}" >
+ <td>
+ {{ i.id }}
+ <td>
+ <a href="/{{ prname }}/{{ i.id }}.html"> {{ i.subject }}</a>
+ <td>
+ {{ i.replies }}
+ <td title="{{ i.created }}">
+ {{ i.nicecreated }}
+ <td title="{{ i.last_reply }}">
+ {{ i.nicereply }}
+ <td>
+ {% if i.closed %}
+ closed
+ {% else %}
+ open
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+</body>
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 @@
+<!DOCTYPE html>
+<head>
+ <title>
+ Hemiptera Bugtracker at {{DOMAIN}}
+ </title>
+ <meta charset="utf-8">
+ <link rel="stylesheet" type="text/css" href="/styles.css" >
+</head>
+<body>
+ List of projects
+ <table>
+ <thead>
+ <td>Name
+ <td>Number of bugs
+ </thead>
+ {% for i in projects %}
+ <tr>
+ <td>
+ <a href="{{ i.name }}"> {{ i.name }}</a>
+ <td>
+ {{ i.count }}
+ </tr>
+ {% endfor %}
+ </table>
+</body>