hydra/src/root/topbar.tt

47 lines
1.3 KiB
Plaintext
Raw Normal View History

[% BLOCK makeLinkWrapped %]
<li [% IF curUri == uri %]class="active"[% END %]>
<a href="[% uri %]">[% title %]</a>
[% content %]
</li>
[% END %]
[% BLOCK makeLink -%]
[% INCLUDE makeLinkWrapped content="" -%]
[% END %]
[% BLOCK makeSubMenu %]
<ul class="short-menu" id="top-menu">
[% content %]
</ul>
</li>
[% END %]
[% WRAPPER makeSubMenu title="Hydra" %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Root').action_for('index'))
title = "Projects" %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Root').action_for('queue'))
title = "Queue" %] ([% nrRunningBuilds %]/[% nrQueuedBuilds %])
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Root').action_for('all'))
title = "All builds" %]
[% IF c.user_exists %]
[% IF c.check_user_roles('admin') %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Admin').action_for('index'))
title = "Admin" %]
[% END %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Root').action_for('logout'))
title = "Sign out" %]
[% ELSE %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Root').action_for('login'))
title = "Sign in" %]
[% END %]
[% END %]