<!-- $Id: serveradmin.tt2 12726 2016-03-09 04:01:24Z sikeda $ -->

[% IF subaction == '' or subaction == 'm_lists' %]
<h2>[%|loc%]Lists[%END%]</h2>

    <h3>[%|loc%]Information[%END%]</h3>
       <ul>
          <li><a href="[% 'get_pending_lists' | url_rel %]">[%|loc%]View Pending (Requested) lists[%END%]</a></li>
          <li><a href="[% 'get_closed_lists' | url_rel %]">[%|loc%]View Closed Lists[%END%]</a></li>
          <li><a href="[% 'get_latest_lists' | url_rel %]">[%|loc%]View Lists sorted by Creation Date[%END%]</a></li>
          <li><a href="[% 'get_inactive_lists' | url_rel %]">[%|loc%]View Lists sorted by Last Message Date[%END%]</a></li>
       </ul>
[% END %] 

[% IF main_robot %]
  [% IF subaction == 'vhosts' %]
<h2>[%|loc%]Virtual Robots[%END%]</h2> <br />
  [% IF robots %]
    [%|loc%]The following virtual robots are running on this server:[%END%]
    <ul>
    [% FOREACH vr = robots %]<li><a href="[% vr.value.wwsympa_url %]/serveradmin">[% vr.key %]</a> - <i>[%|loc%]Sympa URL:[%END%]</i> <b>[% vr.value.wwsympa_url %]</b> - <i>[%|loc%]Mail domain:[%END%]</i> <b>[% vr.value.host %]</b> - <i>[%|loc%]Listmaster(s):[%END%]</i> <b>[% FOREACH admin = vr.value.listmaster %][% admin %] [% END %]</b></li>[% END %]
    </ul>
  [% ELSE %]
    <p>[%|loc%]No Virtual Robot defined on this server[%END%]</p>
  [% END %]
  [% END %]
[% END %]

[% IF families -%]
  [% IF subaction == 'families' %]
<h2>[%|loc%]Families[%END%]</h2><br />
  <form action="[% path_cgi %]" method="post">
  <fieldset>
  <select name="family_name">
    [% FOREACH f = families %]
	<option value='[% f %]'>[% f %]</option>[% END %]
  </select>
  <input class="MainMenuLinks" type="submit" name="action_review_family" value="[%|loc%]Review lists from this family[%END%]" />
  </fieldset>
  </form>     
  [% END %]
[% END %] 
[% IF subaction == 'users' %]
<hr>
<h2>[%|loc%]Users[%END%]</h2>
        <p>[%|loc%]Enter an email address of a user to view lists that they are subscribed to:[%END%]</p>
        <form action="[% path_cgi %]" method="post">
	<fieldset>
          <div style="padding-bottom:1.0em;">
	    <input type="text" name="email" size="30" value="[% email %]" />
          </div>
	  <input type="hidden" name="action" value="search_user" />
	  <input class="MainMenuLinks" type="submit" name="action_search_user" value="[%|loc%]Search User[%END%]" />
	</fieldset>
	</form>

<hr>
<h2>[%|loc%]Sessions[%END%]</h2>
<form class="bold_label" action="[% path_cgi %]" method="post">
<fieldset>
<span>[%|loc%]View session information for users connected to this web interface:[%END%]</span>
<label for="session_delay">[%|loc%]Delay for active sessions (minutes)[%END%] </label>
<input type="text" id="session_delay" name="session_delay" size="2" value="10" />
<input type="checkbox" id="connected_only" name="connected_only" /><label for="connected_only">[%|loc%]Show only currently connected users[%END%] </label><br />
<input type="submit" name="action_show_sessions" value="[%|loc%]Show Sessions[%END%]" />
</fieldset>
</form>

<hr>
<h2>[%|loc%]Impersonate another User[%END%]</h2>
<p>[%|loc%]Listmasters can switch context (impersonate) other users; this may be useful when providing assistance or when testing privileges.  Enter the email address of the user you'd like to switch context to:[%END%]</p>
<form class="bold_label" action="[% path_cgi %]" method="post">
<fieldset>
<input id="session_email" type="text" name="email" size="50"/> 
<div style="padding-top:1.0em; clear:both;"><input class="MainMenuLinks" type="submit" name="action_set_session_email" value="[%|loc%]Switch User Context[%END%]" /></div>
</fieldset>
</form>
[% END %] 

