Skip to content

Commit

Permalink
Added fieldset to forms
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Esteves committed Jan 26, 2017
1 parent 33c4e88 commit cc5cc6e
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 55 deletions.
26 changes: 14 additions & 12 deletions arctic/templates/arctic/base_confirm_delete.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@
<div>
{% if can_delete %}
<form class="warning callout text-center" action="" method="post">
{% csrf_token %}

{% block confirm_message %}
<h5>Are you sure you want to delete "{{ object }}"?</h5>
<p>This cannot be undone</p>
{% endblock %}

<div class="button-group text-center">
{# Javascript cause forms, get filled values back #}
<a href="#" onclick="window.history.go(-1); return false;" class="secondary button">Cancel</a>
<input type="submit" value="Confirm" class="alert button" />
</div>
<fieldset {%if readonly%}disabled{%endif%}>
{% csrf_token %}

{% block confirm_message %}
<h5>Are you sure you want to delete "{{ object }}"?</h5>
<p>This cannot be undone</p>
{% endblock %}

<div class="button-group text-center">
{# Javascript cause forms, get filled values back #}
<a href="#" onclick="window.history.go(-1); return false;" class="secondary button">Cancel</a>
<input type="submit" value="Confirm" class="alert button" />
</div>
</fieldset>
</form>
{% else %}
<section class="warning callout">
Expand Down
87 changes: 44 additions & 43 deletions arctic/templates/arctic/base_create_update.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,57 +12,58 @@

{% block content %}
<form action="" method="POST" enctype="multipart/form-data" class="dirty-check" data-abide novalidate>

{% csrf_token %}
{% block form %}
{% block form_validation %}
{% include "arctic/partials/form_validation.html" with form=form style="horizontal" %}
{% endblock %}
{% block form_fields %}
{% include "arctic/partials/form_fields.html" with form=form style="horizontal" %}
<fieldset {%if readonly %}disabled{%endif%}>
{% csrf_token %}
{% block form %}
{% block form_validation %}
{% include "arctic/partials/form_validation.html" with form=form style="horizontal" %}
{% endblock %}
{% block form_fields %}
{% include "arctic/partials/form_fields.html" with form=form style="horizontal" %}
{% endblock %}
{% endblock %}
{% endblock %}

{% block inlines %}
{% if inlines %}
{% for formset in inlines %}
{% if formset.verbose_name %}
<h4>{{ formset.verbose_name }}</h4>
{% endif %}
{{ formset.management_form }}
{{ formset.non_form_errors }}
{% block inlines %}
{% if inlines %}
{% for formset in inlines %}
{% if formset.verbose_name %}
<h4>{{ formset.verbose_name }}</h4>
{% endif %}
{{ formset.management_form }}
{{ formset.non_form_errors }}

{% for form in formset %}
{% include "arctic/partials/form_fields.html" with form=form style="horizontal" %}
{% for form in formset %}
{% include "arctic/partials/form_fields.html" with form=form style="horizontal" %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endif %}
{% endblock inlines %}
{% endif %}
{% endblock inlines %}

{% block extra_forms %} {% endblock %}
{% block extra_forms %} {% endblock %}

{% block form_actions %}
<div class="row align-center">
<div class="small-6 medium-4 columns">
{% if links %}
{% for link in links %}
{% if object.pk %}
<a class="button secondary" href="{% arctic_url link.1 object.pk %}">
{% else %}
<a class="button secondary" href="{% arctic_url link.1 %}">
{% endif %}
{{ link.0 }}
</a>
{% endfor %}
{% endif %}
</div>
{% block form_actions %}
<div class="row align-center">
<div class="small-6 medium-4 columns">
{% if links %}
{% for link in links %}
{% if object.pk %}
<a class="button secondary" href="{% arctic_url link.1 object.pk %}">
{% else %}
<a class="button secondary" href="{% arctic_url link.1 %}">
{% endif %}
{{ link.0 }}
</a>
{% endfor %}
{% endif %}
</div>

<div class="small-6 medium-4 columns text-right">
<input type="submit" name="save" value="Submit" class="button" id="submit-id-save" />
<div class="small-6 medium-4 columns text-right">
<input type="submit" name="save" value="Submit" class="button" id="submit-id-save" />
</div>
</div>
</div>
{% endblock form_actions %}
{% endblock form_actions %}
</fieldset>
</form>

{% block extra_content %}{% endblock %}
{% endblock %}
{% endblock %}

0 comments on commit cc5cc6e

Please sign in to comment.