random news image fallback
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
77197c4977
commit
2e1d0c607c
|
@ -0,0 +1 @@
|
||||||
|
../hq/new1.jpg
|
|
@ -0,0 +1 @@
|
||||||
|
../hq/old1.jpg
|
|
@ -0,0 +1 @@
|
||||||
|
../hq/old2.jpg
|
|
@ -0,0 +1 @@
|
||||||
|
../hq/pano1.jpg
|
|
@ -0,0 +1 @@
|
||||||
|
../hq/pano3.jpg
|
|
@ -0,0 +1 @@
|
||||||
|
gchq-hdr.jpg
|
|
@ -0,0 +1 @@
|
||||||
|
../hq/schalter.jpg
|
|
@ -0,0 +1 @@
|
||||||
|
./zentralwerk_bau.jpg
|
|
@ -0,0 +1 @@
|
||||||
|
../hqdefault.jpg
|
|
@ -0,0 +1 @@
|
||||||
|
gchq-werkbank.jpg
|
|
@ -4,7 +4,8 @@
|
||||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
xmlns:date="http://exslt.org/dates-and-times"
|
xmlns:date="http://exslt.org/dates-and-times"
|
||||||
xmlns:str="http://exslt.org/strings"
|
xmlns:str="http://exslt.org/strings"
|
||||||
exclude-result-prefixes="xsl date str">
|
xmlns:crypto="http://exslt.org/crypto"
|
||||||
|
exclude-result-prefixes="xsl date str crypto">
|
||||||
|
|
||||||
|
|
||||||
<xsl:include href="common.xsl" />
|
<xsl:include href="common.xsl" />
|
||||||
|
@ -379,6 +380,8 @@
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="/page/portal/item">
|
<xsl:template match="/page/portal/item">
|
||||||
|
<!-- 1 (not really) random character 1-9 and blank -->
|
||||||
|
<xsl:variable name="random" select="translate(substring(crypto:sha1(.),1,1),'0abcdef','')"/>
|
||||||
<article>
|
<article>
|
||||||
<xsl:if test="@class">
|
<xsl:if test="@class">
|
||||||
<xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
|
<xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
|
||||||
|
@ -393,10 +396,10 @@
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise><!-- Fallback image -->
|
<xsl:otherwise><!-- Fallback image -->
|
||||||
<xsl:choose><!-- depending on class -->
|
<xsl:choose><!-- depending on class -->
|
||||||
<!-- todo: random image from list (filenames might be links), maybe based on hash() -->
|
<!-- "random" image from list (filenames should be links) -->
|
||||||
<xsl:when test="@class = 'news'"><xsl:attribute name="style">background-image: url('images/news/gchq-hdr.jpg');</xsl:attribute></xsl:when>
|
<xsl:when test="@class = 'news'"><xsl:attribute name="style">background-image: url('images/news/rnd<xsl:value-of select="$random"/>');</xsl:attribute></xsl:when>
|
||||||
<!--
|
<!--
|
||||||
<xsl:when test="@class = 'wiki'"><xsl:attribute name="style">background-image: url('images/news/wikidata.png');</xsl:attribute></xsl:when>
|
<xsl:when test="@class = 'news'"><xsl:attribute name="style">background-image: url('images/news/gchq-hdr.jpg');</xsl:attribute></xsl:when>
|
||||||
-->
|
-->
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
|
|
Loading…
Reference in New Issue