[Yanel-commits] rev 43921 - public/yanel/trunk/src/webapp/htdocs

guillaume at wyona.com guillaume at wyona.com
Thu Jul 30 15:31:28 CEST 2009


Author: guillaume
Date: 2009-07-30 15:31:28 +0200 (Thu, 30 Jul 2009)
New Revision: 43921

Modified:
   public/yanel/trunk/src/webapp/htdocs/html.xslt
Log:
The Yanel-global, not-RT-specific, not-repo-stored XSLT now:
- (only on pages that do not sport a cancel button)
   adds a "Go back to home page" link that points to the current realm's root
- uses the top-level heading text (aka H1) as page title if the later was not defined
- adds " - Yanel" at the end of all page titles

Issue: 6897


Modified: public/yanel/trunk/src/webapp/htdocs/html.xslt
===================================================================
--- public/yanel/trunk/src/webapp/htdocs/html.xslt	2009-07-30 12:52:51 UTC (rev 43920)
+++ public/yanel/trunk/src/webapp/htdocs/html.xslt	2009-07-30 13:31:28 UTC (rev 43921)
@@ -13,6 +13,11 @@
     <html>
       <head>
         <link rel="stylesheet" href="{$yanel.back2realm}{$yanel.reservedPrefix}/yanel-css/global.css" type="text/css"/>
+        <xsl:if test="not(/xhtml:html/xhtml:head/xhtml:title)">
+          <xsl:call-template name="yanel:add-page-title">
+            <xsl:with-param name="title" select="/xhtml:html/xhtml:body//xhtml:h1[1]"/>
+          </xsl:call-template>
+        </xsl:if>
         <xsl:apply-templates select="/xhtml:html/xhtml:head/*"/>
       </head>
       <body>
@@ -27,6 +32,10 @@
             <td width="100%" valign="top" colspan="2">
               <div id="content">
                 <xsl:apply-templates select="/xhtml:html/xhtml:body/*"/>
+             <xsl:if test="not(/xhtml:html/xhtml:body//xhtml:input[@type='submit' and @name='cancel'])">
+               <br/>
+               <a href="{$yanel.back2realm}">Go back to home page</a>
+             </xsl:if>
               </div>
             </td>
           </tr>
@@ -35,6 +44,21 @@
     </html>
   </xsl:template>
 
+  <xsl:template match="xhtml:title">
+     <xsl:call-template name="yanel:add-page-title"/>
+  </xsl:template>
+
+  <xsl:template name="yanel:add-page-title">
+    <xsl:param name="title" select="text()"/>
+    <xhtml:title>
+      <xsl:if test="$title">
+        <xsl:value-of select="$title"/>
+        <xsl:text> - </xsl:text>
+      </xsl:if>
+      <xsl:text>Yanel</xsl:text>
+    </xhtml:title>
+  </xsl:template>
+
   <xsl:template match="@*|node()">
     <xsl:copy>
       <xsl:apply-templates select="@*|node()"/>



More information about the Yanel-commits mailing list