SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit f425fbd7 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Finish templates styling for scipost

parent 336a9ee0
No related branches found
No related tags found
No related merge requests found
{% load bootstrap %} {% load bootstrap %}
<div class="form-group row{% if field.errors %} has-error{% endif %}"> <div class="form-group row{% if field.errors %} has-error{% endif %}">
{% if field|is_checkbox %} {% if field|is_checkbox %}
<div class="{{ classes.single_value }}"> <div class="{{ classes.single_value }}">
<div class="checkbox"> <div class="checkbox">
{% if field.auto_id %}
<label {% if field.field.required and form.required_css_class %}class="{{ form.required_css_class }}"{% endif %}>
{{ field }} <span>{{ field.label }}</span>
</label>
{% endif %}
{% for error in field.errors %}
<span class="help-block {{ form.error_css_class }}">{{ error }}</span>
{% endfor %}
{% if field.help_text %}
<p class="help-block">
{{ field.help_text|safe }}
</p>
{% endif %}
</div>
</div>
{% elif field|is_radio %}
{% if field.auto_id %} {% if field.auto_id %}
<label class="col-form-label {{ classes.label }}{% if field.field.required %} {{ form.required_css_class }}{% endif %}">{{ field.label }}</label> <label {% if field.field.required and form.required_css_class %}class="{{ form.required_css_class }}"{% endif %}>
{{ field }} <span>{{ field.label }}</span>
</label>
{% endif %} {% endif %}
<div class="{{ classes.value }}"> {% for error in field.errors %}
{% for choice in field %} <span class="help-block {{ form.error_css_class }}">{{ error }}</span>
<div class="radio"> {% endfor %}
<label>
{{ choice.tag }}
{{ choice.choice_label }}
</label>
</div>
{% endfor %}
{% for error in field.errors %}
<span class="help-block {{ form.error_css_class }}">{{ error }}</span>
{% endfor %}
{% if field.help_text %} {% if field.help_text %}
<p class="help-block"> <p class="help-block">
{{ field.help_text|safe }} {{ field.help_text|safe }}
</p> </p>
{% endif %}
</div>
{% else %}
{% if field.auto_id %}
<label class="col-form-label {{ classes.label }}{% if field.field.required %} {{ form.required_css_class }}{% endif %}" for="{{ field.auto_id }}">{{ field.label }}</label>
{% endif %} {% endif %}
</div>
</div>
{% elif field|is_radio %}
{% if field.auto_id %}
<label class="col-form-label {{ classes.label }}{% if field.field.required %} {{ form.required_css_class }}{% endif %}">{{ field.label }}</label>
{% endif %}
<div class="{{ classes.value }}">
{% for choice in field %}
<div class="radio">
<label>
{{ choice.tag }}
{{ choice.choice_label }}
</label>
</div>
{% endfor %}
<div class="{{ classes.value }}{% if field|is_multiple_checkbox %} multiple-checkbox{% endif %}"> {% for error in field.errors %}
{{ field }} <span class="help-block {{ form.error_css_class }}">{{ error }}</span>
{% endfor %}
{% for error in field.errors %}
<span class="help-block {{ form.error_css_class }}">{{ error }}</span>
{% endfor %}
{% if field.help_text %} {% if field.help_text %}
<p class="help-block"> <p class="help-block">
{{ field.help_text|safe }} {{ field.help_text|safe }}
</p> </p>
{% endif %} {% endif %}
</div> </div>
{% else %}
{% if field.auto_id %}
<label class="col-form-label {{ classes.label }}{% if field.field.required %} {{ form.required_css_class }}{% endif %}" for="{{ field.auto_id }}">{{ field.label }}</label>
{% endif %} {% endif %}
<div class="{{ classes.value }}{% if field|is_multiple_checkbox %} multiple-checkbox{% endif %}">
{{ field }}
{% for error in field.errors %}
<span class="help-block {{ form.error_css_class }}">{{ error }}</span>
{% endfor %}
{% if field.help_text %}
<p class="help-block">
{{ field.help_text|safe }}
</p>
{% endif %}
</div>
{% endif %}
</div> </div>
{% if form.non_field_errors %} {% if form.non_field_errors %}
{% for non_field_error in form.non_field_errors %} {% for non_field_error in form.non_field_errors %}
<div class="alert alert-danger"> <div class="alert alert-danger">
<a class="close" data-dismiss="alert">&times;</a> <a class="close" data-dismiss="alert">&times;</a>
{{ non_field_error }} {{ non_field_error }}
</div> </div>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% for field in form.hidden_fields %} {% for field in form.hidden_fields %}
{{ field }} {{ field }}
{% endfor %} {% endfor %}
{% for field in form.visible_fields %} {% for field in form.visible_fields %}
{% include 'tags/bootstrap/field.html' %} {% include 'tags/bootstrap/field.html' %}
{% endfor %} {% endfor %}
{{ formset.management_form }} {{ formset.management_form }}
{% for form in formset %} {% for form in formset %}
<div class="formset-form form-{{ forloop.counter }}"> <div class="formset-form form-{{ forloop.counter }}">
{% if classes.label == 'sr-only' %} {% if classes.label == 'sr-only' %}
<div class="form-inline"> <div class="form-inline">
{% include "tags/bootstrap/form.html" with form=form formset=formset %} {% include "tags/bootstrap/form.html" with form=form formset=formset %}
</div> </div>
{% else %} {% else %}
{% include "tags/bootstrap/form.html" with form=form formset=formset %} {% include "tags/bootstrap/form.html" with form=form formset=formset %}
{% endif %} {% endif %}
</div> </div>
{% endfor %} {% endfor %}
{% with id=widget.attrs.id %} {% with id=widget.attrs.id %}
{% for group, options, index in widget.optgroups %} {% for group, options, index in widget.optgroups %}
{% for option in options %} {% for option in options %}
{% include 'widgets/checkbox_option_as_btn.html' with widget=option %} {% include 'widgets/checkbox_option_as_btn.html' with widget=option %}
{% endfor %}
{% endfor %} {% endfor %}
{% endfor %}
{% endwith %} {% endwith %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment