mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-22 01:18:22 +02:00
Factorize modal templates
This commit is contained in:
@ -189,10 +189,19 @@
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
{% include "registration/login_modal.html" %}
|
||||
{% trans "Log in" as modal_title %}
|
||||
{% trans "Log in" as modal_button %}
|
||||
{% url "login" as modal_action %}
|
||||
{% include "base_modal.html" with modal_id="login" %}
|
||||
{% if user.is_authenticated %}
|
||||
{% include "participation/create_team_modal.html" %}
|
||||
{% include "participation/join_team_modal.html" %}
|
||||
{% trans "Join team" as modal_title %}
|
||||
{% trans "Join" as modal_button %}
|
||||
{% url "participation:join_team" as modal_action %}
|
||||
{% include "base_modal.html" with modal_id="joinTeam" %}
|
||||
{% trans "Create team" as modal_title %}
|
||||
{% trans "Create" as modal_button %}
|
||||
{% url "participation:create_team" as modal_action %}
|
||||
{% include "base_modal.html" with modal_id="createTeam" modal_button_type="success" %}
|
||||
{% endif %}
|
||||
|
||||
<script>
|
||||
|
21
templates/base_modal.html
Normal file
21
templates/base_modal.html
Normal file
@ -0,0 +1,21 @@
|
||||
{% load i18n %}
|
||||
|
||||
<div id="{{ modal_id }}Modal" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<form method="post" action="{{ modal_action }}" enctype="{{ modal_enctype|default:"application/x-www-form-urlencoded" }}">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">{{ modal_title }}</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body"></div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-{{ modal_button_type|default:"primary" }}">{{ modal_button }}</button>
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">{% trans "Close" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user