summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2018-07-17 16:00:44 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2018-07-17 16:00:44 +0200
commitb94a6df756f80890ca0c04d9c08e05eb7b87870c (patch)
tree74a34ddded993d2428506a290ec369c87899e960
parent95679599de538a4833dd873f0630e5819b60db10 (diff)
downloadhemiptera-b94a6df756f80890ca0c04d9c08e05eb7b87870c.zip
hemiptera-b94a6df756f80890ca0c04d9c08e05eb7b87870c.tar.gz
hemiptera-b94a6df756f80890ca0c04d9c08e05eb7b87870c.tar.bz2
Various html improvements
-rw-r--r--export/styles.css59
-rw-r--r--hemiptera_html.py4
-rw-r--r--templates/bug.html6
-rw-r--r--templates/buglist.html29
-rw-r--r--templates/macros.html13
5 files changed, 101 insertions, 10 deletions
diff --git a/export/styles.css b/export/styles.css
index 51f797e..691d870 100644
--- a/export/styles.css
+++ b/export/styles.css
@@ -6,7 +6,7 @@
padding: 1em;
/* border-radius: 0.5em;*/
background-color: #eee;
- max-width: 35em;
+ max-width: 40em;
padding-bottom: 0;
}
@@ -15,7 +15,7 @@ header {
padding: 1em;
padding-top: 0.1em;
background-color: #eee;
- margin: 0;
+ margin: 1em;
margin-bottom: 1em;
max-width: 40em;
}
@@ -67,7 +67,14 @@ td {
tr.closed {
background: #dee;
+ font-style: italic;
+}
+
+tr.closed td.id {
+ text-decoration: line-through;
+ text-decoration: red double line-through;
}
+
table tr.closed:nth-child(odd) {
background: #cdd;
}
@@ -130,3 +137,51 @@ table {
margin: 1em
}
+
+/* mailto form */
+
+form {
+ padding: 1em;
+ border: 1px solid #aaa;
+ max-width: 40em;
+ margin: 1em;
+ border-radius: 3px;
+}
+
+form textarea {
+ max-width: 100%;
+ width: 100%;
+ height: 20em;
+ min-width: 100%;
+}
+
+input[type=text] {
+ width: auto;
+}
+
+input[type=submit] {
+ padding: 0.2em;
+ margin: 0.5em;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+h5.form {
+ margin: -1em;
+ padding: 1em;
+ font-size: 1em;
+ background-color: #aaa;
+ margin-bottom: 1em;
+}
+
+.floatbarrier {
+ clear:both;
+}
+
+.devavatars {
+ border: 1px solid #aaa;
+ padding: 0.5em;
+}
+.devavatars img {
+ margin-bottom: 0.5em;
+}
diff --git a/hemiptera_html.py b/hemiptera_html.py
index 394608a..39146e7 100644
--- a/hemiptera_html.py
+++ b/hemiptera_html.py
@@ -60,6 +60,7 @@ def create_project_list() :
k.bugs = bugs
os.makedirs(opj(export, i), exist_ok=True)
devs = get_devs(i)
+ dev_avatars = [ generate_avatar(i) for i in devs ]
for j in glob.glob(opj(basedir, "projects", i, "[0-9]*")) :
b = Bug()
b.closed = os.path.exists(opj(j, "closed"))
@@ -83,6 +84,7 @@ def create_project_list() :
m["Avatar"] = generate_avatar(m["From"])
replies.append(m)
b.created = replies[0]["Date"]
+ b.avatar = replies[0]["Avatar"]
if b.created :
b.nicecreated = prettydate(parsedate_to_datetime(b.created))
else :
@@ -97,7 +99,7 @@ def create_project_list() :
bugs.sort(key=lambda b: int(b.id), reverse=True)
bugs.sort(key=lambda b: int(b.closed))
f = open(opj(export, i, "index.html"), "w")
- f.write(buglist.render(DOMAIN=DOMAIN, bugs=bugs, prname=i))
+ f.write(buglist.render(DOMAIN=DOMAIN, bugs=bugs, prname=i, dev_avatars=dev_avatars))
f.close()
k.count = len(k.bugs)
k.opencount = len([ i for i in k.bugs if not i.closed ])
diff --git a/templates/bug.html b/templates/bug.html
index fc891fa..c8c2c70 100644
--- a/templates/bug.html
+++ b/templates/bug.html
@@ -1,3 +1,4 @@
+{% import "macros.html" as macros %}
<!DOCTYPE html>
<head>
<title>
@@ -13,7 +14,7 @@
<h3 class="subject" >
{{ replies[0]["Subject"]|e }}
</h3>
- Send replies to <a href="mailto:{{ bug.id }}@{{ DOMAIN }}" >{{ bug.id }}@{{ DOMAIN }}</a>
+ Send replies to <a href="mailto:{{ bug.id }}@{{ DOMAIN }}" >{{ bug.id }}@{{ DOMAIN }}</a> or using the <a href="#ReplyForm">Form below.</a>
</header>
{% for i in replies %}
<div class="container">
@@ -37,5 +38,8 @@
</div>
</div>
{% endif %}
+
+ {{ macros.form(bug.id, DOMAIN, True) }}
+
</body>
diff --git a/templates/buglist.html b/templates/buglist.html
index 142dc69..2183366 100644
--- a/templates/buglist.html
+++ b/templates/buglist.html
@@ -1,3 +1,4 @@
+{% import "macros.html" as macros %}
<!DOCTYPE html>
<head>
<title>
@@ -14,19 +15,32 @@
<h3>
Bugs in {{prname}}
</h3>
+ Report bugs by sending an e-mail to <a href="mailto:{{prname}}@{{DOMAIN}}" >{{prname}}@{{DOMAIN}}</a> or using the <a href="#ReplyForm">Form below.</a>
+ <div class="devavatars" >
+ Developers:<br>
+ {% for i in dev_avatars %}
+ <img class="avatar" src="{{ i }}" alt="avatar" />
+ {% endfor %}
+ <div class="floatbarrier"> </div>
+ </div>
</header>
<table>
<thead>
- <td>Id
- <td>Name
- <td>Number of replies
- <td>Created
- <td>Last Reply
- <td>Status
+ <tr>
+ <td>
+ <td>Id
+ <td>Subject
+ <td>Replies
+ <td>Created
+ <td>Last Reply
+ <td>Status
+ </tr>
</thead>
{% for i in bugs %}
<tr class="{% if i.closed %} closed {% endif %}" >
<td>
+ <img src="{{ i.avatar }}" style="height:1em;" alt="creator avatar" title="Creator avatar">
+ <td class="id" >
{{ i.id }}
<td>
<a href="/{{ prname }}/{{ i.id }}.html"> {{ i.subject|e }}</a>
@@ -45,4 +59,7 @@
</tr>
{% endfor %}
</table>
+
+{{ macros.form(prname, DOMAIN) }}
+
</body>
diff --git a/templates/macros.html b/templates/macros.html
new file mode 100644
index 0000000..a84624f
--- /dev/null
+++ b/templates/macros.html
@@ -0,0 +1,13 @@
+{% macro form(to, domain, reply=False) %}
+<form action="mailto:{{ to }}@{{ domain }}" method="GET" class="submit">
+ <a name="ReplyForm"></a>
+ {% if reply %}
+ <h5 class="form" > Reply </h4>
+{% else %}
+<h5 class="form" > Submit a bug </h4>
+<label for="subject">Subject: </label><input name="subject" type="text" /><br>
+{% endif %}
+<label for="body">Description of bug:</label><br><textarea name="body"></textarea><br>
+<input type="submit" value="Open mail program to submit bug report" />
+</form>
+{% endmacro %}