提交 e3969834 编写于 作者: K kohsuke

fixed #162.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1157 71c3de6d-444a-0410-be80-ed276b4c234a
上级 d6ea370f
......@@ -90,6 +90,26 @@ public abstract class JobCollection extends AbstractModelObject {
return that.lastChange.compareTo(this.lastChange);
}
}
/**
* Does this {@link JobCollection} has any associated user information recorded?
*/
public final boolean hasPeople() {
for (Job job : getJobs()) {
if (job instanceof Project) {
Project p = (Project) job;
for (Build build : p.getBuilds()) {
for (Entry entry : build.getChangeSet()) {
User user = entry.getAuthor();
if(user!=null)
return true;
}
}
}
}
return false;
}
/**
* Gets the users that show up in the changelog of this job collection.
*/
......
......@@ -13,7 +13,9 @@
<l:isAdmin>
<l:task icon="images/24x24/new-package.gif" href="newJob" title="New Job" />
<l:task icon="images/24x24/setting.gif" href="${rootURL}/manage" title="Manage Hudson" />
<l:task icon="images/24x24/user.gif" href="people" title="People" />
<j:if test="${it.hasPeople()}">
<l:task icon="images/24x24/user.gif" href="people" title="People" />
</j:if>
<st:include page="sidepanel2.jelly" />
</l:isAdmin>
</l:tasks>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册