Skip to content
Permalink
Browse files

[FIXED JENKINS-10122] Fixed so Jenkins installation newer than 1.433 …

…displays a user image.
  • Loading branch information
redsolo committed Nov 18, 2011
1 parent 3b32af8 commit 150843fc09a729806026c97c1ab6b9534a02e2a5
@@ -14,6 +14,7 @@
import hudson.security.ACL;
import hudson.security.AccessControlled;
import hudson.security.Permission;
import hudson.util.VersionNumber;

import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
@@ -52,6 +53,11 @@ public String getUrlName() {
public List<UserScore> getUserScores() {
return getUserScores(User.getAll(), Hudson.getInstance().getDescriptorByType(GameDescriptor.class).getNamesAreCaseSensitive());
}

@Exported
public boolean isUserAvatarSupported() {
return new VersionNumber(Hudson.VERSION).isNewerThan(new VersionNumber("1.433"));
}

List<UserScore> getUserScores(Collection<User> users, boolean usernameIsCasesensitive) {
ArrayList<UserScore> list = new ArrayList<UserScore>();
@@ -4,14 +4,16 @@
<l:main-panel>
<h1>${%Leaderboard.title}</h1>
<div>
<table class="pane sortable" style="width:50%">
<table class="pane sortable bigtable" style="width:50%">
<tr>
<j:if test="${it.userAvatarSupported}"><td class="pane-header" align="left"/></j:if>
<td class="pane-header" align="left,center">${%Leaderboard.Participant}</td>
<td class="pane-header" align="left,center">${%Leaderboard.Description}</td>
<td class="pane-header" initialSortDir="up" align="left" width="10%">${%Leaderboard.Score}</td>
</tr>
<j:forEach var="userscore" items="${it.userScores}">
<tr>
<j:if test="${it.userAvatarSupported}"><td><img src="${h.getUserAvatar(userscore.user,'48x48')}" alt="" height="48" width="48" /></td></j:if>
<td><a href="${rootURL}/${userscore.user.url}">${userscore.user}</a></td>
<td>${userscore.description}</td>
<td>${userscore.score}</td>

0 comments on commit 150843f

Please sign in to comment.
You can’t perform that action at this time.