This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/passbook/admin/templates/blocks/form.html

53 lines
1.8 KiB
HTML
Raw Normal View History

2018-11-26 21:07:40 +00:00
{% load utils %}
{% csrf_token %}
{% for field in form %}
<div class="form-group">
{% if field.field.widget|fieldtype == 'RadioSelect' %}
<label class="col-sm-2 control-label" {% if field.field.required %}class="required"{% endif %} for="{{ field.name }}-{{ forloop.counter0 }}">
{{ field.label }}
</label>
{% for c in field %}
<div class="radio col-sm-10">
<input type="radio" id="{{ field.name }}-{{ forloop.counter0 }}" name="{% if wizard %}{{ wizard.steps.current }}-{% endif %}{{ field.name }}" value="{{ c.data.value }}" {% if c.data.selected %} checked {% endif %}>
<label class="col-sm-2 control-label" for="{{ field.name }}-{{ forloop.counter0 }}">{{ c.choice_label }}</label>
</div>
{% endfor %}
{% elif field.field.widget|fieldtype == 'Select' %}
<label class="col-sm-2 control-label" {% if field.field.required %}class="required"{% endif %} for="{{ field.name }}-{{ forloop.counter0 }}">
{{ field.label }}
</label>
<div class="select col-sm-10">
{{ field }}
</div>
{% elif field.field.widget|fieldtype == 'CheckboxInput' %}
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
{{ field }} {{ field.label }}
</label>
</div>
</div>
{% else %}
<label class="col-sm-2 control-label" {% if field.field.required %}class="required"{% endif %} for="{{ field.name }}-{{ forloop.counter0 }}">
{{ field.label }}
</label>
<div class="col-sm-10">
{{ field|css_class:'form-control' }}
{% if field.help_text %}
<span>
{{ field.help_text }}
</span>
{% endif %}
2018-12-10 14:27:01 +00:00
{% for error in field.errors %}
<hr>
<div class="alert alert-danger">
<span class="pficon pficon-error-circle-o"></span>
<strong>{{ error }}</strong>
2018-11-26 21:07:40 +00:00
</div>
2018-12-10 14:27:01 +00:00
{% endfor %}
2018-11-26 21:07:40 +00:00
</div>
2018-12-10 14:27:01 +00:00
{% endif %}
2018-11-26 21:07:40 +00:00
</div>
{% endfor %}