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" >
2013-10-30 00:13:58 +01:00
<xsl:with-param name= "title" select= "normalize-space($title)" />
2006-01-12 11:38:33 +01:00
</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 >
2013-10-30 00:13:58 +01:00
<xsl:text > < < < /> > Chaos Computer Club Dresden | c3d2</xsl:text>
<xsl:if test= "$title != ''" >
<xsl:text > - </xsl:text>
<xsl:value-of select= "$title" />
</xsl:if>
2006-01-12 11:38:33 +01:00
</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" >
2012-01-22 17:19:42 +01:00
<a href= "http://c3d2.de" > <h1 > < < < /> > Chaos Computer Club Dresden | c3d2</h1> </a>
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
2013-11-12 00:16:21 +01:00
<!-- ### Navigation ### -->
<xsl:comment >
<xsl:text > ### Navigation ### </xsl:text>
</xsl:comment>
<nav id= "navigation" >
<div id= "navgroups" >
2010-11-27 19:00:25 +01:00
<xsl:call-template name= "navitems" />
2013-11-12 00:16:21 +01:00
</div>
</nav>
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>
2013-11-12 00:16:21 +01:00
<xsl:if test= "/page/portal" >
<xsl:attribute name= "class" > portalcontainer</xsl:attribute>
</xsl:if>
2011-03-09 20:12:39 +01:00
2013-10-30 00:13:58 +01:00
<xsl:if test= "$title != ''" >
<h2 >
<xsl:if test= "name(.) = 'item'" >
<xsl:attribute name= "class" > news</xsl:attribute>
</xsl:if>
2011-03-09 20:12:39 +01:00
2013-10-30 00:13:58 +01:00
<xsl:value-of select= "$title" />
</h2>
</xsl:if>
2011-03-09 20:12:39 +01:00
<!-- 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 />
</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="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
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" >
2011-10-28 21:46:40 +02:00
<xsl:apply-templates select= "*[name() != 'addendum']" >
2010-11-26 16:26:36 +01:00
<xsl:with-param name= "itemposition" select= "$itemposition" />
</xsl:apply-templates>
<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>
2012-02-01 19:52:58 +01:00
<aside >
<p >
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.
Mehr News gibts im <a href= "{$baseurl}news-archiv.html" rel= "archives" > Archiv</a> .
</p>
</aside>
2005-12-18 21:20:23 +01:00
</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
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'" >
2011-10-28 21:46:40 +02:00
<xsl:apply-templates select= ".//resource" />
2007-04-10 05:06:51 +02:00
</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>
2013-10-30 00:13:58 +01:00
<xsl:template match= "/page/portal" >
<section id= "portal" >
2013-11-12 00:16:21 +01:00
<!-- Upcoming events -->
<article class= "upcoming" >
<h3 >
<a href= "{$baseurl}calendar.html" > Kalender</a>
</h3>
<xsl:call-template name= "calendar-events" >
<xsl:with-param name= "limit" select= "4" />
</xsl:call-template>
</article>
2013-11-12 21:08:04 +01:00
<!-- TODO:
chaosupdates
pentaradios?
space status
wiki in only 1 tile?
-->
2013-11-12 00:16:21 +01:00
<!-- All items... -->
<xsl:apply-templates select= "item[position() <= 32]" />
2013-10-30 00:13:58 +01:00
</section>
</xsl:template>
<xsl:template match= "/page/portal/item" >
<article >
2013-10-30 01:36:31 +01:00
<xsl:if test= "@class" >
<xsl:attribute name= "class" > <xsl:value-of select= "@class" /> </xsl:attribute>
</xsl:if>
2013-10-30 00:13:58 +01:00
<a href= "{link}" >
<xsl:if test= "content-image" >
<xsl:attribute name= "style" >
background: url('<xsl:value-of select= "content-image" /> ') 50% 50% no-repeat;
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select= "header" />
<xsl:apply-templates select= "footer" />
<xsl:apply-templates select= "content-text" />
</a>
</article>
</xsl:template>
<xsl:template match= "portal/item/header" >
<h3 > <xsl:value-of select= "string(.)" /> </h3>
</xsl:template>
<xsl:template match= "portal/item/footer" >
<p class= "footer" > <xsl:value-of select= "string(.)" /> </p>
</xsl:template>
<xsl:template match= "portal/item/content-text" >
<h4 > <xsl:value-of select= "string(.)" /> </h4>
</xsl:template>
<xsl:template match= "portal/item/content-image" >
<img src= "{{.}}" />
</xsl:template>
2005-12-18 21:20:23 +01:00
</xsl:stylesheet>