Skip to content

Commit

Permalink
Merge pull request #28 from karl-kraus/26-provide-proper-legal-detail…
Browse files Browse the repository at this point in the history
…-views

refactoring entity modals
  • Loading branch information
csae8092 committed Jun 16, 2024
2 parents 2e96b66 + ab3b095 commit 4e7dc60
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 380 deletions.
52 changes: 36 additions & 16 deletions legalkraus-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/imprint.xml</String>
<String>data/editions/D_000001-002-000.xml</String>
</field>
<field name="scenarioIds">
<list>
<String>imprint</String>
<String>editions</String>
</list>
</field>
<field name="scenarioTypes">
Expand All @@ -30,11 +30,11 @@
</scenarioAssociation>
<scenarioAssociation>
<field name="url">
<String>data/indices/listlegal.xml</String>
<String>xslt/editions.xsl</String>
</field>
<field name="scenarioIds">
<list>
<String>listlegal</String>
<String>editions</String>
</list>
</field>
<field name="scenarioTypes">
Expand All @@ -50,11 +50,11 @@
</scenarioAssociation>
<scenarioAssociation>
<field name="url">
<String>data/indices/listwork.xml</String>
<String>data/imprint.xml</String>
</field>
<field name="scenarioIds">
<list>
<String>listbibl.xsl</String>
<String>imprint</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/listlegal.xml</String>
</field>
<field name="scenarioIds">
<list>
<String>listplace</String>
<String>listlegal</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/listwork.xml</String>
</field>
<field name="scenarioIds">
<list>
<String>beacon</String>
<String>listbibl.xsl</String>
</list>
</field>
<field name="scenarioTypes">
Expand All @@ -110,11 +110,11 @@
</scenarioAssociation>
<scenarioAssociation>
<field name="url">
<String>data/indices/listfackel.xml</String>
<String>data/indices/listplace.xml</String>
</field>
<field name="scenarioIds">
<list>
<String>listfackel</String>
<String>listplace</String>
</list>
</field>
<field name="scenarioTypes">
Expand All @@ -130,11 +130,31 @@
</scenarioAssociation>
<scenarioAssociation>
<field name="url">
<String>xslt/editions.xsl</String>
<String>data/indices/listperson.xml</String>
</field>
<field name="scenarioIds">
<list>
<String>editions</String>
<String>beacon</String>
</list>
</field>
<field name="scenarioTypes">
<list>
<String>XSL</String>
</list>
</field>
<field name="scenarioStorageLocations">
<list>
<Byte>2</Byte>
</list>
</field>
</scenarioAssociation>
<scenarioAssociation>
<field name="url">
<String>data/indices/listfackel.xml</String>
</field>
<field name="scenarioIds">
<list>
<String>listfackel</String>
</list>
</field>
<field name="scenarioTypes">
Expand Down Expand Up @@ -722,7 +742,7 @@
<String></String>
</field>
<field name="inputXSLURL">
<String>${pdu}/xslt/search.xsl</String>
<String>${pdu}/xslt/editions.xsl</String>
</field>
<field name="inputXMLURL">
<String>${currentFileURL}</String>
Expand All @@ -743,7 +763,7 @@
<Boolean>true</Boolean>
</field>
<field name="outputResource">
<String>${pd}/html/search.html</String>
<String>${pd}/html/${cfn}.html</String>
</field>
<field name="openOtherLocationInBrowser">
<Boolean>false</Boolean>
Expand Down
45 changes: 26 additions & 19 deletions xslt/listlegal.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<xsl:import href="./partials/html_navbar.xsl"/>
<xsl:import href="./partials/html_head.xsl"/>
<xsl:import href="./partials/html_footer.xsl"/>
<xsl:import href="./partials/bibl.xsl"/>
<xsl:import href="./partials/legal.xsl"/>
<xsl:template match="/">
<xsl:variable name="doc_title">
<xsl:value-of select="'Juristische Texte'"/>
Expand All @@ -32,7 +32,7 @@
</ol>
</nav>

