You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2003/05/06 21:23:52 UTC
cvs commit: cocoon-2.1/src/webapp/samples/common/style/xsl/html simple-samples2html.xsl
vgritsenko 2003/05/06 12:23:51
Modified: src/webapp/resources/styles main.css
src/webapp/samples samples.xml
src/webapp/samples/common/style/xsl/html
simple-samples2html.xsl
Log:
rework samples xslt so samples looks similar to welcome page.
Revision Changes Path
1.2 +7 -0 cocoon-2.1/src/webapp/resources/styles/main.css
Index: main.css
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/webapp/resources/styles/main.css,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- main.css 26 Mar 2003 21:21:34 -0000 1.1
+++ main.css 6 May 2003 19:23:51 -0000 1.2
@@ -1,6 +1,10 @@
body { background-color: white; color: black; font-family: verdana, helvetica, sanf serif; font-size: 80%; }
+td { font-size: 80%; }
h1 { color: #336699; text-align: center; font-size: 3em; padding-bottom: 10px; margin: 0px; }
+h2 { color: #336699; }
+h3 { color: #336699; }
+h4 { color: #336699; }
a:link { font-weight: bold; color: #336699; }
a:visited { color: #336699; }
@@ -20,3 +24,6 @@
span.description { color: #336699; font-weight: bold; }
span.switch { cursor: pointer; margin-left: 5px; text-decoration: underline; }
+
+/* Samples */
+.group { color: #336699; border-width: 0px 0px 1px 0px; border-style: solid; border-color: #336699; }
1.13 +2 -2 cocoon-2.1/src/webapp/samples/samples.xml
Index: samples.xml
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/samples.xml,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- samples.xml 3 May 2003 17:53:11 -0000 1.12
+++ samples.xml 6 May 2003 19:23:51 -0000 1.13
@@ -2,7 +2,7 @@
<!-- CVS $Id$ -->
-<samples xmlns:xlink="http://www.w3.org/1999/xlink">
+<samples name="Cocoon Samples" xmlns:xlink="http://www.w3.org/1999/xlink">
<group name="The Power of XML">
<sample name="Hello World!" href="hello-world/">
1.4 +73 -117 cocoon-2.1/src/webapp/samples/common/style/xsl/html/simple-samples2html.xsl
Index: simple-samples2html.xsl
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/webapp/samples/common/style/xsl/html/simple-samples2html.xsl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- simple-samples2html.xsl 30 Mar 2003 12:48:33 -0000 1.3
+++ simple-samples2html.xsl 6 May 2003 19:23:51 -0000 1.4
@@ -1,7 +1,14 @@
<?xml version="1.0"?>
-<!-- Author: Nicola Ken Barozzi "nicolaken@apache.org" -->
-<!-- Author: Vadim Gritsenko "vgritsenko@apache.org" -->
-<!-- Author: Christian Haul "haul@apache.org" -->
+
+<!--+
+ | Covert samples file to the HTML page. Uses styles/main.css stylesheet.
+ |
+ | Author: Nicola Ken Barozzi "nicolaken@apache.org"
+ | Author: Vadim Gritsenko "vgritsenko@apache.org"
+ | Author: Christian Haul "haul@apache.org"
+ | CVS $Id$
+ +-->
+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink">
<xsl:param name="contextPath" select="string('/cocoon')"/>
@@ -9,43 +16,46 @@
<xsl:template match="/">
<html>
<head>
- <title>Apache Cocoon @version@</title>
- <link rel="SHORTCUT ICON" href="favicon.ico"/>
+ <title>Apache Cocoon 2.1-M2-dev</title>
+ <link rel="SHORTCUT ICON" href="favicon.ico"/>
+ <link href="{$contextPath}/styles/main.css" type="text/css" rel="stylesheet"/>
</head>
- <body bgcolor="#ffffff" link="#0086b2" vlink="#00698c" alink="#743e75">
+ <body>
<table border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
- <tr>
- <td width="*"><font face="arial,helvetica,sanserif" color="#000000">The Apache Software Foundation is proud to present...</font></td>
- <td width="40%" align="center"><img border="0" src="{$contextPath}/images/cocoon.gif"/></td>
- <td width="30%" align="center"><font face="arial,helvetica,sanserif" color="#000000"><b>version @version@</b></font></td>
- </tr>
- <tr>
- <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
- <tr>
- <td width="60%" bgcolor="#0086b2">
- <font size="+1" face="arial,helvetica,sanserif" color="#ffffff"><xsl:value-of select="samples/@name"/></font>
- </td>
- <td align="right" bgcolor="#0086b2"><i>orthogonal views: </i></td>
- <td nowrap="nowrap" bgcolor="#ffffff"><a href="?cocoon-view=content"><i>content</i></a></td>
- <td nowrap="nowrap" bgcolor="#ffffff"><a href="?cocoon-view=pretty-content"><i>pretty content</i></a></td>
- <td nowrap="nowrap" bgcolor="#ffffff"><a href="?cocoon-view=links"><i>links</i></a></td>
- </tr>
- </table>
- </tr>
+ <tr>
+ <td width="*">The Apache Software Foundation is proud to present...</td>
+ <td width="40%" align="center"><img border="0" src="{$contextPath}/images/cocoon.gif"/></td>
+ <td width="30%" align="center">Version: <b>@version@</b></td>
+ </tr>
+ </table>
+
+ <table border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
+ <tr>
+ <td width="75%">
+ <h2><xsl:value-of select="samples/@name"/></h2>
+ </td>
+ <td nowrap="nowrap" align="right">
+ Orthogonal views:
+ <a href="?cocoon-view=content">Content</a>
+  
+ <a href="?cocoon-view=pretty-content">Pretty content</a>
+  
+ <a href="?cocoon-view=links">Links</a>
+ </td>
+ </tr>
</table>
<xsl:apply-templates select="samples"/>
- <p align="center">
- <font size="-1">
- Copyright © @year@ <a href="http://www.apache.org/">The Apache Software Foundation</a>.<br/>
+ <p class="copyright">
+ Copyright © @year@ <a href="http://www.apache.org/">The Apache Software Foundation</a>.
All rights reserved.
- </font>
</p>
</body>
</html>
</xsl:template>
+
<xsl:template match="samples">
<xsl:variable name="gc" select="4"/><!-- group correction -->
<xsl:variable name="all-groups" select="$gc * count(group)"/>
@@ -103,82 +113,36 @@
<xsl:value-of select="substring-before($half-possibilities, ' ')"/>
</xsl:variable>
- <table width="100%">
- <tr>
- <td width="50%" valign="top">
- <xsl:for-each select="group">
- <xsl:variable name="group-position" select="position()"/>
-
- <xsl:choose>
- <xsl:when test="$group-position <= $half">
- <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="97%">
- <tbody>
- <tr>
- <td>
-
- <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
- <tr>
- <td bgcolor="#0086b2" width="100%" align="left">
- <font size="+1" face="arial,helvetica,sanserif" color="#ffffff"><xsl:value-of select="@name"/></font>
- </td>
- </tr>
- <tr>
- <td width="100%" bgcolor="#ffffff" align="left">
- <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
- <xsl:apply-templates/>
- </table>
- </td>
- </tr>
- </table>
-
- </td>
- </tr>
- </tbody>
- </table>
-
- <br/>
- </xsl:when>
- <xsl:otherwise></xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </td>
- <td valign="top">
- <xsl:for-each select="group"> <!-- [position()<=$half] -->
- <xsl:variable name="group-position" select="position()"/>
-
- <xsl:choose>
- <xsl:when test="$group-position > $half">
- <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="97%">
- <tbody>
- <tr>
- <td>
- <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
- <tr>
- <td bgcolor="#0086b2" width="100%" align="left">
- <font size="+1" face="arial,helvetica,sanserif" color="#ffffff"><xsl:value-of select="@name"/></font>
- </td>
- </tr>
- <tr>
- <td width="100%" bgcolor="#ffffff" align="left">
- <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
- <xsl:apply-templates/>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </tbody>
- </table>
- <br/>
- </xsl:when>
- <xsl:otherwise></xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </td>
- </tr>
+ <table width="100%" cellspacing="5">
+ <tr>
+ <td width="50%" valign="top">
+ <xsl:for-each select="group">
+ <xsl:variable name="group-position" select="position()"/>
+ <xsl:choose>
+ <xsl:when test="$group-position <= $half">
+ <h4 class="group"><xsl:value-of select="@name"/></h4>
+ <p><xsl:apply-templates/></p>
+ </xsl:when>
+ <xsl:otherwise></xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </td>
+ <td valign="top">
+ <xsl:for-each select="group"> <!-- [position()<=$half] -->
+ <xsl:variable name="group-position" select="position()"/>
+ <xsl:choose>
+ <xsl:when test="$group-position > $half">
+ <h4 class="group"><xsl:value-of select="@name"/></h4>
+ <p><xsl:apply-templates/></p>
+ </xsl:when>
+ <xsl:otherwise></xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </td>
+ </tr>
</table>
</xsl:template>
+
<xsl:template match="sample">
<xsl:variable name="link">
@@ -191,24 +155,16 @@
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
- <tr>
- <td width="100%" bgcolor="#ffffff" align="left">
- <font size="+0" face="arial,helvetica,sanserif" color="#000000">
- <a href="{$link}"><xsl:value-of select="@name"/></a><xsl:text> - </xsl:text>
- <xsl:value-of select="."/>
- </font>
- </td>
- </tr>
+
+ <a href="{$link}"><xsl:value-of select="@name"/></a><xsl:text> - </xsl:text>
+ <xsl:value-of select="."/>
+ <br/>
</xsl:template>
+
<xsl:template match="note">
- <tr>
- <td width="100%" bgcolor="#ffffff" align="left">
- <font size="+0" face="arial,helvetica,sanserif" color="#000000">
- <xsl:value-of select="."/>
- </font>
- </td>
- </tr>
+ <xsl:value-of select="."/>
+ <br/>
</xsl:template>
</xsl:stylesheet>