提交 73d3b851 编写于 作者: K Kohsuke Kawaguchi

To make views reusable elsewhere, removing "Manage Jenkins" from View and...

To make views reusable elsewhere, removing "Manage Jenkins" from View and moving the logic to the top-level Hudson class.
上级 e198d9f4
/*
* The MIT License
*
* Copyright (c) 2011, CloudBees, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.model;
import hudson.Extension;
/**
* Adds the "Manage Jenkins" link to the top page.
*
* @author Kohsuke Kawaguchi
*/
@Extension(ordinal=100)
public class ManageJenkinsAction implements RootAction {
public String getIconFileName() {
if (Hudson.getInstance().hasPermission(Hudson.ADMINISTER))
return "setting.gif";
else
return null;
}
public String getDisplayName() {
return "Manage Jenkins";
}
public String getUrlName() {
return "/manage";
}
}
......@@ -35,8 +35,9 @@ THE SOFTWARE.
</l:header>
<l:side-panel>
<l:tasks>
<st:include page="tasks-top.jelly" from="${it.owner}" optional="true" />
<l:task icon="images/24x24/new-package.gif" href="${rootURL}/${it.viewUrl}newJob" title="${%New Job}" permission="${it.itemCreatePermission}" it="${app}" />
<l:task icon="images/24x24/setting.gif" href="${rootURL}/manage" title="${%Manage Jenkins}" permission="${app.ADMINISTER}" it="${app}" />
<j:choose>
<j:when test="${it.class.name=='hudson.model.AllView'}">
<l:task icon="images/24x24/user.gif" href="${rootURL}/people/" title="${%People}" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册