django-admin2/djadmin2/templates/admin2/bootstrap/model_update_form.html
2013-05-22 01:06:25 +01:00

54 lines
1.4 KiB
HTML

{% extends "admin2/bootstrap/base.html" %}
{% load admin2_tags %}
{% block title %}{{ action }} {{ model }}{% endblock %}
{% block page_title %}{{ action }} {{ model }}{% endblock %}
{% block content %}
<div class="row">
<div class="span12">
<form method="post">
{% csrf_token %}
{{ form.as_p }}
{% for formset in inlines %}
<h4>{{ formset.model|model_verbose_name_plural|capfirst }}</h4>
{{ formset.management_form }}
<table class="table table-striped table-bordered">
<thead>
<tr>
{% for field in formset|formset_visible_fieldlist %}
<th>{{ field }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for inline_form in formset %}
<tr>
{% for field in inline_form.visible_fields %}
<td>
{% if forloop.first %}
{% for hidden_field in inline_form.hidden_fields %}
{{ hidden_field }}
{% endfor %}
{% endif %}
{{ field }}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
<button class="btn btn-small" type="submit" name="_addanother">Save and add another</button>
<button class="btn btn-small" type="submit" name="_continue">Save and continue editing</button>
<button class="btn btn-small btn-success" type="submit" name="_save">Save</button>
</form>
</div>
</div>
{% endblock content %}