Skip to content

Commit

Permalink
Merge pull request #35 from evt-project/develop
Browse files Browse the repository at this point in the history
Release/1.3.1
  • Loading branch information
EVTDevelopers authored Nov 10, 2020
2 parents 9f62b90 + 1510cd8 commit 7f38d90
Show file tree
Hide file tree
Showing 19 changed files with 584 additions and 253 deletions.
2 changes: 1 addition & 1 deletion builder_pack/evt_builder.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<xsl:include href="modules/evt_builder-main.xsl"/>
<xsl:include href="../config/evt_builder-config.xsl"/>

<xsl:variable name="evtVersion" select="'1.3'"/>
<xsl:variable name="evtVersion" select="'1.3.1'"/>

<xsl:include href="modules/fundamental_units/evt_builder-copy_and_call_main.xsl"/>
<xsl:include href="modules/fundamental_units/evt_builder-structure.xsl"/>
Expand Down
2 changes: 1 addition & 1 deletion builder_pack/modules/elements/evt_builder-dipl-core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@
<xsl:value-of select="' ', name()" separator=""/>
</xsl:attribute>
<xsl:call-template name="dataAttributesFromAttributes"/>
<xsl:apply-templates select="normalize-space()" mode="#current"/>
<xsl:apply-templates mode="#current"/>
</xsl:element>
</xsl:template>

Expand Down
56 changes: 50 additions & 6 deletions builder_pack/modules/elements/evt_builder-interp-core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@
<xsl:value-of select="' ', name()" separator="-"/>
</xsl:attribute>
<xsl:call-template name="dataAttributesFromAttributes"/>
<xsl:apply-templates select="normalize-space()" mode="#current"/>
<xsl:apply-templates mode="#current"/>
</xsl:element>
</xsl:template>

Expand Down Expand Up @@ -1083,10 +1083,54 @@
</xsl:template>

