wrap everything in another div to enable centering of page
[cmcms:cmcms.git] / src / page.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3
4 cmcms == CMCMS Content Management System
5 Copyright (C) 2008,2009,2010,2012  Claude Heiland-Allen <claudiusmaximus@goto10.org>
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Affero General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU Affero General Public License for more details.
16
17 You should have received a copy of the GNU Affero General Public License
18 along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20 -->
21 <xsl:stylesheet version="1.0"
22  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
23  xmlns="http://www.w3.org/1999/xhtml">
24 <xsl:output method="xml" indent="no" encoding="UTF-8"
25  doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
26  doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
27 <xsl:param name="SITENAME" />
28 <xsl:param name="HEADER1" />
29 <xsl:param name="HEADER2" />
30 <xsl:param name="FOOTER" />
31 <xsl:param name="NAVIGATION" />
32 <xsl:param name="PAGE" />
33 <xsl:template match="/">
34 <xsl:apply-templates select="pages/page[file=$PAGE]" />
35 </xsl:template>
36 <xsl:template match="page">
37 <xsl:variable name="top" select="/" />
38 <html xml:lang="en" lang="en">
39 <head>
40 <title><xsl:value-of select="title" /> :: <xsl:value-of select="$SITENAME" /></title>
41 <link rel="stylesheet" type="text/css" href="cmcms.css" title="cmcms" />
42 <link rel="alternate stylesheet" type="text/css" href="print.css" title="print" />
43 </head>
44 <body><div class="body">
45 <div class="top">
46 <div class="header">
47 <xsl:copy-of select="document($HEADER1)" />
48 <xsl:apply-templates select="document($NAVIGATION)/navigation" />
49 <xsl:copy-of select="document($HEADER2)" />
50 </div>
51 <div class="main">
52 <h2 class="title"><xsl:value-of select="title" /></h2>
53 <div class="content"><xsl:apply-templates select="content/node()" /></div>
54 <div class="separator" />
55 </div>
56 </div>
57 <xsl:copy-of select="document($FOOTER)" />
58 </div></body>
59 </html>
60 </xsl:template>
61 <xsl:template match="@*|node()">
62 <xsl:choose>
63 <xsl:when test="@class='gallery'">
64 <xsl:copy-of select="document(concat('gallery_', node(), '.xml'))" />
65 </xsl:when><xsl:otherwise>
66 <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
67 </xsl:otherwise>
68 </xsl:choose>
69 </xsl:template>
70 <xsl:template match="navigation">
71 <div class="navigation"><h3>Related</h3>
72 <ul class="navigation">
73 <li><ul class="by-date">
74 <li class="later"><xsl:choose>
75 <xsl:when test="by-date/later=''">&#9675;</xsl:when>
76 <xsl:when test="by-date/later!=''"><a href="{by-date/later}.html" title="later">↑</a></xsl:when>
77 </xsl:choose></li>
78 <li class="date"><a href=".#p_{$PAGE}"><xsl:value-of select="substring(by-date/date, 0, 17)" /></a></li>
79 <li class="earlier"><xsl:choose>
80 <xsl:when test="by-date/earlier!=''"><a href="{by-date/earlier}.html" title="earlier">↓</a></xsl:when>
81 <xsl:when test="by-date/earlier=''">&#9675;</xsl:when>
82 </xsl:choose></li>
83 </ul></li>
84 <xsl:for-each select="by-tag"><li><ul class="by-tag">
85 <li class="later"><xsl:choose>
86 <xsl:when test="later=''">&#9675;</xsl:when>
87 <xsl:when test="later!=''"><a href="{later}.html" title="later">↑</a></xsl:when>
88 </xsl:choose></li>
89 <li class="tag"><a href="{tag}.html#p_{$PAGE}" title="{tag}"><xsl:value-of select="tag" /></a></li>
90 <li class="earlier"><xsl:choose>
91 <xsl:when test="earlier!=''"><a href="{earlier}.html" title="earlier">↓</a></xsl:when>
92 <xsl:when test="earlier=''">&#9675;</xsl:when>
93 </xsl:choose></li>
94 </ul></li></xsl:for-each>
95 </ul></div>
96 </xsl:template>
97 </xsl:stylesheet>