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