<xsl:template match="tei:name" mode="interp">
<xsl:element name="span">
<xsl:attribute name="class" select="'name interp-name'"/>
<xsl:call-template name="dataAttributesFromAttributes"/>
<xsl:apply-templates mode="#current"/>
</xsl:element>
<xsl:choose>
<xsl:when test="@ref and @ref != '' and $root//node()[@xml:id = substring-after(current()/@ref, '#')]">
<xsl:variable name="refEl" select="$root//node()[@xml:id = substring-after(current()/@ref, '#')]"/>
<xsl:variable name="listParent" select="$refEl/ancestor-or-self::node()[starts-with(name(), 'list')]"/>
<xsl:element name="span">
<xsl:attribute name="class">popup name</xsl:attribute>
<xsl:call-template name="dataAttributesFromAttributes"/>
<xsl:attribute name="data-list" select="$listParent/name()"/>
<xsl:attribute name="data-list-type" select="$listParent/@type"/>
<xsl:attribute name="data-ref">
<xsl:value-of select="translate(@ref, '#', '')"/>
</xsl:attribute>
<xsl:element name="span">
<xsl:attribute name="class">trigger</xsl:attribute>
<xsl:apply-templates mode="#current"/>
</xsl:element>
<xsl:element name="span">
<xsl:attribute name="class">tooltip</xsl:attribute>
<xsl:element name="span">
<xsl:attribute name="class">before</xsl:attribute>
</xsl:element>
<xsl:for-each
select="$root//node()[@xml:id = substring-after(current()/@ref, '#')]">
<xsl:choose>
<xsl:when test="name() = 'person'">
<xsl:call-template name="person"/>
</xsl:when>
<xsl:when test="name() = 'place'">
<xsl:call-template name="place"/>
</xsl:when>
<xsl:when test="name() = 'org'">
<xsl:call-template name="org"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="#current"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="span">
<xsl:attribute name="class" select="'name interp-name'"/>
<xsl:call-template name="dataAttributesFromAttributes"/>
<xsl:apply-templates mode="#current"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
24 changes: 23 additions & 1 deletion builder_pack/modules/elements/evt_builder-lists.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<xsl:template name="org">
<xsl:choose>
<xsl:when
test="current()[@type] or current()[@subtype] or current()[@role] or current()/tei:orgName or current()/tei:desc or current()//tei:idno">
test="current()[@type] or current()[@subtype] or current()[@role] or current()/tei:orgName or current()/tei:desc or current()//tei:idno or current()//tei:listPerson">
<xsl:if test="current()/tei:orgName">
<xsl:element name="span">
<xsl:attribute name="class">entity_name <xsl:if test="$list_org = true()">
Expand Down Expand Up @@ -208,6 +208,28 @@
<xsl:if test="current()/tei:idno">
<xsl:apply-templates select="tei:idno"/>
</xsl:if>
<xsl:if test="current()//tei:person">
<span class="nested-list-container">
<span lang="def">MEMBERS</span>:
<span class="nested-list" data-list="listPerson">
<xsl:for-each select="current()//tei:person">
<span data-ref="{substring-after(current()/@sameAs, '#')}">
<xsl:choose>
<xsl:when test="@sameAs">
<xsl:for-each
select="$root//node()[@xml:id = substring-after(current()/@sameAs, '#')]">
<xsl:call-template name="person"/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="."/>
</xsl:otherwise>
</xsl:choose>
</span>
</xsl:for-each>
</span>
</span>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:element name="span">
Expand Down
18 changes: 18 additions & 0 deletions builder_pack/modules/elements/evt_builder-namedEntities.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:when test="@from or @to">
<xsl:element name="span">
<xsl:attribute name="class">popup date</xsl:attribute>
<xsl:call-template name="dataAttributesFromAttributes"/>
<xsl:element name="span">
<xsl:attribute name="class">trigger</xsl:attribute>
<xsl:apply-templates mode="#current"/>
</xsl:element>
<xsl:element name="span">
<xsl:attribute name="class">tooltip</xsl:attribute>
<xsl:element name="span">
<xsl:attribute name="class">before</xsl:attribute>
</xsl:element>
<xsl:text>Data normalizzata: </xsl:text>
<xsl:value-of select="@from"/>/<xsl:value-of select="@to"/>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="span">
<xsl:attribute name="class">date no-info </xsl:attribute>
Expand Down
123 changes: 75 additions & 48 deletions builder_pack/modules/evt_builder-main.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -533,28 +533,37 @@
<xsl:element name="ul">
<xsl:attribute name="id" select="'ul_listPerson'"/>
<xsl:attribute name="class" select="'ul_list'"/>
<xsl:for-each select="$root//tei:listPerson/person">
<xsl:sort select="lower-case(tei:persName/tei:forename)" order="ascending"/>
<xsl:sort select="lower-case(tei:persName/tei:name)" order="ascending"/>
<xsl:element name="li">
<xsl:attribute name="id" select="@xml:id"/>
<xsl:attribute name="class" select="'list_element'"/>
<xsl:attribute name="data-order-list">
<xsl:choose>
<xsl:when test="tei:persName/tei:forename and substring(tei:persName/tei:forename, 1, 1) != '.' and substring(tei:persName/tei:forename, 1, 1) != ' '">
<xsl:value-of select="substring(tei:persName/tei:forename, 1, 1)"/>
</xsl:when>
<xsl:when test="tei:persName/tei:name and substring(tei:persName/tei:name, 1, 1) != '.' and substring(tei:persName/tei:name, 1, 1) != ' '">
<xsl:value-of select="substring(tei:persName/tei:name, 1, 1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(@xml:id, 1, 1)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<!--<xsl:value-of select="substring(@xml:id, 1, 1)"/>-->
<xsl:call-template name="person"/>
</xsl:element>
<xsl:for-each select="$root//tei:listPerson">
<li data-type="{@type}" class="ul_list-sublist">
<xsl:if test="$use_list_head_as_label = true() and tei:head">
<span class="list-label"><xsl:value-of select="tei:head"/></span>
</xsl:if>
<ul class="items">
<xsl:for-each select="tei:person">
<xsl:sort select="lower-case(tei:persName/tei:forename)" order="ascending"/>
<xsl:sort select="lower-case(tei:persName/tei:name)" order="ascending"/>
<xsl:element name="li">
<xsl:attribute name="id" select="@xml:id"/>
<xsl:attribute name="class" select="'list_element'"/>
<xsl:attribute name="data-order-list">
<xsl:choose>
<xsl:when test="tei:persName/tei:forename and substring(tei:persName/tei:forename, 1, 1) != '.' and substring(tei:persName/tei:forename, 1, 1) != ' '">
<xsl:value-of select="substring(tei:persName/tei:forename, 1, 1)"/>
</xsl:when>
<xsl:when test="tei:persName/tei:name and substring(tei:persName/tei:name, 1, 1) != '.' and substring(tei:persName/tei:name, 1, 1) != ' '">
<xsl:value-of select="substring(tei:persName/tei:name, 1, 1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(@xml:id, 1, 1)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<!--<xsl:value-of select="substring(@xml:id, 1, 1)"/>-->
<xsl:call-template name="person"/>
</xsl:element>
</xsl:for-each>
</ul>
</li>
</xsl:for-each>
</xsl:element>
</xsl:template>
Expand All @@ -564,23 +573,32 @@
<xsl:element name="ul">
<xsl:attribute name="id" select="'ul_listPlace'"/>
<xsl:attribute name="class" select="'ul_list'"/>
<xsl:for-each select="$root//tei:listPlace/place">
<xsl:sort select="lower-case(tei:settlement[1])" order="ascending"/>
<xsl:element name="li">
<xsl:attribute name="id" select="@xml:id"/>
<xsl:attribute name="class" select="'list_element'"/>
<xsl:attribute name="data-order-list">
<xsl:choose>
<xsl:when test="tei:settlement[1] and substring(tei:settlement[1], 1, 1) != '.' and substring(tei:settlement[1], 1, 1) != ' '">
<xsl:value-of select="substring(tei:settlement[1], 1, 1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(@xml:id, 1, 1)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:call-template name="place"/>
</xsl:element>
<xsl:for-each select="$root//tei:listPlace">
<li data-type="{@type}" class="ul_list-sublist">
<xsl:if test="$use_list_head_as_label = true() and tei:head">
<span class="list-label"><xsl:value-of select="tei:head"/></span>
</xsl:if>
<ul class="items">
<xsl:for-each select="tei:place">
<xsl:sort select="lower-case(tei:settlement[1])" order="ascending"/>
<xsl:element name="li">
<xsl:attribute name="id" select="@xml:id"/>
<xsl:attribute name="class" select="'list_element'"/>
<xsl:attribute name="data-order-list">
<xsl:choose>
<xsl:when test="tei:settlement[1] and substring(tei:settlement[1], 1, 1) != '.' and substring(tei:settlement[1], 1, 1) != ' '">
<xsl:value-of select="substring(tei:settlement[1], 1, 1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(@xml:id, 1, 1)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:call-template name="place"/>
</xsl:element>
</xsl:for-each>
</ul>
</li>
</xsl:for-each>
</xsl:element>
</xsl:template>
Expand All @@ -590,14 +608,23 @@
<xsl:element name="ul">
<xsl:attribute name="id" select="'ul_listOrg'"/>
<xsl:attribute name="class" select="'ul_list'"/>
<xsl:for-each select="$root//tei:listOrg/org">
<xsl:sort select="lower-case(@xml:id)" order="ascending"/>
<xsl:element name="li">
<xsl:attribute name="id" select="@xml:id"/>
<xsl:attribute name="class" select="'list_element'"/>
<xsl:attribute name="data-order-list" select="substring(@xml:id, 1, 1)"/>
<xsl:call-template name="org"/>
</xsl:element>
<xsl:for-each select="$root//tei:listOrg">
<li data-type="{@type}" class="ul_list-sublist">
<xsl:if test="$use_list_head_as_label = true() and tei:head">
<span class="list-label"><xsl:value-of select="tei:head"/></span>
</xsl:if>
<ul class="items">
<xsl:for-each select="tei:org">
<xsl:sort select="lower-case(@xml:id)" order="ascending"/>
<xsl:element name="li">
<xsl:attribute name="id" select="@xml:id"/>
<xsl:attribute name="class" select="'list_element'"/>
<xsl:attribute name="data-order-list" select="substring(@xml:id, 1, 1)"/>
<xsl:call-template name="org"/>
</xsl:element>
</xsl:for-each>
</ul>
</li>
</xsl:for-each>
</xsl:element>
</xsl:template>
Expand Down Expand Up @@ -724,7 +751,7 @@

