<?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: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: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:choose>
    </xsl:variable>
    
    <!-- *****************
        Modes used in this stylesheet 
    ***************-->
    <xsl:variable name="overviewMode">
        <xsl:text>overview</xsl:text>
    </xsl:variable>
    <xsl:variable name="mehrMachenMode">
        <xsl:text>mehrMachen</xsl:text>
    </xsl:variable>
    <xsl:variable name="mehrErfahrenMode">
        <xsl:text></xsl:text>
    </xsl:variable>
    <xsl:variable name="quellenMode">
        <xsl:text>quellenText</xsl:text>
    </xsl:variable>
    <xsl:variable name="imageMode">
        <xsl:text>imageMode</xsl:text>
    </xsl:variable>
    <xsl:variable name="materialMode">
        <xsl:text>materialMode</xsl:text>
    </xsl:variable>
    <xsl:variable name="metaDataMode">
        <xsl:text>metaDataMode</xsl:text>
    </xsl:variable>
    
    <xsl:variable name="emptyMode"/>
    <xsl:variable name="linkedPlacePid">
        <xsl:value-of select="substring-after(//t:settingDesc/t:place/t:idno[@type='URI'], 'gams.uni-graz.at/')"/>
    </xsl:variable>
    
    <xsl:template name="content">
        
        <section class="content container derlaObject derlaFixed">
            <script>
                gamsJs.dom.assignActiveClass("navDidPortal");
            </script>
            <link rel="stylesheet" href="{$projectCssPath}/derla-tei-fixed.css"/>
        
            
            <div class="row">
            <article class="col-md">
                <br class="d-none d-sd-block">
                    <xsl:text> </xsl:text>
                </br>
                <div class="row">
                    <div class="col-md-6 derlaBorderLeft">
                        <h1>Vermittlungsangebot</h1>
                        <h2><a href="/archive/objects/{$linkedPlacePid}/methods/sdef:TEI/get">Zu: <xsl:value-of select="document(concat('/archive/objects/',$linkedPlacePid,'/datastreams/TEI_SOURCE/content'))//t:titleStmt/t:title"/></a></h2>
                     
                    </div>
                </div>
                <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:30px"><xsl:text> </xsl:text></img></a>
                <a aria-label="Distant Reading via Voyant Tools" style="border:none" 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:30px"><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:25px"
                        src="/templates/img/gams_solo.png"
                        title="{$gams}" alt="{$gams}"/>
                </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>
                <div class="row">
                    <div class="col-md">
                        <div class="row">
                            <div class="col-md-6">
                                <div class="bg-light" style="padding:.5em">
                                    <div><xsl:value-of select="document(concat('/archive/objects/',$linkedPlacePid,'/datastreams/TEI_SOURCE/content'))//t:location/t:address/t:addName"/></div>
                                    <a target="_blank" href="/archive/objects/{$linkedPlacePid}/datastreams/IMAGE.1/content"><img src="{$server}/archive/objects/{$linkedPlacePid}/datastreams/IMAGE.1/content" class="figure-img img-fluid rounded" style="max-height:150px"><xsl:text> </xsl:text></img></a>
                                    <a target="_blank" href="/archive/objects/{$linkedPlacePid}/datastreams/IMAGE.2/content"><img src="{$server}/archive/objects/{$linkedPlacePid}/datastreams/IMAGE.2/content" class="figure-img img-fluid rounded" style="max-height:150px"><xsl:text> </xsl:text></img></a>    
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div style="padding:.5em" class="bg-light">
                                    <xsl:apply-templates select="//t:div[@type='factbox']"></xsl:apply-templates>
                                </div>
                            </div>
                            
                            
                        </div>
                        <br class="d-none d-sd-block">
                            <xsl:text> </xsl:text>
                        </br>
                        
                        <div class="bg-light" style="padding: .5em;">
                            <div>Verbundene Orte:</div>
                            <!--<img src="{$server}/archive/objects/{$linkedPlacePid}/datastreams/THUMBNAIL/content"><xsl:text> </xsl:text></img> ...
                            <img src="{$server}/archive/objects/{$linkedPlacePid}/datastreams/THUMBNAIL/content"><xsl:text> </xsl:text></img>-->
                            
                            <xsl:for-each select="//t:listPlace//t:place">
                                <xsl:variable name="imgBaseUrl">
                                    <xsl:choose>
                                        <xsl:when test="contains($server, 'glossa')">
                                            <xsl:value-of select="replace(t:idno, 'https://gams.uni-graz.at/', 'https://glossa.uni-graz.at/archive/objects/')"/>
                                        </xsl:when>
                                        <xsl:otherwise>
                                            <xsl:value-of select="replace(t:idno, 'https://gams.uni-graz.at/','https://gams.uni-graz.at/archive/objects/')"/>
                                        </xsl:otherwise>
                                    </xsl:choose>
                                </xsl:variable>
                                <a href="{replace($imgBaseUrl, ' ', '')}/methods/sdef:TEI/get?locale={$locale}" target="_blank"><img src="{replace($imgBaseUrl, ' ', '')}/datastreams/THUMBNAIL/content"><xsl:text> </xsl:text></img></a>
                            </xsl:for-each>
                            <br class="d-none d-sd-block">
                                <xsl:text> </xsl:text>
                            </br>
                            
                            <!--<hr style="background: whitesmoke; padding: .125em"><xsl:text> </xsl:text></hr>-->
                        </div>
                        
                        
                        <br class="d-none d-sd-block">
                            <xsl:text> </xsl:text>
                        </br>
                        
                        
                        <xsl:choose>
                            <xsl:when test="$mode = $mehrErfahrenMode">
                                <h2 id="mehrMachenHeader">Mehr Erfahren</h2>
                                <div class="derla-fixed-content" style="border: 3px solid lightgrey; padding: 1em;"><xsl:apply-templates select="//t:div[@type='mehrErfahren']"></xsl:apply-templates></div>
                            </xsl:when>
                            <xsl:when test="$mode = $mehrMachenMode">
                                <h2 id="mehrErfahrenHeader">Mehr Machen</h2>
                                <style>
                                    .card-columns .card {
                                    transition: background .25s ease-in;
                                    }
                                    
                                    .card-columns .card:hover {
                                    cursor: pointer;
                                    background: orange;
                                    text-decoration: underline;
                                    
                                    }
                                </style>
                                <br class="d-none d-sd-block">
                                    <xsl:text> </xsl:text>
                                </br>
                                <div class="card-columns">
                                    <div class="card" onclick="window.location.href='/archive/objects/{$curPid}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mehrMachenMode}#{//t:head}'">
                                        <div class="card-body">
                                            <h2>Titel des Angebotes</h2>
                                            <br class="d-none d-sd-block">
                                                <xsl:text> </xsl:text>
                                            </br>
                                        </div>
                                        
                                    </div>
                                    <div class="card card" onclick="window.location.href='/archive/objects/{$curPid}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mehrMachenMode}#Arbeitsaufträge'">
                                        <div class="card-body">
                                            <h2>Arbeitsaufträge</h2>
                                            <br class="d-none d-sd-block">
                                                <xsl:text> </xsl:text>
                                            </br>
                                        </div>
                                    </div>
                                    <div id="map_card" class="card card" onclick="window.location.href='/archive/objects/{$curPid}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mehrMachenMode}#Didaktischer Kommentar'">
                                        <div class="card-body">
                                            <h2>Didaktischer Kommentar</h2>
                                            <br class="d-none d-sd-block">
                                                <xsl:text> </xsl:text>
                                            </br>
                                        </div>
                                        
                                    </div>
                                    
                                    <div class="card card" onclick="window.location.href='/archive/objects/{$curPid}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mehrMachenMode}#Vermittlungshinweise'">
                                        <div class="card-body">
                                            <h2>Vermittlungshinweise</h2>
                                            <br class="d-none d-sd-block">
                                                <xsl:text> </xsl:text>
                                            </br>
                                        </div>
                                    </div>
                                    <div class="card card" onclick="window.location.href='/archive/objects/{$curPid}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mehrMachenMode}#Vermittlungsziele'">
                                        <div class="card-body">
                                            <h2>Vermittlungsziele</h2>
                                            <br class="d-none d-sd-block">
                                                <xsl:text> </xsl:text>
                                            </br>
                                        </div>
                                    </div>
                                    
                                    <div class="card" onclick="window.location.href='/archive/objects/{$curPid}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mehrMachenMode}#Literatur'">
                                        <div class="card-body">
                                            <h2>Literatur</h2>
                                            <br class="d-none d-sd-block">
                                                <xsl:text> </xsl:text>
                                            </br>
                                        </div>
                                        
                                    </div>
                                    
                                </div>
                                <br class="d-none d-sd-block">
                                    <xsl:text> </xsl:text>
                                </br>
                                <div class="derla-fixed-content" style="border: 3px solid lightgrey; padding: 1em;"><xsl:apply-templates select="//t:div[@type='mehrMachen']"></xsl:apply-templates></div>
                            </xsl:when>
                            <xsl:when test="$mode=$quellenMode">
                                <h2 id="quellenHeader">Textquellen</h2>
                                
                                <div class="derla-fixed-content" style="border: 3px solid lightgrey; padding: 1em;">
                                    <xsl:if test="//t:div[@type='quellenText']/t:caption[1]/following-sibling::t:p[1]">
                                        <p><xsl:value-of select="//t:div[@type='quellenText']/t:caption[1]/following-sibling::t:p[1]"/><xsl:text> </xsl:text></p>
                                    </xsl:if>
                                    
                                    
                                    
                                    <div style="font-style: italic; color:#6b6b6b; font-family: math;">
                                        <xsl:apply-templates select="//t:div[@type='quellenText']/t:p[1]">
                                    </xsl:apply-templates>
                                        <xsl:text> </xsl:text>
                                    </div>
                                    <hr></hr>
                                    <h3><xsl:value-of select="//t:div[@type='quellenText']/t:caption[2]"/><xsl:text> </xsl:text></h3>
                                    <p><xsl:value-of select="//t:div[@type='quellenText']/t:caption[2]/following-sibling::t:p"/><xsl:text> </xsl:text></p>
                                </div>
                            </xsl:when>
                            <xsl:when test="$mode=$imageMode">
                                <h2 id="bilderHeader">Bildquellen</h2>
                                <div class="derla-fixed-content" style="border: 3px solid lightgrey; padding: 1em;">
                                    
                                    <xsl:apply-templates select="//t:facsimile">
                                        
                                    </xsl:apply-templates><xsl:text> </xsl:text></div>
                            </xsl:when>
                            <xsl:when test="$mode=$materialMode">
                                <h2 id="materialHeader">Videos und Audios</h2>
                                <div class="derla-fixed-content" style="border: 3px solid lightgrey; padding: 1em;">
                                    <xsl:apply-templates select="//t:div[contains(@type, 'video') or contains(@type, 'audio')]"></xsl:apply-templates>
                                    <xsl:text> </xsl:text>
                                    
                                    <ul>
                                    <xsl:for-each select="//t:linkGrp/t:ptr">
                                        <li><a target="_blank" href="{@ref}"><xsl:value-of select="@rendition"/> - <xsl:value-of select="@rend"/></a></li>
                                    </xsl:for-each>
                                    </ul>
                                </div>
                            </xsl:when>
                            <xsl:when test="$mode=$metaDataMode">
                                <h2 id="metadataHeader">Forschungsdaten</h2>
                                <div style="border: 3px solid lightgrey; padding: 1em;"><br class="d-none d-sd-block">
                                    <xsl:text> </xsl:text>
                                </br>
                                <a aria-label="Zu den TEI Daten" data-balloon-pos="up" href="{$server}/archive/objects/{$curPid}/datastreams/TEI_SOURCE/content" target="_blank">Download der Forschungsdaten für das aktuelle Vermittlungsangebot</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>
                                <p>Erklärung bzw. Beschreibung der Forschungsdaten:</p>
                                <ul>
                                    <li><a href="/archive/objects/o:derla.ontology/methods/sdef:Ontology/get?locale={$locale}&amp;mode=ont_overview">Zum Datenmodell</a></li>
                                </ul>
                                
                                <p>Weiterführende Links:</p>
                                <ul>
                                    <li>
                                        <a href="/archive/objects/context:derla/methods/sdef:Context/get?locale={$locale}&amp;mode=openScience">Open Science in DERLA</a>
                                    </li>
                                    <li>
                                        <a href="/archive/objects/o:derla.thesaurus/methods/sdef:SKOS/get?locale={$locale}">Historischer Thesaurus</a>
                                    </li>
                                    <li>
                                        <a href="/archive/objects/o:derla.terms/methods/sdef:SKOS/get?locale={$locale}">Didaktisches Glossar</a>
                                    </li>
                                </ul></div>
                            </xsl:when>
                            <xsl:otherwise>
                                
                                <h2 id="mehrMachenHeader">Überblick</h2>
                                <div class="card-columns">
                                    <div id="map_card" class="card card" onclick="window.location.href='/archive/objects/{$curPid}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mehrMachenMode}#Didaktischer Kommentar'">
                                        <div class="card-body">
                                            <h2>Didaktischer Kommentar</h2>
                                            <br class="d-none d-sd-block">
                                                <xsl:text> </xsl:text>
                                            </br>
                                        </div>
                                        
                                    </div>
                                    <div class="card card" onclick="window.location.href='/archive/objects/{$curPid}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mehrMachenMode}#Arbeitsaufträge'">
                                        <div class="card-body">
                                            <h2>Arbeitsaufträge</h2>
                                            <br class="d-none d-sd-block">
                                                <xsl:text> </xsl:text>
                                            </br>
                                        </div>
                                    </div>
                                    <div class="card card" onclick="window.location.href='/archive/objects/{$curPid}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mehrMachenMode}#Vermittlungshinweise'">
                                        <div class="card-body">
                                            <h2>Vermittlungshinweise</h2>
                                            <br class="d-none d-sd-block">
                                                <xsl:text> </xsl:text>
                                            </br>
                                        </div>
                                    </div>
                                    <div class="card card" onclick="window.location.href='/archive/objects/{$curPid}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mehrMachenMode}#Vermittlungsziele'">
                                        <div class="card-body">
                                            <h2>Vermittlungsziele</h2>
                                            <br class="d-none d-sd-block">
                                                <xsl:text> </xsl:text>
                                            </br>
                                        </div>
                                    </div>
                                    
                                    <div class="card" onclick="window.location.href='/archive/objects/{$curPid}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mehrMachenMode}#Literatur'">
                                        <div class="card-body">
                                            <h2>Literatur</h2>
                                            <br class="d-none d-sd-block">
                                                <xsl:text> </xsl:text>
                                            </br>
                                        </div>
                                        
                                    </div>
                                    <div class="card" onclick="window.location.href='/archive/objects/{$curPid}/methods/sdef:TEI/get?locale={$locale}&amp;mode={$mehrMachenMode}#Literatur'">
                                        <div class="card-body">
                                            <h2>Test</h2>
                                            <br class="d-none d-sd-block">
                                                <xsl:text> </xsl:text>
                                            </br>
                                        </div>
                                        
                                    </div>
                                    <!--<div class="card bg-dark text-light" onclick="window.location.href='{$server}/archive/objects/query:derla.allderlapoints/methods/sdef:Query/get?locale={$locale}&amp;mode=map'">
                                        <div class="card-body">
                                            <div class="card_icon_header">
                                                <h2>Karte der Erinnerung</h2>
                                                <i class="far fa-map fa-2x"><xsl:text> </xsl:text></i>
                                            </div>
                                            <p>Zur interaktiven Zusammenstellung von Erinnerungsorten und Erinnerungszeichen in Österreich gelangen</p>
                                        </div>
                                    </div>
                                    <div class="card bg-dark text-light">
                                        
                                        <div class="card-body">
                                            <div class="card_icon_header">
                                                <h2>Manual</h2>
                                                s     <i class="fas fa-question fa-2x"><xsl:text> </xsl:text></i>
                                            </div>
                                            <p>Hinweise und
                                                Anleitungen zum
                                                Umgang mit dem
                                                Vermittlungsportal
                                                nachschlagen</p>
                                        </div>
                                        
                                    </div>-->
                                </div>
                            </xsl:otherwise>
                        </xsl:choose>
                        
                        
                    </div>
                    <div class="col-md-2">
                        <!--<img style="border:1px solid lightgrey" src="/archive/objects/{$linkedPlacePid}/datastreams/QR/content"><xsl:text> </xsl:text></img>-->
                        
                        <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.origin + '<xsl:value-of select="concat('/', $linkedPlacePid)"/>',
                            width: 128,
                            height: 128,
                            colorDark : '#000',
                            colorLight : '#fff',
                            correctLevel : QRCode.CorrectLevel.H
                            });
                        </script>
                        
                        <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 class="sticky-top" style="padding-top: 6em;margin-top:-6em">
                            <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 class="sticky-top d-print-none" style="padding-top: 6em;margin-top:-6em">
                            <!--<img style="border:3px solid lightgrey" src="/archive/objects/{$linkedPlacePid}/datastreams/QR/content"><xsl:text> </xsl:text></img>-->
                            
                            
                            <!--<a style="margin-right:.5em" class="btn {if ($mode=$overviewMode) then ('btn-dark text-light') else ('btn-outline-light')}" href="/archive/objects/{$curPid}/methods/sdef:TEI/get?mode={$overviewMode}&amp;locale={$locale}">Überblick</a>-->
                            <a data-balloon-length="large" aria-label="Weiterführende Informationen zum Erinnerungszeichen und zum Erinnerungsort" data-balloon-pos="up" style="margin-right:.5em" class="btn {if ($mode=$mehrErfahrenMode) then ('btn-dark text-light') else ('btn-outline-light')}" href="/archive/objects/{$curPid}/methods/sdef:TEI/get?mode={$mehrErfahrenMode}&amp;locale={$locale}#mehrErfahrenHeader">Mehr Erfahren</a>
                            <a data-balloon-length="large" aria-label="Arbeitsaufträge, Vermittlungshinweise, Lehr- und Lernziele, Didaktischer Kommentar und weiterführende Literatur" data-balloon-pos="up" style="margin-right:.5em" class="btn {if ($mode=$mehrMachenMode) then ('btn-dark text-light') else ('btn-outline-light')}" href="/archive/objects/{$curPid}/methods/sdef:TEI/get?mode={$mehrMachenMode}&amp;locale={$locale}#mehrMachen">Mehr Machen</a>
                            <a style="margin-right:.5em" class="btn {if ($mode=$quellenMode) then ('btn-dark text-light') else ('btn-outline-light')}" href="/archive/objects/{$curPid}/methods/sdef:TEI/get?mode={$quellenMode}&amp;locale={$locale}#quellenHeader">Textquellen</a>
                            <a style="margin-right:.5em" class="btn {if ($mode=$imageMode) then ('btn-dark text-light') else ('btn-outline-light')}" href="/archive/objects/{$curPid}/methods/sdef:TEI/get?mode={$imageMode}&amp;locale={$locale}#bilderHeader">Bildquellen</a>
                            <a style="margin-right:.5em" class="btn {if ($mode=$materialMode) then ('btn-dark text-light') else ('btn-outline-light')}" href="/archive/objects/{$curPid}/methods/sdef:TEI/get?mode={$materialMode}&amp;locale={$locale}#materialHeader">Videos und Audios</a>
                            <a style="margin-right:.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}#metadataHeader">Forschungsdaten</a>
                            <a onclick="print()" href="#" class="d-print-none btn btn-outline-light" style="margin-right:.5em">Diese Seite drucken</a>
                            <a onclick="window.scrollTo(0,0)" href="#" class="d-print-none btn btn-outline-light" style="margin-right:.5em">Zurück nach oben</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>
                            
                        </div>
                        </div>
                        <!--<div>
                            <figure class="figure">
                                <a target="_blank" href="/archive/objects/o:derla.vor5/methods/sdef:TEI/get"><img src="{$server}/archive/objects/o:derla.vor5/datastreams/IMAGE.1/content" class="figure-img img-fluid rounded" style="max-height:300px"><xsl:text> </xsl:text></img></a>
                                <figcaption class="figure-caption"><xsl:value-of select="document('/archive/objects/o:derla.vor5/datastreams/TEI_SOURCE/content')//t:titleStmt/t:title"></xsl:value-of></figcaption>
                            </figure>
                        </div>-->
                    </div>
                </div>
                
            </article>
        </div>
        </section>
    </xsl:template>
    
    <xsl:template match="t:div[@type='factbox']/t:p">
        <div><b><xsl:value-of select="replace(@rend, ', Gemeinde EO/EZ', '')"/></b>: <xsl:value-of select="."/></div>
    </xsl:template>
   
    <xsl:template match="t:p">
        <xsl:text> </xsl:text>
        <p><xsl:apply-templates></xsl:apply-templates><xsl:text> </xsl:text></p>
    </xsl:template>
   
   <xsl:template match="t:ref">
       
       <xsl:variable name="target">
           <xsl:choose>
               <xsl:when test="contains($server, 'glossa')">
                   <xsl:value-of select="replace(@target, 'gams', 'glossa')"/>
               </xsl:when>
               <xsl:otherwise>
                   <xsl:value-of select="@target"/>
               </xsl:otherwise>
           </xsl:choose>
       </xsl:variable>
       
       <a href="{$target}" target="_blank"><xsl:value-of select="."/><xsl:text> </xsl:text></a>
   </xsl:template>
    
   <xsl:template match="t:space">
       <!--<div style="margin:1em"><xsl:text> </xsl:text></div>-->
       <span class="derla_space" style="display:block;"><xsl:text> </xsl:text></span>
   </xsl:template>
    
   <xsl:template match="t:lb">
       <span class="derla_linebreak" style="margin: 1em; display:block;"><xsl:text> </xsl:text></span>
   </xsl:template>
    
   <xsl:template match="t:list[@style='unordered']">
       <ul class="list-group"><xsl:apply-templates></xsl:apply-templates></ul>
   </xsl:template>
    
    <xsl:template match="t:list[@style='ordered']">
        <ol class="list-group"><xsl:apply-templates></xsl:apply-templates></ol>
    </xsl:template>
    
   <xsl:template match="t:item">
       <li class="list-group-item"><xsl:apply-templates></xsl:apply-templates></li>
   </xsl:template>
    
   <xsl:template match="t:head">
       <h2 id="{.}"><xsl:value-of select="."/></h2>
   </xsl:template>
    
    <xsl:template match="t:emph[@style='bold']">
        <b><xsl:value-of select="."/></b>
    </xsl:template>
    
    <xsl:template match="t:emph[@style='color']">
        <span style="color:orange;"><xsl:value-of select="."/></span>
    </xsl:template>
    
    <xsl:template match="t:graphic">
        <figure class="figure">
            <figcaption><xsl:value-of select=".//t:desc[1]"/></figcaption>
            <br></br>
            <a target="_blank" href="/archive/objects/{$curPid}/datastreams/{@xml:id}/content">
                <img src="/archive/objects/{$curPid}/datastreams/{@xml:id}/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:desc[@type='title']"/></figcaption>
        </figure>
    </xsl:template>
    
    <xsl:template match="t:ptr">
        <a>IMPLEMENT</a>
    </xsl:template>
    
    <xsl:template match="t:caption">
        <br class="d-none d-sd-block">
            <xsl:text> </xsl:text>
        </br>
        <h2 id="{.}"><xsl:value-of select="."/></h2>
    </xsl:template>
   
</xsl:stylesheet>
