<% #main %>
<% response.pager %>
<% response.list %>
<% response.pager %>

<% #navigation %>
<div class='uk-panel uk-panel-box'>
   <h1 class='uk-panel-title'><% gettext Administration %></h1>
   <ul class='uk-nav uk-nav-side'>
      <li><% admin.link setup <% gettext Setup %> %></li>
      <li><% admin.link sites <% gettext Sites %> %></li>
      <li><% admin.link users <% gettext Users %> %></li>
      <li><% admin.link jobs <% gettext Jobs %> %></li>
      <li><% admin.link main <% gettext Activity %> %></li>
   </ul>
</div>

<% #welcome %>
<p>
   <em><% gettext Note %></em>: <% gettext 'Since you are an administrator of this Antville installation you are entitled to administer <a href="{0}">sites</a> and <a href="{1}">users</a>, view the <a href="{2}">administration log</a> and configure the <a href="{3}">setup</a>.' <% root.admin.href sites %> <% root.admin.href users %> <% root.admin.href log %>  <% root.admin.href setup %> %>
</p>

<% #setup %>
<h1><% response.title %></h1>
<form class='uk-form uk-form-stacked' method="post" action="<% response.action %>">
   <fieldset>
      <legend><% gettext General %></legend>
      <div class='uk-form-row'>
         <label class='uk-form-label' for='notificationScope'>
            <% gettext Notifications %>
         </label>
         <div class='uk-form-controls'>
            <% root.select notificationScope %>
         </div>
      </div>
      <div class='uk-form-row'>
         <label class='uk-form-label' for='replyTo'>
            <% gettext Reply-To %>
         </label>
         <div class='uk-form-controls'>
            <% root.input replyTo class=uk-width-1-2 type=email %>
         </div>
      </div>
      <div class='uk-form-row'>
         <label class='uk-form-label' for='quote'>
            <% gettext "Disk Quota" %>
         </label>
         <div class='uk-form-controls'>
            <% root.input quota class=uk-width-1-6 type=number min=0 %> MB
         </div>
      </div>
   </fieldset>
   <fieldset class='uk-margin-top'>
      <legend><% gettext 'Site Creation' %></legend>
      <div class='uk-form-row'>
         <label class='uk-form-label' for='creationScope'>
            <% gettext 'User Role' %>
         </label>
         <div class='uk-form-controls'>
            <% root.select creationScope %>
         </div>
      </div>
      <div class='uk-form-row'>
         <label class='uk-form-label' for='probationPeriod'>
            <% gettext 'Probation Period' %>
         </label>
         <div class='uk-form-controls'>
            <% root.input probationPeriod class=uk-width-1-6 type=number min=1 %> <% gettext days %>
         </div>
      </div>
      <div class='uk-form-row'>
         <label class='uk-form-label' for='creationDelay'>
            <% gettext Interval %>
         </label>
         <div class='uk-form-controls'>
            <% root.input creationDelay maxlength=3 class=uk-width-1-6 type=number min=1 %> <% gettext days %>
         </div>
      </div>
   </fieldset>
   <fieldset class='uk-margin-top'>
      <legend><% gettext Phase-Out %></legend>
      <div class='uk-form-row'>
         <label class='uk-form-label' for='phaseOutMode'>
            <% gettext Mode %>
         </label>
         <div class='uk-form-controls'>
            <% root.select phaseOutMode label=enabled %>
         </div>
      </div>
      <div class='uk-form-row'>
         <label class='uk-form-label' for='phaseOutNotificationPeriod'>
            <% gettext 'Notification Period' %>
         </label>
         <div class='uk-form-controls'>
         <% root.input phaseOutNotificationPeriod class=uk-width-1-6 type=number min=1 %> <% gettext days %>
         </div>
      </div>
      <div class='uk-form-row'>
         <label class='uk-form-label' for='phaseOutGracePeriod'>
            <% gettext 'Grace Period' %>
         </label>
         <div class='uk-form-controls'>
            <% root.input phaseOutGracePeriod class=uk-width-1-6 type=number min=1 %> <% gettext days %>
         </div>
      </div>
   </fieldset>
   <div class='uk-margin-top'>
      <button class='uk-button uk-button-primary' type="submit" id="submit" name="save" value="1">
         <% gettext Save %>
      </button>
      <a href="" class="uk-button uk-button-link cancel"><% gettext Cancel %></a>
   </div>
