forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r652464 - /forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-document.xsl
Date Thu, 01 May 2008 09:49:46 GMT
Author: jeremias
Date: Thu May  1 02:49:45 2008
New Revision: 652464

URL: http://svn.apache.org/viewvc?rev=652464&view=rev
Log:
SourceForge doesn't offer a simple bug ID to web page mapping. So I added code that doesn't
generate a link if the bugtracking-url is set to an empty string.

Modified:
    forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-document.xsl

Modified: forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-document.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-document.xsl?rev=652464&r1=652463&r2=652464&view=diff
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-document.xsl
(original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.input.projectInfo/resources/stylesheets/changes-to-document.xsl
Thu May  1 02:49:45 2008
@@ -294,15 +294,30 @@
     <xsl:param name="buglist"/>
     <xsl:choose>
       <xsl:when test="contains($buglist, ',')">
-        <xsl:variable name="current" select="substring-before($buglist, ',')"/><link
href="{concat($bugtracking-url, $current)}">
-        <xsl:value-of select="$current"/></link>
+        <xsl:variable name="current" select="substring-before($buglist, ',')"/>
+        <xsl:call-template name="print-bug">
+          <xsl:with-param name="bug-id" select="$current"/>
+        </xsl:call-template>
 <xsl:text>, </xsl:text>
         <xsl:call-template name="print-bugs">
           <xsl:with-param name="buglist" select="substring-after($buglist, ',')"/>
         </xsl:call-template>
       </xsl:when>
-      <xsl:otherwise><link href="{concat($bugtracking-url, $buglist)}">
-        <xsl:value-of select="$buglist"/></link>
+      <xsl:otherwise>
+        <xsl:call-template name="print-bug">
+          <xsl:with-param name="bug-id" select="$buglist"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  <xsl:template name="print-bug">
+    <xsl:param name="bug-id"/>
+    <xsl:choose>
+      <xsl:when test="string-length($bugtracking-url) &gt; 0">
+        <link href="{concat($bugtracking-url, $bug-id)}"><xsl:value-of select="$bug-id"/></link>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$bug-id"/>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>



Mime
View raw message