[% IF subaction == 'archives' %]
<h2>[%|loc%]Archives[%END%]</h2>
[%|loc%]It is possible to rebuild HTML archives for an individual list or for all lists (in batch).[%END%]
<hr>
<h3>[%|loc%]Rebuild archives for an individual list[%END%]</h3>
<p>[%|loc%]Enter the name of the list that you'd like to rebuild HTML archives for:[%END%]</p>

<form action="[% path_cgi %]" method="post">
<fieldset>
<label for="list"></label><input id="list" type="text" name="list" size="20" /><div style="padding-top:1.0em; padding-bottom:0.25em; float:clear;"><input class="MainMenuLinks" type="submit" name="action_rebuildarc" value="[%|loc%]Rebuild archive[%END%]" /></div>

<h3>[%|loc%]Rebuild archives for all lists[%END%]</h3>
<p><b>[%|loc%]Note:[%END%]</b> [%|loc%]As this option may take a long time to complete, it is recommended (if possible) to use this option during non-busy times.[%END%]
<div style="padding-bottom: 1.0em; float:clear;"> <input class="MainMenuLinks" type="submit" name="action_rebuildallarc" value="[%|loc%]Rebuild all[%END%]" /></div>
</fieldset>
</form>
[% END %] 

[% IF subaction == 'logs' %]
<h2>[%|loc%]System log[%END%]</h2>
<h3>[%|loc%]Sympa log level[%END%]</h3>
<p>[%|loc%]Set debug level for logs written to disk.  This setting is temporary, applying only for the lifetime of the fastcgi session hosting this interface.[%END%]</p>
<form class="bold_label" action="[% path_cgi %]" method="post">
<fieldset>
[%|loc%]Log level:[%END%] 
<input id="log_level_0" type="radio" name="log_level" value="0" [%IF log_level == 0 %]checked="checked"[%END%]/> <label class="inlineLabel" for="log_level_0">0 </label> 
<input id="log_level_1" type="radio" name="log_level" value="1" [%IF log_level == 1 %]checked="checked"[%END%]/> <label class="inlineLabel" for="log_level_1">1 </label>
<input id="log_level_2" type="radio" name="log_level" value="2" [%IF log_level == 2 %]checked="checked"[%END%]/> <label class="inlineLabel" for="log_level_2">2 </label>
<input id="log_level_3" type="radio" name="log_level" value="3" [%IF log_level == 3 %]checked="checked"[%END%]/> <label class="inlineLabel" for="log_level_3">3 </label>
<input id="log_level_4" type="radio" name="log_level" value="4" [%IF log_level == 4 %]checked="checked"[%END%]/> <label class="inlineLabel" for="log_level_4">4 </label>
<input type="submit" name="action_set_loglevel" value="[%|loc%]Set log level[%END%]" />
</fieldset>
</form>
[% END %] 

[% IF subaction == 'templates' %]
<h2>[%|loc%]Templates[%END%]</h2>
<form class="bold_label" action="[% path_cgi %]" method="post">
<fieldset>
  <h3>[%|loc%]Edit default list template[%END%]</h3>
  <select id="file" name="file">
    [% FOREACH f = lists_default_files %]<option value='[% f.key %]' [% f.value.selected %]>[% f.value.complete %]</option>[% END %]
  </select>
  <input type="submit" name="action_editfile" value="[%|loc%]Edit[%END%]" />
</fieldset>
</form>

<form class="bold_label" action="[% path_cgi %]" method="post">
<fieldset>
  <h3>[%|loc%]Edit site-wide templates[%END%]</h3>
  <select id="file" name="file">
    [% FOREACH f = server_files %]<option value='[% f.key %]' [% f.value.selected %]>[% f.value.complete %]</option>[% END %]
  </select>
  <input class="MainMenuLinks" type="submit" name="action_editfile" value="[%|loc%]Edit[%END%]" />
