Add a keep option per fetch, fixes #60

This commit is contained in:
Pierre Jaury
2017-02-02 22:45:43 +01:00
parent 38f291bc5d
commit 25d8b9e614
5 changed files with 40 additions and 5 deletions

View File

@@ -119,6 +119,7 @@ class FetchForm(flask_wtf.FlaskForm):
tls = fields.BooleanField(_('Enable TLS'))
username = fields.StringField(_('Username'))
password = fields.StringField(_('Password'))
keep = fields.BooleanField(_('Keep emails on the server'))
submit = fields.SubmitField(_('Submit'))

View File

@@ -222,5 +222,6 @@ class Fetch(Base):
tls = db.Column(db.Boolean(), nullable=False)
username = db.Column(db.String(255), nullable=False)
password = db.Column(db.String(255), nullable=False)
keep = db.Column(db.Boolean(), nullable=False)
last_check = db.Column(db.DateTime, nullable=True)
error = db.Column(db.String(1023), nullable=True)

View File

@@ -19,6 +19,7 @@
<th>{% trans %}Actions{% endtrans %}</th>
<th>{% trans %}Endpoint{% endtrans %}</th>
<th>{% trans %}Username{% endtrans %}</th>
<th>{% trans %}Keep emails{% endtrans %}</th>
<th>{% trans %}Last check{% endtrans %}</th>
<th>{% trans %}Status{% endtrans %}</th>
<th>{% trans %}Created{% endtrans %}</th>
@@ -32,6 +33,7 @@
</td>
<td>{{ fetch.protocol }}{{ 's' if fetch.tls else '' }}://{{ fetch.host }}:{{ fetch.port }}</td>
<td>{{ fetch.username }}</td>
<td>{% if fetch.keep %}{% trans %}yes{% endtrans %}{% else %}{% trans %}no{% endtrans %}{% endif %}</td>
<td>{{ fetch.last_check or '-' }}</td>
<td>{{ fetch.error or '-' }}</td>
<td>{{ fetch.created_at }}</td>