-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(templates): add link_to_reference_on templatetag
This commit introduces a `link_to_reference_on` reference tag, which can be used to include link to the referenceonview from other modules. The tag expects a model instance as argument. It then creates a link to the reference on view. If the `modal` argument is passed to the templatetag, the created link uses htmx to fill a modal with the id #modal-here
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
apis_bibsonomy/templates/apis_bibsonomy/link_to_reference_on_tag.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script src="https://unpkg.com/[email protected]"></script> | ||
<a href="{% url "apis_bibsonomy:referenceonlist" content_type object_pk %}" | ||
{% if modal %} | ||
hx-get="{% url "apis_bibsonomy:referenceonlist" content_type object_pk %}" | ||
hx-target="#modal-here" | ||
data-toggle="modal" | ||
data-target="#referenceModal" | ||
{% endif %} | ||
><i data-feather="book-open"></i></a> |
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