templates: add blocks for easier reuse of oauth2 templates (#22923)

This commit is contained in:
Frédéric Péters 2018-03-30 13:47:22 +02:00
parent 38330c324e
commit 44a52e2c75
2 changed files with 10 additions and 0 deletions

View File

@ -3,6 +3,9 @@
{% block content %}
<div id="fargo-oauth2-authorize">
{% block form-intro %}
{% endblock %}
{% block form %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
@ -11,5 +14,6 @@
<button name="cancel">{% trans "Cancel" %}</button>
</div>
</form>
{% endblock %}
</div>
{% endblock %}

View File

@ -4,12 +4,17 @@
{% block content %}
<div id="fargo-oauth2-confirm">
{% if error_message %}
{% block error-message %}
<p>{% trans error_message %}</p>
<a href="{{ redirect_uri }}">{% trans "Continue to your client url" %}</a>
{% endblock %}
{% else %}
{% block form-intro %}
<p>{% blocktrans %}
Do you accept to add <em class="filename">{{ filename }}</em> to your portfolio?
{% endblocktrans %}</p>
{% endblock %}
{% block form %}
<form id="send-file" method="post" enctype="multipart/form-data">
{% csrf_token %}
<div class="buttons">
@ -17,6 +22,7 @@
<button name="cancel">{% trans "Cancel" %}</button>
</div>
</form>
{% endblock %}
{% endif %}
</div>
{% endblock %}