Revert "don't publish news items with future @date"

issues with calendar-summary and calendar

This reverts commit 4b74bd5a88.
This commit is contained in:
vv01f 2014-03-29 18:59:32 +01:00
parent 681f39a80a
commit 581f0be64f
7 changed files with 31 additions and 46 deletions

View File

@ -9,8 +9,3 @@ XSL-Stylesheet
- Wird IMMER explizit als Parameter an xsltproc übergeben, nicht als Attribut in xml-stylesheet-Tag - Wird IMMER explizit als Parameter an xsltproc übergeben, nicht als Attribut in xml-stylesheet-Tag
- Begründung: Ermöglicht Transformation in verschiedene Formate durch Angabe des entsprechenden XSL-Stylesheets - Begründung: Ermöglicht Transformation in verschiedene Formate durch Angabe des entsprechenden XSL-Stylesheets
(z.B. item-XML-Datei in HTML oder alternativ in RSS transformieren) (z.B. item-XML-Datei in HTML oder alternativ in RSS transformieren)
== news pre-posting
some news shall be written right now but published later, thats why the date next to author of the news/events item etc. should be compared and if greater than the current one not considered for publication yet.

View File

@ -1,5 +1,9 @@
= was man noch machen könnte = was man noch machen könnte
== news pre-posting
some news shall be written right now but published later, thats why the date next to author of the news/events item etc. should be compared and if greater than the current one not considered for publication yet.
== potal-mediagoblin == potal-mediagoblin
eine option für das bekanntgeben eines neuen Bilcdes fehlt im Mediagobline. Derzeit werden alle Bilder von bestimmten Nutzern (john, astro, lachmoewe, bigalex) bekannt gegeben.. nuja. eine option für das bekanntgeben eines neuen Bilcdes fehlt im Mediagobline. Derzeit werden alle Bilder von bestimmten Nutzern (john, astro, lachmoewe, bigalex) bekannt gegeben.. nuja.

View File

@ -41,8 +41,8 @@
<xsl:sort select="date:seconds(document(.)/item/@date)" data-type="number" order="descending" /> <xsl:sort select="date:seconds(document(.)/item/@date)" data-type="number" order="descending" />
<xsl:variable name="newsfile" select="."/> <xsl:variable name="newsfile" select="."/>
<xsl:if test="(position() &lt;= $maxitems) and <xsl:if test="(position() &lt;= $maxitems) and
starts-with(substring-after(substring-after($newsfile, '/'), '/'), $prefix) and starts-with(substring-after(substring-after($newsfile, '/'), '/'), $prefix)">
starts-with(date:difference(date:date-time(), document(.)/item/@date), '-')">
<xsl:for-each select="document($newsfile)/item"> <xsl:for-each select="document($newsfile)/item">
<xsl:call-template name="atom-entry"> <xsl:call-template name="atom-entry">
<xsl:with-param name="newsfile" select="$newsfile"/> <xsl:with-param name="newsfile" select="$newsfile"/>

View File

