Skip to content
Snippets Groups Projects
Commit 959015c5 authored by Tim Fechner's avatar Tim Fechner
Browse files

Add include templates for forms

these will eventually transformed to template tags later
parent 27134270
No related branches found
No related tags found
No related merge requests found
{% load i18n %}
{% if form.non_field_errors %}
<div class="notification is-danger">
{% for error in form.non_field_errors %}
{{ error }}
{% endfor %}
</div>
{% endif %}
<div class="card">
<div class="card-content">
<form method="post">
{% csrf_token %}
{% include "hshassets/includes/plain_form.html" %}
<div class="field">
<div class="control">
<button class="button is-success is-outlined" type="submit" name="submit">{% trans "Submit" %}</button>
</div>
</div>
</form>
</div>
</div>
{% load i18n %}
{% for field in form %}
<div class="field">
<label for="{{ field.id_for_label }}" class="label">{{ field.label }}</label>
<div class="control">
<input
id="{{ field.id_for_label }}"
class="input {% if field.errors %}is-danger{% endif %}"
name="{{ field.html_name }}"
type="{{ field.field.widget.input_type }}"
placeholder=""
{% if not field.field.widget.input_type == 'password' %}
value="{% if field.value %}{{ field.value }}{% endif %}"
{% endif %}
>
{% if field.errors %}
<span class="help is-danger">
{% for error in field.errors %}
{{ error }}
{% endfor %}
</span>
{% endif %}
</div>
</div>
{% endfor %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment