c04625a3d584020e5a4da1388d0f5835b9b81020
[citadel.git] / webcit / static / t / sieve / list.html
1 <?=("head")><?%("COND:LOGGEDIN", 1, 1, 1, "", ="paging")>
2
3 <?--("iterate over an empty template, so we have the states already loaded for below")><?ITERATE("SIEVE:SCRIPTS", ="sieve_empty")>
4 <script type="text/javascript">
5
6         var previously_active_script;
7
8         function ToggleSievePanels() {
9                 d = ($('sieveform').bigaction.options[$('sieveform').bigaction.selectedIndex].value);
10                 for (i=0; i<3; ++i) {
11                         if (i == d) {
12                                 $('sievediv' + i).style.display = 'block';
13                         }
14                         else {
15                                 $('sievediv' + i).style.display = 'none';
16                         }
17                 }
18         }
19
20         function ToggleScriptPanels() {
21                 d = ($('sieveform').active_script.options[$('sieveform').active_script.selectedIndex].value);
22                 if ($('script_' + previously_active_script)) {
23                         $('script_' + previously_active_script).style.display = 'none';
24                 }
25                 $('script_' + d).style.display = 'block';
26                 previously_active_script = d;
27         }
28 </script>
29
30 <div id="banner">
31         <img src="static/webcit_icons/essen/32x32/config.png">
32         <h1><?_("View/edit server-side mail filters")></h1>
33 </div>
34
35 <div id="content" class="service">
36
37   <table class="sieve_background">
38     <tr><td valign="top"><form id="sieveform" method="post" action="save_sieve">
39         <input type="hidden" name="nonce" value="<?NONCE>">
40
41         <?_("When new mail arrives: ")>
42         <select name="bigaction" size=1 onChange="ToggleSievePanels();">
43           <option <?%("COND:BSTR", 1, "__SIEVE:RULESSCRIPT", 1, "", "selected")> value="0"><?_("Leave it in my inbox without filtering")></option>
44           <option <?%("COND:BSTR", 1, "__SIEVE:RULESSCRIPT", 1, "selected", "")> value="1"><?_("Filter it according to rules selected below")></option>
45           <option <?%("COND:BSTR", 1, "__SIEVE:EXTERNAL_SCRIPT", 1, "selected", "")> value="2"><?_("Filter it through a manually edited script (advanced users only)")></option>
46         </select>
47
48 <?--("The no filtering div")>
49         <div id="sievediv0" style="display:none">
50                 <div align="center">
51                         <br><br>
52                         <?_("Your incoming mail will not be filtered through any scripts.")>
53                         <br><br>
54                 </div>
55         </div>
56
57 <?--("The webcit managed scripts div")>
58         <div id="sievediv1" style="display:none">
59                 <?=("sieve_display")><br>
60                 <table cellpadding="2" width="100%" class="altern">
61                         <?ITERATE("SIEVE:RULES", ="sieve_display_one")>
62                 </table>
63                 <br>
64                 <div id="div_addrule"><a href="javascript:AddRule();"><?_("Add rule")></a><br></div>
65                 <script type="text/javascript">UpdateRules();</script>
66         </div>
67
68 <?--("The I am smart and can write my own Sieve scripts div")>
69         <div id="sievediv2" style="display:none">
70                 <??("COND:BSTR", 1, "__SIEVE:EXTERNALSCRIPT", 1)>
71                         <?_("The currently active script is: ")>
72                         <select name="active_script" size=1 onChange="ToggleScriptPanels();">
73                                 <?ITERATE("SIEVE:SCRIPTS", ="sieve_list_select_one")>
74                         </select>
75                         &nbsp;&nbsp;&nbsp;
76                         <a href="display_sieve_add_or_delete"><?_("Add or delete scripts")></a>
77                         <br>
78                         <?ITERATE("SIEVE:SCRIPTS", ="sieve_display_one_script")>
79                 <??("X", 1)>
80                 <script type="text/javascript">ToggleScriptPanels();</script>
81         </div>
82
83 <?--("The rest of this is common for all panels... ")>
84         <div align="center"><br>
85                 <input type="submit" name="save_button" value='<?_("Save changes")>'>
86                 &nbsp;
87                 <input type="submit" name="cancel_button" value='<?_("Cancel")>'>
88         </div>
89   </form></td></tr></table>
90
91   <script type="text/javascript">ToggleSievePanels();</script>
92
93 </div> <!-- end of 'content' div -->
94 <?=("trailing")>