makeLink -> menuItem

This commit is contained in:
Eelco Dolstra 2013-04-26 13:45:47 +02:00
parent 77a0fd9488
commit 002793bf2d

View file

@ -13,33 +13,22 @@
</li> </li>
[% END %] [% 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 pull-left" id="top-menu"> <ul class="nav pull-left" id="top-menu">
[% WRAPPER makeSubMenu title="Status" %] [% WRAPPER makeSubMenu title="Status" %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Root').action_for('queue')) uri = c.uri_for(c.controller('Root').action_for('queue'))
title = "Queue ("_ nrRunningBuilds _"/"_ nrQueuedBuilds _")" %] title = "Queue ("_ nrRunningBuilds _"/"_ nrQueuedBuilds _")" %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Root').action_for('status')) uri = c.uri_for(c.controller('Root').action_for('status'))
title = "Active build steps" %] title = "Active build steps" %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Root').action_for('machines')) uri = c.uri_for(c.controller('Root').action_for('machines'))
title = "Machine status" %] title = "Machine status" %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Root').action_for('evals')) uri = c.uri_for(c.controller('Root').action_for('evals'))
title = "Latest evaluations" %] title = "Latest evaluations" %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Root').action_for('all')) uri = c.uri_for(c.controller('Root').action_for('all'))
title = "Latest builds" %] title = "Latest builds" %]
[% END %] [% END %]
@ -62,19 +51,19 @@
[% IF jobset %] [% IF jobset %]
[% WRAPPER makeSubMenu title=("Jobset: " _ ellipsize(jobset.name, 30)) %] [% WRAPPER makeSubMenu title=("Jobset: " _ ellipsize(jobset.name, 30)) %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Jobset').action_for('index'), [project.name, jobset.name]) uri = c.uri_for(c.controller('Jobset').action_for('index'), [project.name, jobset.name])
title = "Overview" %] title = "Overview" %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Jobset').action_for('evals'), [project.name, jobset.name]) uri = c.uri_for(c.controller('Jobset').action_for('evals'), [project.name, jobset.name])
title = "Evaluations" %] title = "Evaluations" %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Jobset').action_for('all'), [project.name, jobset.name]) uri = c.uri_for(c.controller('Jobset').action_for('all'), [project.name, jobset.name])
title = "Latest builds" %] title = "Latest builds" %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Jobset').action_for('jobstatus'), [project.name, jobset.name]) uri = c.uri_for(c.controller('Jobset').action_for('jobstatus'), [project.name, jobset.name])
title = "Job status" %] title = "Job status" %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Jobset').action_for('errors'), [project.name, jobset.name]) uri = c.uri_for(c.controller('Jobset').action_for('errors'), [project.name, jobset.name])
title = "Errors" %] title = "Errors" %]
<li class="divider"></li> <li class="divider"></li>
@ -110,16 +99,16 @@
[% IF job %] [% IF job %]
[% WRAPPER makeSubMenu title=("Job: " _ ellipsize(job.name, 30)) %] [% WRAPPER makeSubMenu title=("Job: " _ ellipsize(job.name, 30)) %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Job').action_for('overview'), [project.name, jobset.name, job.name]) uri = c.uri_for(c.controller('Job').action_for('overview'), [project.name, jobset.name, job.name])
title = "Overview" %] title = "Overview" %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Job').action_for('all'), [project.name, jobset.name, job.name]) uri = c.uri_for(c.controller('Job').action_for('all'), [project.name, jobset.name, job.name])
title = "Latest builds" %] title = "Latest builds" %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Job').action_for('jobstatus'), [project.name, jobset.name, job.name]) uri = c.uri_for(c.controller('Job').action_for('jobstatus'), [project.name, jobset.name, job.name])
title = "Job status" %] title = "Job status" %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Job').action_for('errors'), [project.name, jobset.name, job.name]) uri = c.uri_for(c.controller('Job').action_for('errors'), [project.name, jobset.name, job.name])
title = "Errors" %] title = "Errors" %]
<li class="divider"></li> <li class="divider"></li>
@ -129,32 +118,32 @@
[% IF build %] [% IF build %]
[% WRAPPER makeSubMenu title=("Build: " _ build.id) %] [% WRAPPER makeSubMenu title=("Build: " _ build.id) %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for('/build' build.id) uri = c.uri_for('/build' build.id)
title = "Overview" %] title = "Overview" %]
[% IF c.user_exists %] [% IF c.user_exists %]
<li class="divider"></li> <li class="divider"></li>
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for('/build' build.id 'clone') uri = c.uri_for('/build' build.id 'clone')
title = "Clone build" %] title = "Clone build" %]
[% IF available %] [% IF available %]
[% IF build.keep %] [% IF build.keep %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for('/build' build.id 'keep' 0) uri = c.uri_for('/build' build.id 'keep' 0)
title = "Unkeep build" %] title = "Unkeep build" %]
[% ELSE %] [% ELSE %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for('/build' build.id 'keep' 1) uri = c.uri_for('/build' build.id 'keep' 1)
title = "Keep build" %] title = "Keep build" %]
[% END %] [% END %]
[% END %] [% END %]
[% IF build.finished %] [% IF build.finished %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for('/build' build.id 'restart') uri = c.uri_for('/build' build.id 'restart')
title = "Restart build" %] title = "Restart build" %]
[% END %] [% END %]
[% IF !build.finished %] [% IF !build.finished %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for('/build' build.id 'cancel') uri = c.uri_for('/build' build.id 'cancel')
title = "Cancel build" %] title = "Cancel build" %]
[% END %] [% END %]
@ -168,13 +157,13 @@
[% INCLUDE menuItem uri = c.uri_for(c.controller('Project').action_for('create')) title = "Create project" %] [% INCLUDE menuItem uri = c.uri_for(c.controller('Project').action_for('create')) title = "Create project" %]
<li class="divider"></li> <li class="divider"></li>
[% END %] [% END %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Admin').action_for('machines')) uri = c.uri_for(c.controller('Admin').action_for('machines'))
title = "Manage machines" %] title = "Manage machines" %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Admin').action_for('managenews')) uri = c.uri_for(c.controller('Admin').action_for('managenews'))
title = "Manage news" %] title = "Manage news" %]
[% INCLUDE makeLink [% INCLUDE menuItem
uri = c.uri_for(c.controller('Admin').action_for('users')) uri = c.uri_for(c.controller('Admin').action_for('users'))
title = "Manage users" %] title = "Manage users" %]
<li class="divider"></li> <li class="divider"></li>
@ -202,10 +191,10 @@
<ul class="nav" id="top-menu"> <ul class="nav" id="top-menu">
[% IF c.user_exists %] [% IF c.user_exists %]
[% INCLUDE makeLink uri = c.uri_for(c.controller('User').action_for('edit'), [c.user.username]) title = "Preferences" %] [% INCLUDE menuItem uri = c.uri_for(c.controller('User').action_for('edit'), [c.user.username]) title = "Preferences" %]
[% INCLUDE makeLink uri = c.uri_for(c.controller('Root').action_for('logout')) title = "Sign out" %] [% INCLUDE menuItem uri = c.uri_for(c.controller('Root').action_for('logout')) title = "Sign out" %]
[% ELSE %] [% ELSE %]
[% INCLUDE makeLink uri = c.uri_for(c.controller('Root').action_for('login')) title = "Sign in" %] [% INCLUDE menuItem uri = c.uri_for(c.controller('Root').action_for('login')) title = "Sign in" %]
[% END %] [% END %]
</ul> </ul>