<xsl:template name="listDoc">
<xsl:element name="ul">
<xsl:attribute name="id" select="'ul_listDocument'"/>
<xsl:attribute name="id" select="'ul_listDoc'"/>
<xsl:attribute name="class" select="'ul_list'"/>
<xsl:for-each select="$root//tei:text/tei:group/tei:text">
<xsl:element name="li">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,50 @@
<xsl:with-param name="position" select="position()"/>
</xsl:call-template>
</xsl:variable>
<xsl:for-each select="$root//tei:listOrg">
<xsl:if test="@type">
<xsl:variable name="listType" select="@type"/>
<xsl:for-each select="current-group()/descendant::tei:name">
<xsl:variable name="refEl" select="$root//tei:listOrg[@type = $listType]//node()[@xml:id = substring-after(current()/@ref, '#')]"/>
<xsl:if test="current()/@ref and $refEl">
<xsl:variable name="doc_id">
<xsl:choose>
<xsl:when test="current()/ancestor::tei:text[1]/@xml:id">
<xsl:value-of select="current()/ancestor::tei:text[1]/@xml:id"/>
</xsl:when>
<xsl:when
test="current()/ancestor::tei:body[1]/tei:div[@subtype = 'edition_text']/@xml:id">
<xsl:value-of
select="current()/ancestor::tei:body[1]/tei:div[@subtype = 'edition_text']/@xml:id"
/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of
select="count(current()/ancestor::tei:text[1]/preceding-sibling::tei:text) + 1"
/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="span">
<xsl:attribute name="data-list">listOrg</xsl:attribute>
<xsl:attribute name="data-list-type"><xsl:value-of select="$listType"/></xsl:attribute>
<xsl:attribute name="data-ref">
<xsl:value-of select="translate(@ref, '#', '')"/>
</xsl:attribute>
<xsl:attribute name="data-doc">
<xsl:value-of select="$doc_id"/>
</xsl:attribute>
<xsl:attribute name="data-pb">
<xsl:value-of select="$pb_id"/>
</xsl:attribute>
<xsl:attribute name="data-pb-n">
<xsl:value-of select="$pb_n"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
<xsl:for-each
select="current-group()/descendant::tei:orgName[starts-with(@ref, '#')]">
<xsl:variable name="doc_id">
Expand Down
7 changes: 7 additions & 0 deletions config/evt_builder-config.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@
<!-- default: true() -->
<xsl:param name="list_doc" select="false()"/>

<!-- EN: On/Off <head> in <list*> as list label. If false, generic label will be used. -->
<!-- IT: Attiva/disattiva l'utilizzo del contenuto di <head> nella <list*> come etichetta della lista stessa. Se falso, verrà usata un'etichetta generica. -->
<!-- default: true() -->
<xsl:param name="use_list_head_as_label" select="false()"/>

<!-- EN: It is possibile to personalize the elements in the filter select element that will select and highlight particular (groups of) words.
In order to remove an element from the list in the application just remove the element itself.
In order to add a new element to the list you simply need to know that the tag corresponds to the class name that has be given to the html element referring to the particular words to be selected. -->
Expand All @@ -381,6 +386,8 @@
<persName active="true"/>
<placeName active="false"/>
<orgName active="false"/>
<name active="false" list-type="familia"/>
<orgName active="false" type="gens"/>
</group>
<group label="INTERESTING_ELEMENTS" active="false">
<roleName active="true"/>
Expand Down
Loading

0 comments on commit 7f38d90

Please sign in to comment.