formspree/formspree/templates/forms/submissions.html

67 lines
2.4 KiB
HTML

{% extends 'users/dashboard.html' %}
{% block sectiontitle %}
<h1>Submission History</h1>
{% endblock %}
{% block section %}
<div class="col-1-1 submissions-col">
<h2>
Submissions for
{% if not form.hash %}
<span class="code">/{{ form.hashid }}</span>
{% else %}
<span class="code">/{{ form.email }}</span>
{% endif %}
at <span class="code">{{ form.host }}</span>{% if form.sitewide %} and all its subpaths.{% endif %}
{% if not form.hash %}
<br><small>targeting <span class="code">{{ form.email }}</span></small>
{% else %}
<br><small>you can now replace the email in the URL with <span class="code">/{{ form.hashid }}</span></small>
{% endif %}
</h2>
{% if submissions %}
<table class="submissions responsive">
<thead>
<tr>
<th>Submitted at</th>
{% for f in fields %}
<th>{{ f }}</th>
{% endfor %}
<th></th>
</tr>
</thead>
<tbody>
{% for s in submissions %}
<tr id="submission-{{ s.id }}">
<td id="p-{{ s.id }}" data-label="Submitted at">{{ s.submitted_at.strftime('%A, %B %d, %Y at %X') }} UTC</td>
{% for f in fields %}
{% set value = s.data[f] %}
<td data-label="{{ f }}">
{% if 320 < (value | length) %}
<pre>{{ value[:270] }}&hellip; <a href=#submission-{{ s.id }}>(see more)</a></pre>
<pre class="full">{{ value }} <a href=#p-{{ s.id }}>(see less)</a></pre>
{% else %}
<pre>{{ value }}</pre>
{% endif %}</pre>
</td>
{% endfor %}
<td><form method="POST" action="{{ url_for('submission-deletion', hashid=form.hashid, submissionid=s.id) }}"><button class="no-border"><i class="fa fa-trash-o delete"></i></button></form></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<h3>No submissions archived yet.</h3>
{% endif %}
</div>
</div>
<div class="container block">
<div class="col-1-1 right">
<a href="{{ url_for('form-submissions', hashid=form.hashid, format='csv') }}" target="_blank" class="button export">Export&nbsp;as&nbsp;CSV</a>
<a href="{{ url_for('form-submissions', hashid=form.hashid, format='json') }}" target="_blank" class="button export">Export&nbsp;as&nbsp;JSON</a>
</div>
{% endblock %}