Skip to content

Commit

Permalink
wip #4
Browse files Browse the repository at this point in the history
  • Loading branch information
csae8092 committed Dec 19, 2024
1 parent 2e9e89b commit 4a53641
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 102 deletions.
22 changes: 11 additions & 11 deletions pez-nachlass-static.xpr
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<scenarioAssociation-array>
<scenarioAssociation>
<field name="url">
<String>data/editions/msDesc_495102.xml</String>
<String>data/indices/listperson.xml</String>
</field>
<field name="scenarioIds">
<list>
<String>editions</String>
<String>listperson</String>
</list>
</field>
<field name="scenarioTypes">
Expand All @@ -30,11 +30,11 @@
</scenarioAssociation>
<scenarioAssociation>
<field name="url">
<String>data/imprint.xml</String>
<String>data/editions/msDesc_495102.xml</String>
</field>
<field name="scenarioIds">
<list>
<String>toc</String>
<String>editions</String>
</list>
</field>
<field name="scenarioTypes">
Expand All @@ -50,11 +50,11 @@
</scenarioAssociation>
<scenarioAssociation>
<field name="url">
<String>data/indices/listbibl.xml</String>
<String>data/imprint.xml</String>
</field>
<field name="scenarioIds">
<list>
<String>listbibl</String>
<String>toc</String>
</list>
</field>
<field name="scenarioTypes">
Expand All @@ -70,11 +70,11 @@
</scenarioAssociation>
<scenarioAssociation>
<field name="url">
<String>data/indices/listplace.xml</String>
<String>data/indices/listbibl.xml</String>
</field>
<field name="scenarioIds">
<list>
<String>listplace</String>
<String>listbibl</String>
</list>
</field>
<field name="scenarioTypes">
Expand All @@ -90,11 +90,11 @@
</scenarioAssociation>
<scenarioAssociation>
<field name="url">
<String>data/indices/listperson.xml</String>
<String>data/indices/listplace.xml</String>
</field>
<field name="scenarioIds">
<list>
<String>listperson</String>
<String>listplace</String>
</list>
</field>
<field name="scenarioTypes">
Expand Down Expand Up @@ -443,7 +443,7 @@
<Boolean>true</Boolean>
</field>
<field name="openInBrowser">
<Boolean>true</Boolean>
<Boolean>false</Boolean>
</field>
<field name="outputResource">
<String>${pd}/html/${cfn}.html</String>
Expand Down
26 changes: 26 additions & 0 deletions xslt/editions.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,32 @@
</dd>
</xsl:for-each>
</xsl:if>
<xsl:if test=".//tei:person[@role='autor']">
<dt>Autor</dt>
<xsl:for-each select=".//tei:person[@role='autor']">
<dd>
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat(@xml:id, '.html')"/>
</xsl:attribute>
<xsl:value-of select="./tei:persName/text()"/>
</a>
</dd>
</xsl:for-each>
</xsl:if>
<xsl:if test=".//tei:person[@role='bearbeiter']">
<dt>Bearbeiter</dt>
<xsl:for-each select=".//tei:person[@role='bearbeiter']">
<dd>
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat(@xml:id, '.html')"/>
</xsl:attribute>
<xsl:value-of select="./tei:persName/text()"/>
</a>
</dd>
</xsl:for-each>
</xsl:if>
<xsl:if test=".//tei:person[@role='behandelte']">
<dt>behandelt</dt>
<xsl:for-each select=".//tei:person[@role='behandelte']">
Expand Down
94 changes: 81 additions & 13 deletions xslt/listperson.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,41 @@

<body class="d-flex flex-column h-100">
<xsl:call-template name="nav_bar"/>

<main class="flex-shrink-0 flex-grow-1">
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb"
class="ps-5 p-3">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="index.html">Pez-Nachlass</a>
</li>
<li class="breadcrumb-item active" aria-current="page">Alle
Personen</li>
</ol>
</nav>
<div class="container">

<h1>
<h1 class="display-5 text-center">
<xsl:value-of select="$doc_title"/>
</h1>
<div class="text-center p-1">
<span id="counter1"/> von <span id="counter2"/>Personen
</div>

<table id="myTable">
<thead>
<tr>
<th scope="col" width="20" tabulator-formatter="html" tabulator-headerSort="false" tabulator-download="false">#</th>
<th scope="col" tabulator-headerFilter="input">Nachname</th>
<th scope="col" tabulator-headerFilter="input">Vorname</th>
<th scope="col" tabulator-headerFilter="input">ID</th>
<th scope="col" tabulator-headerFilter="input"
tabulator-formatter="html" tabulator-download="false"
tabulator-minWidth="350">Name</th>
<th scope="col" tabulator-headerFilter="input"
tabulator-visible="false" tabulator-download="true"
>name_</th>
<th scope="col" tabulator-headerFilter="input">Urheberschaft</th>
<th scope="col" tabulator-headerFilter="input">Nennungen</th>
<!-- <th scope="col" tabulator-headerFilter="input">Bearbeitungen</th>
<th scope="col" tabulator-headerFilter="input">Autorschaft</th>-->
<th scope="col" tabulator-headerFilter="input"
tabulator-maxWidth="170">ID</th>
</tr>
</thead>
<tbody>
Expand All @@ -54,15 +74,24 @@
<xsl:attribute name="href">
<xsl:value-of select="concat($id, '.html')"/>
</xsl:attribute>
<i class="bi bi-link-45deg"/>
<xsl:value-of select="normalize-space(./tei:persName/text())"/>
</a>
</td>
<td>
<xsl:value-of select=".//tei:surname/text()"/>
<xsl:value-of select="./tei:persName/text()"/>
</td>
<td>
<xsl:value-of select="count(.//tei:ptr[@type='urheber'])"/>
</td>
<td>
<xsl:value-of select=".//tei:forename/text()"/>
<xsl:value-of select="count(.//tei:ptr[@type='behandelte'])"/>
</td>
<!--<td>
<xsl:value-of select="count(.//tei:ptr[@type='bearbeiter'])"/>
</td>
<td>
<xsl:value-of select="count(.//tei:ptr[@type='autor'])"/>
</td>-->
<td>
<xsl:value-of select="$id"/>
</td>
Expand All @@ -81,23 +110,62 @@

