<!-- BEGIN site/header.tt -->
[% action_links = [
{ permission => 'search', label => 'Search', ico => 'search' }
{ permission => 'register', label => 'Register', ico => 'person' }
{ permission => 'modify_results', label => 'WorkList', ico => 'note' }
{ permission => 'print_all', label => 'PrintRun', ico => 'print' }
{ permission => 'search', label => 'Resources', ico => 'scissors' }
{ permission => 'do_admin', label => 'Admin', ico => 'wrench' }
];
IF c.cfg('settings').have_hmrn AND c.user_can('hmrn_admin');
action_links.push({ permission => 'search', label => 'HMRN', ico => 'foo' });
END;
%]
[% # PROCESS dumper.tt dump = active_link %]
<table id="nav">
<tbody>
<tr>
[% IF c.authen.username; user = c.session.param('UserProfile') %]
<td>
<span style="padding: 0 5px"> </span>
[% FOREACH action_links;
NEXT UNLESS c.user_can(permission);
re = '(?i)' _ label; # see VMethods
matches = active_link.match(re);
# admin tab on its own:
NEXT IF active_link.match('admin') AND label != 'Admin';
%]
<div style="padding: 0 1px; display: inline">
<a href="[% app_url %]/[% label | lower %]" class="ui-corner-top"
[% IF matches %]id="selected"[% END %]
[% IF label == 'Admin' # use 'new' to force same window each time: %]
target="_new"[% END %]>
[% label %]
</a>
<span class="ui-icon-white ui-icon-[% ico # doesn't display %]"></span>
</div>
[% END %]
<span id="userid" class="ui-corner-top">
[% user.first_name | ucfirst %] [% user.last_name | ucfirst %]
</span>
<span id="logout">
[% IF active_link.match('admin') %]
[<a href="javascript: self.close ()">close window</a>]
[% ELSE %]
[<a href="[% app_url %]/logout">log out</a>]
[% END %]
</span>
</td>
[% END %]
<td id="logo">
<img src="/images/logo.jpeg" alt="logo" />
</td>
</tr>
</tbody>
</table>
<div id="title">
<p>
[% c.cfg('settings').application_name %] » [% # my.meta_title defined in .tt:
template.title || my.meta_title || action | ucfirst %]
<span>
[% USE date(format = '%a %d %B %Y @ %R', locale = 'en_GB');
date.format # time.strftime('%a %d %B %Y @ %R %Z') %]
</span>
</p>
</div>
<!-- END site/header.tt -->