{% comment %} Script to make modal appear whenever a user clicks any delete button/link The modal's Delete button fires the second script to actually delete the target entry {% endcomment %} {% comment %} Generic AJAX script that works with any of the AJAX views for deleting a model entry and any properly crafted delete link or button The delete link must have several attributes: * A unique ``id`` value * data-bs-toggle="modal" * data-bs-target="#confirm-delete-modal" * delete-target-csrftoken="{{ csrf_token }}" * delete-target-url="" * delete-target-id="" * delete-target-type="" The URL directs the POST to the proper URL without requiring multiple scripts for pages with more than one type of delete link The ``delete-target-type`` attribute is displayed in the delete modal and used as part of of the jQuery selector used for finding the preview content – this helps in case two objects from different models that share an ID number do not get confused when searching for ``object-preview-content-`` Any ```` tags should also have ``href="javascript:void(0);"`` to avoid style issues brought on by an apparent bug in Bootstrap v4 If desired, a preview of the content to be deleted can be displayed in the modal's ``object-preview-content`` section Flag the content that should be displayed with ``id="delete-target-content--{{ object.id }}"`` The script gets the parent ```` and then searches for a an element with a ``delete-target-content`` attribute that matches the ``delete-target-id`` If an element is found, the HTML will be included in the modal confirmation so the user knows they selected the correct object Example: {{ objective.objective }} {% endcomment %}