<xsl:for-each select=".//tei:person[@xml:id]">
<xsl:variable name="filename" select="concat(./@xml:id, '.html')"/>
<xsl:variable name="name" select="normalize-space(string-join(./tei:persName[1]//text()))"></xsl:variable>
<xsl:variable name="doc_title" select="normalize-space(string-join(./tei:persName[1]//text()))"></xsl:variable>
<xsl:result-document href="{$filename}">
<html class="h-100">
<head>
<xsl:call-template name="html_head">
<xsl:with-param name="html_title" select="$name"></xsl:with-param>
<xsl:with-param name="html_title" select="$doc_title"></xsl:with-param>
</xsl:call-template>
</head>

<body class="d-flex flex-column h-100">
<xsl:call-template name="nav_bar"/>
<main class="flex-shrink-0 flex-grow-1">
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb"
class="ps-5 p-3">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="index.html">Pez-Nachlass</a>
</li>
<li class="breadcrumb-item"><a href="listperson.html">Alle Personen</a></li>
</ol>
</nav>
<div class="container">
<h1>
<xsl:value-of select="$name"/>
<h1 class="display-5 text-center">
<xsl:value-of select="$doc_title"/>
</h1>
<xsl:call-template name="person_detail"/>
<h2 class="text-center">Verknüpfte Dokumente</h2>
<div class="row justify-content-center">
<div class="col-md-6">
<h3>Urheber von</h3>
<ul>
<xsl:for-each select=".//tei:ptr[@type='urheber']">
<xsl:variable name="foo">
<xsl:value-of select="replace(tokenize(@target, '/')[last()], '.xml', '.html')"/>
</xsl:variable>
<li>
<a href="{$foo}"><xsl:value-of select="replace($foo, '.html', '')"/></a>
</li>
</xsl:for-each>
</ul>
</div>
<div class="col-md-6">
<h3>Erwähnt erwähnt in</h3>
<ul>
<xsl:for-each select=".//tei:ptr[@type='behandelte']">
<xsl:variable name="foo">
<xsl:value-of select="replace(tokenize(@target, '/')[last()], '.xml', '.html')"/>
</xsl:variable>
<li>
<a href="{$foo}"><xsl:value-of select="replace($foo, '.html', '')"/></a>
</li>
</xsl:for-each>
</ul>
</div>
</div>

</div>
</main>
<xsl:call-template name="html_footer"/>
Expand Down
86 changes: 8 additions & 78 deletions xslt/partials/person.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,83 +5,13 @@
version="2.0" exclude-result-prefixes="xsl tei xs">

<xsl:template match="tei:person" name="person_detail">
<table class="table entity-table">
<tbody>
<xsl:if test="./tei:birth/tei:date">
<tr>
<th>
Geburtsdatum
</th>
<td>
<xsl:value-of select="./tei:birth/tei:date"/>
</td>
</tr>
</xsl:if>
<xsl:if test="./tei:death/tei:date">
<tr>
<th>
Sterbedatum
</th>
<td>
<xsl:value-of select="./tei:death/tei:date"/>
</td>
</tr>
</xsl:if>
<xsl:if test="./tei:idno[@type='GND']/text()">
<tr>
<th>
GND ID
</th>
<td>
<a href="{./tei:idno[@type='GND']}" target="_blank">
<xsl:value-of select="tokenize(./tei:idno[@type='GND'], '/')[last()]"/>
</a>
</td>
</tr>
</xsl:if>
<xsl:if test="./tei:idno[@type='WIKIDATA']/text()">
<tr>
<th>
Wikidata ID
</th>
<td>
<a href="{./tei:idno[@type='WIKIDATA']}" target="_blank">
<xsl:value-of select="tokenize(./tei:idno[@type='WIKIDATA'], '/')[last()]"/>
</a>
</td>
</tr>
</xsl:if>
<xsl:if test="./tei:idno[@type='GEONAMES']/text()">
<tr>
<th>
Geonames ID
</th>
<td>
<a href="{./tei:idno[@type='GEONAMES']}" target="_blank">
<xsl:value-of select="tokenize(./tei:idno[@type='GEONAMES'], '/')[4]"/>
</a>
</td>
</tr>
</xsl:if>
<xsl:if test="./tei:noteGrp/tei:note[@type='mentions']">
<tr>
<th>
Erwähnt in
</th>
<td>
<ul>
<xsl:for-each select="./tei:noteGrp/tei:note[@type='mentions']">
<li>
<a href="{replace(@target, '.xml', '.html')}">
<xsl:value-of select="./text()"/>
</a>
</li>
</xsl:for-each>
</ul>
</td>
</tr>
</xsl:if>
</tbody>
</table>
<dl>
<xsl:if test="./tei:idno">
<dt>Normdaten</dt>
<xsl:for-each select="./tei:idno/text()">
<dd><a href="{.}"><xsl:value-of select="."/></a></dd>
</xsl:for-each>
</xsl:if>
</dl>
</xsl:template>
</xsl:stylesheet>

0 comments on commit 4a53641

Please sign in to comment.