hydra/src/root/topbar.tt

192 lines
7.8 KiB
Plaintext
Raw Normal View History

[% BLOCK menuItem %]
<li class="[% IF "${root}${curUri}" == uri %]active[% END %]">
<a href="[% uri %]">[% title %]</a>
</li>
[% END %]
[% BLOCK makeSubMenu %]
<li class="dropdown">
<a class="dropdown-toggle" href="#" data-toggle="dropdown">[% title %]<b class="caret"></b></a>
<ul id="left-menu" class="dropdown-menu">
[% content %]
</ul>
</li>
[% END %]
[% BLOCK makeLinkWrapped %]
<li [% IF curUri == uri %]class="active"[% END %]>
<a href="[% uri %]">[% title %]</a>
[% content %]
</li>
[% END %]
[% BLOCK makeLink %]
[% INCLUDE makeLinkWrapped content="" %]
[% END %]
<ul class="nav" id="top-menu">
[% WRAPPER makeSubMenu title="Status" %]
[% 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('status'))
title = "Active build steps" %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Root').action_for('machines'))
title = "Machine status" %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Root').action_for('evals'))
title = "Latest evaluations" %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Root').action_for('all'))
2013-02-20 17:23:49 +00:00
title = "Latest builds" %]
[% END %]
[% IF project %]
[% WRAPPER makeSubMenu title=("Project: " _ project.name) %]
[% INCLUDE menuItem uri = c.uri_for(c.controller('Project').action_for('view'), [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(c.controller('Project').action_for('jobstatus'), [project.name]) title = "Job status" %]
[% INCLUDE menuItem uri = c.uri_for(c.controller('Project').action_for('errors'), [project.name]) title = "Errors" %]
<li class="divider"></li>
[% INCLUDE menuItem uri = c.uri_for('/project' project.name 'channel' 'latest') title = "Channel" %]
[% IF c.user_exists %]
<li class="divider"></li>
2013-02-21 00:26:29 +00:00
[% INCLUDE menuItem uri = c.uri_for('/project' project.name 'edit') title="Edit" %]
[% INCLUDE menuItem uri = c.uri_for(c.controller('Project').action_for('create_jobset'), [project.name]) title = "Create jobset" %]
[% END %]
[% END %]
[% END %]
2013-01-22 13:41:02 +00:00
[% IF jobset %]
[% WRAPPER makeSubMenu title=("Jobset: " _ jobset.name) %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Jobset').action_for('index'), [project.name, jobset.name])
title = "Overview" %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Jobset').action_for('evals'), [project.name, jobset.name])
title = "Evaluations" %]
[% INCLUDE makeLink
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 makeLink
uri = c.uri_for(c.controller('Jobset').action_for('jobstatus'), [project.name, jobset.name])
title = "Job status" %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Jobset').action_for('errors'), [project.name, jobset.name])
title = "Errors" %]
<li class="divider"></li>
[% INCLUDE menuItem uri = c.uri_for('/jobset' project.name jobset.name 'channel' 'latest') title = "Channel" %]
[% IF c.user_exists %]
<li class="divider"></li>
2013-02-21 00:26:29 +00:00
[% INCLUDE menuItem uri = c.uri_for('/jobset' project.name jobset.name 'edit') title="Edit" %]
<form id="delete-jobset" method="post" action="[% c.uri_for('/jobset' project.name jobset.name 'delete') %]" class="hidden"></form>
<script>
function confirmDeleteJobset() {
bootbox.confirm(
'Are you sure you want to delete this jobset?',
function(del) { if (del) $('#delete-jobset').submit(); });
return;
};
</script>
[% INCLUDE menuItem title="Delete" uri = "javascript:confirmDeleteJobset()" %]
[% INCLUDE menuItem uri = c.uri_for('/jobset' project.name jobset.name 'clone') title="Clone" %]
[% INCLUDE maybeLink uri = c.uri_for(c.controller('Admin').action_for('force_eval'), project.name, jobset.name)
content = "Evaluate" confirmmsg = ("Are you sure you want to force evaluation of jobset " _ project.name _ ":" _ jobset.name _ "?") class = "" %]
[% END %]
[% END %]
[% END %]
2013-01-22 13:41:02 +00:00
[% IF job %]
[% WRAPPER makeSubMenu title=("Job: " _ job.name) %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Job').action_for('overview'), [project.name, jobset.name, job.name])
title = "Overview" %]
[% INCLUDE makeLink
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" %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Job').action_for('jobstatus'), [project.name, jobset.name, job.name])
title = "Job status" %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Job').action_for('errors'), [project.name, jobset.name, job.name])
title = "Errors" %]
[% END %]
[% END %]
[% IF build %]
[% WRAPPER makeSubMenu title=("Build: " _ build.id) %]
[% INCLUDE makeLink
2013-02-20 14:54:33 +00:00
uri = c.uri_for('/build' build.id)
title = "Overview" %]
2012-04-13 08:19:15 +00:00
[% IF c.user_exists %]
<li class="divider"></li>
[% INCLUDE makeLink
uri = c.uri_for('/build' build.id 'clone')
title = "Clone build" %]
[% IF available %]
[% IF build.keep %]
[% INCLUDE makeLink
uri = c.uri_for('/build' build.id 'keep' 0)
title = "Unkeep build" %]
2012-04-13 08:19:15 +00:00
[% ELSE %]
[% INCLUDE makeLink
uri = c.uri_for('/build' build.id 'keep' 1)
title = "Keep build" %]
2012-04-13 08:19:15 +00:00
[% END %]
[% END %]
[% IF build.finished %]
[% INCLUDE makeLink
2012-04-13 08:19:15 +00:00
uri = c.uri_for('/build' build.id 'restart')
title = "Restart build" %]
[% END %]
[% IF !build.finished %]
[% INCLUDE makeLink
uri = c.uri_for('/build' build.id 'cancel')
title = "Cancel build" %]
[% END %]
[% END %]
[% END %]
[% END %]
2013-01-22 13:41:02 +00:00
[% IF c.user_exists && c.check_user_roles('admin') %]
[% WRAPPER makeSubMenu title="Admin" %]
2013-02-21 00:26:29 +00:00
[% IF c.check_user_roles('admin') %]
[% INCLUDE menuItem uri = c.uri_for(c.controller('Project').action_for('create')) title = "Create project" %]
<li class="divider"></li>
[% END %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Admin').action_for('machines'))
title = "Manage machines" %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Admin').action_for('managenews'))
title = "Manage news" %]
[% INCLUDE makeLink
uri = c.uri_for(c.controller('Admin').action_for('users'))
title = "Manage users" %]
<li class="divider"></li>
2013-01-22 13:41:02 +00:00
[% INCLUDE maybeLink
uri = c.uri_for(c.controller('Admin').action_for('clearfailedcache'))
content = "Clear failed builds cache"
confirmmsg = "Are you sure you want to clear the failed builds cache?"
class = "" %]
2013-01-22 13:41:02 +00:00
[% INCLUDE maybeLink
uri = c.uri_for(c.controller('Admin').action_for('clear_queue_non_current'))
2013-02-20 14:54:33 +00:00
content = "Clear all non-running old builds from queue"
confirmmsg = "Are you sure you want to clear the queue?"
class = "" %]
[% END %]
[% END %]
[% IF c.user_exists %]
[% 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 %]
</ul>