{extends "manage/manage.tpl.html"}

{block "javascripts" append}

  <script type="text/javascript">
    {*FIXME: what uses the projects var? *}
  var projects = [];
  {foreach from=$project_list key=prj_id item=prj_title name=projects}
    projects[{$smarty.foreach.projects.iteration-1}] = {$prj_id};
  {/foreach}

  function openAliasList(e)
  {
    var target = $(e.target);
    var features = 'width=560,height=460,top=30,left=30,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no,status=no';
    var aliasEmailWin = window.open('email_alias.php?id=' + target.attr('data-usr-id'), '_EmailAlias', features);
    aliasEmailWin.focus();
    return false;
  }

  $(function() {
      $('a.manage_alias').click(openAliasList);
    });
  </script>
{/block}

{*
 NOTE: we load the includes in reverse order
 even logically in users.tpl we append form and list templates,
 but smarty messes it up and reverses the order:

 list.tpl, form.tpl while it should be form.tpl, list.tpl

 see https://github.com/smarty-php/smarty/issues/303
*}

{if isset($list)}
  {include file="manage/users_list.tpl.html"}
{/if}

{include file="manage/users_form.tpl.html"}
