mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
bepasty: Use generic form template for add password view
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
2b48f10cfb
commit
7d0d95d163
@ -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 form-add" method="post">
|
|
||||||
{% csrf_token %}
|
|
||||||
|
|
||||||
{{ form|bootstrap }}
|
|
||||||
|
|
||||||
<input type="submit" class="btn btn-primary"
|
|
||||||
value="{% trans "Submit" %}"/>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
@ -73,7 +73,7 @@ def _add_password(browser):
|
|||||||
browser.find_by_css('#id_bepasty-permissions input[value="{}"]'.format(
|
browser.find_by_css('#id_bepasty-permissions input[value="{}"]'.format(
|
||||||
permission)).check()
|
permission)).check()
|
||||||
browser.fill('bepasty-comment', 'bepasty functional test')
|
browser.fill('bepasty-comment', 'bepasty functional test')
|
||||||
functional.submit(browser, form_class='form-add')
|
functional.submit(browser, form_class='form-bepasty')
|
||||||
|
|
||||||
|
|
||||||
def _remove_all_passwords(browser):
|
def _remove_all_passwords(browser):
|
||||||
|
|||||||
@ -97,9 +97,10 @@ class BepastyView(AppView):
|
|||||||
|
|
||||||
class AddPasswordView(SuccessMessageMixin, FormView):
|
class AddPasswordView(SuccessMessageMixin, FormView):
|
||||||
"""View to add a new password."""
|
"""View to add a new password."""
|
||||||
|
|
||||||
form_class = AddPasswordForm
|
form_class = AddPasswordForm
|
||||||
prefix = 'bepasty'
|
prefix = 'bepasty'
|
||||||
template_name = 'bepasty_add.html'
|
template_name = 'form.html'
|
||||||
success_url = reverse_lazy('bepasty:index')
|
success_url = reverse_lazy('bepasty:index')
|
||||||
success_message = _('Password added.')
|
success_message = _('Password added.')
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user