hydra/src/root/topbar.tt

153 lines
5.9 KiB
Text
Raw Normal View History

[% BLOCK makeSubMenu %]
<li class="dropdown">
<a class="dropdown-toggle" href="#" data-toggle="dropdown">[% title %]<b class="caret"></b></a>
<ul class="dropdown-menu">
[% content %]
</ul>
</li>
[% END %]
[% showPrivate = (isPrivateHydra && c.user_exists) || ! isPrivateHydra %]
[% IF showPrivate %]
<ul class="nav pull-left">
[% IF c.user_exists %]
[% INCLUDE menuItem uri = c.uri_for(c.controller('User').action_for('dashboard'), [c.user.username]) title = "Dashboard" %]
[% END %]
[% WRAPPER makeSubMenu title="Status" %]
2013-04-26 11:45:47 +00:00
[% INCLUDE menuItem
uri = c.uri_for(c.controller('Root').action_for('queue'))
title = "Queue ("_ nrRunningBuilds _"/"_ nrQueuedBuilds _")" %]
2013-04-26 11:45:47 +00:00
[% INCLUDE menuItem
uri = c.uri_for(c.controller('Root').action_for('status'))
title = "Running builds" %]
2013-04-26 11:45:47 +00:00
[% INCLUDE menuItem
uri = c.uri_for(c.controller('Root').action_for('machines'))
title = "Machine status" %]
2013-04-26 11:45:47 +00:00
[% INCLUDE menuItem
uri = c.uri_for(c.controller('Root').action_for('evals'))
title = "Latest evaluations" %]
2013-04-26 11:45:47 +00:00
[% INCLUDE menuItem
uri = c.uri_for(c.controller('Root').action_for('all'))
2013-02-20 17:23:49 +00:00
title = "Latest builds" %]
2015-07-10 13:08:34 +00:00
[% INCLUDE menuItem
uri = c.uri_for(c.controller('Root').action_for('steps'))
title = "Latest steps" %]
[% END %]
[% IF project %]
[% WRAPPER makeSubMenu title="Project" %]
<li class="nav-header">[% HTML.escape(project.name) %]</li>
<li class="divider"></li>
[% INCLUDE menuItem uri = c.uri_for(c.controller('Project').action_for('project'), [project.name]) title = "Overview" %]
2013-02-20 17:23:49 +00:00
[% INCLUDE menuItem uri = c.uri_for(c.controller('Project').action_for('all'), [project.name]) title = "Latest builds" %]
[% INCLUDE menuItem uri = c.uri_for('/project' project.name 'channel' 'latest') title = "Channel" %]
[% END %]
[% END %]
2013-01-22 13:41:02 +00:00
[% IF jobset %]
[% WRAPPER makeSubMenu title="Jobset" %]
<li class="nav-header">[% HTML.escape(jobset.name) %]</li>
<li class="divider"></li>
2013-04-26 11:45:47 +00:00
[% INCLUDE menuItem
uri = c.uri_for(c.controller('Jobset').action_for('jobset'), [project.name, jobset.name])
title = "Overview" %]
2013-04-26 11:45:47 +00:00
[% INCLUDE menuItem
uri = c.uri_for(c.controller('Jobset').action_for('evals'), [project.name, jobset.name])
title = "Evaluations" %]
2013-04-26 11:45:47 +00:00
[% INCLUDE menuItem
uri = c.uri_for(c.controller('Jobset').action_for('all'), [project.name, jobset.name])
2013-02-20 17:23:49 +00:00
title = "Latest builds" %]
[% INCLUDE menuItem uri = c.uri_for('/jobset' project.name jobset.name 'channel' 'latest') title = "Channel" %]
[% END %]
[% END %]
2013-01-22 13:41:02 +00:00
[% IF job %]
[% WRAPPER makeSubMenu title="Job" %]
<li class="nav-header">[% HTML.escape(job.name) %]</li>
<li class="divider"></li>
2013-04-26 11:45:47 +00:00
[% INCLUDE menuItem
uri = c.uri_for(c.controller('Job').action_for('overview'), [project.name, jobset.name, job.name])
title = "Overview" %]
2013-04-26 11:45:47 +00:00
[% INCLUDE menuItem
uri = c.uri_for(c.controller('Job').action_for('all'), [project.name, jobset.name, job.name])
2013-02-20 17:23:49 +00:00
title = "Latest builds" %]
2013-02-22 11:00:32 +00:00
[% INCLUDE menuItem uri = c.uri_for('/job' project.name jobset.name job.name 'channel' 'latest') title = "Channel" %]
[% END %]
[% END %]
[% IF c.user_exists && (c.check_user_roles('admin') ||
c.check_user_roles('create-projects')) %]
[% WRAPPER makeSubMenu title="Admin" %]
[% IF c.check_user_roles('admin') || c.check_user_roles('create-projects') %]
2013-02-21 00:26:29 +00:00
[% INCLUDE menuItem uri = c.uri_for(c.controller('Project').action_for('create')) title = "Create project" %]
<li class="divider"></li>
[% END %]
[% IF c.check_user_roles('admin') %]
2013-04-26 11:45:47 +00:00
[% INCLUDE menuItem
uri = c.uri_for(c.controller('Admin').action_for('machines'))
title = "Manage machines" %]
2013-04-26 11:45:47 +00:00
[% INCLUDE menuItem
uri = c.uri_for(c.controller('Admin').action_for('managenews'))
title = "Manage news" %]
2013-04-26 11:45:47 +00:00
[% INCLUDE menuItem
uri = c.uri_for(c.controller('Admin').action_for('users'))
title = "Manage users" %]
<li class="divider"></li>
2013-04-26 12:45:20 +00:00
[% INCLUDE menuItem
2013-01-22 13:41:02 +00:00
uri = c.uri_for(c.controller('Admin').action_for('clearfailedcache'))
2013-04-26 12:45:20 +00:00
title = "Clear failed builds cache"
confirmmsg = "Are you sure you want to clear the failed builds cache?"
class = "" %]
2013-04-26 12:45:20 +00:00
[% INCLUDE menuItem
uri = c.uri_for(c.controller('Admin').action_for('clear_queue_non_current'))
title = "Clear scheduled non-current builds from queue"
confirmmsg = "Are you sure you want to clear the queue?"
class = "" %]
2013-10-03 17:43:21 +00:00
[% INCLUDE menuItem
uri = c.uri_for(c.controller('Admin').action_for('clearvcscache'))
title = "Clear VCS caches"
confirmmsg = "Are you sure you want to clear the VCS cache?"
class = "" %]
[% END %]
[% END %]
[% END %]
</ul>
[% END %]
<ul class="nav pull-right">
[% IF showPrivate %]
<form class="navbar-search" action="[% c.uri_for('/search') %]">
<input name="query" type="text" class="search-query span2" placeholder="Search" [% HTML.attributes(value => c.req.params.query) %]/>
</form>
[% END %]
[% IF c.user_exists %]
[% INCLUDE menuItem uri = c.uri_for(c.controller('User').action_for('edit'), [c.user.username]) title = "Preferences" %]
<li>
<a href="#" id="persona-signout">Sign out</a>
</li>
[% ELSE %]
[% IF personaEnabled %]
[% WRAPPER makeSubMenu title="Sign in" %]
<li>
<a href="#" id="persona-signin">
<img src="[% c.uri_for("/static/images/persona_sign_in_blue.png") %]" alt="Sign in with Persona" />
</a>
</li>
<li class="divider"></li>
<li>
<a href="#hydra-signin" data-toggle="modal">Sign in with a Hydra account</a>
</li>
[% END %]
[% ELSE %]
<li>
<a href="#hydra-signin" data-toggle="modal">Sign in</a>
</li>
[% END %]
[% END %]
</ul>