-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
65 additions
and
15 deletions.
There are no files selected for viewing
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,17 @@ | ||
function showPopup(recordId, renderStyle) { | ||
renderStyle = "tei"; | ||
fetch(`/apis/excerpts/${recordId}/${renderStyle}`) | ||
.then(response => response.text()) | ||
.then(data => { | ||
// Display the data in the popup | ||
document.getElementById('popupContent').innerHTML = data; | ||
document.getElementById('popupModal').style.display = 'block'; | ||
}) | ||
.catch(error => { | ||
console.error('Error fetching dynamic content:', error); | ||
}); | ||
} | ||
|
||
function closePopup() { | ||
document.getElementById('popupModal').style.display = 'none'; | ||
} |
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
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
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
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,19 @@ | ||
<script src="/static/scripts/show_popup.js"></script> | ||
|
||
<div class="modal" id="popupModal" style="display:none;" tabindex="-1" role="dialog"> | ||
<div class="modal-dialog modal-dialog-centered" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title">Excerpt</h5> | ||
</div> | ||
<div class="modal-body"> | ||
|
||
<span id="popupContent"></span> | ||
</div> | ||
<div class="modal-footer"> | ||
|
||
<button onclick="closePopup()">Close</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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
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,19 @@ | ||
from django.http import HttpResponse | ||
from django.views import View | ||
from django.shortcuts import get_object_or_404 | ||
from .models import Excerpts | ||
|
||
|
||
class ExcerptsView(View): | ||
def get(self, request, xml_id, render_style, *args, **kwargs): | ||
print("You are here!") | ||
record = get_object_or_404(Excerpts, xml_id=xml_id) | ||
|
||
# Generate dynamic content based on link_type | ||
if render_style == "tei": | ||
# TODO: render correctly with xslt | ||
content = f"{record.xml_content}" | ||
else: | ||
content = f"{record.xml_content}" | ||
|
||
return HttpResponse(content) |