Add BS modals when confirmation needed
This commit is contained in:
parent
73e24514b1
commit
476b8c396e
7 changed files with 400 additions and 171 deletions
|
|
@ -266,70 +266,47 @@
|
|||
{% if !Person.DeletedAt.Valid %}
|
||||
|
||||
{% if PermEdit %}
|
||||
<a class="btn btn-md btn-primary" href="/members/{{ Person.ID }}/edit">
|
||||
<a class="btn btn-outline-primary" href="/members/{{ Person.ID }}/edit">
|
||||
<i class="bi-pencil-square"></i>
|
||||
Modifier
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% if PermConvert %}
|
||||
<form
|
||||
action="/members/{{ Person.ID }}/convert"
|
||||
method="post"
|
||||
class="d-inline p-0"
|
||||
>
|
||||
<button class="btn btn-md btn-secondary areyousure" type="submit">
|
||||
<i class="bi-arrow-repeat"></i>
|
||||
Convertir en contact
|
||||
</button>
|
||||
</form>
|
||||
<button class="btn btn-outline-secondary" type="button" data-bs-toggle="modal" data-bs-target="#modal-convert">
|
||||
<i class="bi-arrow-repeat"></i>
|
||||
Convertir en contact
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-6 text-md-end mt-2 mt-md-0">
|
||||
{% if Person.DeletedAt.Valid %}
|
||||
|
||||
{% if PermRestore %}
|
||||
<form
|
||||
action="/members/{{ Person.ID }}/restore"
|
||||
method="post"
|
||||
class="d-inline p-0"
|
||||
>
|
||||
<button class="btn btn-md btn-secondary areyousure" type="submit">
|
||||
<i class="bi-person-check"></i>
|
||||
Restaurer
|
||||
</button>
|
||||
</form>
|
||||
<button class="btn btn-outline-secondary" type="button" data-bs-toggle="modal" data-bs-target="#modal-restore">
|
||||
<i class="bi-person-check"></i>
|
||||
Restaurer
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
|
||||
{% if PermArchive %}
|
||||
<form
|
||||
action="/members/{{ Person.ID }}/archive"
|
||||
method="post"
|
||||
class="d-inline p-0"
|
||||
>
|
||||
<button class="btn btn-md btn-secondary areyousure" type="submit">
|
||||
<i class="bi-person-slash"></i>
|
||||
Archiver
|
||||
</button>
|
||||
</form>
|
||||
<button class="btn btn-outline-secondary" type="button" data-bs-toggle="modal" data-bs-target="#modal-archive">
|
||||
<i class="bi-person-slash"></i>
|
||||
Archiver
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if PermPurge %}
|
||||
<form
|
||||
action="/members/{{ Person.ID }}/purge"
|
||||
method="post"
|
||||
class="d-inline p-0"
|
||||
>
|
||||
<button class="btn btn-md btn-danger areyousure" type="submit">
|
||||
<i class="bi-trash3"></i>
|
||||
Supprimer
|
||||
</button>
|
||||
</form>
|
||||
<button class="btn btn-outline-danger" type="button" data-bs-toggle="modal" data-bs-target="#modal-delete">
|
||||
<i class="bi-trash3"></i>
|
||||
Supprimer
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
|
@ -339,62 +316,200 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{% if !Person.DeletedAt.Valid %}
|
||||
<a class="btn btn-md btn-primary" href="/contacts/{{ Person.ID }}/edit">
|
||||
<i class="bi-pencil-square"></i>
|
||||
Modifier
|
||||
</a>
|
||||
<form
|
||||
action="/contacts/{{ Person.ID }}/convert"
|
||||
method="post"
|
||||
class="d-inline p-0"
|
||||
>
|
||||
<button class="btn btn-md btn-secondary areyousure" type="submit">
|
||||
<i class="bi-arrow-repeat"></i>
|
||||
Convertir en membre
|
||||
</button>
|
||||
</form>
|
||||
{% if !Person.DeletedAt.Valid %}
|
||||
|
||||
{% if PermEdit %}
|
||||
<a class="btn btn-outline-primary" href="/contacts/{{ Person.ID }}/edit">
|
||||
<i class="bi-pencil-square"></i>
|
||||
Modifier
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% if PermConvert %}
|
||||
<button class="btn btn-outline-secondary" type="button" data-bs-toggle="modal" data-bs-target="#modal-convert">
|
||||
<i class="bi-arrow-repeat"></i>
|
||||
Convertir en membre
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-6 text-md-end mt-2 mt-md-0">
|
||||
{% if Person.DeletedAt.Valid %}
|
||||
<form
|
||||
action="/contacts/{{ Person.ID }}/restore"
|
||||
method="post"
|
||||
class="d-inline p-0"
|
||||
>
|
||||
<button class="btn btn-md btn-secondary areyousure" type="submit">
|
||||
|
||||
{% if PermRestore %}
|
||||
<button class="btn btn-outline-secondary" type="button" data-bs-toggle="modal" data-bs-target="#modal-restore">
|
||||
<i class="bi-person-check"></i>
|
||||
Restaurer
|
||||
</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form
|
||||
action="/contacts/{{ Person.ID }}/archive"
|
||||
method="post"
|
||||
class="d-inline p-0"
|
||||
>
|
||||
<button class="btn btn-md btn-secondary areyousure" type="submit">
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
|
||||
{% if PermArchive %}
|
||||
<button class="btn btn-outline-secondary" type="button" data-bs-toggle="modal" data-bs-target="#modal-archive">
|
||||
<i class="bi-person-slash"></i>
|
||||
Archiver
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
<form
|
||||
action="/contacts/{{ Person.ID }}/purge"
|
||||
method="post"
|
||||
class="d-inline p-0"
|
||||
>
|
||||
<button class="btn btn-md btn-danger areyousure" type="submit">
|
||||
|
||||
{% if PermPurge %}
|
||||
<button class="btn btn-outline-danger" type="button" data-bs-toggle="modal" data-bs-target="#modal-delete">
|
||||
<i class="bi-trash3"></i>
|
||||
Supprimer
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modal-delete" class="modal" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
{% if Person.IsMember %}
|
||||
<p>Êtes-vous sûr de vouloir supprimer ce membre ?</p>
|
||||
{% else %}
|
||||
<p>Êtes-vous sûr de vouloir supprimer ce contact ?</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">
|
||||
<i class="bi-x-lg me-1"></i>
|
||||
Annuler
|
||||
</button>
|
||||
|
||||
{% if Person.IsMember %}
|
||||
<form action="/members/{{ Person.ID }}/purge" method="post" class="d-inline p-0">
|
||||
<button class="btn btn-md btn-outline-danger" type="submit">
|
||||
<i class="bi-trash3 me-1"></i>
|
||||
Supprimer
|
||||
</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form action="/contacts/{{ Person.ID }}/purge" method="post" class="d-inline p-0">
|
||||
<button class="btn btn-md btn-outline-danger" type="submit">
|
||||
<i class="bi-trash3 me-1"></i>
|
||||
Supprimer
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modal-archive" class="modal" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
{% if Person.IsMember %}
|
||||
<p>Êtes-vous sûr de vouloir archiver ce membre ?</p>
|
||||
{% else %}
|
||||
<p>Êtes-vous sûr de vouloir archiver ce contact ?</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">
|
||||
<i class="bi-x-lg me-1"></i>
|
||||
Annuler
|
||||
</button>
|
||||
|
||||
{% if Person.IsMember %}
|
||||
<form action="/members/{{ Person.ID }}/archive" method="post" class="d-inline p-0">
|
||||
<button class="btn btn-md btn-outline-primary" type="submit">
|
||||
<i class="bi-person-slash"></i>
|
||||
Archiver
|
||||
</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form action="/contacts/{{ Person.ID }}/archive" method="post" class="d-inline p-0">
|
||||
<button class="btn btn-md btn-outline-primary" type="submit">
|
||||
<i class="bi-person-slash"></i>
|
||||
Archiver
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modal-restore" class="modal" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
{% if Person.IsMember %}
|
||||
<p>Êtes-vous sûr de vouloir restaurer ce membre ?</p>
|
||||
{% else %}
|
||||
<p>Êtes-vous sûr de vouloir restaurer ce contact ?</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">
|
||||
<i class="bi-x-lg me-1"></i>
|
||||
Annuler
|
||||
</button>
|
||||
|
||||
{% if Person.IsMember %}
|
||||
<form action="/members/{{ Person.ID }}/restore" method="post" class="d-inline p-0">
|
||||
<button class="btn btn-md btn-outline-primary" type="submit">
|
||||
<i class="bi-person-check"></i>
|
||||
Restaurer
|
||||
</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form action="/contacts/{{ Person.ID }}/restore" method="post" class="d-inline p-0">
|
||||
<button class="btn btn-md btn-outline-primary" type="submit">
|
||||
<i class="bi-person-check"></i>
|
||||
Restaurer
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modal-convert" class="modal" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
{% if Person.IsMember %}
|
||||
<p>Êtes-vous sûr de vouloir convertir ce membre en contact ?</p>
|
||||
{% else %}
|
||||
<p>Êtes-vous sûr de vouloir convertir ce contact en membre ?</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">
|
||||
<i class="bi-x-lg me-1"></i>
|
||||
Annuler
|
||||
</button>
|
||||
|
||||
{% if Person.IsMember %}
|
||||
<form action="/members/{{ Person.ID }}/convert" method="post" class="d-inline p-0">
|
||||
<button class="btn btn-md btn-outline-primary" type="submit">
|
||||
<i class="bi-arrow-repeat"></i>
|
||||
Convertir
|
||||
</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form action="/contacts/{{ Person.ID }}/convert" method="post" class="d-inline p-0">
|
||||
<button class="btn btn-md btn-outline-primary" type="submit">
|
||||
<i class="bi-arrow-repeat"></i>
|
||||
Convertir
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue