public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/www-redesign:master commit in: xml/htdocs/xsl/
@ 2011-03-04  6:50 Alec Warner
  0 siblings, 0 replies; 2+ messages in thread
From: Alec Warner @ 2011-03-04  6:50 UTC (permalink / raw
  To: gentoo-commits

commit:     4dec7f7225172a511ab6f40dd5117c4f6cee1f26
Author:     Alec Warner <antarus <AT> scriptkitty <DOT> com>
AuthorDate: Mon Sep 13 01:09:00 2010 +0000
Commit:     Alec Warner <antarus <AT> gentoo <DOT> org>
CommitDate: Mon Sep 13 01:09:00 2010 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/www-redesign.git;a=commit;h=4dec7f72

Split the function that determines what image we are using into its own template

---
 xml/htdocs/xsl/newscontent.xsl |   94 +++++++++++++++++++++------------------
 1 files changed, 51 insertions(+), 43 deletions(-)

diff --git a/xml/htdocs/xsl/newscontent.xsl b/xml/htdocs/xsl/newscontent.xsl
index e560c98..b9fd65d 100644
--- a/xml/htdocs/xsl/newscontent.xsl
+++ b/xml/htdocs/xsl/newscontent.xsl
@@ -1,6 +1,50 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-    
+
+
+  <xsl:template name="news-icon-selector">
+    <xsl:param name="category"/>
+    <xsl:choose>
+      <xsl:when test="$category='birthday'">
+        <img class="newsicon" src="/images/birthday_cake.png" alt="Happy Birthday"/>
+      </xsl:when>
+      <xsl:when test="$category='gentoo'">
+        <img class="newsicon" src="/images/icon-gentoo.png" alt="gentoo"/>
+      </xsl:when>
+      <xsl:when test="$category='main'">
+        <img class="newsicon" src="/images/icon-stick.png" alt="stick man"/>
+      </xsl:when>
+      <xsl:when test="$category='linux'">
+        <img class="newsicon" src="/images/icon-penguin.png" alt="tux"/>
+      </xsl:when>
+      <xsl:when test="$category='moo'">
+        <img class="newsicon" src="/images/icon-cow.png" alt="Larry the Cow"/>
+      </xsl:when>
+      <xsl:when test="$category='plans'">
+        <img class="newsicon" src="/images/icon-clock.png" alt="Clock"/>
+      </xsl:when>
+      <xsl:when test="$category='planet'">
+        <img class="newsicon" src="/images/G-Earth.png" alt="Planet Earth"/>
+      </xsl:when>
+      <!-- old ones, kept to display very very old news items -->
+      <xsl:when test="$category='alpha'">
+        <img class="newsicon" src="/images/icon-alpha.gif" alt="AlphaServer GS160"/>
+      </xsl:when>
+      <xsl:when test="$category='kde'">
+        <img class="newsicon" src="/images/icon-kde.png" alt="KDE"/>
+      </xsl:when>
+      <xsl:when test="$category='ibm'">
+        <img class="newsicon" src="/images/icon-ibm.gif" alt="ibm"/>
+      </xsl:when>
+      <xsl:when test="$category='nvidia'">
+        <img class="newsicon" src="/images/icon-nvidia.png" alt="Nvidia"/>
+      </xsl:when>
+      <xsl:when test="$category='freescale'">
+        <img class="newsicon" src="/images/icon-freescale.gif" alt="Freescale Semiconductor"/>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:template>
+
   <!--
   TODO(antarus): What does this actually do?  Does anything still use it?
 
@@ -8,9 +52,9 @@
   TODO(antarus): The icon selector should be its own template.
   -->
   <xsl:template name="newscontent">
-  <xsl:param name="thenews"/>
-  <xsl:param name="summary"/>
-  <xsl:param name="link"/>
+    <xsl:param name="thenews"/>
+    <xsl:param name="summary"/>
+    <xsl:param name="link"/>
 
     <div class="news">
       <p class="newshead" lang="en">
@@ -34,45 +78,9 @@
         </font>
       </p>
 
-      <xsl:choose>
-        <xsl:when test="$thenews/@category='birthday'">
-          <img class="newsicon" src="/images/birthday_cake.png" alt="Happy Birthday"/>
-        </xsl:when>
-        <xsl:when test="$thenews/@category='gentoo'">
-          <img class="newsicon" src="/images/icon-gentoo.png" alt="gentoo"/>
-        </xsl:when>
-        <xsl:when test="$thenews/@category='main'">
-          <img class="newsicon" src="/images/icon-stick.png" alt="stick man"/>
-        </xsl:when>
-        <xsl:when test="$thenews/@category='linux'">
-          <img class="newsicon" src="/images/icon-penguin.png" alt="tux"/>
-        </xsl:when>
-        <xsl:when test="$thenews/@category='moo'">
-          <img class="newsicon" src="/images/icon-cow.png" alt="Larry the Cow"/>
-        </xsl:when>
-        <xsl:when test="$thenews/@category='plans'">
-          <img class="newsicon" src="/images/icon-clock.png" alt="Clock"/>
-        </xsl:when>
-        <xsl:when test="$thenews/@category='planet'">
-          <img class="newsicon" src="/images/G-Earth.png" alt="Planet Earth"/>
-        </xsl:when>
-        <!-- old ones, kept to display very very old news items -->
-        <xsl:when test="$thenews/@category='alpha'">
-          <img class="newsicon" src="/images/icon-alpha.gif" alt="AlphaServer GS160"/>
-        </xsl:when>
-        <xsl:when test="$thenews/@category='kde'">
-          <img class="newsicon" src="/images/icon-kde.png" alt="KDE"/>
-        </xsl:when>
-        <xsl:when test="$thenews/@category='ibm'">
-          <img class="newsicon" src="/images/icon-ibm.gif" alt="ibm"/>
-        </xsl:when>
-        <xsl:when test="$thenews/@category='nvidia'">
-          <img class="newsicon" src="/images/icon-nvidia.png" alt="Nvidia"/>
-        </xsl:when>
-        <xsl:when test="$thenews/@category='freescale'">
-          <img class="newsicon" src="/images/icon-freescale.gif" alt="Freescale Semiconductor"/>
-        </xsl:when>
-      </xsl:choose>
+      <xsl:call-template name="news-icon-selector">
+        <xsl:with-param name="category" select="$thenews/@category"/>
+      </xsl:call-template>
 
       <div class="newsitem">
       <xsl:choose>



^ permalink raw reply related	[flat|nested] 2+ messages in thread
* [gentoo-commits] proj/www-redesign:master commit in: xml/htdocs/xsl/
@ 2011-04-01  5:46 Alec Warner
  0 siblings, 0 replies; 2+ messages in thread
From: Alec Warner @ 2011-04-01  5:46 UTC (permalink / raw
  To: gentoo-commits

commit:     49c05702caab2bb7c351c9e1099bc33f017e06cf
Author:     Alec Warner <antarus <AT> scriptkitty <DOT> com>
AuthorDate: Fri Apr  1 05:46:31 2011 +0000
Commit:     Alec Warner <antarus <AT> gentoo <DOT> org>
CommitDate: Fri Apr  1 05:46:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/www-redesign.git;a=commit;h=49c05702

test fix for bug 361035

---
 xml/htdocs/xsl/newscontent.xsl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xml/htdocs/xsl/newscontent.xsl b/xml/htdocs/xsl/newscontent.xsl
index b9fd65d..16e0a6f 100644
--- a/xml/htdocs/xsl/newscontent.xsl
+++ b/xml/htdocs/xsl/newscontent.xsl
@@ -58,7 +58,7 @@
 
     <div class="news">
       <p class="newshead" lang="en">
-        <b><xsl:value-of select="$thenews/title"/></b>
+        <a href="${link}"><xsl:value-of select="$thenews/title"/></a>
         <br/>
         <font size="0.90em">
         <xsl:choose>



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-01  5:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-04  6:50 [gentoo-commits] proj/www-redesign:master commit in: xml/htdocs/xsl/ Alec Warner
  -- strict thread matches above, loose matches on Subject: below --
2011-04-01  5:46 Alec Warner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox