~ubuntu-branches/ubuntu/raring/lurker/raring

« back to all changes in this revision

Viewing changes to ui/message.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 message links by subject -->
 
7
<xsl:template match="summary" mode="post-subject">
 
8
 <xsl:value-of select="subject"/>
 
9
</xsl:template>
 
10
<xsl:template match="summary" mode="post-subject-link">
 
11
 <a href="{id}.{$ext}">
 
12
  <xsl:apply-templates mode="post-subject" select="."/>
 
13
 </a>
 
14
</xsl:template>
 
15
<xsl:template match="summary" mode="post-subject-list">
 
16
 <xsl:if test="position()!=1">, </xsl:if>
 
17
 <xsl:apply-templates mode="post-subject-link" select="."/>
 
18
</xsl:template>
 
19
 
 
20
 
 
21
<!-- Format the message header fields -->
 
22
<xsl:template name="header-fields">
 
23
 <b><xsl:value-of select="$author"/>:&#160;</b>
 
24
 <xsl:apply-templates select="summary/email" mode="email-link"/><br/>
 
25
 <b><xsl:value-of select="$date"/>:&#160;</b>
 
26
 <xsl:apply-templates select="summary" mode="text-date"/>
 
27
 <xsl:text>&#160;</xsl:text>
 
28
 <xsl:apply-templates select="summary" mode="timezone"/>
 
29
 <br/>
 
30
 <xsl:if test="to">
 
31
  <b><xsl:value-of select="$to"/>:&#160;</b>
 
32
  <xsl:apply-templates mode="email-list" select="to/email"/><br/>
 
33
 </xsl:if>
 
34
 <xsl:if test="cc">
 
35
  <b><xsl:value-of select="$cc"/>:&#160;</b>
 
36
  <xsl:apply-templates mode="email-list" select="cc"/><br/>
 
37
 </xsl:if>
 
38
 <xsl:if test="threading/inreplyto">
 
39
  <b><xsl:value-of select="$old-topics"/>:&#160;</b>
 
40
  <xsl:apply-templates mode="post-subject-list" select="threading/inreplyto/summary"/><br/>
 
41
 </xsl:if>
 
42
 <xsl:if test="threading/drift">
 
43
  <b><xsl:value-of select="$new-topics"/>:&#160;</b>
 
44
  <xsl:apply-templates mode="post-subject-list" select="threading/drift/summary"/><br/>
 
45
 </xsl:if>
 
46
 <b><xsl:value-of select="$subject"/>:&#160;</b>
 
47
 <xsl:value-of select="summary/subject"/><br/>
 
48
</xsl:template>
 
49
 
 
50
 
 
51
<!-- Format the mime attachments -->
 
52
<xsl:template match="mime" mode="attach">
 
53
 <xsl:if test="translate(substring-before(@type,'/'),'MULTIPART','multipart')!='multipart'">
 
54
  <a href="../attach/{@id}@{/message/summary/id}.attach">
 
55
   <img src="../imgs/paperclip.png" alt="+"/>
 
56
   <xsl:if test="@name">
 
57
    <xsl:text>&#160;</xsl:text>
 
58
    <xsl:value-of select="@name"/>
 
59
   </xsl:if>
 
60
   <xsl:text>&#160;(</xsl:text>
 
61
   <xsl:value-of select="@type"/>
 
62
   <xsl:text>)</xsl:text>
 
63
  </a>
 
64
  <br/>
 
65
 </xsl:if>
 
66
 <xsl:apply-templates mode="attach" select="mime|signed"/>
 
67
</xsl:template>
 
68
<xsl:template match="signed" mode="attach">
 
69
 <xsl:apply-templates mode="attach" select="data/mime"/>
 
70
</xsl:template>
 
71
<xsl:template name="attachments">
 
72
 <table class="attachments">
 
73
  <tr><th align="left"><xsl:value-of select="$attachments"/></th></tr>
 
74
  <tr><td>
 
75
   <a href="../mbox/{summary/id}.rfc822"><xsl:value-of select="$raw-email"/></a><br/>
 
76
   <xsl:apply-templates mode="attach" select="mime"/>
 
77
  </td></tr>
 
78
 </table>
 
79
</xsl:template>
 
