]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/work-packages_index.xsl
- main page now generated automatically
[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     <xsl:call-template name="head">
19      <xsl:with-param name="path_to_top" select="'..'"/>
20     </xsl:call-template>
21     <xsl:apply-templates/>
22     <xsl:call-template name="foot">
23      <xsl:with-param name="path_to_top" select="'..'"/>
24     </xsl:call-template>
25   </body>
26  </html>
27 </xsl:template>
28
29 <xsl:template match="work-packages">
30  <h1>Work Packages</h1>
31  <table border="1">
32   <thead>
33    <tr>
34     <td>Work Package:</td>
35     <td>Tasks:</td>
36     <td>Deliverables:</td>
37    </tr>
38   </thead>
39   <tbody>
40    <xsl:apply-templates select="work-package"/>
41   </tbody>
42  </table>
43  <xsl:copy-of select="description/*"/>
44 </xsl:template>
45
46 <xsl:template match="work-package">
47  <xsl:variable name="work-package"
48                select="document(concat('../xml/work-packages/',@file,'.xml'))/work-package"/>
49  <tr>
50   <td valign="top">
51    <xsl:value-of select="$work-package/@number"/>.
52    <a href="{@file}.html">
53     <xsl:value-of select="$work-package/name"/>
54    </a>
55   </td>
56   <td valign="top">
57    <xsl:choose>
58     <xsl:when test="$work-package/description/tasks">
59      <xsl:apply-templates select="$work-package/description/tasks">
60       <xsl:with-param name="url" select="concat(@file,'.html')"/>
61      </xsl:apply-templates>
62     </xsl:when>
63     <xsl:otherwise>&#x00A0;</xsl:otherwise>
64    </xsl:choose>
65   </td>
66   <td valign="top">
67    <xsl:if test="$work-package/deliverable">
68     <ul>
69      <xsl:for-each select="$work-package/deliverable[@file]">
70       <xsl:apply-templates select="document(concat('../xml/deliverables/',@file,'.xml'))/deliverable">
71        <xsl:with-param name="url" select="concat('../deliverables/',@file,'.html')"/>
72       </xsl:apply-templates>
73      </xsl:for-each>
74     </ul>
75    </xsl:if>
76   </td>
77  </tr>
78 </xsl:template>
79
80 <xsl:template match="tasks">
81  <xsl:param name="url"/>
82  <ul>
83   <xsl:apply-templates>
84    <xsl:with-param name="url" select="$url"/>
85   </xsl:apply-templates>
86  </ul>
87 </xsl:template>
88
89 <xsl:template match="deliverable">
90  <xsl:param name="url"/>
91  <li>
92   <a href="{$url}">
93    <xsl:value-of select="@id"/>
94    <xsl:text> </xsl:text>
95    <xsl:value-of select="name"/>
96   </a>
97  </li>
98 </xsl:template>
99
100 <xsl:template match="task">
101  <xsl:param name="url"/>
102  <li>
103   <a href="{$url}#{@id}">
104    <xsl:value-of select="@id"/>
105    <xsl:text> </xsl:text>
106    <xsl:value-of select="name"/>
107   </a>
108  </li>
109 </xsl:template>
110
111 </xsl:stylesheet>