dav_submission: added group to submission list. Improved E-Mail.

This commit is contained in:
2019-11-07 08:59:45 +01:00
parent 6f999e419d
commit eba8409256
3 changed files with 16 additions and 2 deletions

View File

@@ -10,5 +10,5 @@ Beschreibung:
{{ metadata.description }}
Ihr könnt den Beitrag unter
https://mein-dav.alpenverein-karlsruhe.de/download
{{ base_url }}{% url 'dav_submission:list' %}
herunterladen.

View File

@@ -10,6 +10,7 @@
<tr>
<th>{% trans 'Titel' %}</th>
<th>{% trans 'Absender' %}</th>
<th>{% trans 'Gruppe' %}</th>
<th>{% trans 'Datum' %}</th>
<th>&nbsp;</th>
</tr>
@@ -17,6 +18,7 @@
<th><input type="text" placeholder="{% trans 'Filter' %}" /></th>
<th><input type="text" placeholder="{% trans 'Filter' %}" /></th>
<th><input type="text" placeholder="{% trans 'Filter' %}" /></th>
<th><input type="text" placeholder="{% trans 'Filter' %}" /></th>
<th>&nbsp;</th>
</tr>
<tbody>
@@ -28,6 +30,13 @@
<td>
{{ object.name }} (<a href="mailto:{{ object.email_address }}">{{ object.email_address }}</a>)
</td>
<td>
{% if object.group %}
{{ object.group }}
{% else %}
-
{% endif %}
</td>
<td data-order="{{ object.timestamp|date:'U' }}">
{{ object.timestamp|date:'l, d. F Y H:i:s e' }}
</td>
@@ -44,7 +53,7 @@
$(document).ready( function () {
var table = $("#objects_table").DataTable( {
orderCellsTop: true,
order: [[2, "asc"]],
order: [[3, "asc"]],
paging: false,
language: {
search: "{% trans 'Filter' %}:",

View File

@@ -45,6 +45,7 @@ class ListView(generic.ListView):
'name': None,
'email_address': None,
'title': None,
'group': None,
'timestamp': None,
}
with open(metadata_file_path) as f:
@@ -58,6 +59,10 @@ class ListView(generic.ListView):
if mo is not None:
metadata['title'] = mo.group(1)
continue
mo = re.match(r'^Gruppe: (.*)$', line)
if mo is not None:
metadata['group'] = mo.group(1)
continue
mo = re.match(r'^Datum: ([0-9]{2}.[0-9]{2}.[0-9]{4}) ([0-9]{2}:[0-9]{2}:[0-9]{2}) (.*)$', line)
if mo is not None:
date_str = mo.group(1)