~ubuntu-branches/ubuntu/breezy/lurker/breezy

« back to all changes in this revision

Viewing changes to ui/list.xsl

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Meurer
  • Date: 2004-09-26 16:27:51 UTC
  • Revision ID: james.westby@ubuntu.com-20040926162751-z1ohcjltv7ojtg6z
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
3
 
 
4
<xsl:import href="common.xsl"/>
 
5
 
 
6
<!-- Format a new thread row -->
 
7
<xsl:template name="max">
 
8
 <xsl:param name="args"/>
 
9
 <xsl:variable name="rest"  select="$args[position() &gt; 1]"/>
 
10
 <xsl:variable name="first">
 
11
  <xsl:value-of select="$args[position()=1]"/>
 
12
 </xsl:variable>
 
13
 <xsl:variable name="best">
 
14
  <xsl:choose>
 
15
   <xsl:when test="count($args) &gt; 0">
 
16
    <xsl:call-template name="max">
 
17
     <xsl:with-param name="args" select="$rest"/>
 
18
    </xsl:call-template>
 
19
   </xsl:when>
 
20
   <xsl:otherwise>0</xsl:otherwise>
 
21
  </xsl:choose>
 
22
 </xsl:variable>
 
23
 <xsl:choose>
 
24
  <xsl:when test="$best &gt; $first"><xsl:value-of select="$best"/></xsl:when>
 
25
  <xsl:otherwise><xsl:value-of select="$first"/></xsl:otherwise>
 
26
 </xsl:choose>
 
27
</xsl:template>
 
28
<xsl:template match="row" mode="newthreads">
 
29
 <xsl:element name="tr">
 
30
  <xsl:attribute name="onClick">
 
31
   <xsl:text>self.location='</xsl:text>
 
32
   <xsl:value-of select="../server/doc-url"/>
 
33
   <xsl:choose>
 
34
    <xsl:when test="sum(day) &lt;= 1"><xsl:text>/message/</xsl:text></xsl:when>
 
35
    <xsl:otherwise><xsl:text>/thread/</xsl:text></xsl:otherwise>
 
36
   </xsl:choose>
 
37
   <xsl:value-of select="summary/id"/>
 
38
   <xsl:text>.</xsl:text>
 
39
   <xsl:value-of select="$ext"/>
 
40
   <xsl:text>';</xsl:text>
 
41
  </xsl:attribute>
 
42
  <xsl:attribute name="onDblClick">
 
43
   <xsl:text>self.location='</xsl:text>
 
44
   <xsl:value-of select="../server/doc-url"/>
 
45
   <xsl:text>/message/</xsl:text>
 
46
   <xsl:value-of select="summary/id"/>
 
47
   <xsl:text>.</xsl:text>
 
48
   <xsl:value-of select="$ext"/>
 
49
   <xsl:text>';</xsl:text>
 
50
  </xsl:attribute>
 
51
  <xsl:attribute name="onMouseOver">rollIn(this);</xsl:attribute>
 
52
  <xsl:attribute name="onMouseOut">rollOut(this);</xsl:attribute>
 
53
  <xsl:attribute name="class">
 
54
   <xsl:choose>
 
55
    <xsl:when test="@selected">lit</xsl:when>
 
56
    <xsl:when test="(position() mod 2) = 0">row1</xsl:when>
 
57
    <xsl:otherwise>row2</xsl:otherwise>
 
58
   </xsl:choose>
 
59
  </xsl:attribute>
 
60
  <td nowrap="NOWRAP">
 
61
   <div class="squash" onclick="this.firstChild.removeAttribute('href');">
 
62
   <xsl:choose>
 
63
    <xsl:when test="sum(day) &lt;= 1">
 
64
     <a href="../message/{summary/id}.{$ext}"><xsl:value-of select="title"/></a>
 
65
    </xsl:when>
 
66
    <xsl:otherwise>
 
67
     <a href="../thread/{summary/id}.{$ext}"><xsl:value-of select="title"/></a>
 
68
    </xsl:otherwise>
 
69
   </xsl:choose>
 
70
   </div>
 
71
  </td>
 
72
  <td nowrap="NOWRAP">
 
73
   <div class="squash">
 
74
    <xsl:apply-templates mode="email-name" select="summary/email"/>
 
75
   </div>
 
76
  </td>
 
77
  <td nowrap="NOWRAP" class="chart">
 
78
   <xsl:variable name="maxval">
 
79
    <xsl:call-template name="max">
 
80
     <xsl:with-param name="args" select="day"/>
 
81
    </xsl:call-template>
 
82
   </xsl:variable>
 
83
   <xsl:for-each select="day">
 
84
    <img src="../imgs/bar.png" height="{(number(.)*21 div $maxval)+1}" width="5" alt=""/>
 
85
   </xsl:for-each>
 
86
  </td>
 
87
  <td align="right">
 
88
   <xsl:value-of select="sum(day)"/>
 
89
  </td>
 
90
 </xsl:element>
 
91
 <xsl:text>&#10;</xsl:text>
 
92
</xsl:template>
 
93
 
 
94
 
 
95
<!-- Format a list request -->
 
96
<xsl:template match="list">
 
