提交 5301b262 编写于 作者: K Kohsuke Kawaguchi

Added a mechanism to exclude <l:task> from context menu. Used it to remove some menu items.

上级 b22cfd5d
...@@ -61,6 +61,8 @@ Upcoming changes</a> ...@@ -61,6 +61,8 @@ Upcoming changes</a>
<li class=bug> <li class=bug>
Some of the context menu items have wrong links Some of the context menu items have wrong links
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-12945">issue 12945</a>) (<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> <li class=rfe>
Enable automatic hyperlinking on failed test summary. Enable automatic hyperlinking on failed test summary.
(<a href="https://github.com/jenkinsci/jenkins/pull/392">pull 392</a>) (<a href="https://github.com/jenkinsci/jenkins/pull/392">pull 392</a>)
......
...@@ -34,10 +34,10 @@ THE SOFTWARE. ...@@ -34,10 +34,10 @@ THE SOFTWARE.
<st:include page="tasks.jelly"/> <st:include page="tasks.jelly"/>
<st:include page="actions.jelly" /> <st:include page="actions.jelly" />
<j:if test="${it.previousBuild!=null}"> <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>
<j:if test="${it.nextBuild!=null}"> <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> </j:if>
</l:tasks> </l:tasks>
</l:side-panel> </l:side-panel>
......
...@@ -27,8 +27,8 @@ THE SOFTWARE. ...@@ -27,8 +27,8 @@ THE SOFTWARE.
--> -->
<?jelly escape-by-default='true'?> <?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"> <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/up.png" href="${it.upUrl}" title="${%Back to Project}" contextMenu="false"/>
<l:task icon="images/24x24/search.png" href="${buildUrl.baseUrl}/" title="${%Status}" /> <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}" /> <l:task icon="images/24x24/notepad.png" href="${buildUrl.baseUrl}/changes" title="${%Changes}" />
<j:choose> <j:choose>
<j:when test="${it.logFile.length() > 200000}"> <j:when test="${it.logFile.length() > 200000}">
......
...@@ -37,8 +37,8 @@ THE SOFTWARE. ...@@ -37,8 +37,8 @@ THE SOFTWARE.
<l:side-panel> <l:side-panel>
<l:tasks> <l:tasks>
<j:set var="url" value="${h.getNearestAncestorUrl(request,it)}"/> <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/up.png" href="${rootURL}/" title="${%Back to Dashboard}" contextMenu="false" />
<l:task icon="images/24x24/search.png" href="${url}/" title="${%Status}" /> <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/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.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}" /> <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. ...@@ -30,8 +30,8 @@ THE SOFTWARE.
<l:header /> <l:header />
<l:side-panel> <l:side-panel>
<l:tasks> <l:tasks>
<l:task icon="images/24x24/up.png" href=".." title="${%Back to List}" /> <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}" /> <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/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/setting.png" href="configure" title="${%Configure}" permission="${it.CONFIGURE}" />
<l:task icon="images/24x24/notepad.png" href="builds" title="${%Build History}" /> <l:task icon="images/24x24/notepad.png" href="builds" title="${%Build History}" />
......
...@@ -30,7 +30,7 @@ THE SOFTWARE. ...@@ -30,7 +30,7 @@ THE SOFTWARE.
<l:header title="${it.fullDisplayName}" /> <l:header title="${it.fullDisplayName}" />
<l:side-panel> <l:side-panel>
<l:tasks> <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}" /> <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}"> <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}" /> <l:task icon="images/24x24/package.png" href="artifacts-index" title="${%Artifacts}" />
......
...@@ -30,8 +30,8 @@ THE SOFTWARE. ...@@ -30,8 +30,8 @@ THE SOFTWARE.
<l:header title="Label ${it.displayName}" /> <l:header title="Label ${it.displayName}" />
<l:side-panel> <l:side-panel>
<l:tasks> <l:tasks>
<l:task icon="images/24x24/up.png" href="${rootURL}/" title="${%Back to Dashboard}" /> <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}" /> <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}" /> <l:task icon="images/24x24/monitor.png" href="load-statistics" title="${%Load Statistics}" />
<st:include page="actions.jelly" /> <st:include page="actions.jelly" />
</l:tasks> </l:tasks>
......
...@@ -30,8 +30,8 @@ THE SOFTWARE. ...@@ -30,8 +30,8 @@ THE SOFTWARE.
<l:header /> <l:header />
<l:side-panel> <l:side-panel>
<l:tasks> <l:tasks>
<l:task icon="images/24x24/up.png" href="${rootURL}/people/" title="${%People}" /> <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}" /> <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}/builds" title="${%Builds}" />
<l:task icon="images/24x24/notepad.png" href="${rootURL}/${it.url}/my-views/" title="${%My Views}" /> <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}" /> <l:task icon="images/24x24/setting.png" href="${rootURL}/${it.url}/configure" title="${%Configure}" permission="${app.ADMINISTER}" />
......
...@@ -46,6 +46,9 @@ THE SOFTWARE. ...@@ -46,6 +46,9 @@ THE SOFTWARE.
<st:attribute name="enabled"> <st:attribute name="enabled">
If specified, then this controls whether the task is enabled or not. If specified, then this controls whether the task is enabled or not.
</st:attribute> </st:attribute>
<st:attribute name="contextMenu" type="boolean">
If "false", remove this item from the context menu.
</st:attribute>
<st:attribute name="permission"> <st:attribute name="permission">
If specified, the link will be only displayed when the current user If specified, the link will be only displayed when the current user
has the specified permission against the "it" object. has the specified permission against the "it" object.
...@@ -95,8 +98,7 @@ THE SOFTWARE. ...@@ -95,8 +98,7 @@ THE SOFTWARE.
<j:otherwise> <j:otherwise>
<div class="task"> <div class="task">
<j:set var="icon" value="${rootURL}${icon.startsWith('images/') ? h.resourcePath : ''}/${icon}"/> <j:set var="icon" value="${rootURL}${icon.startsWith('images/') ? h.resourcePath : ''}/${icon}"/>
${taskTags!=null ? taskTags.add(href,icon,title) : null} ${taskTags!=null and attrs.contextMenu!='false' ? taskTags.add(href,icon,title) : null}
${taskTags}
<a href="${href}" onclick="${attrs.onclick}"> <a href="${href}" onclick="${attrs.onclick}">
<img width="24" height="24" style="margin: 2px;" alt="" src="${icon}"/> <img width="24" height="24" style="margin: 2px;" alt="" src="${icon}"/>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册