Skip to content

Commit

Permalink
Updates to JoE record view. #133
Browse files Browse the repository at this point in the history
  • Loading branch information
wsalesky committed Jan 16, 2024
1 parent 7b43124 commit e4779c7
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 14 deletions.
2 changes: 1 addition & 1 deletion johnofephesus/persons/record.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div data-template="app:other-data-formats" data-template-formats="print,tei,rdf,text"/>
<div class="row">
<div class="col-md-7 col-lg-8">
<div data-template="app:display-nodes" data-template-paths="descendant-or-self::tei:TEI"/>
<div data-template="app:display-nodes" data-template-paths="descendant-or-self::tei:TEI" data-template-collection="johnofephesusPersons"/>
</div>
<div class="col-md-5 col-lg-4 right-menu">
<br/>
Expand Down
2 changes: 1 addition & 1 deletion johnofephesus/places/record.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div data-template="app:other-data-formats" data-template-formats="print,tei,rdf,text"/>
<div class="row">
<div class="col-md-7 col-lg-8">
<div data-template="app:display-nodes" data-template-paths="descendant-or-self::tei:TEI"/>
<div data-template="app:display-nodes" data-template-paths="descendant-or-self::tei:TEI" data-template-collection="johnofephesusPlaces"/>
</div>
<div class="col-md-5 col-lg-4 right-menu">
<!-- Make dynamic -->
Expand Down
84 changes: 72 additions & 12 deletions resources/xsl/tei2html.xsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:t="http://www.tei-c.org/ns/1.0" xmlns:x="http://www.w3.org/1999/xhtml" xmlns:srophe="https://srophe.app" xmlns:saxon="http://saxon.sf.net/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:local="http://syriaca.org/ns" exclude-result-prefixes="xs t x saxon local" version="2.0">
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" xmlns:srophe="https://srophe.app" xmlns:saxon="http://saxon.sf.net/" xmlns:local="http://syriaca.org/ns" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:t="http://www.tei-c.org/ns/1.0" xmlns:x="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs t x saxon local" version="2.0">

<!-- ==================================================================
Copyright 2013 New York University
Expand Down Expand Up @@ -608,9 +608,25 @@
<!-- Main page modules for syriaca.org display -->
<xsl:template match="t:person">
<xsl:if test="t:desc[@type='abstract'] | t:desc[starts-with(@xml:id, 'abstract-en')] | t:note[@type='abstract']">
<div class="tei-desc text abstract">
<xsl:apply-templates select="t:desc[@type='abstract' or starts-with(@xml:id, 'abstract-en')][1] | t:note[@type='abstract']"/>
</div>
<xsl:choose>
<xsl:when test="$collection = 'johnofephesusPersons'">
<xsl:if test="t:note[@type='abstract'][contains(@corresp,'http://syriaca.org/johnofephesus/persons')]">
<div class="tei-desc text abstract">
<xsl:apply-templates select="t:note[@type='abstract'][contains(@corresp,'http://syriaca.org/johnofephesus/persons')]"/>
</div>
</xsl:if>
</xsl:when>
<xsl:when test="t:note[@type='abstract'][contains(@corresp,'http://syriaca.org/persons')]">
<div class="tei-desc text abstract">
<xsl:apply-templates select="t:note[@type='abstract'][contains(@corresp,'http://syriaca.org/persons')]"/>
</div>
</xsl:when>
<xsl:otherwise>
<div class="tei-desc text abstract">
<xsl:apply-templates select="t:desc[@type='abstract' or starts-with(@xml:id, 'abstract-en')][1] | t:note[@type='abstract'][1]"/>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="t:persName[not(empty(descendant-or-self::text()))]">
<h3>Names</h3>
Expand Down Expand Up @@ -695,8 +711,22 @@
</xsl:if>

