c3d2-web/xsl/datenspuren/xhtml5.xsl

307 lines
11 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
exclude-result-prefixes="xsl date dc itunes">
<xsl:include href="../common.xsl" />
<xsl:output method="xml"
version="1.0"
encoding="utf-8"
indent="yes"/>
<xsl:strip-space elements="p ul td"/>
<xsl:template match="/page">
<xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html&gt;
</xsl:text>
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="/page/@pagetitle">
<xsl:value-of select="/page/@pagetitle"/>
</xsl:when>
<xsl:when test="/page/@title">
<xsl:value-of select="/page/@title"/>
</xsl:when>
<xsl:otherwise>
<xsl:comment><xsl:text> missing title </xsl:text></xsl:comment>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<html lang="de" xml:lang="de" dir="ltr">
<xsl:call-template name="htmlhead">
<xsl:with-param name="title" select="$title"/>
</xsl:call-template>
<body>
<nav data-stellar-ratio="0">
<ul>
<li>
<a href="index.html">Start</a>
</li>
<li>
<a href="about.html">Über</a>
</li>
<li>
<a href="location.html">Ort</a>
</li>
<li>
<a href="help.html">Helfen</a>
</li>
<li>
<a href="fahrplan.html">Fahrplan</a>
</li>
<li>
<a href="mitschnitte.html">Mitschnitte</a>
</li>
<!-- <li> -->
<!-- <a href="mitschnitte.html">Mitschnitte</a> -->
<!-- </li> -->
</ul>
</nav>
<div id="head1" data-stellar-ratio="0.125"><xsl:text> </xsl:text></div>
<div id="head2" data-stellar-ratio="0.20"><xsl:text> </xsl:text></div>
<div id="head3" data-stellar-ratio="0.75"><xsl:text> </xsl:text></div>
<!--aside>
<ul>
<li>2-tägiges Symposium zu Datenschutz und Privatsphäre</li>
<li>Technische Sammlungen Dresden, Eintritt frei</li>
<li>Sa 24. &amp; So 25. Oktober 2015</li>
</ul>
</aside-->
<article>
<xsl:apply-templates/>
</article>
<footer>
<ul id="oldds">
<li><a href="../2014/">2014</a></li>
<li><a href="../2013/">2013</a></li>
<li><a href="../2012/">2012</a></li>
<li><a href="../2011/">2011</a></li>
<li><a href="../2010/">2010</a></li>
<li><a href="../2009/">2009</a></li>
<li><a href="../2008/">2008</a></li>
<li><a href="../2007/">2007</a></li>
<li><a href="../2006/">2006</a></li>
<li><a href="../2005/">2005</a></li>
<li><a href="../2004/">2004</a></li>
</ul>
<div>
<!--a href="licenses.html">Lizenzen</a> | -->
<a href="http://www.c3d2.de/">Chaos Computer Club Dresden</a> |
<a href="mailto:mail@c3d2.de" title="eMail webmaster">mail@c3d2.de</a>
</div>
</footer>
<script type="application/javascript"
src="script/jquery-2.1.4.min.js">
<xsl:text> </xsl:text>
</script>
<script type="application/javascript"
src="script/jquery.stellar.min.js">
<xsl:text> </xsl:text>
</script>
<script type="application/javascript">
$.stellar({
positionProperty: 'transform',
hideDistantElements: false,
responsive: true
});
</script>
<xsl:if test="/page/@title = 'Ort'">
<script type="application/javascript"
src="script/wgs84util.js">
<xsl:text> </xsl:text>
</script>
<script type="application/javascript"
src="script/pois.js">
<xsl:text> </xsl:text>
</script>
</xsl:if>
</body>
</html>
</xsl:template>
<!-- Parse HTML schedule generated by Frab[tm] -->
<xsl:template match="include-frab-schedule">
<xsl:variable name="title" select="@title"/>
<xsl:for-each select="document(@src)/day">
<h3 class="scheduletitle">
<xsl:choose>
<xsl:when test="$title">
<xsl:value-of select="$title"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@title"/>
</xsl:otherwise>
</xsl:choose>
</h3>
<table class="schedule">
<xsl:copy-of select="table/thead"/>
<xsl:copy-of select="table/tbody"/>
</table>
</xsl:for-each>
</xsl:template>
<xsl:template name="htmlhead">
<xsl:param name="title"/>
<head>
<meta charset="utf-8" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name="description" content="Symposium Datenspuren - Crypto Is Not A Crime, 2015, Technische Sammlungen Dresden, veranstaltet vom Chaos Computer Club Dresden" />
<meta name="keywords" content="Symposium Datenspuren,c3d2,Chaos Computer Club,CCC,Dresden,Datenschutz,Privatsphäre,IPv6,Cloud,ePostbrief,de-Mail,Anonymität,informationelle Selbstbestimmung,Überwachung,Data Mining,ETSI,RFID,Mautsystem,Remailer,TCPA,TCG,Bundestrojaner,Vorratsdatenspeicherung,Biometrie" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<meta name="robots" content="index,follow" />
<meta name="language" content="German" />
<link rel="stylesheet" type="text/css" href="style/style.css" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="news-rss.xml" />
<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="news-atom.xml" />
<title>
<xsl:text>Datenspuren 2015 — </xsl:text>
<xsl:value-of select="$title" />
</title>
<!--script type="application/javascript" src="script/jquery-1.9.1.min.js" defer="defer">
<xsl:text> </xsl:text>
</script>
<script type="application/javascript" src="script/play-resources.js" defer="defer">
<xsl:text> </xsl:text>
</script-->
</head>
</xsl:template>
<xsl:template match="news-list">
<xsl:variable name="prefix" select="@prefix"/>
<xsl:variable name="details" select="@details"/>
<xsl:for-each select="document('../../news.xml')/page/news/newsfile">
<xsl:sort select="date:seconds(document(concat('../../', .))/item/@date)" data-type="number" order="descending" />
<xsl:variable name="newsfile" select="."/>
<xsl:for-each select="document(concat('../../', $newsfile))/item">
<xsl:if test="((string-length($prefix) = 0) or starts-with($newsfile, concat('content/news/', $prefix))) and (($details != 'resources-only') or (count(resource) &gt; 0))">
<h3 class="summary">
<date>
<xsl:call-template name="get-short-datestring">
<xsl:with-param name="date" select="@date"/>
</xsl:call-template>
</date>
<a href="https://www.c3d2.de/{substring-before(substring-after($newsfile, 'content/'), '.xml')}.html" class="url">
<xsl:value-of select="@title"/>
</a>
</h3>
<!-- Diese Elemente entsprechen Block.class aus xsd/c3d2web.xsd -->
<!--xsl:apply-templates select=".//*[name() = 'dl' or name() = 'p' or name() = 'ul' or name() = 'ol' or name() = 'pre']"/-->
<xsl:apply-templates/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
<xsl:template match="item/image">
<!-- Nix Bilder in den Datenspuren-News -->
</xsl:template>
<xsl:template match="resource">
<section class="resource">
<xsl:if test="@preview">
<xsl:attribute name="data-preview">
<xsl:value-of select="@preview"/>
</xsl:attribute>
</xsl:if>
<h4>
<xsl:attribute name="id">
<xsl:call-template name="string-to-lower">
<xsl:with-param name="string" select="@title"/>
<xsl:with-param name="forspace">-</xsl:with-param>
</xsl:call-template>
</xsl:attribute>
<xsl:choose>
<xsl:when test="@details-link">
<a href="{@details-link}">
<xsl:value-of select="@title"/>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@title"/>
</xsl:otherwise>
</xsl:choose>
</h4>
<xsl:if test="@poster">
<div class="preview">
<img src="{@poster}" title="{@title}"/>
</div>
</xsl:if>
<ul class="links">
<li><xsl:call-template name="link-resource"/></li>
<xsl:for-each select="alternative">
<li><xsl:call-template name="link-resource"/></li>
</xsl:for-each>
<xsl:if test="@feedback-link">
<li class="feedback"><a href="{@feedback-link}">Feedback</a></li>
</xsl:if>
</ul>
</section>
</xsl:template>
<xsl:template name="link-resource">
<a href="{@url}" type="{@type}">
<xsl:call-template name="mime-for-human-short">
<xsl:with-param name="mime" select="@type"/>
</xsl:call-template>
</a>
<span class="size">
<xsl:call-template name="format-filesize">
<xsl:with-param name="value" select="@size"/>
</xsl:call-template>
</span>
</xsl:template>
<xsl:template match="include-feeds">
<xsl:variable name="feeds" select="."/>
<xsl:for-each select="feed[1]">
<xsl:for-each select="document(.)/rss/channel/item">
<xsl:variable name="identifier" select="dc:identifier"/>
<xsl:variable name="title" select="substring-after(title, ': ')"/>
<xsl:variable name="preview"
select="concat('https://static.media.ccc.de/media/events/datenspuren/2015/',
substring-before(substring-after(link ,'/datenspuren15-'), '-'),
'-sd_preview.jpg')"/>
<section class="resource">
<h4><xsl:value-of select="$title"/></h4>
<div class="preview">
<img src="{$preview}" title="$title"/>
</div>
<ul class="links">
<xsl:for-each select="$feeds/feed">
<xsl:for-each select="document(.)/rss/channel/item[dc:identifier = $identifier]/enclosure">
<li>
<a href="{@url}" type="{@type}">
<xsl:call-template name="mime-for-human-short">
<xsl:with-param name="mime" select="@type"/>
</xsl:call-template>
</a>
</li>
</xsl:for-each>
</xsl:for-each>
<li>
<span class="size">
<xsl:value-of select="itunes:duration"/>
</span>
</li>
</ul>
</section>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>