Add reusable form template snippet
This commit is contained in:
parent
0be7c6fb6f
commit
325e767b0e
2 changed files with 17 additions and 5 deletions
|
@ -41,11 +41,9 @@
|
|||
id="login-form"
|
||||
class="form form-vertical"
|
||||
style="max-width: 400px">
|
||||
<form method="post" action="{% url 'account_login' %}">
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<button class="btn btn-primary" type="submit">{% translate "Sign In" %}</button>
|
||||
</form>
|
||||
{% url 'account_login' as form_action %}
|
||||
{% translate "Sign In" as form_submit_label %}
|
||||
{% include "includes/form.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
14
src/servala/frontend/templates/includes/form.html
Normal file
14
src/servala/frontend/templates/includes/form.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
{% load i18n %}
|
||||
<form class="form form-vertical"
|
||||
method="post"
|
||||
{% if form_action %}action="{{ form_action }}"{% endif %}>
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<button class="btn btn-primary" type="submit">
|
||||
{% if form_submit_label %}
|
||||
{{ form_submit_label }}
|
||||
{% else %}
|
||||
{% translate "Save" %}
|
||||
{% endif %}
|
||||
</button>
|
||||
</form>
|
Loading…
Add table
Add a link
Reference in a new issue