mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-03-17 14:40:27 +00:00
75 lines
2.6 KiB
HTML
75 lines
2.6 KiB
HTML
{% extends "admin2/bootstrap/base.html" %}
|
|
|
|
{% load admin2_tags i18n %}
|
|
|
|
{% block title %}{% blocktrans with action=action model_name=model_name %}{{ action }} {{ model_name }}{% endblocktrans %}{% endblock title %}
|
|
|
|
{% block page_title %}{% blocktrans with action=action model_name=model_name %}{{ action }} {{ model_name }}{% endblocktrans %}{% endblock page_title %}
|
|
|
|
{% block breadcrumbs %}
|
|
<li><a href="{% url "admin2:dashboard" %}">Home</a> <span class="divider">/</span></li>
|
|
<li><a href="{% url "admin2:app_index" app_label=app_label %}">{{ app_label|title }}</a> <span class="divider">/</span></li>
|
|
<li><a href="{% url view|admin2_urlname:"index" %}">{{ model_name_pluralized|title }}</a> <span class="divider">/</span></li>
|
|
{% if action == 'Add' %}
|
|
<li class="active">{{ action }}</li>
|
|
{% else %}
|
|
<li><a href="{% url view|admin2_urlname:"detail" pk=object.pk %}">{{ object }}</a> <span class="divider">/</span></li>
|
|
<li class="active">{% trans 'Change' %}</li>
|
|
{% endif %}
|
|
|
|
{% endblock breadcrumbs %}
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="row-fluid">
|
|
<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 %}
|
|
|
|
<hr/>
|
|
{% if object %}
|
|
<a class="btn btn-small btn-danger" href="{% url view|admin2_urlname:'delete' pk=object.pk %}">{% trans "Delete" %}</a>
|
|
{% endif %}
|
|
|
|
<div class="pull-right">
|
|
<button class="btn btn-small" type="submit" name="_addanother">{% trans "Save and add another" %}</button>
|
|
<button class="btn btn-small" type="submit" name="_continue">{% trans "Save and continue editing" %}</button>
|
|
<button class="btn btn-small btn-success" type="submit" name="_save">{% trans "Save" %}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock content %}
|