<div class="container-fluid">
<div class="container">
<div class="card rounded-0">
<div class="card-header rounded-0 bg-darker-gray">
<h1><xsl:value-of select="$doc_title"/></h1>
Expand All @@ -44,7 +44,7 @@
<th scope="col">Titel</th>
<th scope="col">Gesetz</th>
<th scope="col">Datum</th>
<th scope="col">erwähnt in</th>
<th scope="col">Erwähnungen</th>
</tr>
</thead>
<tbody>
Expand All @@ -54,7 +54,7 @@
</xsl:variable>
<tr>
<td>
<a href="{@corresp}">
<a href="{concat($id, '.html')}">
<xsl:value-of select=".//tei:title[1]/text()"/>
</a>
</td>
Expand All @@ -63,13 +63,7 @@
<xsl:value-of select=".//tei:date[1]/text()"/>
</td>
<td>
<ul>
<xsl:for-each select=".//tei:ref">
<li>
<a href="{replace(./@target, '.xml', '.html')}"><xsl:value-of select="./text()"/></a>
</li>
</xsl:for-each>
</ul>
<xsl:value-of select="count(./tei:ref)"/>
</td>
</tr>
</xsl:for-each>
Expand All @@ -89,7 +83,7 @@
</div>
</body>
</html>
<!--<xsl:for-each select=".//tei:bibl">
<xsl:for-each select=".//tei:bibl">
<xsl:variable name="filename" select="concat(./@xml:id, '.html')"/>
<xsl:variable name="name" select="./tei:title[1]/text()"></xsl:variable>
<xsl:result-document href="{$filename}">
Expand All @@ -101,23 +95,36 @@
<body class="page">
<div class="hfeed site" id="page">
<xsl:call-template name="nav_bar"/>
<nav style="-\-bs-breadcrumb-divider: '>';" aria-label="breadcrumb" class="p-3">
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb" class="p-3">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.html">Home</a></li>
<li class="breadcrumb-item" aria-current="page"><a href="listorg.html"><xsl:value-of select="$doc_title"/></a></li>
<li class="breadcrumb-item" aria-current="page"><a href="listlegal.html"><xsl:value-of select="$doc_title"/></a></li>
<li class="breadcrumb-item active" aria-current="page"><xsl:value-of select="$name"/></li>
</ol>
</nav>

<div class="container-fluid">
<div class="card">
<div class="card-header">
<div class="container">
<div class="card rounded-0">
<div class="card-header rounded-0 bg-darker-gray">
<h1>
<xsl:value-of select="$name"/>
<a class="ps-2" title="zur Online Ausgabe von {$name}" href="{./@corresp}"><i class="fas fa-external-link-alt fa-sm"></i></a>
</h1>
</div>
<div class="card-body">
<xsl:call-template name="bibl_detail"/>
<xsl:call-template name="legal_detail"/>
<div>
<h3>erwähnt in</h3>
<ul>
<xsl:for-each select="./tei:ref[@target]">
<li>
<a href="{replace(@target, '.xml', '.html')}">
<xsl:value-of select="."/>
</a>
</li>
</xsl:for-each>
</ul>
</div>
</div>
</div>
</div>
Expand All @@ -128,7 +135,7 @@
</html>
</xsl:result-document>

</xsl:for-each>-->
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>
115 changes: 26 additions & 89 deletions xslt/partials/legal.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,94 +2,31 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tei="http://www.tei-c.org/ns/1.0"
version="2.0" exclude-result-prefixes="xsl tei xs">


<xsl:template match="tei:bibl" name="bibl_detail">
<table class="table entity-table">
<tbody>
<xsl:if test="./tei:author">
<tr>
<th>
Autor(en)
</th>
<td>
<ul>
<xsl:for-each select="./tei:author">
<li>
<a href="{@xml:id}.html">
<xsl:value-of select="./tei:persName"/>
</a>
</li>
</xsl:for-each>
</ul>
</td>
</tr>
</xsl:if>
<xsl:if test="./tei:date">
<tr>
<th>
Datum
</th>
<td>
<xsl:value-of select="./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:listEvent">
<tr>
<th>
Erwähnt in
</th>
<td>
<ul>
<xsl:for-each select="./tei:listEvent/tei:event">
<li>
<a href="{replace(./tei:linkGrp/tei:link/@target, '.xml', '.html')}">
<xsl:value-of select="./text()"/>
</a>
</li>
</xsl:for-each>
</ul>
</td>
</tr>
</xsl:if>
</tbody>
</table>


<xsl:template match="tei:bibl" name="legal_detail">
<dl>
<dt>Gesetz</dt>
<dd>
<xsl:value-of select="./tei:title[@level='s']/text()"/>
</dd>
<dt>Titel</dt>
<dd>
<xsl:value-of select="./tei:title[@level='a']/text()"/>
</dd>


<xsl:if test="./tei:date">
<dt>Erscheinungsjahr, -zeitraum</dt>
<xsl:for-each select="./tei:date">
<dd>
<xsl:value-of select="normalize-space(./text())"/>
</dd>
</xsl:for-each>
</xsl:if>

</dl>


</xsl:template>
</xsl:stylesheet>
Loading

0 comments on commit 4e7dc60

Please sign in to comment.