Lay out mail form using bootstrap4
This commit is contained in:
parent
4d5497f2fa
commit
29c752e572
|
@ -1,10 +1,15 @@
|
|||
{% extends "musician/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap4 i18n %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="service-name">{{ service.verbose_name }}</h1>
|
||||
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<button type="submit">OK</button>
|
||||
{% bootstrap_form form %}
|
||||
{% buttons %}
|
||||
<a class="btn btn-light mr-2" href="{% url 'musician:mails' %}">{% trans "Cancel" %}</a>
|
||||
<button type="submit" class="btn btn-secondary">{% trans "Save" %}</button>
|
||||
{% endbuttons %}
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
|
|
@ -207,6 +207,7 @@ class MailCreateView(CustomContextMixin, UserTokenRequiredMixin, FormView):
|
|||
template_name = "musician/mail_form.html"
|
||||
form_class = MailForm
|
||||
success_url = reverse_lazy("musician:mails")
|
||||
extra_context = {'service': service_class}
|
||||
|
||||
def get_form_kwargs(self):
|
||||
kwargs = super().get_form_kwargs()
|
||||
|
@ -231,6 +232,7 @@ class MailUpdateView(CustomContextMixin, UserTokenRequiredMixin, FormView):
|
|||
template_name = "musician/mail_form.html"
|
||||
form_class = MailForm
|
||||
success_url = reverse_lazy("musician:mails")
|
||||
extra_context = {'service': service_class}
|
||||
|
||||
def get_form_kwargs(self):
|
||||
kwargs = super().get_form_kwargs()
|
||||
|
|
Loading…
Reference in New Issue