Permalink
Browse files

Added a mechanism to exclude <l:task> from context menu. Used it to r…

…emove some menu items.
  • Loading branch information...
1 parent b22cfd5 commit 5301b262327e685251e786ea0176a11b4bd994a4 @kohsuke kohsuke committed Mar 6, 2012
View
@@ -62,6 +62,8 @@
Some of the context menu items have wrong links
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-12945">issue 12945</a>)
<li class=rfe>
+ Removed entries that don't make sense from the context menu
+ <li class=rfe>
Enable automatic hyperlinking on failed test summary.
(<a href="https://github.com/jenkinsci/jenkins/pull/392">pull 392</a>)
<li class=rfe>
@@ -34,10 +34,10 @@ THE SOFTWARE.
<st:include page="tasks.jelly"/>
<st:include page="actions.jelly" />
<j:if test="${it.previousBuild!=null}">
- <l:task icon="images/24x24/previous.png" href="${buildUrl.previousBuildUrl}" title="${%Previous Build}" />
+ <l:task icon="images/24x24/previous.png" href="${buildUrl.previousBuildUrl}" title="${%Previous Build}" contextMenu="false"/>
</j:if>
<j:if test="${it.nextBuild!=null}">
- <l:task icon="images/24x24/next.png" href="${buildUrl.nextBuildUrl}" title="${%Next Build}" />
+ <l:task icon="images/24x24/next.png" href="${buildUrl.nextBuildUrl}" title="${%Next Build}" contextMenu="false"/>
</j:if>
</l:tasks>
</l:side-panel>
@@ -27,8 +27,8 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
- <l:task icon="images/24x24/up.png" href="${it.upUrl}" title="${%Back to Project}" />
- <l:task icon="images/24x24/search.png" href="${buildUrl.baseUrl}/" title="${%Status}" />
+ <l:task icon="images/24x24/up.png" href="${it.upUrl}" title="${%Back to Project}" contextMenu="false"/>
+ <l:task icon="images/24x24/search.png" href="${buildUrl.baseUrl}/" title="${%Status}" contextMenu="false"/>
<l:task icon="images/24x24/notepad.png" href="${buildUrl.baseUrl}/changes" title="${%Changes}" />
<j:choose>
<j:when test="${it.logFile.length() > 200000}">
@@ -37,8 +37,8 @@ THE SOFTWARE.
<l:side-panel>
<l:tasks>
<j:set var="url" value="${h.getNearestAncestorUrl(request,it)}"/>
- <l:task icon="images/24x24/up.png" href="${rootURL}/" title="${%Back to Dashboard}" />
- <l:task icon="images/24x24/search.png" href="${url}/" title="${%Status}" />
+ <l:task icon="images/24x24/up.png" href="${rootURL}/" title="${%Back to Dashboard}" contextMenu="false" />
+ <l:task icon="images/24x24/search.png" href="${url}/" title="${%Status}" contextMenu="false"/>
<l:task icon="images/24x24/notepad.png" href="${url}/changes" title="${%Changes}" />
<l:task icon="images/24x24/folder.png" href="${url}/ws/" title="${%Workspace}" permission="${it.WORKSPACE}">
<l:task icon="images/24x24/folder-delete.png" href="${url}/wipeOutWorkspace" title="${%Wipe Out Workspace}" permission="${h.isWipeOutPermissionEnabled() ? it.WIPEOUT : it.BUILD}" />
@@ -30,8 +30,8 @@ THE SOFTWARE.
<l:header />
<l:side-panel>
<l:tasks>
- <l:task icon="images/24x24/up.png" href=".." title="${%Back to List}" />
- <l:task icon="images/24x24/search.png" href="${rootURL}/${it.url}" title="${%Status}" />
+ <l:task icon="images/24x24/up.png" href=".." title="${%Back to List}" contextMenu="false"/>
+ <l:task icon="images/24x24/search.png" href="${rootURL}/${it.url}" title="${%Status}" contextMenu="false"/>
<l:task icon="images/24x24/edit-delete.png" href="delete" title="${%Delete Slave}" permission="${it.DELETE}" />
<l:task icon="images/24x24/setting.png" href="configure" title="${%Configure}" permission="${it.CONFIGURE}" />
<l:task icon="images/24x24/notepad.png" href="builds" title="${%Build History}" />
@@ -30,7 +30,7 @@ THE SOFTWARE.
<l:header title="${it.fullDisplayName}" />
<l:side-panel>
<l:tasks>
- <l:task icon="images/24x24/up.png" href="${rootURL}/${it.parent.url}" title="${%Back to Job}" />
+ <l:task icon="images/24x24/up.png" href="${rootURL}/${it.parent.url}" title="${%Back to Job}" contextMenu="false"/>
<l:task icon="images/24x24/terminal.png" href="." title="${%Console Output}" />
<j:if test="${(!h.isArtifactsPermissionEnabled() or h.isArtifactsPermissionEnabled() and h.hasPermission(it,attrs.permission)) and it.hasArtifacts}">
<l:task icon="images/24x24/package.png" href="artifacts-index" title="${%Artifacts}" />
@@ -30,8 +30,8 @@ THE SOFTWARE.
<l:header title="Label ${it.displayName}" />
<l:side-panel>
<l:tasks>
- <l:task icon="images/24x24/up.png" href="${rootURL}/" title="${%Back to Dashboard}" />
- <l:task icon="images/24x24/computer.png" href="." title="${%Overview}" />
+ <l:task icon="images/24x24/up.png" href="${rootURL}/" title="${%Back to Dashboard}" contextMenu="false"/>
+ <l:task icon="images/24x24/computer.png" href="." title="${%Overview}" contextMenu="false"/>
<l:task icon="images/24x24/monitor.png" href="load-statistics" title="${%Load Statistics}" />
<st:include page="actions.jelly" />
</l:tasks>
@@ -30,8 +30,8 @@ THE SOFTWARE.
<l:header />
<l:side-panel>
<l:tasks>
- <l:task icon="images/24x24/up.png" href="${rootURL}/people/" title="${%People}" />
- <l:task icon="images/24x24/search.png" href="${rootURL}/${it.url}/" title="${%Status}" />
+ <l:task icon="images/24x24/up.png" href="${rootURL}/people/" title="${%People}" contextMenu="false"/>
+ <l:task icon="images/24x24/search.png" href="${rootURL}/${it.url}/" title="${%Status}" contextMenu="false"/>
<l:task icon="images/24x24/notepad.png" href="${rootURL}/${it.url}/builds" title="${%Builds}" />
<l:task icon="images/24x24/notepad.png" href="${rootURL}/${it.url}/my-views/" title="${%My Views}" />
<l:task icon="images/24x24/setting.png" href="${rootURL}/${it.url}/configure" title="${%Configure}" permission="${app.ADMINISTER}" />
@@ -46,6 +46,9 @@ THE SOFTWARE.
<st:attribute name="enabled">
If specified, then this controls whether the task is enabled or not.
</st:attribute>
+ <st:attribute name="contextMenu" type="boolean">
+ If "false", remove this item from the context menu.
+ </st:attribute>
<st:attribute name="permission">
If specified, the link will be only displayed when the current user
has the specified permission against the "it" object.
@@ -95,8 +98,7 @@ THE SOFTWARE.
<j:otherwise>
<div class="task">
<j:set var="icon" value="${rootURL}${icon.startsWith('images/') ? h.resourcePath : ''}/${icon}"/>
- ${taskTags!=null ? taskTags.add(href,icon,title) : null}
- ${taskTags}
+ ${taskTags!=null and attrs.contextMenu!='false' ? taskTags.add(href,icon,title) : null}
<a href="${href}" onclick="${attrs.onclick}">
<img width="24" height="24" style="margin: 2px;" alt="" src="${icon}"/>

0 comments on commit 5301b26

Please sign in to comment.