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