]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/work-packages_index.xsl
- more uniform layout
[helm.git] / helm / mowgli / home / xsl / work-packages_index.xsl
1 <?xml version="1.0"?>
2
3 <xsl:stylesheet version="1.0"
4                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5
6 <xsl:import href="common.xsl"/>
7
8 <xsl:output method="html"/>
9
10 <xsl:template match="/">
11  <html>
12   <head>
13    <title>Work Packages</title>
14    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
15    <link rel="stylesheet" href="../../style/mowgli.css" type="text/css"/>
16   </head>
17   <body>
18    <blockquote>
19     <xsl:call-template name="head"/>
20     <xsl:apply-templates/>
21     <xsl:call-template name="foot"/>
22    </blockquote>
23   </body>
24  </html>
25 </xsl:template>
26
27 <xsl:template match="work-packages">
28  <h1>Work Packages</h1>
29  <table border="1">
30   <thead>
31    <tr>
32     <td>Work Package:</td>
33     <td>Tasks:</td>
34     <td>Deliverables:</td>
35    </tr>
36   </thead>
37   <tbody>
38    <xsl:apply-templates select="work-package"/>
39   </tbody>
40  </table>
41  <xsl:copy-of select="description/*"/>
42 </xsl:template>
43
44 <xsl:template match="work-package">
45  <xsl:variable name="work-package"
46                select="document(concat('../xml/work-packages/',@file,'.xml'))/work-package"/>
47  <tr>
48   <td valign="top">
49    <xsl:value-of select="$work-package/@number"/>.
50    <a href="{@file}.html">
51     <xsl:value-of select="$work-package/name"/>
52    </a>
53   </td>
54   <td valign="top">
55    <xsl:choose>
56     <xsl:when test="$work-package/description/tasks">
57      <xsl:apply-templates select="$work-package/description/tasks">
58       <xsl:with-param name="url" select="concat(@file,'.html')"/>
59      </xsl:apply-templates>
60     </xsl:when>
61     <xsl:otherwise>&#x00A0;</xsl:otherwise>
62    </xsl:choose>
63   </td>
64   <td valign="top">
65    <xsl:if test="$work-package/deliverable">
66     <ul>
67      <xsl:variable name="url" select="concat(@file,'.html')"/>
68      <xsl:for-each select="$work-package/deliverable[@file]">
69       <xsl:apply-templates select="document(concat('../xml/deliverables/',@file,'.xml'))/deliverable">
70        <xsl:with-param name="url" select="$url"/>
71       </xsl:apply-templates>
72      </xsl:for-each>
73     </ul>
74    </xsl:if>
75   </td>
76  </tr>
77 </xsl:template>
78
79 <xsl:template match="tasks">
80  <xsl:param name="url"/>
81  <ul>
82   <xsl:apply-templates>
83    <xsl:with-param name="url" select="$url"/>
84   </xsl:apply-templates>
85  </ul>
86 </xsl:template>
87
88 <xsl:template match="deliverable">
89  <xsl:param name="url"/>
90  <li>
91   <a href="{$url}#{@id}">
92    <xsl:value-of select="@id"/>
93    <xsl:text> </xsl:text>
94    <xsl:value-of select="name"/>
95   </a>
96  </li>
97 </xsl:template>
98
99 <xsl:template match="task">
100  <xsl:param name="url"/>
101  <li>
102   <a href="{$url}#{@id}">
103    <xsl:value-of select="@id"/>
104    <xsl:text> </xsl:text>
105    <xsl:value-of select="name"/>
106   </a>
107  </li>
108 </xsl:template>
109
110 </xsl:stylesheet>