Browse Source

Include newsletter into news feeds just like other news

pull/864/head
Reinhard Müller 4 months ago
parent
commit
b2bfeda55f
8 changed files with 15 additions and 56 deletions
  1. 2
    0
      activities/ftf/avm-gpl-violation.sources
  2. 4
    0
      index.sources
  3. 0
    15
      index.xsl
  4. 2
    3
      news/news.xsl
  5. 4
    0
      press/press.sources
  6. 2
    2
      press/press.xsl
  7. 0
    12
      tools/xsltsl/feeds.xsl
  8. 1
    24
      tools/xsltsl/tagging.xsl

+ 2
- 0
activities/ftf/avm-gpl-violation.sources View File

@@ -1,2 +1,4 @@
news/*/news-*:[avm]
news/*/.news-*:[avm]
news/nl/nl-*:[avm]
news/nl/.nl-*:[avm]

+ 4
- 0
index.sources View File

@@ -2,6 +2,10 @@ news/$thisyear/news-*:[front-page]
news/$lastyear/news-*:[front-page]
news/$thisyear/.news-*:[front-page]
news/$lastyear/.news-*:[front-page]
news/nl/nl-$thisyear*:[front-page]
news/nl/nl-$lastyear*:[front-page]
news/nl/.nl-$thisyear*:[front-page]
news/nl/.nl-$lastyear*:[front-page]
events/$thisyear/event-*:[front-page]
tools/frontpage/*:[]
tools/static-elements/element-*:[]

+ 0
- 15
index.xsl View File

@@ -36,21 +36,6 @@
</xsl:template>
<!--display dynamic list of newsletters items-->
<xsl:template match="all-newsletters">
<xsl:call-template name="fetch-newsletters">
<xsl:with-param name="nb-items" select="0" />
</xsl:call-template>

<!--xsl:element name="p">
<xsl:element name="a">
<xsl:attribute name="href">/news/news.html</xsl:attribute>
<xsl:attribute name="class">learn-more</xsl:attribute>
<xsl:call-template name="more-news" /><xsl:text></xsl:text>
</xsl:element>
</xsl:element-->
</xsl:template>
<!--display dynamic list of event items-->
<xsl:template match="all-events">
<!-- Current events -->

+ 2
- 3
news/news.xsl View File

@@ -20,10 +20,9 @@
<xsl:value-of select="/buildinfo/@date" />
</xsl:variable>

<!-- show news except those in the future, but no newsletters -->
<!-- show news except those in the future -->
<xsl:for-each select="/buildinfo/document/set/news
[translate (@date, '-', '') &lt;= translate ($today, '-', '')
and not (@type = 'newsletter')]">
[translate (@date, '-', '') &lt;= translate ($today, '-', '')]">
<xsl:sort select="@date" order="descending" />

<!-- begin: news entry -->

+ 4
- 0
press/press.sources View File

@@ -2,3 +2,7 @@ news/$thisyear/news-*:[]
news/$lastyear/news-*:[]
news/$thisyear/.news-*:[]
news/$lastyear/.news-*:[]
news/nl/nl-$thisyear*:[]
news/nl/nl-$lastyear*:[]
news/nl/.nl-$thisyear*:[]
news/nl/.nl-$lastyear*:[]

+ 2
- 2
press/press.xsl View File

@@ -14,8 +14,8 @@
<xsl:element name="dl">
<xsl:attribute name="id">press-releases</xsl:attribute>

<!-- Show news except those in the future, but no newsletters -->
<xsl:for-each select="/buildinfo/document/set/news[translate(@date,'-','')&lt;=translate($today,'-','') and not(@type='newsletter')]">
<!-- Show news except those in the future -->
<xsl:for-each select="/buildinfo/document/set/news[translate(@date,'-','')&lt;=translate($today,'-','')]">
<xsl:sort select="@date" order="descending" />

<!-- A news entry -->

+ 0
- 12
tools/xsltsl/feeds.xsl View File

@@ -79,18 +79,6 @@
</xsl:choose>
</xsl:template>
<!-- Show a single newsletter item -->
<xsl:template name="newsletter">
<xsl:variable name="link">
<xsl:value-of select="link" />
</xsl:variable>
<li>
<a href="{link}">
<xsl:value-of select="title" />
</a>
</li>
</xsl:template>
<!-- Show a single event -->
<xsl:template name="event">
<xsl:param name="header" select="''" />

+ 1
- 24
tools/xsltsl/tagging.xsl View File

@@ -19,9 +19,7 @@

<xsl:for-each select="/buildinfo/document/set/news[
translate(@date, '-', '') &lt;= translate($today, '-', '')
and ($tag = '' or tags/tag[@key] = $tag or tags/tag = $tag)
and not(tags/tag = 'newsletter' or tags/tag[@key] = 'newsletter')
and not( @type = 'newsletter' ) ]"> <!-- Legacy -->
and ($tag = '' or tags/tag[@key] = $tag or tags/tag = $tag)]">
<xsl:sort select="@date" order="descending" />

<xsl:if test="$nb-items = '' or position() &lt;= $nb-items">
@@ -33,29 +31,8 @@
</xsl:call-template>
</xsl:if>
</xsl:for-each>

</xsl:template>

<!--display dynamic list of (not yet tagged) newsletters items-->

<xsl:template name="fetch-newsletters">
<xsl:param name="today" select="/buildinfo/@date" />
<xsl:param name="nb-items" select="''" />

<xsl:for-each select="/buildinfo/document/set/news[
translate(@date, '-', '') &lt;= translate($today, '-', '')
and (tags/tag[@key] = 'newsletter' or tags/tag = 'newsletter'
or @type = 'newsletter' ) ]">
<xsl:sort select="@date" order="descending" />

<xsl:if test="$nb-items = '' or position() &lt;= $nb-items">
<xsl:call-template name="newsletter" />
</xsl:if>
</xsl:for-each>

</xsl:template>


<!--display dynamic list of tagged event items-->

<xsl:template name="fetch-events">

Loading…
Cancel
Save