/[mws]/trunk/templates/master.html
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/templates/master.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6 by dpavlin, Wed May 5 13:42:27 2004 UTC revision 20 by dpavlin, Fri May 7 23:35:39 2004 UTC
# Line 1  Line 1 
1  <html>  <html>
2  <head>  <head>
3    <title>[% IF title %][% title %] -- [% END %]Mail::Box Web Search</title>
4  </head>  </head>
5    
6    [% MACRO search(fld,text,link_text) BLOCK; %]
7    <a href="?search=[% fld %]:[% IF fld == "subject" %][% FILTER subject_search ; text ; END %][% ELSE ; text ; END %]">[% IF link_text ; link_text ; ELSE ; text ; END %]</a>
8    [% END %]
9    
10    [% MACRO option(var, value, text) BLOCK %]
11    <option value="[% value %]"[% IF value == param.search_fld %] selected[% END %]>[% text %]</option>
12    [% END %]
13    
14    [% MACRO from(message) BLOCK %]
15    <span class="from">
16     [% FOREACH f IN message.from %]
17      [% search('from_phrase',f) %][% IF !loop.last %],[% END %]
18     [% END %]
19    </span>
20    [% END %]
21    
22    [% MACRO to(message) BLOCK %]
23    [% IF message.to.size %]
24    <span class="to">To:
25     [% FOREACH f IN message.to %]
26      [% search('to_phrase',f) %][% IF !loop.last %], [% END %]
27     [% END %]
28    </span>
29    [% END %]
30    [% IF message.cc.size %]
31    <span class="cc">Cc:
32     [% FOREACH f IN message.cc %]
33      [% search('cc_phrase',f) %][% IF !loop.last %], [% END %]
34     [% END %]
35    </span>
36    [% END %]
37    [% IF message.bcc.size %]
38    <span class="bcc">Bcc:
39     [% FOREACH f IN message.bcc %]
40      [% IF loop.fist %]Bcc [% END %]
41      [% search('bcc_phrase',f) %][% IF !loop.last %], [% END %]
42     [% END %]
43    </span>
44    [% END %]
45    [% END %]
46    
47    [% MACRO date(msg) BLOCK %]
48    <span class="date">[% msg.date %]</span>
49    [% END %]
50    
51    [% MACRO usage_list(list,key,description) BLOCK %]
52    [% IF list %]
53    <div class="[% key %]">
54    [% description %]
55    [% FOREACH l IN list %]
56    <br><a href="?search=from_phrase:[% l.name %]">[% l.name %]</a>&nbsp;<span class="counter">[% l.usage %]</span>
57    [% END %]
58    </div>
59    [% END %]
60    [% END %]
61    
62  <body>  <body>
63    
64  [% INCLUDE results.html %]  <table border="0" width="100%">
65    <tr>
66    <td colspan="2">
67    
68    <form>
69    Search
70    <select name="search_fld">
71    [% option("search_fld","message","anywhere") %]
72    [% option("search_fld","subject","message subject") %]
73    [% option("search_fld","body","message text") %]
74    [% option("search_fld","from_phrase","sender name") %]
75    [% option("search_fld","from_address","sender address") %]
76    [% option("search_fld","to_phrase","recipient name") %]
77    [% option("search_fld","to_address","recipient address") %]
78    [% option("search_fld","cc_phrase","also to name") %]
79    [% option("search_fld","bcc_phrase","sneek to name") %]
80    </select>
81    <input type="text" name="search_val" size=20 value="[% param.search_val %]">
82    </select>
83    <input type="submit" name="submit" value="Go!">
84    </form>
85    
86    </td>
87    </tr>
88    
89    <tr>
90    <td valign="top" width="90%">
91    
92    [% IF results %]
93     [% INCLUDE results.html %]
94    [% ELSIF message %]
95     [% INCLUDE message.html %]
96    [% END %]
97    
98    </td>
99    <td valign="top">
100    
101    [% USE cal = Calendar.Simple(mm,yyyy) %]
102    
103    [% PERL %]
104    $stash->set( get_cal => sub {
105            my $cal = shift;
106            my $yyyy = shift || return "BUG2";
107            my $mm = shift || return "BUG3";
108            my $day = shift || return "&nbsp;";
109    
110            return $day if (! $cal);        # no calendar entries
111    
112            my $yyyymm = sprintf("%04d-%02d",$yyyy,$mm);
113            my $dd = sprintf("%02d",$day);
114    
115            if ($cal->{$yyyymm}->{$dd}) {
116                    return "<a href=\"/$yyyy/$mm/$dd/\" title=\"".$cal->{$yyyymm}->{$dd}."\">$day</a>";
117            } else {
118                    return $day;
119            }
120    } );
121    [% END %]
122    
123      <table border="0">
124      <tr><th colspan="7"><a href="/[% yyyy ; "/" ; mm %]/">[% yyyy ; "-" ; mm %]</a></th></tr>
125      [% FOREACH row = cal.rows %]
126         <tr>
127         [% FOREACH col = row %]
128            <td align="right">[% get_cal(calendar,yyyy,mm,col) %]</td>
129         [% END %]
130         </tr>
131      [% END %]
132      </table>
133    
134    <br>
135    Thread
136    
137    [% usage_list(counters.from,'from','From') %]
138    
139    [% usage_list(counters.to,'to','To') %]
140    
141    [% usage_list(counters.cc,'cc','Cc') %]
142    
143    <br>
144    Lists
145    
146    <br>
147    Links
148    
149    <br>
150    [% USE dumper ; dumper.dump(calendar) %]
151    
152    </td>
153    
154    </tr>
155    
156    
157    </table>
158    
159  </body>  </body>

Legend:
Removed from v.6  
changed lines
  Added in v.20

  ViewVC Help
Powered by ViewVC 1.1.26