mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-04-24 00:24:45 +00:00
There's currently a lot of copy-pasting of breadcrumbs, this can be revisited once we have a better understanding of how we're going to handle navigation. I've also tried to make template context variables more logical and consistent throughout.
68 lines
2.3 KiB
HTML
68 lines
2.3 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 %}
|
|
|
|
{% block page_title %}{% blocktrans with action=action model_name=model_name %}{{ action }} {{ model_name }}{% endblocktrans %}{% endblock %}
|
|
|
|
{% 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 %}
|
|
|
|
|
|
{% 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">{% 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>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock content %}
|