<xsl:if test="not(empty(t:note[not(@type='description')][1]))">
<h3>Notes</h3>
<xsl:apply-templates select="t:note[not(@type='description')]"/>
<xsl:choose>
<xsl:when test="$collection = 'johnofephesusPersons'">
<xsl:if test="t:note[@type='abstract'][contains(@corresp,'http://syriaca.org/johnofephesus/persons')]">
<h3>Notes</h3>
<xsl:apply-templates select="t:note[not(@type='description')][not(contains(@corresp,'http://syriaca.org/johnofephesus/persons'))]"/>
</xsl:if>
</xsl:when>
<xsl:when test="t:note[@type='abstract'][contains(@corresp,'http://syriaca.org/persons')]">
<h3>Notes</h3>
<xsl:apply-templates select="t:note[not(@type='description')][not(contains(@corresp,'http://syriaca.org/persons'))]"/>
</xsl:when>
<xsl:otherwise>
<h3>Notes</h3>
<xsl:apply-templates select="t:note[not(@type='description')]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>

<div class="info-btns">
Expand All @@ -720,9 +750,25 @@
</xsl:template>
<xsl:template match="t:place">
<xsl:if test="t:desc[@type='abstract'] | t:desc[starts-with(@xml:id, 'abstract-en')] | t:note[@type='abstract']">
<div class="tei-desc text abstract">
<xsl:apply-templates select="t:desc[@type='abstract' or starts-with(@xml:id, 'abstract-en')][1] | t:note[@type='abstract']"/>
</div>
<xsl:choose>
<xsl:when test="$collection = 'johnofephesusPlace'">
<xsl:if test="t:note[@type='abstract'][contains(@corresp,'http://syriaca.org/johnofephesus/places')]">
<div class="tei-desc text abstract">
<xsl:apply-templates select="t:note[@type='abstract'][contains(@corresp,'http://syriaca.org/johnofephesus/places')]"/>
</div>
</xsl:if>
</xsl:when>
<xsl:when test="t:note[@type='abstract'][contains(@corresp,'http://syriaca.org/places')]">
<div class="tei-desc text abstract">
<xsl:apply-templates select="t:note[@type='abstract'][contains(@corresp,'http://syriaca.org/places')]"/>
</div>
</xsl:when>
<xsl:otherwise>
<div class="tei-desc text abstract">
<xsl:apply-templates select="t:desc[@type='abstract' or starts-with(@xml:id, 'abstract-en')][1] | t:note[@type='abstract'][1]"/>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="t:placeName">
<div id="placenames" class="content-block">
Expand Down Expand Up @@ -817,8 +863,22 @@
</xsl:if>

<xsl:if test="not(empty(t:note[not(@type='description')][1]))">
<h3>Notes</h3>
<xsl:apply-templates select="t:note[not(@type='description')]"/>
<xsl:choose>
<xsl:when test="$collection = 'johnofephesusPlace'">
<xsl:if test="t:note[@type='abstract'][contains(@corresp,'http://syriaca.org/johnofephesus/places')]">
<h3>Notes</h3>
<xsl:apply-templates select="t:note[not(@type='description')][not(contains(@corresp,'http://syriaca.org/johnofephesus/places'))]"/>
</xsl:if>
</xsl:when>
<xsl:when test="t:note[@type='abstract'][contains(@corresp,'http://syriaca.org/places')]">
<h3>Notes</h3>
<xsl:apply-templates select="t:note[not(@type='description')][not(contains(@corresp,'http://syriaca.org/places'))]"/>
</xsl:when>
<xsl:otherwise>
<h3>Notes</h3>
<xsl:apply-templates select="t:note[not(@type='description')]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<!-- Confessions/Religious Communities -->
<xsl:if test="t:state[@type='confession'][parent::t:place]">
Expand Down Expand Up @@ -2235,4 +2295,4 @@
<xsl:sequence select="local:add-footnotes(@source,.)"/>
</xsl:template>

</xsl:stylesheet>
</xsl:stylesheet>

0 comments on commit e4779c7

Please sign in to comment.