<?xml version="1.0" encoding="UTF-8"?>

<!-- 
    Project: GAMS Projekttemplate
    Company: ZIM-ACDH (Zentrum für Informationsmodellierung - Austrian Centre for Digital Humanities)
    Author: Hans Clausen, Maximilian Müller, Gerlinde Schneider, Martina Semlak, Christian Steiner, Elisabeth Steiner
    Last update: 2015
 -->

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:s="http://www.w3.org/2001/sw/DataAccess/rf1/result" xmlns="http://www.w3.org/1999/xhtml"
    xmlns:t="http://www.tei-c.org/ns/1.0" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
    xmlns:dc="http://purl.org/dc/elements/1.1/" exclude-result-prefixes="#all">
    
    <xsl:variable name="curPid">
        <xsl:value-of select="//t:idno[@type='PID']"/>
    </xsl:variable>
    <xsl:variable name="teiHeader" select="//t:teiHeader"/>
    <xsl:variable name="teiGeogfeat" select="$teiHeader/t:profileDesc/t:settingDesc/t:place/t:location/t:geogFeat"/>
    <xsl:include href="derla-static.xsl"/>
    
    
    <xsl:variable name="curStateAbbr">
        <xsl:choose>
            <xsl:when test="contains($curPid, 'sty')">sty</xsl:when>
            <xsl:when test="contains($curPid, 'vor')">vor</xsl:when>
            <xsl:when test="contains($curPid, 'bur')">bur</xsl:when>
            <xsl:when test="contains($curPid, 'tir')">tir</xsl:when>
            <xsl:when test="contains($curPid, 'car')">car</xsl:when>
            
            <xsl:when test="contains($curPid, 'sal')">sal</xsl:when>
            <xsl:when test="contains($curPid, 'vie')">vie</xsl:when>
            <xsl:when test="contains($curPid, 'upp')">upp</xsl:when>
            <xsl:when test="contains($curPid, 'low')">low</xsl:when>
            
        </xsl:choose>
    </xsl:variable>
    <xsl:variable name="curState">
        <xsl:choose>
            <xsl:when test="contains($curPid, 'sty')">Steiermark</xsl:when>
            <xsl:when test="contains($curPid, 'vor')">Vorarlberg</xsl:when>
            <xsl:when test="contains($curPid, 'bur')">Burgenland</xsl:when>
            <xsl:when test="contains($curPid, 'tir')">Tirol</xsl:when>
            <xsl:when test="contains($curPid, 'car')">Kärnten</xsl:when>
            
            <xsl:when test="contains($curPid, 'sal')">Salzburg</xsl:when>
            <xsl:when test="contains($curPid, 'vie')">Wien</xsl:when>
            <xsl:when test="contains($curPid, 'upp')">Oberösterreich</xsl:when>
            <xsl:when test="contains($curPid, 'low')">Niederösterreich</xsl:when>
            
            
        </xsl:choose>
    </xsl:variable>
    
    <!-- *****************
        Modes used in this stylesheet 
    ***************-->
    <xsl:variable name="emptyMode"/>
    <xsl:variable name="defaultMode">
        <xsl:text>view:object:default</xsl:text>
    </xsl:variable>
    <xsl:variable name="metadataMode">
        <xsl:text>view:object:metadata</xsl:text>
    </xsl:variable>
    <xsl:variable name="imagesMode">
        <xsl:text>view:object:images</xsl:text>
    </xsl:variable>
    <xsl:variable name="mapMode">
        <xsl:text>view:object:objMap</xsl:text>
    </xsl:variable>
    <xsl:variable name="victimsMode">
        <xsl:text>view:object:victims</xsl:text>
    </xsl:variable>
    <xsl:variable name="printMode">
        <xsl:text>view:object:print</xsl:text>
    </xsl:variable>
    <xsl:variable name="didacticsMode">
        <xsl:text>view:object:didactics</xsl:text>
    </xsl:variable>
    
    <xsl:variable name="curOsmNmbr">
        <xsl:value-of select="//t:idno[@type='osm-number']/text()"/>
    </xsl:variable>
    <xsl:variable name="nomLink">
        <xsl:text>https://nominatim.openstreetmap.org/ui/details.html?osmtype=</xsl:text><xsl:value-of select="upper-case(substring($curOsmNmbr,0,2))"/><xsl:text>&amp;osmid=</xsl:text><xsl:value-of select="substring-after($curOsmNmbr, ' ')"/>
    </xsl:variable>
    
    <xsl:template name="content">
        
        <section class="content container derlaObject">
            <script>
                gamsJs.dom.assignActiveClass("navbardrop");
            </script>
            
            <div class="row">
            <article class="col-md">
                <br class="d-none d-sd-block">
                    <xsl:text> </xsl:text>
                </br>
                <!--<ol class="breadcrumb bg-white" style="padding-left:0;">
                    <li class="breadcrumb-item"><a href="/context:derla/sdef:Context/get?mode=&amp;locale={$locale}">DERLA</a></li>
                    <li class="breadcrumb-item"><a href="/archive/objects/query:derla.allderlapoints/methods/sdef:Query/get?locale={$locale}&amp;mode=map">Orte der Erinnerung</a></li>
                    <li class="breadcrumb-item"><a href="/archive/objects/o:derla.{$curStateAbbr}/methods/sdef:GML/get?locale={$locale}"><xsl:value-of select="$curState"/></a></li>
                    <li class="breadcrumb-item active" aria-current="page">Ort</li>
                </ol>-->
                <div class="row">
                    <div class="col-md-12 derlaBorderLeft">
                        
                        <h1><xsl:value-of select="(//t:title)[1]"/></h1>
                        <h2>Erinnerungsort detailiert betrachten | Forschungsdaten downloaden <br class="d-none d-sd-block"><xsl:text> </xsl:text></br> | Personen, Metadaten und Bilder ansehen <i class="fas fa-map-marker-alt fa-1x" style="color:black;"><xsl:text> </xsl:text></i><xsl:text> </xsl:text></h2>
                        <div><xsl:value-of select="$curState"/> - <xsl:value-of select="//t:location/t:address/t:addName"/></div>
                        <a data-balloon-length="large" aria-label="Zum vorherigen Erinnerungsort springen" data-balloon-pos="up" class="btn btn-light" href="/archive/objects/o:derla.{$curStateAbbr}{number(substring($curPid,12,3))-1}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mode}" style="padding: .125em; margin-right: .25em;"><i class="fas fa-angle-left" style="color: grey;"><xsl:text> </xsl:text></i></a>
                        <a style="border:none;" href="/search/gsearch?query={$query}&amp;hitPageSize=10&amp;hitPageStart=1&amp;pid=derla&amp;x2=http%3A%2F%2F{$serverName}{encode-for-uri($gamsdev)}%2Fderla%2Fderla-searchadv.xsl&amp;mode=&amp;dc.typeAsAnd=Erinnerungsort&amp;dc.subjectAsAnd={$curState}" class="btn badge badge-light"><xsl:value-of select="$curState"/></a> / 
                        <xsl:variable name="objType"> 
                            <xsl:value-of select="//t:objectType/t:term"/>
                        </xsl:variable>
                        <xsl:if test="$objType">
                            <a style="border:none;" href="/search/gsearch?query={$query}&amp;hitPageSize=10&amp;hitPageStart=1&amp;pid=derla&amp;x2=http%3A%2F%2F{$serverName}{encode-for-uri($gamsdev)}%2Fderla%2Fderla-searchadv.xsl&amp;mode=&amp;dc.typeAsAnd=Erinnerungsort&amp;dc.subjectAsAnd={$curState}&amp;dc.typeAsAnd={$objType}" class="btn badge badge-light"><xsl:value-of select="$objType"/></a>
                        </xsl:if>
                        <xsl:for-each select="//t:keywords/t:term">
                            <a style="border:none;" href="/search/gsearch?query={$query}&amp;hitPageSize=10&amp;hitPageStart=1&amp;pid=derla&amp;x2=http%3A%2F%2F{$serverName}{encode-for-uri($gamsdev)}%2Fderla%2Fderla-searchadv.xsl&amp;mode=&amp;dc.typeAsAnd=Erinnerungsort&amp;dc.subjectAsAnd={$curState}&amp;dc.typeAsAnd={.}" class="btn badge badge-light"><xsl:value-of select="."/></a>    
                        </xsl:for-each>
                        
                        <xsl:variable name="loc"> 
                            <xsl:value-of select="//t:location/t:desc/t:term"/>
                        </xsl:variable>
                        <xsl:if test="//t:location/t:desc/t:term">
                            <a style="border:none;" href="/search/gsearch?query={$query}&amp;hitPageSize=10&amp;hitPageStart=1&amp;pid=derla&amp;x2=http%3A%2F%2F{$serverName}{encode-for-uri($gamsdev)}%2Fderla%2Fderla-searchadv.xsl&amp;mode=&amp;dc.typeAsAnd=Erinnerungsort&amp;dc.subjectAsAnd={$curState}&amp;dc.typeAsAnd={$loc}" class="btn badge badge-light"><xsl:value-of select="$loc"/></a>
                        </xsl:if> 
                        <a data-balloon-length="large" aria-label="Zum nächsten Erinnerungsort springen" data-balloon-pos="up" class="btn btn-light" href="/archive/objects/o:derla.{$curStateAbbr}{number(substring($curPid,12,3))+1}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mode}" style="padding: .125em; margin-right: .25em;"><i class="fas fa-angle-right" style="color: grey;"><xsl:text> </xsl:text></i></a>
                        
                        
                    </div>
                    
                    <!--<div class="col-md-4" style="padding-top:2em;">
                        
                        <!-\-Only visible in Print-\->
                        <ul class="d-none d-print-block">
                            <li>
                                <a>Bundesland: <xsl:value-of select="$curState"/></a>
                                
                            </li>
                            <li>
                                <a>Adresse: <xsl:value-of select="//t:addName"/></a>
                            </li>
                            <li>
                                <a>Zugänglichkeit: <xsl:value-of select="//t:desc/t:term"/></a>
                            </li>
                            <li>
                                <a>Typ: <xsl:value-of select="//t:objectType/t:term[1]"/></a>
                            </li>
                        </ul>
                        
                        <ul class="d-print-none">
                            
                            <li><a href="/o:derla.{substring($curPid,9,3)}"><xsl:value-of select="$curState"/> - Alle Orte</a></li>
                            <xsl:variable name="xCoord">
                                <xsl:value-of select="//t:geo[1]"/>
                            </xsl:variable>
                            <xsl:variable name="yCoord">
                                <xsl:value-of select="//t:geo[2]"/>
                            </xsl:variable>
                            <li><a target="_blank" href="http://maps.google.de/maps?q={$xCoord},{$yCoord}&amp;ll={$xCoord},{$yCoord}&amp;z=12">Hierhin navigieren</a></li>
                        </ul>
                        
                        <script>
                            function _testPrint(urlParam){
                                let url = new URL(urlParam);
                                url.searchParams.set('mode',"view:object:print");
                                
                                let printWindow = window.open(url.toString());
                                printWindow.print();
                                setTimeout(function(){
                                printWindow.close();
                                }, 1000);
                            }
                            
                        </script>
                        <ul class="d-print-none">
                            <li><a href="/archive/objects/o:derla.{$curStateAbbr}{number(substring($curPid,12,3))-1}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mode}">Vorheriger Erinnerungsort</a></li>
                            <li><a href="/archive/objects/o:derla.{$curStateAbbr}{number(substring($curPid,12,3))+1}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mode}">Nächster Erinnerungsort</a></li>
                            <li><a onclick="print()" href="#">Diese Seite drucken</a></li>
                            <!-\-<li><a onclick="_testPrint(window.location.href)">Gesamtes Material drucken</a></li>-\->
                        </ul>
                        
                    </div>
                    <div class="col-md-1 d-none d-sm-block" style="padding-top:2em;">
                        <a target="_blank" href="/archive/objects/{$curPid}/datastreams/QR/content"><img src="/archive/objects/{$curPid}/datastreams/QR/content"><xsl:text> </xsl:text></img></a>
                    </div>-->
                </div>
                
                    <xsl:if test="$mode=$defaultMode or $mode = $emptyMode">
                        <br class="d-none d-sd-block">
                            <xsl:text> </xsl:text>
                        </br>
                        <div style="border:3px solid lightgrey; padding:0 1em;">
                        ​<div class="row" >
                                    <div class="col-md-6">
                                        <p ><xsl:value-of select="//t:body/t:div[@type='maintext']/t:p"/></p>
                                        
                                        <!--<a style="border:none;" target="_blank" href="/archive/objects/{$curPid}/datastreams/QR/content"><img style="border:1px solid lightgrey" src="/archive/objects/{$curPid}/datastreams/QR/content"><xsl:text> </xsl:text></img></a>-->
                                        <script src="https://cdn.jsdelivr.net/gh/davidshimjs/qrcodejs/qrcode.min.js"><xsl:text> </xsl:text></script>
                                        <div id="qrcode"><xsl:text> </xsl:text></div>
                                        
                                        <script>
                                            const qrcode = new QRCode(document.getElementById('qrcode'), {
                                            text: window.location.href,
                                            width: 128,
                                            height: 128,
                                            colorDark : '#000',
                                            colorLight : '#fff',
                                            correctLevel : QRCode.CorrectLevel.H
                                            });
                                        </script>
                                        
                                        
                                        <xsl:variable name="victims" select="//t:listPerson[@type='victims']"/>
                                        <xsl:choose>
                                            <xsl:when test="$victims/text() != ''">
                                                <h3>Verbundene Personen</h3>
                                                <div>
                                                    <ul >
                                                        <xsl:for-each select="$victims/t:person">
                                                            <li>
                                                                <i class="far fa-user" style="color:black;"><xsl:text> </xsl:text></i><xsl:text> </xsl:text>
                                                                <a>
                                                                    <xsl:attribute name="href">
                                                                        <!--<xsl:attribute name="href">/archive/objects/query:derla.oneperson/methods/sdef:Query/get?params=$1|%3C<xsl:value-of select="encode-for-uri(concat('https://gams.uni-graz.at/o:derla.data#', @xml:id))"/>%3E</xsl:attribute>-->
                                                                        <xsl:choose>
                                                                            <xsl:when test="contains($server, 'glossa')"><xsl:value-of select="replace(./t:persName/@ref, 'gams', 'glossa')"/></xsl:when>
                                                                            <xsl:otherwise><xsl:value-of select="./t:persName/@ref"/></xsl:otherwise>
                                                                        </xsl:choose>
                                                                        
                                                                    </xsl:attribute>
                                                                    <xsl:value-of select="t:persName/t:surname"/>, <xsl:value-of select="t:persName/t:forename"/>
                                                                </a>
                                                            </li>
                                                        </xsl:for-each>
                                                    </ul>
                                                    
                                                </div>
                                            </xsl:when>
                                        </xsl:choose>
                                        <br class="d-none d-sd-block">
                                            <xsl:text> </xsl:text>
                                        </br>
                                        
                                        <br class="d-none d-sd-block">
                                            <xsl:text> </xsl:text>
                                        </br>
                                    </div>
                                    <div class="col-md-6">
                                        <div>
                                            <figure class="figure d-none d-print-block">
                                                <a target="_blank" href="/archive/objects/{$curPid}/datastreams/IMAGE.1/content"><img src="{$server}/archive/objects/{$teipid}/datastreams/IMAGE.1/content" class="figure-img img-fluid rounded" style="max-height:500px"><xsl:text> </xsl:text></img></a>
                                                <!--<figcaption class="figure-caption"><xsl:value-of select="//t:graphic[1]/t:desc"/></figcaption>-->
                                            </figure>
                                            
                                            <!-- splide deps -->
                                            <script src="{$gamsdev}/derla/js/splide.min.js"><xsl:text> </xsl:text></script>
                                            <link rel="stylesheet" href="{$gamsdev}/derla/css/deps/splide-skyblue.min.css"/>
                                            
                                            
                                            
                                            <div id="secondary-slider" class="splide d-print-none">
                                                <div class="splide__track">
                                                    <ul class="splide__list">
                                                        <li class="splide__slide" style="border:1px solid lightgrey; padding: .5em; font-weight: 800; color: black;" onclick="window.location.href = '/archive/objects/{$curPid}/methods/sdef:TEI/get?mode={$imagesMode}&amp;locale={$locale}'">
                                                            <img loading="lazy" alt="Hauptbild des Ortes" src="/archive/objects/{$curPid}/datastreams/IMAGE.1/content"/>
                                                        </li>
                                                        <li class="splide__slide" style="border:1px solid lightgrey; padding: .5em; font-weight: 800; color: black;" onclick="window.location.href = '/archive/objects/{$curPid}/methods/sdef:TEI/get?mode={$imagesMode}&amp;locale={$locale}'">
                                                            <img loading="lazy" alt="Sekundäres Bild des Ortes" src="/archive/objects/{$curPid}/datastreams/IMAGE.2/content"/>
                                                        </li>
                                                    </ul>
                                                </div>
                                            </div>
                                            
                                            
                                            <style>
                                                
                                                .splide li {
                                                    filter: grayscale(150%);
                                                }
                                                
                                                .splide li:hover {
                                                    cursor: pointer;
                                                    background: white;
                                                    filter: grayscale(10%);
                                                }
                                            </style>
                                            <style>
                                                svg {
                                                fill: lightgrey !important;
                                                }
                                                
                                                button.is-active {
                                                background: black !important;
                                                }
                                                
                                                .splide__progress div{
                                                background: whitesmoke !important;
                                                }
                                                
                                                
                                            </style>
                                            
                                            
                                            <script>
                                                document.addEventListener( 'DOMContentLoaded', function () {
                                                new Splide( '#secondary-slider', {
                                                fixedWidth: 300,
                                                fixedHeight:300,
                                                rewind    : true,
                                                gap       : 5,
                                                pagination: false,
                                                cover: true
                                                } ).mount();
                                                } );
                                            </script>
                                            <figcaption class="figure-caption"><xsl:value-of select="//t:graphic[1]/t:desc"/></figcaption>
                                            <br class="d-none d-sd-block">
                                                <xsl:text> </xsl:text>
                                            </br>
                                            <div style="margin: -10px 0" class="d-print-none">
                                                <xsl:if test="$curOsmNmbr/text() != ''">
                                                    <a aria-label="Verbundene OSM Entität anzeigen" style="border:none;" data-balloon-pos="up" href="{$nomLink}" target="_blank"><img src="{$gamsdev}/derla/img/logos/osm_logo.png" style="width:30px"><xsl:text> </xsl:text></img></a>    
                                                </xsl:if>
                                                
                                                <a aria-label="Anfahrt planen via Google Maps" data-balloon-pos="up" style="border:none;margin-right: .15em; color: #343a40; font-size: 1.5em;" target="_blank" href="http://maps.google.de/maps?q={$teiGeogfeat/t:geo[1]},{$teiGeogfeat/t:geo[2]}&amp;ll={$teiGeogfeat/t:geo[1]},{$teiGeogfeat/t:geo[2]}&amp;z=12"><i class="fas fa-route"><xsl:text> </xsl:text></i></a>
                                                <a aria-label="Distant Reading via Voyant Tools" style="border:none; margin-right:.5em" data-balloon-pos="up" href="{$server}/archive/objects/{$curPid}/methods/sdef:Voyant/get" target="_blank"><img src="{$gamsdev}/derla/img/logos/voyant_icon.png" style="width:25px"><xsl:text> </xsl:text></img></a>
                                                
                                                <a aria-label="Zu den TEI Daten" style="border:none;" data-balloon-pos="up" href="{$server}/archive/objects/{$curPid}/datastreams/TEI_SOURCE/content" target="_blank"><img src="https://www.stefanzweig.digital/templates/img/tei_icon.jpg" style="width:25px"><xsl:text> </xsl:text></img></a>
                                                <a aria-label="Zu den RDF Daten {$curState}" style="border:none;" data-balloon-pos="up" href="{$server}/archive/objects/o:derla.{$curStateAbbr}/datastreams/GEO_RDF/content" target="_blank"><img src="https://www.stefanzweig.digital/templates/img/RDF_icon.png" style="width:22px"><xsl:text> </xsl:text></img></a>
                                                <a aria-label="Zur Metadatenasicht des GAMS" style="border:none;" data-balloon-pos="up" href="/archive/objects/{$teipid}/methods/sdef:Object/getDC?" target="_blank">
                                                    <img loading="lazy" class="footer_icons" style="width:20px"
                                                        src="/templates/img/gams_solo.png"
                                                        title="{$gams}" alt="{$gams}"/>
                                                </a>
                                            </div>
                                            
                                            
                                            <xsl:if test="//t:div[@type='inscription']">
                                                <br class="d-none d-sd-block">
                                                    <xsl:text> </xsl:text>
                                                </br>
                                                <h3 style="">Transkription</h3>
                                                <span style="font-size:.9em;"><xsl:value-of select="//t:body/t:div[@type='inscription']/t:p"/></span>
                                                <br class="d-none d-sd-block">
                                                    <xsl:text> </xsl:text>
                                                </br>
                                            </xsl:if>
                                            
                                            
                                            <br class="d-none d-sd-block">
                                                <xsl:text> </xsl:text>
                                            </br>
                                            <h3 class="d-print-none">Weiteres</h3>
                                            <ul class="d-print-none">
                                                
                                                <xsl:if test="$curOsmNmbr/text() != ''">
                                                    <li><a href="{$nomLink}" target="_blank">Verknüpfte Open Street Maps Entität</a></li>    
                                                </xsl:if>
                                                <li><a href="/archive/objects/o:derla.{$curStateAbbr}{number(substring($curPid,12,3))-1}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mode}">Vorheriger Erinnerungsort</a></li>
                                                <li><a href="/archive/objects/o:derla.{$curStateAbbr}{number(substring($curPid,12,3))+1}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mode}">Nächster Erinnerungsort</a></li>
                                                <li><a onclick="print()" href="#">Diese Seite drucken</a></li>
                                                <xsl:variable name="xCoord">
                                                    <xsl:value-of select="$teiGeogfeat/t:geo[1]"/>
                                                </xsl:variable>
                                                <xsl:variable name="yCoord">
                                                    <xsl:value-of select="$teiGeogfeat/t:geo[2]"/>
                                                </xsl:variable>
                                                <li><a target="_blank" href="http://maps.google.de/maps?q={$xCoord},{$yCoord}&amp;ll={$xCoord},{$yCoord}&amp;z=12">Hierhin navigieren</a></li>
                                                
                                                
                                                
                                                
                                                
                                                
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                        </div>    
                        </xsl:if>
                        
                        <xsl:if test="$mode=$metadataMode">
                            <br class="d-none d-sd-block">
                                <xsl:text> </xsl:text>
                            </br>
                            <xsl:apply-templates select="//t:teiHeader" mode="metaData"></xsl:apply-templates>    
                        </xsl:if>
                        
                        <xsl:if test="$mode=$imagesMode">
                            <br class="d-none d-sd-block">
                                <xsl:text> </xsl:text>
                            </br>
                            
                            <xsl:apply-templates select="//t:facsimile" mode="images"></xsl:apply-templates>
                        </xsl:if>
                        
                        <xsl:if test="$mode=$victimsMode">
                            <br class="d-none d-sd-block">
                                <xsl:text> </xsl:text>
                            </br>
                            <div>
                                <br class="d-none d-sd-block">
                                    <xsl:text> </xsl:text>
                                </br>
                                <xsl:variable name="victims" select="//t:listPerson[@type='victims']"/>
                                <xsl:choose>
                                    <xsl:when test="$victims/text() != ''">
                                        <ul style="overflow:hidden; list-style:none; padding:0;">
                                            <xsl:for-each select="$victims/t:person">
                                                <li>
                                                    <xsl:attribute name="style">
                                                        <xsl:choose>
                                                            <xsl:when test="(position() mod 5) = 0">float:left;clear:left;padding:.5em;margin:.25em;border:1px solid grey;</xsl:when>
                                                            <xsl:otherwise>float:left;padding:.5em;margin:.25em;border:1px solid grey;</xsl:otherwise>
                                                        </xsl:choose>
                                                    </xsl:attribute>
                                                    <a>
                                                        <xsl:attribute name="href">
                                                            <!--<xsl:attribute name="href">/archive/objects/query:derla.oneperson/methods/sdef:Query/get?params=$1|%3C<xsl:value-of select="encode-for-uri(concat('https://gams.uni-graz.at/o:derla.data#', @xml:id))"/>%3E</xsl:attribute>-->
                                                            <xsl:choose>
                                                                <xsl:when test="contains($server, 'glossa')"><xsl:value-of select="replace(./t:persName/@ref, 'gams', 'glossa')"/></xsl:when>
                                                                <xsl:otherwise><xsl:value-of select="./t:persName/@ref"/></xsl:otherwise>
                                                            </xsl:choose>
                                                        </xsl:attribute>
                                                        <xsl:value-of select="t:persName/t:surname"/>, <xsl:value-of select="t:persName/t:forename"/>
                                                    </a>
                                                </li>
                                            </xsl:for-each>
                                        </ul>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <span>(Keine Person verbunden)</span>
                                    </xsl:otherwise>
                                </xsl:choose>
                                
                                <br class="d-none d-sd-block">
                                    <xsl:text> </xsl:text>
                                </br>
                            </div>
                            
                        </xsl:if>
                    
                        <xsl:if test="$mode=$mapMode">
                            <br class="d-none d-sd-block">
                                <xsl:text> </xsl:text>
                            </br>
                            <!-- Base css for the mobileExplorer -->
                            <link href="{concat($server, $gamsdev, '/derla/css/mobileExplorer/mobileExplorer.css')}"
                                rel="stylesheet"/>
                            <!-- Custom CSS for the map on a TEI object --> 
                            <link href="{concat($server, $gamsdev, '/derla/css/objectMap.css')}"
                                rel="stylesheet"/>
                            
                            <script>
                                window.derla_mapp = {
                                gui: {
                                tileLayerSrc: "https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",
                                startZoom:25,
                                startView:[<xsl:value-of select="//t:geo[1]"></xsl:value-of>, <xsl:value-of select="//t:geo[2]"/>],
                                },
                                data: {
                                "type": "FeatureCollection",
                                "features": [
                                {
                                "type": "Feature",
                                "properties": {
                                "title": "",
                                "pid": "<xsl:value-of select=".//t:idno[@type='PID']"/>",
                                "layer": "<xsl:value-of select=".//t:keywords/t:term[1]"/>",
                                "filterTerm": " ",
                                "address": "<xsl:value-of select=".//t:address/t:addName"/>",
                                "imageSrc": "/archive/objects/<xsl:value-of select="$curPid"/>/datastreams/IMAGE.1/content",
                                "detailLink": " ",
                                "publicAvailable":" ",
                                "type": "(siehe rechts)"
                                },
                                "geometry": {
                                "type": "Point",
                                "coordinates": [<xsl:value-of select="//t:geo[2]"></xsl:value-of>, <xsl:value-of select="//t:geo[1]"/>]
                                }
                                }
                                ]
                                }
                                }
                            </script>
                            
                            <div id="derla_mapp"><xsl:text> </xsl:text></div>
                            <script type="text/javascript" src="{$gamsdev}/derla/apps/derla_mapp/js/2.64447cb2.chunk.js"><xsl:text> </xsl:text></script>
                            <script type="text/javascript" src="{$gamsdev}/derla/apps/derla_mapp/js/main.bc93747c.chunk.js"><xsl:text> </xsl:text></script>
                            <script type="text/javascript" src="{$gamsdev}/derla/apps/derla_mapp/js/runtime-main.de9be49c.js"><xsl:text> </xsl:text></script>
                            <link rel="stylesheet" type="text/css" href="{$gamsdev}/derla/apps/derla_mapp/css/2.1c6c8e19.chunk.css"><xsl:text> </xsl:text></link>
                            <link rel="stylesheet" type="text/css" href="{$gamsdev}/derla/apps/derla_mapp/css/main.83638e06.chunk.css"><xsl:text> </xsl:text></link>
                            
                            
                            
                            
                            
                        
                        
                        </xsl:if>
                    
                        <xsl:if test="$mode=$printMode">
                            <br class="d-none d-sd-block">
                                <xsl:text> </xsl:text>
                            </br>
                            <div class="row" style="height:75vh; overvlow:hidden;">
                                <div class="col-md-6">
                                    <p style="padding:1em; border: 1px solid grey"><xsl:value-of select="//t:body/t:div[@type='maintext']/t:p"/></p>
                                </div>
                                <div class="col-md-6">
                                    <div style="padding:1em; border: 1px solid grey">
                                        <figure class="figure">
                                            <img src="{$server}/archive/objects/{$teipid}/datastreams/IMAGE.1/content" class="figure-img img-fluid rounded" style="max-height:500px"><xsl:text> </xsl:text></img>
                                            <figcaption class="figure-caption"><xsl:value-of select="//t:graphic[1]/t:desc"/></figcaption>
                                        </figure>
                                        <!--<h3 style="">Transkription</h3>-->
                                        <xsl:variable name="transcr">
                                            <xsl:value-of select="//t:body/t:div[@type='inscription']/t:p/text()"/>
                                        </xsl:variable>
                                        <xsl:if test="$transcr != ''">
                                            <h3 style="">Transkription</h3>
                                            <i><p style="font-size:.9em">"<xsl:value-of select="$transcr"/>"</p></i>
                                        </xsl:if>
                                        <!--<i><p style="font-size:.9em">"<xsl:value-of select="//t:body/t:div[@type='inscription']/t:p"/>"</p></i>-->
                                    </div>
                                </div>
                            </div>
                            <br class="d-none d-sd-block">
                                <xsl:text> </xsl:text>
                            </br>
                            <br class="d-none d-sd-block">
                                <xsl:text> </xsl:text>
                            </br>
                            
                            <!-- Base css for the mobileExplorer -->
                            <link href="{concat($server, $gamsdev, '/derla/css/mobileExplorer/mobileExplorer.css')}"
                                rel="stylesheet"/>
                            <!-- Custom CSS for the map on a TEI object --> 
                            <link href="{concat($server, $gamsdev, '/derla/css/objectMap.css')}"
                                rel="stylesheet"/>
                            
                            <script>
                                // case of directly providing configuration via a js object.
                                window.derla_mapp = {
                                gui: {
                                tileLayerSrc: "https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",
                                startZoom:6,
                                startView:[<xsl:value-of select="//t:geo[1]"></xsl:value-of>, <xsl:value-of select="//t:geo[2]"/>],
                                },
                                data: {
                                "type": "FeatureCollection",
                                "features": [
                                
                                {
                                "type": "Feature",
                                "properties": {
                                "title": "<xsl:value-of select="//t:title"/>",
                                "pid": "<xsl:value-of select=".//t:idno[@type='PID']"/>",
                                "layer": "<xsl:value-of select=".//t:keywords/t:term[1]"/>",
                                "filterTerm": " ",
                                "address": "<xsl:value-of select=".//t:address/t:addName"/>",
                                "imageSrc": "/archive/objects/<xsl:value-of select="$curPid"/>/datastreams/IMAGE.1/content",
                                "detailLink": " ",
                                "publicAvailable":" ",
                                "type": "(siehe rechts)"
                                },
                                "geometry": {
                                "type": "Point",
                                "coordinates": [<xsl:value-of select="//t:geo[2]"></xsl:value-of>, <xsl:value-of select="//t:geo[1]"/>]
                                }
                                }
                                ]
                                  }
                                }
                            </script>
                            
                            
                            <div id="derla_mapp"><xsl:text> </xsl:text></div> 
                            <script type="text/javascript" src="{$gamsdev}/derla/apps/derla_mapp/js/2.5a431163.chunk.js"><xsl:text> </xsl:text></script>
                            <script type="text/javascript" src="{$gamsdev}/derla/apps/derla_mapp/js/main.b3828426.chunk.js"><xsl:text> </xsl:text></script>
                            <script type="text/javascript" src="{$gamsdev}/derla/apps/derla_mapp/js/runtime-main.7780d3d3.js"><xsl:text> </xsl:text></script>
                            <link rel="stylesheet" type="text/css" href="{$gamsdev}/derla/apps/derla_mapp/css/2.1c6c8e19.chunk.css"><xsl:text> </xsl:text></link>
                            <link rel="stylesheet" type="text/css" href="{$gamsdev}/derla/apps/derla_mapp/css/main.a37f7f25.chunk.css"><xsl:text> </xsl:text></link>
                            
                            <xsl:apply-templates select="//t:teiHeader" mode="metaData"></xsl:apply-templates>
                            <br class="d-none d-sd-block">
                                <xsl:text> </xsl:text>
                            </br>
                            <xsl:apply-templates select="//t:facsimile" mode="images"></xsl:apply-templates>
                            <br class="d-none d-sd-block">
                                <xsl:text> </xsl:text>
                            </br>
                            <div>
                                <br class="d-none d-sd-block">
                                    <xsl:text> </xsl:text>
                                </br>
                                <ul style="overflow:hidden; list-style:none; padding:0;">
                                    <xsl:for-each select="//t:listPerson[@type='victims']/t:person">
                                        <li>
                                            <xsl:attribute name="style">
                                                <xsl:choose>
                                                    <xsl:when test="(position() mod 5) = 0">float:left;clear:left;padding:.5em;margin:.25em;border:1px solid grey;</xsl:when>
                                                    <xsl:otherwise>float:left;padding:.5em;margin:.25em;border:1px solid grey;</xsl:otherwise>
                                                </xsl:choose>
                                            </xsl:attribute>
                                            
                                            <i class="far fa-user" style="color:black;"><xsl:text> </xsl:text></i><xsl:text> </xsl:text>
                                            <a>
                                                <xsl:attribute name="href">
                                                    <xsl:attribute name="href">/archive/objects/query:derla.oneperson/methods/sdef:Query/get?params=$1|%3C<xsl:value-of select="encode-for-uri(concat('https://gams.uni-graz.at/o:derla.data#', @xml:id))"/>%3E</xsl:attribute>
                                                </xsl:attribute>
                                                <xsl:value-of select="t:persName/t:surname"/>, <xsl:value-of select="t:persName/t:forename"/>
                                            </a>
                                        </li>
                                    </xsl:for-each>
                                </ul>
                                
                            </div>
                        </xsl:if>
                </article>
                <article class="col-md-2 d-print-none" style="font-size:.75em">
                
                    <div class="sticky-top" style="padding-top: 24em;margin-top:-5.5em">
                        <br class="d-none d-sd-block">
                            <xsl:text> </xsl:text>
                        </br>
                                <a style="margin-right:.5em" class="btn {if ($mode=$defaultMode or $mode='') then ('btn-dark text-light') else ('btn-outline-light')}" href="/archive/objects/{$curPid}/methods/sdef:TEI/get?mode={$defaultMode}&amp;locale={$locale}"><i class="fas fa-th"><xsl:text> </xsl:text></i> Überblick</a>
                        
                        <!-- Only display button to the right if material is available -->
                        <xsl:variable select="//t:desc[@type='mediation']" name="mediationDiv"/>
                        <xsl:if test="$mediationDiv">
                            <a data-balloon-length="large" aria-label="Weiterführende Informationen zum Erinnerungszeichen und zum Erinnerungsort" data-balloon-pos="up" style="margin-right:.5em; margin-top:.5em" class="btn {if ($mode=$mapMode) then ('btn-dark text-light') else ('btn-outline-light')}" href="{$mediationDiv/t:ref/@target}"><i class="fas fa-angle-double-right"><xsl:text> </xsl:text></i> Mehr erfahren</a>                            
                        </xsl:if>
                        
                        <a style="margin-right:.5em; margin-top:.5em" class="btn {if ($mode=$imagesMode) then ('btn-dark text-light') else ('btn-outline-light')}" href="/archive/objects/{$curPid}/methods/sdef:TEI/get?mode={$imagesMode}&amp;locale={$locale}"><i class="fas fa-images"><xsl:text> </xsl:text></i> Bilder</a>
                        <a data-balloon-length="large" aria-label="Weiterführende Informationen zum Erinnerungszeichen und Erinnerungsorten für: {$curState}" data-balloon-pos="up" style="margin-right:.5em; margin-top:.5em" class="btn btn-outline-light" href="/archive/objects/o:derla.fix{$curStateAbbr}/methods/sdef:TEI/get?locale={$locale}"><i class="fas fa-chalkboard-teacher"><xsl:text> </xsl:text></i> Vermittlungsangebot</a>
                        <a style="margin-right:.5em; margin-top:.5em" class="btn {if ($mode=$victimsMode) then ('btn-dark text-light') else ('btn-outline-light')}" href="/archive/objects/{$curPid}/methods/sdef:TEI/get?mode={$victimsMode}&amp;locale={$locale}"><i class="fas fa-user-friends"><xsl:text> </xsl:text></i> Personen</a>
                        <a style="margin-right:.5em; margin-top:.5em" class="btn {if ($mode=$mapMode) then ('btn-dark text-light') else ('btn-outline-light')}" href="/archive/objects/{$curPid}/methods/sdef:TEI/get?mode={$mapMode}&amp;locale={$locale}"><i class="far fa-map"><xsl:text> </xsl:text></i> Karte</a>
                        <a style="margin-right:.5em; margin-top:.5em" class="btn {if ($mode=$metadataMode) then ('btn-dark text-light') else ('btn-outline-light')}" href="/archive/objects/{$curPid}/methods/sdef:TEI/get?mode={$metadataMode}&amp;locale={$locale}"><i class="fas fa-database"><xsl:text> </xsl:text></i> Forschungsdaten</a>
                        <a style="margin-right:.5em; margin-top:.5em" class="btn btn-outline-light" target="_blank" href="/archive/objects/{$teipid}/methods/sdef:Object/getDC?"><i class="fas fa-table"><xsl:text> </xsl:text></i> Metadatenansicht</a>
                        
                        <br class="d-none d-sd-block">
                            <xsl:text> </xsl:text>
                        </br>
                        
                        <br style="margin:0; padding:0;"><xsl:text> </xsl:text></br>
                        
                        
                        <br class="d-none d-sd-block">
                            <xsl:text> </xsl:text>
                        </br>
                        <!--<h3><a style="border:none" href="http://glossa.uni-graz.at/o:derla.fixvor0">Fixiertes Vermittlungsangebot</a></h3>-->
                        
                        <!--<a style="margin-right:.5em; margin-top:.5em;" class="btn" href="/archive/objects/{$curPid}/datastreams/MEHR_ERFAHREN/content">Mehr erfahren</a>
                        <a style="margin-right:.5em; margin-top:.5em;" class="btn" href="/archive/objects/{$curPid}/datastreams/MEHR_MACHEN/content">Mehr machen</a>
                        <br class="d-none d-sd-block">
                            <xsl:text> </xsl:text>
                        </br>
                        <br class="d-none d-sd-block">
                            <xsl:text> </xsl:text>
                        </br>-->
                        <!--<ol class="breadcrumb">
                            <li class="breadcrumb-item"><a style="border:none" href="/context:derla/sdef:Context/get?mode=&amp;locale={$locale}">DERLA</a></li>
                            <li class="breadcrumb-item"><a style="border:none" href="/archive/objects/query:derla.allderlapoints/methods/sdef:Query/get?locale={$locale}de&amp;mode=map">Orte der Erinnerung</a></li>
                            <li class="breadcrumb-item"><a style="border:none" href="/archive/objects/o:derla.{$curStateAbbr}/methods/sdef:GML/get?locale={$locale}"><xsl:value-of select="$curState"/></a></li>
                            <li class="breadcrumb-item active" aria-current="page"><xsl:value-of select="(//t:title)[1]"/></li>
                        </ol>-->
                        </div>    
            </article>
            
        </div>
        </section>
    </xsl:template>
    
    <doc>
        For ignoring the context value
    </doc>
    <xsl:template match="t:ab">
        
    </xsl:template>
    
    <xsl:template match="t:div">
        <xsl:param name="heading">
            <xsl:value-of select="./@type"/>
        </xsl:param>
        <div>
            <xsl:if test="$heading = 'inscription'">
                <h2>Transkription der Inschrift</h2>
            </xsl:if>
            <xsl:if test="$heading = 'maintext'">
                <h2 style="">Beschreibung</h2>
            </xsl:if>
            
            <div><xsl:apply-templates></xsl:apply-templates></div>
            <br><xsl:text> </xsl:text></br>
        </div>
    </xsl:template>

    <xsl:template match="t:p">
        <p class="bg-light" style="text-align:justify; padding:1em; box-shadow:1px 1px 3px 1px lightgrey"><xsl:apply-templates></xsl:apply-templates></p>
    </xsl:template>
    
    <xsl:template match="t:facsimile/t:graphic" mode="images">
        <figure>
            ​<figure class="figure">
                <a target="_blank" href="/archive/objects/{$curPid}/datastreams/{@xml:id}/content"><img src="{$server}/archive/objects/{$teipid}/datastreams/{@xml:id}/content" class="figure-img img-fluid rounded"><xsl:text> </xsl:text></img></a>
                <figcaption class="figure-caption"><xsl:value-of select="t:desc"/></figcaption>
            </figure>
        </figure>
    </xsl:template>
    
    <xsl:template match="t:teiHeader" mode="metaData">
        
        
        <!--<a aria-label="Zu den TEI Daten" data-balloon-pos="up" href="{$server}/archive/objects/{$curPid}/datastreams/TEI_SOURCE/content" target="_blank"><img src="https://www.stefanzweig.digital/templates/img/tei_icon.jpg" style="width:40px"><xsl:text> </xsl:text></img></a>
        <a aria-label="Zu den RDF Daten {$curState}" data-balloon-pos="up" href="{$server}/archive/objects/o:derla.{$curStateAbbr}/datastreams/GEO_RDF/content" target="_blank"><img src="https://www.stefanzweig.digital/templates/img/RDF_icon.png" style="width:40px"><xsl:text> </xsl:text></img></a>
        <br><xsl:text> </xsl:text></br>-->
        
        <table class="table table-hover table-bordered table-sm">
            <thead>
                <tr>
                    <th>Erinnerungsort</th>
                    <th><xsl:text> </xsl:text></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td class="color">Titel</td>
                    <td>
                        <xsl:value-of select="(//t:title)[1]"/>
                    </td>
                </tr>
                <tr>
                    <td class="color">Koordinaten (x y)</td>
                    <td><xsl:value-of select="//t:geo"/></td>
                </tr>
                <tr>
                    <td class="color">Verknüpfte OSM - Nummer</td>
                    <td><a href="{$nomLink}" target="_blank"><xsl:value-of select="//t:idno[@type='osm-number']"/></a></td>
                </tr>
                <tr>
                    <td class="color">Verbundene Adresse</td>
                    <td><xsl:value-of select="//t:address/t:addName"/></td>
                </tr>
                <tr>
                    <td class="color">Zugänglichkeit</td>
                    <td><a href="{//t:location/t:desc/t:term/@ref}"><xsl:value-of select="//t:location/t:desc/t:term"/></a></td>
                </tr>
            </tbody>
        </table>
        
        <table class="table table-hover table-bordered table-sm">
            <thead>
                <tr>
                    <th>Erinnerungszeichen</th>
                    <th><xsl:text> </xsl:text></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td class="color">Typ</td>
                    <xsl:variable name="term" select="//t:objectType/t:term"/>
                    <td><a target="_blank" href="{$term/@ref}"><xsl:value-of select="$term"/></a></td>
                </tr>
                <tr>
                    <td class="color">Datum der Denkmalsetzung</td>
                    <td><xsl:value-of select="//t:geogFeat/t:date"/></td>
                </tr>
                
                <tr>
                    <td class="color">Initiator / Stifter</td>
                    <td><xsl:value-of select="//t:person[@role='initiator']"/></td>
                </tr>
                <tr>
                    <td class="color">KünstlerIn</td>
                    <td><xsl:value-of select="//t:person[@role='artist']"/></td>
                </tr>
            </tbody>
        </table>
        
        <h3>Klassifizierung</h3>
        <xsl:for-each select="//t:keywords/t:term">
            <a style="border:none;" href="{@ref}" class="badge badge-light"><xsl:value-of select="."/></a>    
        </xsl:for-each>
        
        
        
        
    </xsl:template>
   
    <xsl:template match="t:person" mode="victims"> 
        <tr>
            <th><xsl:value-of select="./t:persName/t:surname"/>, <xsl:value-of select="./t:persName/t:forename"/></th>
            <td><xsl:value-of select="./t:listEvent/t:desc"/></td>
        </tr>
        
    </xsl:template>
   
</xsl:stylesheet>