</form>
<script type="text/javascript">
$(function() {
   $("#creationScope").on('change', function() {
      var disabled = $(this).val() === "regular" ? false : true;
      $("#probationPeriod").attr("disabled", disabled);
      $("#creationDelay").attr("disabled", disabled);
   }).change();
   $("#phaseOutMode").on('change', function() {
      var disabled = $(this).val() !== "disabled" ? false : true;
      $("#phaseOutNotificationPeriod").attr("disabled", disabled);
      $("#phaseOutGracePeriod").attr("disabled", disabled);
   }).change();
});
</script>

<% #log %>
<h1><% response.title %></h1>
<form method="post" action="<% response.action %>">
   <table cellspacing="0" cellpadding="2">
      <tr>
         <td class="small"><% gettext Type suffix=: %></td>
         <td>
            <% admin.dropdown name="filter" <% markgettext Any %> <% markgettext Root %> <% markgettext Site %> <% markgettext User %> %>
         </td>
      </tr>
      <tr>
         <td class="small"><% gettext Sort suffix=: %></td>
         <td><% admin.dropdown name="dir" <% markgettext Descending %> <% markgettext Ascending %> %></td>
      </tr>
      <tr>
         <td class="small"><% gettext Search suffix=: %></td>
         <td>
            <input id="query" name="query" value="<% request.query %>">
            <button onclick='this.form.query.value = ''; return !1;'><% gettext Reset %></button>
            <button type="submit" name="search" value="1"><% gettext Update %></button>
         </td>
      </tr>
   </table>
</form>
<% response.pager %>
<table class='uk-table uk-table-striped uk-table-hover uk-table-condensed'>
   <thead>
      <tr>
         <td><% gettext Date %></td>
         <td><% gettext Type %></td>
         <td><% gettext Name %></td>
         <td><% gettext Description %></td>
         <td><% gettext User %></td>
      </tr>
   </thead>
   <tbody>
      <% response.list %>
   </tbody>
</table>
<% response.pager %>

<% #logentry %>
<tr>
   <td><% item.created short %></td>
   <td><% item.context_type %></td>
   <td class='uk-text-bold'><% item.context.name %></td>
   <td><% item.action %></td>
   <td><% item.creator %></td>
</tr>

<% #sites %>
<h1><% response.title %></h1>
<form method="post" action="<% response.action %>">
   <table cellspacing="0" cellpadding="2">
      <tr>
         <td class="small"><% gettext Type suffix=: %></td>
         <td>
            <% admin.dropdown name="filter" <% markgettext Any %> <% markgettext Blocked %> <% markgettext Trusted %> <% markgettext Open %> <% markgettext Restricted %> <% markgettext Public %> <% markgettext Closed %> <% markgettext Deleted %> %>
         </td>
         </tr>
      <tr>
         <td class="small"><% gettext Sort suffix=: %></td>
         <td>
            <% admin.dropdown name="order" <% markgettext Modified %> <% markgettext "Created" %> <% markgettext Name %> %> <% admin.dropdown name="dir" <% markgettext Descending %> <% markgettext Ascending %> %>
         </td>
      </tr>
      <tr>
         <td class="small"><% gettext Search suffix=: %></td>
         <td>
            <input id="query" name="query" value="<% request.query encoding="form" %>">
            <button onclick="this.form.query.value = ''; return !1;"><% gettext Reset %></button>
            <button type="submit" name="search" value="1"><% gettext Update %></button>
         </td>
      </tr>
   </table>
</form>
<% response.pager %>
<table class='uk-table uk-table-striped uk-table-hover uk-table-condensed'>
   <thead>
      <tr>
         <td><% gettext Name %></td>
         <td><% gettext Created %></td>
         <td><% gettext Modified %></td>
         <td><% gettext Status %></td>
         <td><% gettext Mode %></td>
         <td></td>
         <td></td>
      </tr>
   </thead>
   <tbody>
      <% response.list %>
   </tbody>
