Added viewport meta tag to improve display on small devices eg iPhones
[exim-website.git] / templates / wrapper.xsl
index 82fed80ce448982d0c2ff4de973099fabfff75a9..4acf48ec4623445262d67b15fdcfbea3bec6c598 100644 (file)
@@ -17,6 +17,7 @@
       <xsl:variable name="html.head.robots" select="'noodp,noydir,index,follow'"/>
       <xsl:variable name="html.head.append"/>
       <xsl:variable name="html.body.append"/>
+      <xsl:variable name="html.body.outer.append"/>
 
    <!-- The main template code -->
       <xsl:template match="/">
@@ -30,6 +31,9 @@
                <meta name="keywords"    content="{$html.head.keywords}"/>
                <meta name="robots"      content="{$html.head.robots}"/>
 
+               <!-- Mobile Safari (iPhone) - Reduce viewport to physical size of device -->
+                  <meta name="viewport" content="width=device-width"/>
+
                <title>
                   <xsl:value-of select="$html.head.title"/>
                </title>
@@ -95,6 +99,8 @@
                          <div class="left_bar"/>
                          <div class="right_bar"/>
 
+                      <!-- Append anything to the outer container? -->
+                         <xsl:copy-of select="$html.body.outer.append"/>
                    </div>
 
                 <!-- Load latest version of jQuery 1.4 from the Google CDN -->
          <a href="{@url}" title="{@chapter_id}. {@chapter_title}">
             <xsl:choose>
                <xsl:when test="@section_id">
-                  <xsl:value-of select="concat(@chapter_id,'.',@section_id)"/>
+                  <xsl:choose>
+                     <xsl:when test="@longref">
+                        <xsl:value-of select="@chapter_title"/>
+                        <small>
+                           <xsl:value-of select="concat(' [',@section_title,']')"/>
+                        </small>
+                     </xsl:when>
+                     <xsl:otherwise>
+                        <xsl:value-of select="concat(@chapter_id,'.',@section_id)"/>
+                     </xsl:otherwise>
+                  </xsl:choose>
                </xsl:when>
                <xsl:otherwise>
-                  <xsl:value-of select="@chapter_id"/>
+                  <xsl:choose>
+                     <xsl:when test="@longref">
+                        <xsl:value-of select="@chapter_title"/>
+                     </xsl:when>
+                     <xsl:otherwise>
+                        <xsl:value-of select="@chapter_id"/>
+                     </xsl:otherwise>
+                  </xsl:choose>
                </xsl:otherwise>
             </xsl:choose>
          </a>
       <xsl:template match="para"> <p> <xsl:apply-templates/> </p> </xsl:template>
 
    <!-- Lists -->
-      <xsl:template match="itemizedlist">          <ul> <xsl:apply-templates/> </ul> </xsl:template>
-      <xsl:template match="itemizedlist/listitem"> <li> <xsl:apply-templates/> </li> </xsl:template>
-      <xsl:template match="orderedlist">           <ol> <xsl:apply-templates/> </ol> </xsl:template>
-      <xsl:template match="orderedlist/listitem">  <li> <xsl:apply-templates/> </li> </xsl:template>
+      <xsl:template match="itemizedlist">                        <ul> <xsl:apply-templates/> </ul> </xsl:template>
+      <xsl:template match="itemizedlist/listitem">               <li> <xsl:apply-templates/> </li> </xsl:template>
+      <xsl:template match="orderedlist">                         <ol> <xsl:apply-templates/> </ol> </xsl:template>
+      <xsl:template match="orderedlist/listitem">                <li> <xsl:apply-templates/> </li> </xsl:template>
+      <xsl:template match="variablelist">                        <dl> <xsl:apply-templates/> </dl> </xsl:template>
+      <xsl:template match="variablelist/varlistentry/term">      <dt> <xsl:apply-templates/> </dt> </xsl:template>
+      <xsl:template match="variablelist/varlistentry/listitem">  <dd> <xsl:apply-templates/> </dd> </xsl:template>
 
    <!-- Table -->
       <xsl:template match="informaltable"> <table> <xsl:apply-templates/> </table> </xsl:template>