diff --git a/manuscript/views.py b/manuscript/views.py index 65cc62c..bc68f25 100644 --- a/manuscript/views.py +++ b/manuscript/views.py @@ -1,3 +1,5 @@ +from html import unescape + from django.http import HttpRequest from django.shortcuts import render from django.urls import reverse @@ -16,6 +18,8 @@ def about(request: HttpRequest): def stanzas(request: HttpRequest): stanzas = Stanza.objects.all().order_by("stanza_line_code_starts") + for stanza in stanzas: + stanza.stanza_text = unescape(stanza.stanza_text) return render(request, "stanzas.html", {"stanzas": stanzas}) diff --git a/static/css/custom.css b/static/css/custom.css new file mode 100644 index 0000000..b85da73 --- /dev/null +++ b/static/css/custom.css @@ -0,0 +1,25 @@ +.prose span div { + display: inline; +} + +[data-notation] { + background-color: #ffffcc; + cursor: help; + border: 1px solid black; + padding: 0 0.2em; +} +.shadow-left { + box-shadow: -8px 0 10px -6px rgba(0, 0, 0, 0.2); +} +/* +[data-notation]:hover::before { + content: attr(data-notation); + position: absolute; + background: #ffffcc; + padding: 5px; + border: 1px solid #000; + border-radius: 5px; + margin-top: 30px; + font-size: 0.8em; + z-index: 10; +} */ diff --git a/static/js/stanza.js b/static/js/stanza.js new file mode 100644 index 0000000..6025a72 --- /dev/null +++ b/static/js/stanza.js @@ -0,0 +1,25 @@ +// Get the sidebar, close button, and notation text elements +var sidebar = document.getElementById("sidebar"); +var closeButton = document.getElementById("close-button"); +var notationText = document.getElementById("notation-text"); + +// Listen for click events on the document +document.addEventListener("click", function (event) { + // If the clicked element has a data-notation attribute + if (event.target.hasAttribute("data-notation")) { + // Get the data-notation text + var text = event.target.getAttribute("data-notation"); + + // Update the notation text + notationText.textContent = text; + + // Show the sidebar + sidebar.style.transform = "translateX(0)"; + } +}); + +// Add a click event listener to the close button +closeButton.addEventListener("click", function () { + // Hide the sidebar + sidebar.style.transform = "translateX(100%)"; +}); diff --git a/templates/base.html b/templates/base.html index d0fa922..911b43d 100644 --- a/templates/base.html +++ b/templates/base.html @@ -5,80 +5,318 @@ - {% block title %}La Sfera{% endblock %} + + + + {% block title %}The La Sfera Project{% endblock %} {% tailwind_css %} + -
-
-
-
- - Logo -

The La Sfera Project

-
+ {% if request.resolver_match.url_name == 'index' %} +
+
+ +
+
+

La Sfera: The Globe

+

The La Sfera Project encompasses a number of different scholarly efforts exploring the Florentine merchant Gregorio Dati's treatise La sfera (The Globe), written sometime around 1430. It began with the #lasferachallenge, the social-media brainchild of Laura Morreale and Ben Albritton, in 2020, but has since expanded in multiple scholarly directions.

+
+
+
+
+ {% else %} +
+ +
+ {% endif %} +
+ {% block content %} + {% endblock %} +
+ +
-
- {% block content %} - {% endblock %} -
+ + + + {% block scripts %} + {% endblock scripts %} diff --git a/templates/index.html b/templates/index.html index 5dc1caa..8eb7eb8 100644 --- a/templates/index.html +++ b/templates/index.html @@ -26,22 +26,22 @@
-

Introduction

+

Translating La Sfera

This is the introduction section. Add your content here.

-

About

+

Editing La Sfera

This is the about section. Add your content here.

-

Background

+

Mapping La Sfera

This is the background section. Add your content here.

-

Resources

+

Tracking La Sfera

This is the resources section. Add your content here.

{% endblock content %} diff --git a/templates/manuscripts.html b/templates/manuscripts.html index 6343e53..cc7d72d 100644 --- a/templates/manuscripts.html +++ b/templates/manuscripts.html @@ -4,30 +4,30 @@ {% block content %}
-

Table of manuscripts — Back to top ↑

+

Table of manuscripts

- - +
+ + + + + + + + + + {% for manuscript in manuscripts %} - - - - - - - - {% for manuscript in manuscripts %} - - - - - + + + + - - {% endfor %} - -
IDSiglumShelfmarkLibrary
IDSiglumShelfmarkLibrary
{{ manuscript.item_id }}{{ manuscript.siglum }}{{ manuscript.shelfmark }}{{ manuscript.library }}{{ manuscript.item_id }}{{ manuscript.siglum }}{{ manuscript.shelfmark }}{{ manuscript.library }}
+ + {% endfor %} + +
{% endblock content %} diff --git a/templates/stanzas.html b/templates/stanzas.html index ed4c672..83cb67d 100644 --- a/templates/stanzas.html +++ b/templates/stanzas.html @@ -1,22 +1,35 @@ {% extends "base.html" %} +{% load static %} {% block title %}Stanzas - La Sfera{% endblock title %} {% block content %}

- Text of the manuscript — Back to top ↑ -

+ Text of the manuscript + -
- {% for stanza in stanzas %} -

- - {{ stanza.stanza_line_code_starts }} - - {{ stanza.stanza_text }} -

- {% endfor %} -
+
+ {% for stanza in stanzas %} +
+ + {{ stanza.stanza_line_code_starts }} + + + {{ stanza.stanza_text|safe }} + +
+ {% endfor %} +
+ + + {% endblock content %} + +{% block scripts %} + +{% endblock scripts %} \ No newline at end of file