80
 
 
81
 
 
82
<!-- Format the message body -->
 
83
<xsl:template mode="body" match="mailto">
 
84
 <a class="email-address" href="mailto:{.}">
 
85
  <xsl:value-of select="."/>
 
86
 </a>
 
87
</xsl:template>
 
88
<xsl:template mode="body" match="url">
 
89
 <xsl:choose>
 
90
  <xsl:when test="substring(., 1, 4) = 'www.'">
 
91
    <a class="url" href="http://{.}"><xsl:value-of select="."/></a>
 
92
  </xsl:when>
 
93
  <xsl:otherwise>
 
94
    <a class="url" href="{.}"><xsl:value-of select="."/></a>
 
95
  </xsl:otherwise>
 
96
 </xsl:choose>
 
97
</xsl:template>
 
98
<xsl:template mode="body" match="quote">
 
99
 <i class="quote"><xsl:apply-templates mode="body"/></i>
 
100
</xsl:template>
 
101
<xsl:template mode="body" match="art">
 
102
 <br/><!-- browsers ignore the first br before a pre, so we need one more -->
 
103
 <pre class="art"><xsl:apply-templates mode="body"/></pre>
 
104
</xsl:template>
 
105
<xsl:template mode="body" match="br">
 
106
 <xsl:if test="not(ancestor::art)"><br/></xsl:if>
 
107
</xsl:template>
 
108
<xsl:template mode="body" match="signed">
 
109
 <xsl:element name="div">
 
110
  <xsl:attribute name="class">
 
111
   <xsl:choose>
 
112
    <xsl:when test="@ok='yes'">goodsig</xsl:when>
 
113
    <xsl:when test="@ok='unknown'">unknownsig</xsl:when>
 
114
    <xsl:otherwise>badsig</xsl:otherwise>
 
115
   </xsl:choose>
 
116
  </xsl:attribute>
 
117
  <xsl:if test="photo"><img src="{photo}" class="photo"/></xsl:if>
 
118
  <div class="details"><xsl:apply-templates mode="body" select="details"/></div>
 
119
  <div class="data"><xsl:apply-templates mode="body" select="data"/></div>
 
120
 </xsl:element>
 
121
</xsl:template>
 
122
 
 
123
 
 
124
<!-- Format the mailing lists -->
 
125
<xsl:template mode="appear-in" match="mbox">
 
126
 <tr>
 
127
  <td nowrap="NOWRAP" class="padded">
 
128
   <b><a name="{list/id}"/><xsl:value-of select="list/email/@name"/></b><br/>
 
129
   <a href="../list/{list/id}.{$ext}"><xsl:value-of select="$list-info"/></a> |
 
130
   <a href="../mindex/{list/id}@{../summary/id}.{$ext}"><xsl:value-of select="$near-message"/></a>
 
131
  </td>
 
132
  <xsl:choose>
 
133
   <xsl:when test="prev">
 
134
    <td>
 
135
     <a href="{prev/summary/id}.{$ext}#{list/id}">
 
136
      <img src="../imgs/prev.png" alt="&lt;-"/>
 
137
     </a>
 
138
    </td>
 
139
    <td align="left" width="50%">
 
140
     <a href="{prev/summary/id}.{$ext}#{list/id}">
 
141
      <xsl:value-of select="prev/summary/subject"/>
 
142
     </a>
 
143
    </td>
 
144
   </xsl:when>
 
145
   <xsl:otherwise><td>&#160;</td><td>&#160;</td></xsl:otherwise>
 
146
  </xsl:choose>
 
147
  <xsl:choose>
 
148
   <xsl:when test="next">
 
149
    <td align="right" width="50%">
 
150
     <a href="{next/summary/id}.{$ext}#{list/id}">
 
151
      <xsl:value-of select="next/summary/subject"/>
 
152
     </a>
 
153
    </td>
 
154
    <td>
 
155
     <a href="{next/summary/id}.{$ext}#{list/id}">
 
156
      <img src="../imgs/next.png" alt="-&gt;"/>
 
157
     </a>
 
158
    </td>
 
159
   </xsl:when>
 
160
   <xsl:otherwise><td>&#160;</td><td>&#160;</td></xsl:otherwise>
 
161
  </xsl:choose>
 
162
 </tr>
 
