]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/common.xsl
- list of people
[helm.git] / helm / mowgli / home / xsl / common.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:param name="current-date" select="'???'"/>
7
8 <xsl:template name="head">
9   <xsl:param name="path_to_top" select="'.'"/>
10   <br />
11   <table border="0" cellspacing="0" cellpadding="0" width="100%">
12     <tr>
13       <td align="left" valign="bottom">
14         <div class="small">
15           <a href="{$path_to_top}/home.html">MoWGLI: Mathematics on the Web: Get It by Logic and Interfaces</a>
16         </div>
17       </td>
18       <td align="right" valign="bottom">
19         <div class="small">
20           <a href="http://www.cordis.lu/ist"><img border="0" alt="IST Logo Small" src="{$path_to_top}/../images/istbutton_small.gif"/></a>
21         </div>
22       </td>
23     </tr>
24   </table>
25   <hr/>
26 </xsl:template>
27
28 <xsl:template name="foot">
29   <xsl:param name="path_to_top" select="'.'"/>
30   <hr/>
31   <table border="0" cellspacing="0" cellpadding="0" width="100%">
32     <tr>
33       <td align="left" valign="top">
34         <div class="small">
35           This page is hosted by the
36           <a href="http:/www.cs.unibo.it">Department of Computer Science</a>,
37           <a href="http://www.unibo.it">University of Bologna</a>.
38           <br />
39           Last updated <b><xsl:value-of select="$current-date"/></b>.
40         </div>
41       </td>
42       <td align="right" valign="top">
43         <div class="small">
44           <a href="http://www.cordis.lu/ist"><img border="0" alt="IST Logo Small" src="{$path_to_top}/../images/istbutton_small.gif"/></a>
45         </div>
46       </td>
47     </tr>
48   </table>
49   <br />
50 </xsl:template>
51
52 <xsl:template name="person-name">
53   <xsl:param name="file" select="''"/>
54   <xsl:variable name="person" select="document(concat('../xml/people/',$file,'.xml'))/person"/>
55   <xsl:if test="$person/qualification">
56    <xsl:value-of select="$person/qualification"/>
57    <xsl:value-of select="' '"/>
58   </xsl:if>
59   <xsl:value-of select="$person/name"/>
60   <xsl:value-of select="' '"/>
61   <xsl:value-of select="$person/surname"/>
62 </xsl:template>
63
64 <xsl:template name="print_date">
65  <xsl:param name="date"/>
66  <xsl:variable name="year" select="substring($date,1,4)"/>
67  <xsl:variable name="month" select="substring($date,5,2)"/>
68  <xsl:variable name="day" select="substring($date,7,2)"/>
69  <xsl:call-template name="print_month">
70   <xsl:with-param name="month" select="$month"/>
71  </xsl:call-template>
72  <xsl:text> </xsl:text>
73  <xsl:call-template name="print_day">
74   <xsl:with-param name="day" select="$day"/>
75  </xsl:call-template>
76  <xsl:text>, </xsl:text>
77  <xsl:value-of select="$year"/>
78 </xsl:template>
79
80 <xsl:template name="print_month">
81  <xsl:param name="month"/>
82  <xsl:choose>
83   <xsl:when test="$month = '01'">January</xsl:when>
84   <xsl:when test="$month = '02'">February</xsl:when>
85   <xsl:when test="$month = '03'">March</xsl:when>
86   <xsl:when test="$month = '04'">April</xsl:when>
87   <xsl:when test="$month = '05'">May</xsl:when>
88   <xsl:when test="$month = '06'">June</xsl:when>
89   <xsl:when test="$month = '07'">July</xsl:when>
90   <xsl:when test="$month = '08'">August</xsl:when>
91   <xsl:when test="$month = '09'">September</xsl:when>
92   <xsl:when test="$month = '10'">October</xsl:when>
93   <xsl:when test="$month = '11'">November</xsl:when>
94   <xsl:when test="$month = '12'">December</xsl:when>
95  </xsl:choose>
96 </xsl:template>
97
98 <xsl:template name="print_day">
99  <xsl:param name="day"/>
100  <xsl:choose>
101   <xsl:when test="$day = '01'">1st</xsl:when>
102   <xsl:when test="$day = '02'">2nd</xsl:when>
103   <xsl:when test="$day = '03'">3rd</xsl:when>
104   <xsl:when test="$day = '11'">11th</xsl:when>
105   <xsl:when test="$day = '11'">12th</xsl:when>
106   <xsl:when test="$day = '11'">13th</xsl:when>
107   <xsl:when test="substring($day,2,1) = '1'">
108    <xsl:value-of select="$day"/>
109    <xsl:text>st</xsl:text>
110   </xsl:when>
111   <xsl:when test="substring($day,2,1) = '2'">
112    <xsl:value-of select="$day"/>
113    <xsl:text>nd</xsl:text>
114   </xsl:when>
115   <xsl:when test="substring($day,2,1) = '3'">
116    <xsl:value-of select="$day"/>
117    <xsl:text>rd</xsl:text>
118   </xsl:when>
119   <xsl:otherwise>
120    <xsl:value-of select="$day"/>
121    <xsl:text>th</xsl:text>
122   </xsl:otherwise>
123  </xsl:choose>
124 </xsl:template>
125
126 <xsl:template name="print_interval">
127  <xsl:param name="begin"/>
128  <xsl:param name="end"/>
129  <xsl:variable name="byear" select="substring($begin,1,4)"/>
130  <xsl:variable name="bmonth" select="substring($begin,5,2)"/>
131  <xsl:variable name="bday" select="substring($begin,7,2)"/>
132  <xsl:variable name="eyear" select="substring($end,1,4)"/>
133  <xsl:variable name="emonth" select="substring($end,5,2)"/>
134  <xsl:variable name="eday" select="substring($end,7,2)"/>
135  <xsl:choose>
136   <xsl:when test="$byear != $eyear">
137    <xsl:call-template name="print_date">
138     <xsl:with-param name="date" select="$begin"/>
139    </xsl:call-template>
140    <xsl:call-template name="print_date">
141     <xsl:text> - </xsl:text>
142     <xsl:with-param name="date" select="$end"/>
143    </xsl:call-template>
144   </xsl:when>
145   <xsl:when test="$bmonth != $emonth">
146    <xsl:call-template name="print_month">
147     <xsl:with-param name="month" select="$bmonth"/>
148    </xsl:call-template>
149    <xsl:text> </xsl:text>
150    <xsl:call-template name="print_day">
151     <xsl:with-param name="day" select="$bday"/>
152    </xsl:call-template>
153    <xsl:text> - </xsl:text>
154    <xsl:call-template name="print_month">
155     <xsl:with-param name="month" select="$emonth"/>
156    </xsl:call-template>
157    <xsl:text> </xsl:text>
158    <xsl:call-template name="print_day">
159     <xsl:with-param name="day" select="$eday"/>
160    </xsl:call-template>
161    <xsl:text>, </xsl:text>
162    <xsl:value-of select="$byear"/>
163   </xsl:when>
164   <xsl:when test="$bday != $eday">
165    <xsl:call-template name="print_month">
166     <xsl:with-param name="month" select="$bmonth"/>
167    </xsl:call-template>
168    <xsl:text> </xsl:text>
169    <xsl:call-template name="print_day">
170     <xsl:with-param name="day" select="$bday"/>
171    </xsl:call-template>
172    <xsl:text> - </xsl:text>
173    <xsl:call-template name="print_day">
174     <xsl:with-param name="day" select="$eday"/>
175    </xsl:call-template>
176    <xsl:text>, </xsl:text>
177    <xsl:value-of select="$byear"/>
178   </xsl:when>
179   <xsl:otherwise>
180    <xsl:call-template name="print_date">
181     <xsl:with-param name="date" select="$begin"/>
182    </xsl:call-template>
183   </xsl:otherwise>
184  </xsl:choose>
185 </xsl:template>
186
187 <xsl:template name="color_of_deadline_kind">
188  <xsl:param name="kind"/>
189  <xsl:choose>
190   <xsl:when test="$kind = 'submission'">
191    <xsl:text>red</xsl:text>
192   </xsl:when>
193   <xsl:when test="$kind = 'notification'">
194    <xsl:text>green</xsl:text>
195   </xsl:when>
196   <xsl:when test="$kind = 'registration'">
197    <xsl:text>blue</xsl:text>
198   </xsl:when>
199   <xsl:when test="$kind = 'camera-ready'">
200    <xsl:text>maroon</xsl:text>
201   </xsl:when>
202  </xsl:choose>
203 </xsl:template>
204
205 </xsl:stylesheet>