mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
backups: Use generic form template for create and schedule views
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
5935ce89a6
commit
2d3681605e
@ -1,23 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
{% comment %}
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
{% endcomment %}
|
||||
|
||||
{% load bootstrap %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h3>{{ title }}</h3>
|
||||
|
||||
<form class="form" method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
{{ form|bootstrap }}
|
||||
|
||||
<input type="submit" class="btn btn-primary"
|
||||
value="{% trans "Submit" %}"/>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
@ -1,21 +0,0 @@
|
||||
{% extends "base.html" %}
|
||||
{% comment %}
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
{% endcomment %}
|
||||
|
||||
{% load bootstrap %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<h2>{{ title }}</h2>
|
||||
|
||||
<form class="form" method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
{{ form|bootstrap }}
|
||||
|
||||
<input type="submit" class="btn btn-primary"
|
||||
value="{% trans 'Submit' %}" />
|
||||
</form>
|
||||
{% endblock %}
|
||||
@ -50,9 +50,11 @@ class BackupsView(AppView):
|
||||
|
||||
|
||||
class ScheduleView(SuccessMessageMixin, FormView):
|
||||
"""View to edit a backup schedule."""
|
||||
|
||||
form_class = forms.ScheduleForm
|
||||
prefix = 'backups_schedule'
|
||||
template_name = 'backups_schedule.html'
|
||||
template_name = 'form.html'
|
||||
success_url = reverse_lazy('backups:index')
|
||||
success_message = gettext_lazy('Backup schedule updated.')
|
||||
|
||||
@ -101,9 +103,10 @@ class ScheduleView(SuccessMessageMixin, FormView):
|
||||
|
||||
class CreateArchiveView(SuccessMessageMixin, FormView):
|
||||
"""View to create a new archive."""
|
||||
|
||||
form_class = forms.CreateArchiveForm
|
||||
prefix = 'backups'
|
||||
template_name = 'backups_form.html'
|
||||
template_name = 'form.html'
|
||||
success_url = reverse_lazy('backups:index')
|
||||
success_message = gettext_lazy('Archive created.')
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user