</fieldset>
</form>
<br />
<p><a class="actionMenuLinks" href="http://pootle.sympa.org/">[%|loc%]view translations[%END%]</a>
<a class="actionMenuLinks" href="[% 'ls_templates' | url_rel %]">[%|loc%]Customize templates[%END%]</a>
</p>

</div>

<div>
<h3>[%|loc%]Dump TT2 Variables[%END%]</h3>
<p>[%|loc%]Toggle the dumping of available TT2 variables when rendering web interface pages.  This may be useful when developing or debugging custom TT2 templates.  This setting is temporary, applying only for the lifetime of the web interface fastcgi process.[%END%]</p>
<form class="bold_label" action="[% path_cgi %]" method="post">
<fieldset>
[% IF dumpvars == 'true' %]
  <input class="MainMenuLinks" type="submit" name="action_unset_dumpvars" value="[%|loc%]Disable template variables dump[%END%]" />
[% ELSE %]
  <input class="MainMenuLinks" type="submit" name="action_set_dumpvars" value="[%|loc%]Enable template variables dump[%END%]" />
[% END %]

</fieldset>
</form>
</div>
[% END %] 

[% IF subaction == 'skins' %]
<h2>[%|loc%]Skins, CSS and colors[%END%]</h2><br />
<div>
<a class="actionMenuLinks" href="[% 'skinsedit' | url_rel %]">[%|loc%]Skins administration page[%END%]</a>
</div>
[% END %] 
[% IF subaction == 'edit_config' %]
<h2>[%|loc%]View main config[%END%]</h2><br />
<div>

[% SET close_table = '' %]
[% FOREACH confparam IN editable_params %]
  [% IF confparam.title %]
     [% close_table %]
     <h4> [% confparam.title %] </h4> <table class="responsive listOfItems"><tr><th>[%|loc%]parameter name[%END%]</th><th>value</th><th>[%|loc%]default[%END%]</th><th>[%|loc%]semantic[%END%]</th></tr> 
  [% ELSE %]
     [% IF dark == '1' %]
       <tr> [% SET dark='0'%]
     [% ELSE  %]
       <tr class="color0">[% SET dark='1'%]
     [% END %]
     <td>[% confparam.name  %]</td>
     <td>
     [% IF confparam.edit == '1' %]
<form action="[% path_cgi %]" method="post">
  <fieldset>
  <input type="text" name="new_value"  value="[% confparam.current_value %]" style="width:75%"/> 
  <input type="hidden" name="conf_parameter_name" value="[% confparam.name  %]" />
  <input class="MainMenuLinks" type="submit" name="action_set_param" value="[%|loc%]Set[%END%]" style="width:20%" />
</fieldset>
</form>
[% ELSE %]
[% confparam.current_value %]
[% END %]
</td>
<td>[% confparam.default %]</td><td>[% confparam.query %]</td></tr>
     [% SET close_table = '</table>' %]
  [% END %]
[% END %]
[% close_table %]

</div>
[% END %] 
[% IF subaction == 'translation' %]
<h2>[%|loc%]Translating Sympa[%END%]</h2><br />
<div>
[%|loc%]Sympa is designed to allow easy internationalization of its user interface (service mail messages and web interface). All translations for one language are gathered in a single PO file that can be manipulated by standard GNU gettext tools.[%END%]
</div>
<div>
[%|loc%]Check our translation FAQ if you wish to translate Sympa GUI in your native language: [%END%] <a href="http://www.sympa.org/translating_sympa">http://www.sympa.org/translating_sympa</a>
</div>
[% END %] 

[% IF subaction == 'tracker' %]
<h2>[%|loc%]Submitting a bug, a feature request[%END%]</h2><br />
<div>
[%|loc%]You can submit a problem or request a new feature: [%END%]<a href="http://www.sympa.org/tracking">http://www.sympa.org/tracking</a>
</div>
[% END %] 


[% IF subaction == 'logs' %]
[% IF loop_count %]
<p class="bottom_page">
[%|loc(process_id,loop_count,start_time)%]This FastCGI process (%1) has served %2 pages since %3.[%END%]
</p>
[% END %]
[% END %]
<!-- end serveradmin.tt2 (distrib) -->
