formspree/formspree/templates/forms/submissions.html

132 lines
4.5 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] or '' %}
<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 %}
</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-2 left">
<a href="#create-form" class="button">
<i class="fas fa-cogs"></i> Settings
</a>
</div>
<div class="col-1-2 right">
<div class="dropdown">
<a id="settings-button" class="button">Export <i class="fas fa-arrow-circle-down" id="settings-gears"></i></a>
<div id="settings-dropdown-content" class="dropdown-content">
<a href="{{ url_for('form-submissions', hashid=form.hashid, format='csv') }}" target="_blank">Export&nbsp;as&nbsp;CSV</a>
<a href="{{ url_for('form-submissions', hashid=form.hashid, format='json') }}" target="_blank">Export&nbsp;as&nbsp;JSON</a>
</div>
</div>
</div>
<div class="modal" id="create-form" aria-hidden="true">
<div class="container">
<div class="x"><h4 class="large">Form Settings</h4><a href="#">&times;</a></div>
<div class="row">
<div class="col-5-6">
<div><h4>reCAPTCHA</h4></div>
<p class="description">reCAPTCHA provides vital spam protection. You can turn off reCAPTCHA to remove the intermediate screen.</p>
</div>
<div class="col-1-6 switch-row">
<div><label class="switch">
<input type="checkbox"{% if not form.captcha_disabled %} checked{% endif %} id="recaptcha">
<span class="slider"></span>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-5-6">
<h4>Email Notifications</h4>
<p class="description">You can disable email notifications if you want to download all submissions from the Formspree dashboard.</p>
</div>
<div class="col-1-6 switch-row">
<label class="switch">
<input type="checkbox"{% if not form.disable_email %} checked{% endif %} id="email-notifications">
<span class="slider"></span>
</label>
</div>
</div>
<div class="row">
<div class="col-5-6">
<h4>Submission Archive</h4>
<p class="description">You can disable the submission archive if you don't want Formspree to store your submissions.</p>
</div>
<div class="col-1-6 switch-row">
<label class="switch">
<input type="checkbox"{% if not form.disable_storage %} checked{% endif %} id="submission-storage">
<span class="slider"></span>
</label>
</div>
</div>
<p id="status">Saved <i class="fas fa-check-circle"></i></p>
</div>
</div>
</div>
<script>
const hashid = '{{ form.hashid }}';
</script>
<script src="{{ url_for('static', filename='js/submissions.js') }}"></script>
{% endblock %}