163
</xsl:template>
 
164
 
 
165
 
 
166
<!-- Format a message request -->
 
167
<xsl:template match="message">
 
168
 <html lang="{$lang}">
 
169
  <head>
 
170
   <link rel="stylesheet" href="../fmt/default.css" type="text/css"/>
 
171
   <title><xsl:value-of select="summary/subject"/></title>
 
172
   <script type="text/javascript" src="../fmt/common.js"/>
 
173
  </head>
 
174
  <body>
 
175
   <div class="header">
 
176
    <table class="external">
 
177
     <tr>
 
178
      <td align="left">
 
179
       <h1>
 
180
        <xsl:value-of select="substring(summary/subject,1,60)"/>
 
181
        <xsl:if test="string-length(summary/subject) &gt; 60">&#x2026;</xsl:if>
 
182
       </h1>
 
183
      </td>
 
184
      <td align="right"><xsl:call-template name="navbar"/></td>
 
185
     </tr>
 
186
    </table>
 
187
    
 
188
    <table class="navigation">
 
189
     <tr><th align="left" colspan="2"><xsl:value-of select="$tree-context"/></th></tr>
 
190
     <tr>
 
191
      <td nowrap="NOWRAP">
 
192
       <xsl:apply-templates mode="tree" select="threading/snippet/tree[position()=1]"/>
 
193
      </td>
 
194
      <td align="right">
 
195
       <a href="../thread/{summary/id}.{$ext}#{summary/id}">
 
196
        <xsl:value-of select="$full-tree"/>
 
197
       </a>
 
198
      </td>
 
199
     </tr>
 
200
     <tr>
 
201
      <td nowrap="NOWRAP">
 
202
       <xsl:apply-templates mode="tree" select="threading/snippet/tree[position()=2]"/>
 
203
      </td>
 
204
      <td nowrap="NOWRAP" align="right">
 
205
       <xsl:choose>
 
206
        <xsl:when test="threading/prev">
 
207
         <a href="{threading/prev/summary/id}.{$ext}">
 
208
          <xsl:apply-templates mode="post-description-text" select="threading/prev/summary"/>
 
209
          <img src="../imgs/prev.png" alt="&lt;-"/>
 
210
         </a>
 
211
        </xsl:when>
 
212
        <xsl:otherwise>&#160;</xsl:otherwise>
 
213
       </xsl:choose>
 
214
      </td>
 
215
     </tr>
 
216
     <tr>
 
217
      <td nowrap="NOWRAP">
 
218
       <xsl:apply-templates mode="tree" select="threading/snippet/tree[position()=3]"/>
 
219
      </td>
 
220
      <td nowrap="NOWRAP" align="right">
 
221
       <xsl:choose>
 
222
        <xsl:when test="threading/next">
 
223
         <a href="{threading/next/summary/id}.{$ext}">
 
224
          <xsl:apply-templates mode="post-description-text" select="threading/next/summary"/>
 
225
          <img src="../imgs/next.png" alt="-&gt;"/>
 
226
         </a>
 
227
        </xsl:when>
 
228
        <xsl:otherwise>&#160;</xsl:otherwise>
 
229
       </xsl:choose>
 
230
      </td>
 
231
     </tr>
 
232
    </table>
 
233
   </div>
 
234
   
 
235
   <div class="body">
 
236
    <xsl:if test="/message/server/raw-email">
 
237
      <xsl:call-template name="attachments"/>
 
238
    </xsl:if>
 
239
    <xsl:call-template name="header-fields"/>
 
240
    <div class="messageBody">
 
241
     <xsl:apply-templates mode="body" select="mime"/>
 
242
    </div>
 
243
   </div>
 
244
   
 
245
   <div class="footer">
 
246
    <table class="navigation">
 
247
     <tr>
 
248
      <th colspan="5" align="left">
 
249
       <xsl:value-of select="$mail-appears-in"/>
 
250
      </th>
 
251
     </tr>
 
252
     <xsl:apply-templates mode="appear-in" select="mbox"/>
 
253
    </table>
 
254
    <xsl:call-template name="lurker-signature"/>
 
255
   </div>
 
256
  </body>
 
257
 </html>
 
258
</xsl:template>
 
259
 
 
260
</xsl:stylesheet>