97
 <html lang="{$lang}">
 
98
  <head>
 
99
   <link rel="stylesheet" href="../fmt/default.css" type="text/css"/>
 
100
   <title><xsl:value-of select="list/email/@name"/></title>
 
101
   <script type="text/javascript" src="../fmt/common.js"/>
 
102
  </head>
 
103
  <body>
 
104
   <div class="header">
 
105
    <table class="external">
 
106
     <tr>
 
107
      <td align="left"><h1><xsl:value-of select="list/email/@name"/></h1></td>
 
108
      <td align="right"><xsl:call-template name="navbar"/></td>
 
109
     </tr>
 
110
    </table>
 
111
    
 
112
    <table class="navigation">
 
113
     <tr><th align="left" colspan="2"><xsl:value-of select="$jump-to-date"/></th></tr>
 
114
     <tr>
 
115
      <td>
 
116
        <!-- make this the same height as mindex -->
 
117
        <img src="../imgs/a.png" width="1" height="24" alt=""/>
 
118
      </td>
 
119
      <td nowrap="NOWRAP" align="center" width="100%">
 
120
       <form action="{server/cgi-url}/jump.cgi" onsubmit="form_timezone(this)">
 
121
        <input type="hidden" name="doc-url" value="{server/doc-url}"/>
 
122
        <input type="hidden" name="format" value="{$ext}"/>
 
123
        <input type="hidden" name="list" value="{list/id}"/>
 
124
        
 
125
        <xsl:call-template name="date-fields">
 
126
         <xsl:with-param name="date" select="$jump-date"/>
 
127
        </xsl:call-template>
 
128
        <input type="submit" value="{$jump-button}"/>
 
129
       </form>
 
130
      </td>
 
131
     </tr>
 
132
     <tr>
 
133
      <td colspan="2" align="center">
 
134
       [ <a href="../mindex/{list/id}@{$last-date}.{$ext}"><xsl:value-of select="$newest-messages"/></a> ]
 
135
       [ <a href="../splash/index.{$ext}#{list/group}"><xsl:value-of select="$jump-group"/></a> ]
 
136
       <xsl:if test="list/email/@address">
 
137
        [ <a href="mailto:{list/email/@address}"><xsl:value-of select="$post-new"/></a> ]
 
138
       </xsl:if>
 
139
       <xsl:if test="list/link">
 
140
        [ <a href="{list/link}"><xsl:value-of select="$subscribe"/></a> ]
 
141
       </xsl:if>
 
142
      </td>
 
143
     </tr>
 
144
    </table>
 
145
   </div>
 
146
   
 
147
   
 
148
   <div class="body">
 
149
    <div class="mozbug">
 
150
     <table class="index squash">
 
151
      <col width="60%" align="left"/>
 
152
      <col width="30%" align="left"/>
 
153
      <col width="85"  align="left"/>
 
154
      <col width="40"  align="right"/>
 
155
      <tr>
 
156
       <th align="left"><xsl:value-of select="$new-threads"/></th>
 
157
       <th align="left"><xsl:value-of select="$recent-poster"/></th>
 
158
       <th align="left"><xsl:value-of select="$activity-chart"/></th>
 
159
       <th align="right"><xsl:value-of select="$post-count"/></th>
 
160
      </tr>
 
161
      <xsl:apply-templates mode="newthreads" select="row"/>
 
162
     </table>
 
163
    </div>
 
164
    
 
165
<!-- this annoys me
 
166
    <br/>
 
167
    
 
168
    <xsl:if test="list/description">
 
169
     <h2><xsl:value-of select="list/description"/></h2>
 
170
    </xsl:if>
 
171
-->
 
172
   </div>
 
173
   
 
174
   
 
175
   <div class="footer">
 
176
    <table class="navigation">
 
177
     <tr><th align="left" colspan="2"><xsl:value-of select="$search-list"/></th></tr>
 
178
     <tr>
 
179
      <td>
 
180
        <!-- make this the same height as mindex -->
 
181
        <img src="../imgs/a.png" width="1" height="24" alt=""/>
 
182
      </td>
 
183
      <td nowrap="NOWRAP" align="center">
 
184
       <form action="{server/cgi-url}/keyword.cgi" accept-charset="UTF-8">
 
185
        <input type="hidden" name="doc-url" value="{server/doc-url}"/>
 
186
        <input type="hidden" name="format"  value="{$ext}"/>
 
187
        <input type="text"   name="query"   value="ml:{list/id} " class="longtext"/>
 
188
        <input type="submit" name="submit"  value="{$search-button}"/>
 
189
       </form>
 
190
      </td>
 
191
     </tr>
 
192
     <tr>
 
193
      <td colspan="2" align="center">
 
194
       <xsl:value-of select="$use-special-word-list"/>
 
195
       <b>ml:<xsl:value-of select="list/id"/></b>
 
196
       <xsl:value-of select="$to-search-list"/>
 
197
      </td>
 
198
     </tr>
 
199
    </table>
 
200
    <xsl:call-template name="lurker-signature"/>
 
201
   </div>
 
202
  </body>
 
203
 </html>
 
204
</xsl:template>
 
205
 
 
206
</xsl:stylesheet>