@ -31,8 +31,7 @@
<!-- Events must have started at least one year ago --> <!-- Events must have started at least one year ago -->
<xsl:variable name="minstart" select="date:add(date:date-time(), '-P366D')"/> <xsl:variable name="minstart" select="date:add(date:date-time(), '-P366D')"/>
<xsl:if test="starts-with(date:difference(start, $minstart), '-') and <xsl:if test="starts-with(date:difference(start, $minstart), '-')">
starts-with(date:difference(date:date-time(), start), '-')">
<event> <event>
<title> <title>
<xsl:choose> <xsl:choose>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" <xsl:stylesheet version="1.0"
xmlns:atom="http://www.w3.org/2005/Atom" xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8" indent="yes"/> <xsl:output method="xml" encoding="utf-8" indent="yes"/>
@ -18,13 +17,10 @@
<!-- Extract from news --> <!-- Extract from news -->
<xsl:for-each select="document('../news.xml')//newsfile"> <xsl:for-each select="document('../news.xml')//newsfile">
<xsl:if test="starts-with(date:difference(date:date-time(), @date), '-')"> <xsl:apply-templates select="document(concat('../', .))/item" mode="news">
<xsl:apply-templates select="document(concat('../', .))/item" <xsl:with-param name="link"
mode="news"> select="concat(substring-before(substring-after(., 'content/'), '.xml'), '.html')"/>
<xsl:with-param name="link" </xsl:apply-templates>
select="concat(substring-before(substring-after(., 'content/'), '.xml'), '.html')"/>
</xsl:apply-templates>
</xsl:if>
</xsl:for-each> </xsl:for-each>
</portal> </portal>
</xsl:template> </xsl:template>
@ -89,15 +85,23 @@
</xsl:template> </xsl:template>
<xsl:template match="item" mode="news"> <xsl:template match="item" mode="news">
<xsl:param name="link"/> <xsl:param name="link"/>
<item date="{@date}" class="news"> <!-- date cannot be compared (to current date) in xslt 1.0 without a param handed over -->
<header>News</header> <!-- current-date() as of XSLT 2.0 -->
<footer>by <xsl:value-of select="@author"/></footer> <!--
<content-text><xsl:value-of select="@title"/></content-text> <xsl:if test="{@date}">
<xsl:apply-templates select=".//image[1]" mode="news"/> -->
<link><xsl:value-of select="$link"/></link> <item date="{@date}" class="news">
</item> <header>News</header>
<footer>by <xsl:value-of select="@author"/></footer>
<content-text><xsl:value-of select="@title"/></content-text>
<xsl:apply-templates select=".//image[1]" mode="news"/>
<link><xsl:value-of select="$link"/></link>
</item>
<!--
</xsl:if>
-->
</xsl:template> </xsl:template>
<xsl:template match="item/image[1]" mode="news"> <xsl:template match="item/image[1]" mode="news">

View File

@ -39,8 +39,8 @@
<xsl:sort select="date:seconds(document(.)/item/@date)" data-type="number" order="descending" /> <xsl:sort select="date:seconds(document(.)/item/@date)" data-type="number" order="descending" />
<xsl:variable name="newsfile" select="."/> <xsl:variable name="newsfile" select="."/>
<xsl:if test="(position() &lt;= $maxitems) and <xsl:if test="(position() &lt;= $maxitems) and
starts-with(substring-after(substring-after($newsfile, '/'), '/'), $prefix) and starts-with(substring-after(substring-after($newsfile, '/'), '/'), $prefix)">
starts-with(date:difference(date:date-time(), document(.)/item/@date), '-')">
<xsl:apply-templates select="document(.)/item"> <xsl:apply-templates select="document(.)/item">
<xsl:with-param name="newsfile" select="$newsfile"/> <xsl:with-param name="newsfile" select="$newsfile"/>
</xsl:apply-templates> </xsl:apply-templates>

View File

@ -135,14 +135,7 @@
<xsl:for-each select="newsfile"> <xsl:for-each select="newsfile">
<xsl:sort select="date:seconds(document(concat('../', .))/item/@date)" data-type="number" order="descending" /> <xsl:sort select="date:seconds(document(concat('../', .))/item/@date)" data-type="number" order="descending" />
<xsl:if test="position() &lt;= 10 and <xsl:if test="position() &lt;= 10">
not(starts-with(
date:difference(
document(concat('../', .))/item/@date,
date:date-time()
),
'-'
))">
<xsl:variable name="newsfile"><xsl:value-of select="."/></xsl:variable> <xsl:variable name="newsfile"><xsl:value-of select="."/></xsl:variable>
<xsl:variable name="itemposition" select="position()"/> <xsl:variable name="itemposition" select="position()"/>
@ -259,17 +252,7 @@
<xsl:variable name="newsfile" select="."/> <xsl:variable name="newsfile" select="."/>
<xsl:for-each select="document(concat('../', $newsfile))/item"> <xsl:for-each select="document(concat('../', $newsfile))/item">
<xsl:if test="((string-length($prefix) = 0) or <xsl:if test="((string-length($prefix) = 0) or starts-with($newsfile, concat('content/news/', $prefix))) and (($details != 'resources-only') or (count(resource) &gt; 0))">
starts-with($newsfile, concat('content/news/', $prefix))) and
(($details != 'resources-only') or
(count(resource) &gt; 0)) and
starts-with(
date:difference(
document(concat('../', .))/item/@date,
date:date-time()
),
'-'
)">
<div> <div>
<xsl:if test="($details = 'event') and event"> <xsl:if test="($details = 'event') and event">