Created
April 19, 2019 12:13
-
-
Save M0r13n/c1a0a56b17e607aa0c6e9e44370de812 to your computer and use it in GitHub Desktop.
Reusable Confirmation Dialog for Jinja2 using Bootstrap and Modals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro confirm_deletion(endpoint='#') %} | |
<div id="confirm-deletion"> | |
<button type="button" class="btn btn-danger" data-toggle="modal" | |
data-target="#MyFancyModal">Löschen | |
</button> | |
<div id="MyFancyModal" class="modal fade" role="dialog"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-header">Löschen</div> | |
<div class="modal-body">Möchtest du den Eintrag wirklich löschen?</div> | |
<div class="modal-footer"> | |
<form action="{{ endpoint }}" method="post"> | |
<button type="submit" class="btn btn-danger">Ja</button> | |
<button class="btn btn-default" data-dismiss="modal">Nein</button> | |
</form> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
{% endmacro %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment