base: add base template for resource child views (#32652)

This commit is contained in:
Benjamin Dauvergne 2019-04-06 14:32:11 +02:00
parent b621988b17
commit bb23a556ca
3 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,14 @@
{% extends "passerelle/manage.html" %}
{% load i18n %}
{% block breadcrumb %}
{{ block.super }}
<a href="{{ view.resource.get_absolute_url }}">{{ view.resource.title }}</a>
{% block resource-child-breadcrumb %}
{% if object.id %}
<a href="#">{{ object }}</a>
{% else %}
<a href="#">{% blocktrans with verbose_name=view.model_verbose_name|lower %}Add {{ verbose_name }}{% endblocktrans %}</a>
{% endif %}
{% endblock %}
{% endblock %}

View File

@ -0,0 +1,17 @@
{% extends "passerelle/manage/resource_child_base.html" %}
{% load i18n %}
{% block appbar %}
<h2>{{ object }}</h2>
{% endblock %}
{% block content %}
<form method="post">
{% csrf_token %}
<p>{% blocktrans %}Are you sure you want to delete {{ object }} ?{% endblocktrans %}</p>
<div class="buttons">
<button class="delete-button">{% trans 'Delete' %}</button>
<a href="{{ view.resource.get_absolute_url }}" class="cancel">{% trans 'Cancel' %}</a>
</div>
</form>
{% endblock %}

View File

@ -0,0 +1,29 @@
{% extends "passerelle/manage/resource_child_base.html" %}
{% load i18n gadjo %}
{% block appbar %}
<h2>
{% if object %}
{{ object }}
{% else %}
{% blocktrans with verbose_name=view.model_verbose_name|lower %}Add {{ verbose_name }}{% endblocktrans %}
{% endif %}
</h2>
{% endblock %}
{% block content %}
<form method="post" enctype="multipart/form-data">
<div id="form-content">
{% csrf_token %}
{% block form %}
{{ form|with_template }}
{% endblock %}
</div>
{% block buttons %}
<div class="buttons">
<button class="submit-button">{% trans "Save" %}</button>
<a class="cancel" href="{{ view.resource.get_absolute_url }}">{% trans 'Cancel' %}</a>
</div>
{% endblock %}
</form>
{% endblock %}