2005-12-18 21:20:23 +01:00
<?xml version="1.0" encoding="utf-8"?>
2006-01-10 22:53:19 +01:00
<xsl:stylesheet version= "1.0"
2006-08-03 16:45:22 +02:00
xmlns="http://www.w3.org/1999/xhtml"
2006-01-10 22:53:19 +01:00
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2006-01-02 20:29:12 +01:00
xmlns:date="http://exslt.org/dates-and-times"
2006-12-08 00:26:47 +01:00
exclude-result-prefixes="xsl">
2006-01-03 14:10:40 +01:00
2006-04-22 13:54:30 +02:00
2006-01-06 19:51:03 +01:00
<xsl:include href= "common.xsl" />
2006-01-03 09:57:12 +01:00
<xsl:include href= "header.xsl" />
<xsl:include href= "footer.xsl" />
2006-10-28 20:33:31 +02:00
<xsl:include href= "calendar.xsl" />
2005-12-21 02:19:46 +01:00
2006-01-10 22:53:19 +01:00
<xsl:output method= "xml"
2010-11-09 22:25:17 +01:00
version="1.0"
2006-01-10 22:53:19 +01:00
encoding="utf-8"
2005-12-18 21:20:23 +01:00
indent="yes"/>
2006-06-06 21:46:00 +02:00
<xsl:template match= "/page" >
2010-09-25 02:54:22 +02:00
<xsl:text disable-output-escaping= "yes" > < !DOCTYPE html>
</xsl:text>
2006-01-12 11:38:33 +01:00
<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>
2006-10-28 20:33:31 +02:00
<xsl:when test= "/page/calendar-summary" >
<xsl:call-template name= "calendar-title" />
</xsl:when>
2006-01-12 11:38:33 +01:00
<xsl:otherwise >
<xsl:comment > <xsl:text > missing title </xsl:text> </xsl:comment>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name= "body" >
<xsl:with-param name= "title" select= "$title" />
</xsl:call-template>
</xsl:template>
<xsl:template match= "/item" >
<xsl:variable name= "title" >
<xsl:value-of select= "/item/@title" />
</xsl:variable>
<xsl:call-template name= "body" >
<xsl:with-param name= "title" select= "$title" />
</xsl:call-template>
</xsl:template>
<xsl:template name= "body" >
<xsl:param name= "title" />
2005-12-18 21:20:23 +01:00
<xsl:element name= "html" >
2010-11-26 16:26:36 +01:00
<xsl:attribute name= "lang" > de</xsl:attribute>
2005-12-18 21:20:23 +01:00
<xsl:attribute name= "xml:lang" > de</xsl:attribute>
2006-01-03 09:57:12 +01:00
<xsl:element name= "head" >
<xsl:call-template name= "header" />
2006-01-12 11:38:33 +01:00
<title >
<xsl:text > < < < /> > Chaos Computer Club Dresden | c3d2 - </xsl:text>
<xsl:value-of select= "$title" />
</title>
2006-01-03 09:57:12 +01:00
</xsl:element>
2005-12-18 21:20:23 +01:00
2006-01-03 09:57:12 +01:00
<xsl:element name= "body" >
2005-12-18 21:20:23 +01:00
<div id= "page" >
2006-01-03 09:57:12 +01:00
<!-- ### Logo ### -->
2005-12-18 21:20:23 +01:00
<xsl:comment >
2006-01-03 09:57:12 +01:00
<xsl:text > ### Logo ### </xsl:text>
2005-12-18 21:20:23 +01:00
</xsl:comment>
<div id= "logo" >
2006-05-26 23:22:44 +02:00
<h1 > < < < /> > Chaos Computer Club Dresden | c3d2</h1>
2005-12-18 21:20:23 +01:00
</div>
2006-01-03 09:57:12 +01:00
2005-12-18 21:20:23 +01:00
<div id= "body" >
2010-11-27 19:00:25 +01:00
<!-- ### Navigation ### -->
<xsl:comment >
<xsl:text > ### Navigation ### </xsl:text>
</xsl:comment>
<nav id= "navigation" >
<xsl:call-template name= "navitems" />
</nav>
2006-06-08 13:20:14 +02:00
2006-01-03 09:57:12 +01:00
2010-11-27 19:00:25 +01:00
<!-- ### News ### -->
<xsl:comment >
<xsl:text > ### News ### </xsl:text>
</xsl:comment>
2006-06-08 01:04:30 +02:00
2010-11-27 19:00:25 +01:00
<aside id= "rsidebar" >
2011-07-14 00:37:41 +02:00
<xsl:call-template name= "adspace" />
2011-07-14 00:29:13 +02:00
2010-11-27 19:00:25 +01:00
<xsl:call-template name= "calendar-events" />
<xsl:call-template name= "chaosupdates" />
</aside>
2006-01-03 14:10:40 +01:00
2006-01-03 09:57:12 +01:00
<!-- ### Content ### -->
<xsl:comment >
<xsl:text > ### Content ### </xsl:text>
</xsl:comment>
2006-06-06 21:46:00 +02:00
2011-03-09 20:12:39 +01:00
<section id= "content" >
<xsl:if test= "event" >
<xsl:attribute name= "class" > vevent</xsl:attribute>
</xsl:if>
<h2 >
<xsl:if test= "name(.) = 'item'" >
<xsl:attribute name= "class" > news</xsl:attribute>
</xsl:if>
<xsl:value-of select= "$title" />
</h2>
<!-- Für Seiten, die nur ein Newsitem beinhalten,
Newsmetadaten anzeigen
-->
<xsl:if test= "name(.) = 'item'" >
<xsl:call-template name= "news-meta" />
</xsl:if>
<xsl:apply-templates />
<xsl:call-template name= "include-resources" >
<xsl:with-param name= "include-hidden" > yes</xsl:with-param>
</xsl:call-template>
</section> <!-- id="content" -->
2006-01-03 14:10:40 +01:00
2011-03-09 20:12:39 +01:00
<xsl:call-template name= "footer" />
2006-01-03 09:57:12 +01:00
</div> <!-- id="body" -->
</div> <!-- id="page" -->
</xsl:element> <!-- name="body" -->
</xsl:element> <!-- name="html" -->
2005-12-18 21:20:23 +01:00
</xsl:template>
2006-05-24 02:19:45 +02:00
<xsl:template match= "/page/news" >
2007-03-20 16:10:31 +01:00
<p >
2008-11-26 02:44:18 +01:00
Die Neuigkeiten des C3D2 sind auch
als <a href= "{$baseurl}news-atom.xml" > ATOM</a>
und <a href= "{$baseurl}news-rss.xml" > RSS</a> , die
Veranstaltungen
im <a href= "{$baseurl}ical.ics" > iCal-</a> , <a href= "{$baseurl}xcal.xml" > XCal-</a>
und <a href= "{$baseurl}reminders" > remind-Format</a> abrufbar.
2010-11-26 16:26:36 +01:00
Alle News gibts im <a href= "{$baseurl}news-archiv.html" rel= "archives" > Archiv</a> .
2007-03-20 16:10:31 +01:00
</p>
2006-05-24 02:19:45 +02:00
<xsl:for-each select= "newsfile" >
2006-05-31 19:45:57 +02:00
<xsl:sort select= "date:seconds(document(concat('../', .))/item/@date)" data-type= "number" order= "descending" />
2006-07-27 02:01:48 +02:00
<xsl:if test= "position() <= 10" >
2006-07-25 21:56:13 +02:00
<xsl:variable name= "newsfile" > <xsl:value-of select= "." /> </xsl:variable>
<xsl:variable name= "itemposition" select= "position()" />
<xsl:for-each select= "document(concat('../', $newsfile))/item" >
2006-07-25 23:24:59 +02:00
2010-11-26 16:26:36 +01:00
<article > <div >
2006-07-26 03:36:40 +02:00
<xsl:if test= "event" >
<xsl:attribute name= "class" > vevent</xsl:attribute>
</xsl:if>
2010-11-26 16:26:36 +01:00
<header >
<h3 class= "news summary" >
<a href= "{substring-before(substring-after($newsfile, 'content/'), '.xml')}.html" class= "url" >
<xsl:value-of select= "@title" />
</a>
</h3>
2006-07-25 23:24:59 +02:00
2010-11-26 16:26:36 +01:00
<xsl:call-template name= "news-meta" />
</header>
2006-07-25 23:24:59 +02:00
2010-11-26 16:26:36 +01:00
<div class= "news" >
<xsl:apply-templates >
<xsl:with-param name= "itemposition" select= "$itemposition" />
</xsl:apply-templates>
<xsl:call-template name= "include-resources" >
<xsl:with-param name= "include-hidden" > no</xsl:with-param>
</xsl:call-template>
<xsl:if test= "//addendum or //resource[@hide='yes']" >
<footer > <p class= "more" >
<a href= "{substring-before(substring-after($newsfile, 'content/'), '.xml')}.html" >
Weiterlesen…
</a>
</p> </footer>
</xsl:if>
</div>
<hr class= "news" />
</div> </article>
2006-07-25 21:56:13 +02:00
</xsl:for-each>
</xsl:if>
2005-12-18 21:20:23 +01:00
</xsl:for-each>
</xsl:template>
2006-06-06 21:46:00 +02:00
<xsl:template name= "news-meta" >
<small class= "news_author" >
<xsl:value-of select= "@author" />
</small>
2006-07-27 02:01:48 +02:00
<small class= "news_date" >
@
2010-11-26 18:57:18 +01:00
<time datetime= "{@date}" pubdate= "pubdate" >
2010-11-26 16:26:36 +01:00
<xsl:call-template name= "get-datestring" >
<xsl:with-param name= "date" select= "@date" />
</xsl:call-template>
</time>
2006-07-27 02:01:48 +02:00
</small>
2006-06-06 21:46:00 +02:00
</xsl:template>
2006-07-04 01:28:48 +02:00
<xsl:template name= "include-resources" >
<xsl:param name= "include-hidden" />
<xsl:choose >
<xsl:when test= "$include-hidden='yes'" >
<xsl:if test= "resource" >
<ul >
2007-03-14 21:01:37 +01:00
<xsl:apply-templates select= "resource" mode= "resources-in-news" />
2006-07-04 01:28:48 +02:00
</ul>
</xsl:if>
</xsl:when>
<xsl:otherwise >
<xsl:if test= "resource[not(@hide='yes')]" >
<ul >
2007-03-14 21:01:37 +01:00
<xsl:apply-templates select= "resource[not(@hide='yes')]" mode= "resources-in-news" />
2006-07-04 01:28:48 +02:00
</ul>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
2005-12-18 21:20:23 +01:00
2006-01-03 14:10:40 +01:00
<xsl:template match= "item/image" >
2006-06-06 21:01:44 +02:00
<xsl:param name= "itemposition" />
<img >
2010-11-09 23:14:23 +01:00
<xsl:attribute name= "src" >
<xsl:call-template name= "normalize-path" >
<xsl:with-param name= "path" >
<xsl:choose >
<xsl:when test= "contains(., '://')" >
<xsl:value-of select= "." />
</xsl:when>
<xsl:otherwise >
<xsl:value-of select= "concat($baseurl, 'images/news/', .)" />
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:attribute>
2006-06-06 21:01:44 +02:00
<xsl:attribute name= "title" > <xsl:value-of select= "@title" /> </xsl:attribute>
2007-10-08 22:17:21 +02:00
<xsl:attribute name= "alt" > <xsl:value-of select= "@title" /> </xsl:attribute>
2006-06-06 21:01:44 +02:00
<!-- News - Items haben ihre Bilder abwechselnd rechts und links... -->
<xsl:attribute name= "class" >
<xsl:choose >
2006-06-06 22:40:13 +02:00
<xsl:when test= "$itemposition mod 2 = 1" >
2006-06-06 21:01:44 +02:00
<xsl:text > left</xsl:text>
</xsl:when>
<xsl:otherwise >
<xsl:text > right</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</img>
2006-01-03 14:10:40 +01:00
</xsl:template>
2006-07-27 02:01:48 +02:00
<xsl:template match= "news-list" >
2006-09-29 03:52:41 +02:00
<xsl:variable name= "prefix" select= "@prefix" />
2006-07-27 02:01:48 +02:00
<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" >
2007-04-10 05:06:51 +02:00
<xsl:if test= "((string-length($prefix) = 0) or starts-with($newsfile, concat('content/news/', $prefix))) and (($details != 'resources-only') or (count(resource) > 0))" >
2006-07-27 02:01:48 +02:00
2006-07-28 16:23:00 +02:00
<div >
<xsl:if test= "($details = 'event') and event" >
<xsl:attribute name= "class" > vevent</xsl:attribute>
</xsl:if>
<h3 class= "summary" >
<a href= "{substring-before(substring-after($newsfile, 'content/'), '.xml')}.html" class= "url" >
<xsl:value-of select= "@title" />
</a>
</h3>
<xsl:choose >
<xsl:when test= "$details = 'news'" >
<xsl:call-template name= "news-meta" />
</xsl:when>
2007-04-10 05:06:51 +02:00
<xsl:when test= "$details = 'resources-only'" >
<xsl:call-template name= "include-resources" >
<xsl:with-param name= "include-hidden" > yes</xsl:with-param>
</xsl:call-template>
</xsl:when>
2006-07-28 16:23:00 +02:00
<xsl:when test= "($details = 'event') and event" >
<ul class= "details_event" >
<li >
<abbr class= "dtstart" >
<xsl:attribute name= "title" >
<xsl:call-template name= "date-to-hevent" >
<xsl:with-param name= "date" select= "event/start" />
</xsl:call-template>
</xsl:attribute>
<xsl:call-template name= "get-datestring" >
<xsl:with-param name= "date" select= "event/start" />
</xsl:call-template>
</abbr>
</li>
<li class= "location" >
<xsl:value-of select= "event/location" />
</li>
</ul>
</xsl:when>
</xsl:choose>
</div>
2006-07-27 02:01:48 +02:00
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
2007-03-14 21:01:37 +01:00
<xsl:template match= "resource" mode= "resources-in-news" >
2007-08-17 15:46:01 +02:00
<xsl:call-template name= "resource-item" />
2007-04-10 03:36:48 +02:00
<xsl:apply-templates select= "alternative" mode= "resources-in-news" />
</xsl:template>
<xsl:template match= "resource/alternative" mode= "resources-in-news" >
2007-08-17 15:46:01 +02:00
<xsl:call-template name= "resource-item" >
<xsl:with-param name= "title" select= "../@title" />
</xsl:call-template>
</xsl:template>
<xsl:template name= "resource-item" >
<xsl:param name= "title" select= "@title" />
2007-10-27 16:16:39 +02:00
<xsl:variable name= "href" >
<xsl:call-template name= "make-href" >
<xsl:with-param name= "href" select= "@url" />
</xsl:call-template>
</xsl:variable>
2007-08-17 15:46:01 +02:00
2010-11-15 01:41:31 +01:00
<!-- @class = "resource" | "alternative" -->
<li class= "{name(.)}" >
2010-11-15 02:39:28 +01:00
<!-- HTML5 dataset hints for play - resources.js poster -->
<xsl:if test= "@poster" >
<xsl:attribute name= "data-poster" >
<xsl:value-of select= "@poster" />
</xsl:attribute>
</xsl:if>
<xsl:if test= "@preview" >
<xsl:attribute name= "data-preview" >
<xsl:value-of select= "@preview" />
</xsl:attribute>
</xsl:if>
<!-- MIME type hinting works even in the browser -->
2007-10-27 16:16:39 +02:00
<a href= "{$href}" type= "{@type}" class= "mime" rel= "enclosure" >
2007-04-10 03:36:48 +02:00
<xsl:choose >
2007-08-17 15:46:01 +02:00
<xsl:when test= "string-length(string($title))" > <xsl:value-of select= "$title" /> </xsl:when>
2007-10-27 16:16:39 +02:00
<xsl:otherwise > <xsl:value-of select= "$href" /> </xsl:otherwise>
2007-04-10 03:36:48 +02:00
</xsl:choose>
</a>
(<xsl:call-template name= "mime-for-human" >
<xsl:with-param name= "mime" select= "@type" />
</xsl:call-template> , <xsl:call-template name= "format-filesize" >
<xsl:with-param name= "value" select= "@size" />
</xsl:call-template> )
2007-03-14 21:01:37 +01:00
</li>
</xsl:template>
2005-12-18 21:20:23 +01:00
</xsl:stylesheet>