[gnome-doc-utils/mallard: 62/87] Status markers on page links



commit fce77a111d01ae03839b3d74ca49322d19b5001f
Author: Shaun McCance <shaunm gnome org>
Date:   Tue Dec 2 11:15:31 2008 -0600

    Status markers on page links
    
    This uncovered some problems and quirks with the page link code.
    I need to iron them out and clean that code up.
---
 xslt/mallard/html/mal2html-css.xsl  |   36 ++++++++++++++++++++++++++++++++
 xslt/mallard/html/mal2html-page.xsl |   39 +++++++++++++++++++++++++++++++++-
 2 files changed, 73 insertions(+), 2 deletions(-)

diff --git a/xslt/mallard/html/mal2html-css.xsl b/xslt/mallard/html/mal2html-css.xsl
index 6e96299..633002a 100644
--- a/xslt/mallard/html/mal2html-css.xsl
+++ b/xslt/mallard/html/mal2html-css.xsl
@@ -208,6 +208,42 @@ div.pagelink div.title {
   font-size: 1em;
   color: inherit;
 }
+div.pagelink div.title span.status {
+  font-size: 0.83em;
+  font-weight: normal;
+  padding-left: 0.2em;
+  padding-right: 0.2em;
+  color: </xsl:text>
+  <xsl:call-template name="theme.get_color">
+    <xsl:with-param name="id" select="'text-light'"/>
+  </xsl:call-template>
+  <xsl:text>;
+  border: solid 1px </xsl:text>
+  <xsl:call-template name="theme.get_color">
+    <xsl:with-param name="id" select="'red-border'"/>
+  </xsl:call-template>
+  <xsl:text>;
+}
+div.pagelink div.title span.status-stub { background-color: </xsl:text>
+  <xsl:call-template name="theme.get_color">
+    <xsl:with-param name="id" select="'red-background'"/>
+  </xsl:call-template>
+  <xsl:text>; }
+div.pagelink div.title span.status-draft { background-color: </xsl:text>
+  <xsl:call-template name="theme.get_color">
+    <xsl:with-param name="id" select="'red-background'"/>
+  </xsl:call-template>
+  <xsl:text>; }
+div.pagelink div.title span.status-incomplete { background-color: </xsl:text>
+  <xsl:call-template name="theme.get_color">
+    <xsl:with-param name="id" select="'red-background'"/>
+  </xsl:call-template>
+  <xsl:text>; }
+div.pagelink div.title span.status-review { background-color: </xsl:text>
+  <xsl:call-template name="theme.get_color">
+    <xsl:with-param name="id" select="'yellow-background'"/>
+  </xsl:call-template>
+  <xsl:text>; }
 div.pagelink div.desc {
   margin-top: 0.2em;
   color: </xsl:text>
diff --git a/xslt/mallard/html/mal2html-page.xsl b/xslt/mallard/html/mal2html-page.xsl
index 776d0c5..52e418f 100644
--- a/xslt/mallard/html/mal2html-page.xsl
+++ b/xslt/mallard/html/mal2html-page.xsl
@@ -227,16 +227,51 @@ REMARK: Describe this template
       <!-- FIXME: call a common linkifier? -->
       <div class="title">
         <xsl:call-template name="mal.link.content">
-          <xsl:with-param name="node" select="."/>
+          <xsl:with-param name="node" select="$node"/>
           <xsl:with-param name="xref" select="$xref"/>
         </xsl:call-template>
+        <xsl:variable name="date">
+          <xsl:for-each select="$page/mal:info/mal:version">
+            <xsl:sort select="@date" data-type="text" order="descending"/>
+            <xsl:if test="position() = 1">
+              <xsl:value-of select="@date"/>
+            </xsl:if>
+          </xsl:for-each>
+        </xsl:variable>
+        <xsl:variable name="version"
+                      select="$page/mal:info/mal:version[ date = $date][last()]"/>
+        <xsl:if test="$version/@status != '' and $version/@status != 'final'">
+          <xsl:text> </xsl:text>
+          <span>
+            <xsl:attribute name="class">
+              <xsl:value-of select="concat('status status-', $version/@status)"/>
+            </xsl:attribute>
+            <!-- FIXME: i18n -->
+            <xsl:choose>
+              <xsl:when test="$version/@status = 'stub'">
+                <xsl:text>Stub</xsl:text>
+              </xsl:when>
+              <xsl:when test="$version/@status = 'incomplete'">
+                <xsl:text>Incomplete</xsl:text>
+              </xsl:when>
+              <xsl:when test="$version/@status = 'draft'">
+                <xsl:text>Draft</xsl:text>
+              </xsl:when>
+              <xsl:when test="$version/@status = 'review'">
+                <xsl:text>Ready for review</xsl:text>
+              </xsl:when>
+              <xsl:when test="$version/@status = 'final'">
+                <xsl:text>Final</xsl:text>
+              </xsl:when>
+            </xsl:choose>
+          </span>
+        </xsl:if>
       </div>
       <xsl:for-each select="$cache">
         <xsl:variable name="desc"
                       select="key('cache_key', $linkid)/mal:info/mal:desc[1]"/>
         <xsl:if test="$desc">
           <div class="desc">
-            <!-- FIXME: should desc contain inline or block? -->
             <xsl:apply-templates mode="mal2html.inline.mode" select="$desc/node()"/>
           </div>
         </xsl:if>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]