{*
    blocks:
        title
        sidebar
        content
*}
{extends "base.tpl.html"}
{block "header"}
    <div id="header">
        <div id="header_1">
            <div id="app_title">{$core.app_title}</div>

            <ul id="main_menu">
                {include file="navigation.tpl.html"}
            </ul>

            <div class="clear"></div>
        </div>
        <div id="header_2">
            <div id="project_chooser">
                {if $core.active_projects|@count == 1}
                    {t}Project{/t}: <b>{$core.project_name|escape:"html"}</b>
                {else}
                  <form method="post" action="{$core.rel_url}switch.php?current_page={$smarty.server.REQUEST_URI}">
                    <select name="current_project">
                      {html_options options=$core.active_projects selected=$core.project_id}
                    </select>
                  </form>
                {/if}
            </div>

            <div id="go_issue_menu">
              <form method="get" action="{$core.rel_url}view.php" id="shortcut_form">
                <label for="shortcut" accesskey="4">
                <input type="text" id="shortcut" name="id" placeholder="id #" size="5">
                </label>
                <input type="submit" value="{t}Go{/t}" class="shortcut">
              </form>
            </div>

            <div id="search_menu">
                <form method="get" action="{$core.rel_url}list.php">
                <label for="search" accesskey="3"></label>
                <input type="text" id="search" name="keywords" placeholder="{t}keywords{/t}" size="15" accesskey="s">
                <input type="submit" value="{t}Search{/t}" class="shortcut">
                </form>
            </div>

            <div id="user_menu">
                {$core.current_role_name}: {$core.user.usr_full_name|escape:html}
                {if $core.current_role == $core.roles.customer && $core.allowed_customers|@count > 1}
                    [<a href="{$core.rel_url}select_customer.php" title="Change Customer">{$core.current_customer.name}</a>]
                {/if}
                {if $core.current_role > $core.roles.standard_user}
                    [{if $core.is_current_user_clocked_in}{t}CLOCKED IN{/t}{else}{t}CLOCKED OUT{/t}{/if}]
                {/if}
                {strip}
                (
                {if $core.is_anon_user}
                  <a href="{$core.rel_url}signup.php">{t}Register{/t}</a>
                {else}
                  <a title="{t}modify your account details and preferences{/t}" href="{$core.rel_url}preferences.php">{t}Preferences{/t}</a>&nbsp;
                  {if $core.current_role > $core.roles.standard_user && $core.handle_clock_in}
                    <a id="change_clock_status" title="{t}change your account clocked-in status{/t}" href="">
                    {if $core.is_current_user_clocked_in}{t}Clock Out{/t}{else}{t}Clock In{/t}{/if}</a>
                  {/if}
                {/if}
                {if !$core.is_anon_user}
                    &nbsp;<a title="{t}logout from{/t} {$core.app_title}" href="{$core.rel_url}logout.php">{t}Logout{/t}</a>
                {else}
                    <a href="{$core.rel_url}index.php">{t}Login{/t}</a>
                {/if}
                )
                {/strip}
            </div>
            <div class="clear"></div>
        </div>
    </div>
{/block}

{block "footer"}
  <div id="footer">
      {include "app_info.tpl.html"}
  </div>
{/block}
