It is now possible to browse news items directly (XML-Browser only for now)
git-svn-id: svn://svn.c3d2.de/c3d2-web/branches/toidinamais_coole_scheisse@107 31f61c52-7bfb-0310-b897-fc00f8a278f0ds2013
parent
4d42847a77
commit
168d2e777c
8
Makefile
8
Makefile
|
@ -36,7 +36,7 @@ CONTENT=$(PAGES) $(DS_PAGES) $(NEWSFILES)
|
|||
|
||||
PAGES:=$(patsubst content/%.xml, www/%.html, $(filter-out $(NAVIGATION) $(SKELETONS), $(wildcard content/*.xml)))
|
||||
DS_PAGES:=$(patsubst content/datenspuren/%.xml, www/datenspuren/%.html, $(wildcard content/datenspuren/*.xml))
|
||||
NEWSINDEX:=content/news/index.xml
|
||||
NEWSINDEX:=content/news.xml
|
||||
NEWSITEMS:=$(filter-out $(NEWSINDEX), $(wildcard content/news/*.xml))
|
||||
NEWSFILES:=www/news.html www/news-rss.xml www/news-atom.xml
|
||||
DTD:=dtd/c3d2web.dtd
|
||||
|
@ -80,11 +80,11 @@ $(NEWSINDEX): $(NEWSITEMS) Makefile
|
|||
done
|
||||
|
||||
{ echo '<?xml version="1.0" encoding="UTF-8"?>' ; \
|
||||
echo '<!DOCTYPE page SYSTEM "../../dtd/c3d2web.dtd">' ; \
|
||||
echo '<?xml-stylesheet type="text/xsl" href="../../xsl/html.xsl" ?>' ; \
|
||||
echo '<!DOCTYPE page SYSTEM "../dtd/c3d2web.dtd">' ; \
|
||||
echo '<?xml-stylesheet type="text/xsl" href="../xsl/html.xsl" ?>' ; \
|
||||
echo "<page>"; \
|
||||
echo " <news>"; \
|
||||
for item in $(patsubst content/news/%,%,$(NEWSITEMS)) ; do \
|
||||
for item in $(patsubst content/news/%,news/%,$(NEWSITEMS)) ; do \
|
||||
echo " <newsfile>$${item}</newsfile>"; \
|
||||
done; \
|
||||
echo " </news>"; \
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE item SYSTEM "../../dtd/c3d2web.dtd">
|
||||
<?xml-stylesheet type="text/xsl" href="../../xsl/html.xsl" ?>
|
||||
<item title="22C3: Private Investigation is around the corner" date="2005-11-05T23:05:50" author="Fnordic walker" category="Allgemein">
|
||||
<image title="22C3">http://www.c3d2.de/typo3temp/pics/8de5efab18.png</image>
|
||||
<p>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE item SYSTEM "../../dtd/c3d2web.dtd">
|
||||
<?xml-stylesheet type="text/xsl" href="../../xsl/html.xsl" ?>
|
||||
<item title="C3D2-Web ist für Matthias einfach genug" date="2005-12-20T23:05:50" author="BSD-Crew" category="Allgemein">
|
||||
<image title="NetBSD rulez! But FreeBSD is simply better!!!111oneoneoneeleventhousandeleven">http://matthias.bsd-crew.de/pix/1.jpg</image>
|
||||
<p>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE item SYSTEM "../../dtd/c3d2web.dtd">
|
||||
<?xml-stylesheet type="text/xsl" href="../../xsl/html.xsl" ?>
|
||||
<item title="Datenspuren Audio-Tracks 05" date="2005-05-30T23:05:50" author="Fnordic walker" category="Allgemein">
|
||||
<image title="Bild einer Datenspur">http://www.c3d2.de/typo3temp/pics/294776b4ed.gif</image>
|
||||
<p>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE item SYSTEM "../../dtd/c3d2web.dtd">
|
||||
<?xml-stylesheet type="text/xsl" href="../../xsl/html.xsl" ?>
|
||||
<item title="Datenspuren 2006" date="2005-11-13T23:05:50" author="c3d2 himself!!!" category="Allgemein">
|
||||
<image title="Eine Datenspur">http://www.c3d2.de/typo3temp/pics/6def158186.gif</image>
|
||||
<p>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE item SYSTEM "../../dtd/c3d2web.dtd">
|
||||
<?xml-stylesheet type="text/xsl" href="../../xsl/html.xsl" ?>
|
||||
<item title="TA: Hacktivismus" date="2005-07-30T23:05:50" author="Fnordic walker" category="Themenabend">
|
||||
<p>
|
||||
Wegen des großen Erfolges des Vortrags Hacktivismus im <link href="https://berlin05.ccc.de/blog/">Camp Discordia</link> auf der Berlin05 gibt es diesen am 4. Juli ab 20 Uhr im <link href="http://www.azconni.de/">AZ Conni</link> nochmal, noch besser und mit Euch!
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE item SYSTEM "../../dtd/c3d2web.dtd">
|
||||
<?xml-stylesheet type="text/xsl" href="../../xsl/html.xsl" ?>
|
||||
<item title="Linux-Info-Tag" date="2005-10-07T00:05:50" author="Fnordic walker" category="Allgemein">
|
||||
<image title="Dicker Pinguin">http://www.c3d2.de/uploads/pics/tux_01.png</image>
|
||||
<p>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE item SYSTEM "../../dtd/c3d2web.dtd">
|
||||
<?xml-stylesheet type="text/xsl" href="../../xsl/html.xsl" ?>
|
||||
<item title="Mailingliste" date="2005-08-24T00:05:50" author="Fnordic walker" category="Allgemein">
|
||||
<image title="Delivered by mailman">http://www.c3d2.de/typo3temp/pics/9cc3346202.jpg</image>
|
||||
<p>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE item SYSTEM "../../dtd/c3d2web.dtd">
|
||||
<?xml-stylesheet type="text/xsl" href="../../xsl/html.xsl" ?>
|
||||
<item title="Silc.dresden.ccc.de" date="2005-04-13T05:23:05" author="Fnordic walker" category="Allgemein">
|
||||
<image title="Secure Internet Live Conferencing">http://www.c3d2.de/typo3temp/pics/aa268d9e62.gif</image>
|
||||
<pre>/connect silc.dresden.ccc.de
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
xmlns:rss="http://purl.org/rss/1.0/"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:date="http://exslt.org/dates-and-times"
|
||||
exclude-result-prefixes="xsl rss rdf">
|
||||
exclude-result-prefixes="xsl rss rdf date">
|
||||
|
||||
<xsl:template match="pre">
|
||||
<xsl:copy><xsl:apply-templates/></xsl:copy>
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:rss="http://purl.org/rss/1.0/"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:date="http://exslt.org/dates-and-times"
|
||||
exclude-result-prefixes="xsl rss rdf date">
|
||||
exclude-result-prefixes="xsl">
|
||||
|
||||
<xsl:template name="isleap">
|
||||
<xsl:param name="year" />
|
||||
|
|
|
@ -2,13 +2,17 @@
|
|||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:rss="http://purl.org/rss/1.0/"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:date="http://exslt.org/dates-and-times" exclude-result-prefixes="xsl rss rdf">
|
||||
xmlns:date="http://exslt.org/dates-and-times" exclude-result-prefixes="xsl rss rdf date">
|
||||
|
||||
<xsl:template name="links">
|
||||
<link rel="icon" href="images/favicon.png" type="image/png" />
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="news-rss.xml" />
|
||||
<link rel="alternate" type="application/atom" title="Atom 1.0" href="news-atom.xml" />
|
||||
<link rel="stylesheet" title="Default" type="text/css" href="style/default.css" />
|
||||
<xsl:variable name="baseurl">
|
||||
<xsl:call-template name="getbaseurl" />
|
||||
</xsl:variable>
|
||||
|
||||
<link rel="icon" type="image/png" href="{$baseurl}images/favicon.png" />
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="{$baseurl}news-rss.xml" />
|
||||
<link rel="alternate" type="application/atom" title="Atom 1.0" href="{$baseurl}news-atom.xml" />
|
||||
<link rel="stylesheet" title="Default" type="text/css" href="{$baseurl}style/default.css" />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="header">
|
||||
|
@ -32,7 +36,6 @@
|
|||
|
||||
<xsl:call-template name="links" />
|
||||
|
||||
<title><<</>> Chaos Computer Club Dresden | c3d2</title>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
140
xsl/html.xsl
140
xsl/html.xsl
|
@ -1,18 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
exclude-result-prefixes="xsl">
|
||||
xmlns:date="http://exslt.org/dates-and-times"
|
||||
exclude-result-prefixes="xsl date">
|
||||
|
||||
<xsl:import href="xhtml.xsl" />
|
||||
|
||||
<xsl:template name="links">
|
||||
<link rel="icon" type="image/png" href="../images/favicon.png" />
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="../news-rss.xml" />
|
||||
<link rel="alternate" type="application/atom" title="Atom 1.0" href="../news-atom.xml" />
|
||||
<link rel="stylesheet" title="Default" type="text/css" href="../style/default.css" />
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:output method="html"
|
||||
version="1.0"
|
||||
encoding="utf-8"
|
||||
|
@ -20,11 +13,30 @@
|
|||
doctype-system="DTD/xhtml1-strict.dtd"
|
||||
indent="yes"/>
|
||||
|
||||
|
||||
<xsl:template name="getbaseurl">
|
||||
<xsl:choose>
|
||||
<xsl:when test="/item">
|
||||
<xsl:text>../../</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>../</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="navitem">
|
||||
<xsl:param name="file"/>
|
||||
|
||||
<xsl:variable name="baseurl">
|
||||
<xsl:if test="/item">
|
||||
<xsl:text>../</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:variable>
|
||||
|
||||
<li>
|
||||
<xsl:element name="a">
|
||||
<xsl:attribute name="href"><xsl:value-of select="$file"/>.xml</xsl:attribute>
|
||||
<xsl:attribute name="href"><xsl:value-of select="concat($baseurl,$file)"/>.xml</xsl:attribute>
|
||||
<xsl:if test="document(concat('../content/', $file, '.xml'))/page/@pagetitle">
|
||||
<xsl:attribute name="title"><xsl:value-of select="document(concat('../content/', $file, '.xml'))/page/@pagetitle"/></xsl:attribute>
|
||||
</xsl:if>
|
||||
|
@ -34,16 +46,104 @@
|
|||
</xsl:template>
|
||||
|
||||
<xsl:template name="navitems">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="news.xml" title="News">News</a>
|
||||
</li>
|
||||
<xsl:for-each select="document('../content/navigation.xml')/navigation/file">
|
||||
<xsl:call-template name="navitem">
|
||||
<xsl:with-param name="file" select="."/>
|
||||
</xsl:call-template>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
<xsl:variable name="baseurl">
|
||||
<xsl:if test="/item">
|
||||
<xsl:text>../</xsl:text>
|
||||
</xsl:if>
|
||||
</xsl:variable>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{$baseurl}news.xml" title="News">News</a>
|
||||
</li>
|
||||
<xsl:for-each select="document('../content/navigation.xml')/navigation/file">
|
||||
<xsl:call-template name="navitem">
|
||||
<xsl:with-param name="file" select="."/>
|
||||
</xsl:call-template>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="news">
|
||||
<xsl:for-each select="document(newsfile, ..)/item">
|
||||
<xsl:sort select="@date" data-type="text" order="descending" />
|
||||
|
||||
<xsl:variable name="current">
|
||||
<xsl:value-of select="." />
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="newsfile">
|
||||
<xsl:for-each select="document('../content/news.xml')/page/news/newsfile">
|
||||
<xsl:if test="document(current()) = $current">
|
||||
<xsl:value-of select="current()" />
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
|
||||
<h3 class="news">
|
||||
<xsl:element name="a">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="$newsfile" />
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="title">
|
||||
<xsl:value-of select="@title" />
|
||||
</xsl:attribute>
|
||||
|
||||
<xsl:value-of select="@title"/>
|
||||
</xsl:element>
|
||||
</h3>
|
||||
|
||||
<small class="news_author">
|
||||
<xsl:value-of select="@author"/>
|
||||
</small>
|
||||
|
||||
<xsl:variable name="datestring">
|
||||
<xsl:value-of select="@date" />
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:element name="small">
|
||||
<xsl:attribute name="class">news_date</xsl:attribute>
|
||||
<xsl:value-of select="concat(' @ ', $datestring)"/>
|
||||
</xsl:element>
|
||||
|
||||
<div class="news">
|
||||
<xsl:choose>
|
||||
|
||||
<!--- <XXX> Kann das hier in ein Template? -->
|
||||
<xsl:when test="image">
|
||||
<xsl:element name="img">
|
||||
<xsl:attribute name="src"><xsl:value-of select="image"/></xsl:attribute>
|
||||
<xsl:attribute name="title"><xsl:value-of select="image/@title"/></xsl:attribute>
|
||||
<xsl:attribute name="alt"><xsl:value-of select="image/@title"/></xsl:attribute>
|
||||
<!-- News-Items haben ihre Bilder abwechselnd rechts und links... -->
|
||||
<xsl:attribute name="class">
|
||||
<xsl:choose>
|
||||
<xsl:when test="position() mod 2 = 1">
|
||||
<xsl:text>left</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>right</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
</xsl:element>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- TODO:
|
||||
<xsl:call-template name="getimage">
|
||||
<xsl:with-param name="category" select="@category" />
|
||||
</xsl:call-template>
|
||||
-->
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<!-- </XXX> -->
|
||||
|
||||
<xsl:apply-templates/>
|
||||
</div>
|
||||
|
||||
<hr class="news"/>
|
||||
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
|
@ -18,13 +18,52 @@
|
|||
doctype-system="DTD/xhtml1-strict.dtd"
|
||||
indent="yes"/>
|
||||
|
||||
<xsl:template name="getbaseurl">
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="/page">
|
||||
<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>
|
||||
|
||||
<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" />
|
||||
|
||||
<xsl:element name="html">
|
||||
<!--xsl:attribute name="xmlns">http://www.w3.org/1999/xhtml</xsl:attribute-->
|
||||
<xsl:attribute name="lang">de</xsl:attribute>
|
||||
<xsl:attribute name="xml:lang">de</xsl:attribute>
|
||||
<xsl:element name="head">
|
||||
<xsl:call-template name="header" />
|
||||
<title>
|
||||
<xsl:text><<</>> Chaos Computer Club Dresden | c3d2 - </xsl:text>
|
||||
<xsl:value-of select="$title" />
|
||||
</title>
|
||||
</xsl:element>
|
||||
|
||||
<xsl:element name="body">
|
||||
|
@ -69,17 +108,7 @@
|
|||
</xsl:comment>
|
||||
<div id="content">
|
||||
<h2>
|
||||
<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:value-of select="$title" />
|
||||
</h2>
|
||||
<xsl:apply-templates/>
|
||||
</div> <!-- id="content" -->
|
||||
|
|
Loading…
Reference in New Issue