</table>
<% response.pager %>

<% #site %>
<tr>
   <td style='max-width: 150px; overflow: hidden;'>
      <div><% item.title default='<i>Untitled</i>' | item.link %></div>
      <div class='uk-text-small'><% item.href %></div>
   </td>
   <td><% item.created text %></td>
   <td><% item.modified text %></td>
   <td><% item.status %></td>
   <td><% item.mode %></td>
   <td>
      <% item.notes prefix="<span title='" suffix="' data-uk-tooltip><i class='uk-icon-info-circle uk-text-muted'></i></span>" %>
   </td>
   <td class='uk-text-right' style='white-space: nowrap'>
      <% if <% item.mode %> is deleted then '' else
         <% item.link delete "<i class='uk-icon-trash-o'></i>" <% item.id %> %>
      %>
      <% item.link edit#admin "<i class='uk-icon-pencil'></i>" <% item.id %> %>
   </td>
</tr>

<% #users %>
<h1><% response.title %></h1>
<form method="post" action="<% response.action %>">
   <table cellspacing="0" cellpadding="2">
      <tr>
         <td class="small"><% gettext Type suffix=: %></td>
         <td>
            <% admin.dropdown name="filter" <% markgettext All %> <% markgettext Blocked %>
                  <% markgettext Trusted %> <% markgettext Privileged %> %>
         </td>
      </tr>
      <tr>
         <td class="small"><% gettext Sort suffix=: %></td>
         <td>
            <% admin.dropdown name="order" <% markgettext Registration %>
                  <% markgettext Login %> <% markgettext Username %> %>
            <% admin.dropdown name="dir" <% markgettext Descending %>
                  <% markgettext Ascending %> %>
         </td>
      </tr>
      <tr>
         <td class="small"><% gettext Search suffix=: %></td>
         <td>
            <input name="query" value="<% request.query %>">
            <button type="reset"><% gettext Reset %></button>
            <button type="submit" name="search" value="1"><% gettext Update %></button>
         </td>
      </tr>
   </table>
</form>
<% response.pager %>
<table class='uk-table uk-table-striped uk-table-hover uk-table-condensed'>
   <thead>
      <tr>
         <td><% gettext Name %></td>
         <td><% gettext Registered %></td>
         <td><% gettext 'Last Login' %></td>
         <td><% gettext Status %></td>
         <td></td>
         <td></td>
      </tr>
   </thead>
   <tbody>
      <% response.list %>
   </tbody>
</table>
<% response.pager %>

<% #user %>
<tr>
   <td style='max-width: 200px; overflow: hidden;'>
      <div class='uk-text-bold'>
         <% if <% item.url %> is null then <% item.name %> else <% item.name | item.link <% item.url %> %> %>
      </div>
      <div class='uk-text-small'><a href='mailto:<% item.email %>'><% item.email %></a></div>
   </td>
   <td><% item.created text %></td>
   <td><% item.modified text %></td>
   <td><% item.status %></td>
   <td>
      <% item.notes prefix="<span title='" suffix="' data-uk-tooltip><i class='uk-icon-info-circle uk-text-muted'></i></span>" %>
   </td>
   <td style='white-space: nowrap;'>
      <% item.link delete "<i class='uk-icon-trash-o'></i>" %>
      <% item.link edit#admin "<i class='uk-icon-pencil'></i>" %>
   </td>
</tr>

<% #jobs %>
<h1><% response.title %></h1>
<% response.pager %>
<table class='uk-table uk-table-striped uk-table-hover uk-table-condensed'>
   <thead>
      <tr>
         <td><% gettext Method %></td>
         <td><% gettext Type %></td>
         <td><% gettext ID %></td>
         <td><% gettext User %></td>
         <td></td>
      </tr>
   </thead>
   <tbody>
      <% response.list %>
   </tbody>
</table>
<% response.pager %>

<% #job %>
<tr>
   <td><% item.method %></td>
   <td><% item.type %></td>
   <td><% item.id %></td>
   <td><% item.user %></td>
   <td style='white-space: nowrap;'>
      <% item.link delete "<i class='uk-icon-trash-o'></i>" %>
   </td>
</tr>
