9580165c332ace410b401c90a3820fd5534ccb6e
[citadel.git] / webcit / static / t / sieve / list.html
1 <?=("head")><?=("important_msg")><?%("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 <?ITERATE("SIEVE:RULE:EMPTY", ="sieve_display_one")>
30
31
32 <div id="banner">
33 <img src="static/webcit_icons/essen/32x32/config.png">
34 <h1><?_("View/edit server-side mail filters")></h1>
35 </div>
36
37 <div id="content" class="service">
38
39 <table class="sieve_background">
40 <tr><td valign=top>
41 <form id="sieveform" method="post" action="save_sieve">
42 <input type="hidden" name="nonce" value="<?NONCE>">
43
44 <?--("The no filtering div")>
45 <?_("When new mail arrives: ")>
46 <select name="bigaction" size=1 onChange="ToggleSievePanels();">
47  <option <?%("COND:BSTR", 1, "__SIEVE:RULESSCRIPT", 1, "", "selected")> value="0"><?_("Leave it in my inbox without filtering")></option>
48  <option <?%("COND:BSTR", 1, "__SIEVE:RULESSCRIPT", 1, "selected", "")> value="1"><?_("Filter it according to rules selected below")></option>
49  <option <?%("COND:BSTR", 1, "__SIEVE:EXTERNAL_SCRIPT", 1, "selected", "")> value="2"><?_("Filter it through a manually edited script (advanced users only)")></option>
50 </select>
51
52 <div id="sievediv0" style="display:none">
53 <div align="center"><br><br>
54 <?_("Your incoming mail will not be filtered through any scripts.")>
55 <br><br></div>
56 </div>
57 <?--("The webcit managed scripts div")>
58
59 <div id="sievediv1" style="display:none">
60
61 <?=("sieve_display")>
62 </div>
63 <?--("The I am smart and can write my own Sieve scripts div ")>
64
65 <div id="sievediv2" style="display:none">
66
67 <?!("COND:BSTR", 1, "__SIEVE:RULESSCRIPT", 1)>
68 <?_("The currently active script is: ")>
69 <select name="active_script" size=1 onChange="ToggleScriptPanels();">
70 <?ITERATE("SIEVE:SCRIPTS", ="sieve_list_select_one")>
71 </select>
72
73 &nbsp;&nbsp;&nbsp;
74 <a href="display_add_remove_scripts"><?_("Add or delete scripts")></a>
75 <br>
76 <?ITERATE("SIEVE:RULES", ="sieve_display_one_script")>
77
78 <??("X", 1)>
79
80 <script type="text/javascript">ToggleScriptPanels();</script>
81 </div>
82 <?--("The rest of this is common for all panels... ")>
83
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></form>
89
90 </td></tr></table>
91
92 <script type="text/javascript">ToggleSievePanels();</script>
93 </div> <!-- end of 'content' div -->
94 <?=("trailing")>