summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/wicket/panels
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/gitblit/wicket/panels')
-rw-r--r--src/main/java/com/gitblit/wicket/panels/ActivityPanel.java2
-rw-r--r--src/main/java/com/gitblit/wicket/panels/AvatarImage.html (renamed from src/main/java/com/gitblit/wicket/panels/GravatarImage.html)0
-rw-r--r--src/main/java/com/gitblit/wicket/panels/AvatarImage.java (renamed from src/main/java/com/gitblit/wicket/panels/GravatarImage.java)21
-rw-r--r--src/main/java/com/gitblit/wicket/panels/CommitHeaderPanel.java2
-rw-r--r--src/main/java/com/gitblit/wicket/panels/DigestsPanel.java2
-rw-r--r--src/main/java/com/gitblit/wicket/panels/ReflogPanel.java2
-rw-r--r--src/main/java/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java2
-rw-r--r--src/main/java/com/gitblit/wicket/panels/TicketListPanel.java2
-rw-r--r--src/main/java/com/gitblit/wicket/panels/UserTitlePanel.java2
9 files changed, 14 insertions, 21 deletions
diff --git a/src/main/java/com/gitblit/wicket/panels/ActivityPanel.java b/src/main/java/com/gitblit/wicket/panels/ActivityPanel.java
index 35513bb3..062df84e 100644
--- a/src/main/java/com/gitblit/wicket/panels/ActivityPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/ActivityPanel.java
@@ -76,7 +76,7 @@ public class ActivityPanel extends BasePanel {
.getWhen(), getTimeZone(), getTimeUtils()));
// avatar
- commitItem.add(new GravatarImage("avatar", commit.getAuthorIdent(), 40));
+ commitItem.add(new AvatarImage("avatar", commit.getAuthorIdent(), 40));
// merge icon
if (commit.getParentCount() > 1) {
diff --git a/src/main/java/com/gitblit/wicket/panels/GravatarImage.html b/src/main/java/com/gitblit/wicket/panels/AvatarImage.html
index 846a8f1b..846a8f1b 100644
--- a/src/main/java/com/gitblit/wicket/panels/GravatarImage.html
+++ b/src/main/java/com/gitblit/wicket/panels/AvatarImage.html
diff --git a/src/main/java/com/gitblit/wicket/panels/GravatarImage.java b/src/main/java/com/gitblit/wicket/panels/AvatarImage.java
index e4157577..99015612 100644
--- a/src/main/java/com/gitblit/wicket/panels/GravatarImage.java
+++ b/src/main/java/com/gitblit/wicket/panels/AvatarImage.java
@@ -19,7 +19,6 @@ import org.eclipse.jgit.lib.PersonIdent;
import com.gitblit.Keys;
import com.gitblit.models.UserModel;
-import com.gitblit.utils.ActivityUtils;
import com.gitblit.wicket.ExternalImage;
import com.gitblit.wicket.WicketUtils;
@@ -29,36 +28,30 @@ import com.gitblit.wicket.WicketUtils;
* @author James Moger
*
*/
-public class GravatarImage extends BasePanel {
+public class AvatarImage extends BasePanel {
private static final long serialVersionUID = 1L;
- public GravatarImage(String id, PersonIdent person) {
+ public AvatarImage(String id, PersonIdent person) {
this(id, person, 0);
}
- public GravatarImage(String id, PersonIdent person, int width) {
+ public AvatarImage(String id, PersonIdent person, int width) {
this(id, person.getName(), person.getEmailAddress(), "gravatar", width, true);
}
- public GravatarImage(String id, PersonIdent person, String cssClass, int width, boolean identicon) {
+ public AvatarImage(String id, PersonIdent person, String cssClass, int width, boolean identicon) {
this(id, person.getName(), person.getEmailAddress(), cssClass, width, identicon);
}
- public GravatarImage(String id, UserModel user, String cssClass, int width, boolean identicon) {
+ public AvatarImage(String id, UserModel user, String cssClass, int width, boolean identicon) {
this(id, user.getDisplayName(), user.emailAddress, cssClass, width, identicon);
}
- public GravatarImage(String id, String username, String emailaddress, String cssClass, int width, boolean identicon) {
+ public AvatarImage(String id, String username, String emailaddress, String cssClass, int width, boolean identicon) {
super(id);
- String email = emailaddress == null ? username.toLowerCase() : emailaddress.toLowerCase();
- String url;
- if (identicon) {
- url = ActivityUtils.getGravatarIdenticonUrl(email, width);
- } else {
- url = ActivityUtils.getGravatarThumbnailUrl(email, width);
- }
+ String url = app().buildAvatarUrl(username, emailaddress, cssClass, width, identicon);
ExternalImage image = new ExternalImage("image", url);
if (cssClass != null) {
WicketUtils.setCssClass(image, cssClass);
diff --git a/src/main/java/com/gitblit/wicket/panels/CommitHeaderPanel.java b/src/main/java/com/gitblit/wicket/panels/CommitHeaderPanel.java
index eb757501..249cd4ac 100644
--- a/src/main/java/com/gitblit/wicket/panels/CommitHeaderPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/CommitHeaderPanel.java
@@ -44,6 +44,6 @@ public class CommitHeaderPanel extends BasePanel {
add(new Label("commitid", c.getName()));
add(new Label("author", c.getAuthorIdent().getName()));
add(WicketUtils.createDateLabel("date", c.getAuthorIdent().getWhen(), getTimeZone(), getTimeUtils()));
- add(new GravatarImage("authorAvatar", c.getAuthorIdent()));
+ add(new AvatarImage("authorAvatar", c.getAuthorIdent()));
}
} \ No newline at end of file
diff --git a/src/main/java/com/gitblit/wicket/panels/DigestsPanel.java b/src/main/java/com/gitblit/wicket/panels/DigestsPanel.java
index decfda50..d901945d 100644
--- a/src/main/java/com/gitblit/wicket/panels/DigestsPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/DigestsPanel.java
@@ -216,7 +216,7 @@ public class DigestsPanel extends BasePanel {
final RepositoryCommit commit = commitItem.getModelObject();
// author gravatar
- commitItem.add(new GravatarImage("commitAuthor", commit.getAuthorIdent(), null, 16, false));
+ commitItem.add(new AvatarImage("commitAuthor", commit.getAuthorIdent(), null, 16, false));
// merge icon
if (commit.getParentCount() > 1) {
diff --git a/src/main/java/com/gitblit/wicket/panels/ReflogPanel.java b/src/main/java/com/gitblit/wicket/panels/ReflogPanel.java
index baefc6bd..2235fd3d 100644
--- a/src/main/java/com/gitblit/wicket/panels/ReflogPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/ReflogPanel.java
@@ -271,7 +271,7 @@ public class ReflogPanel extends BasePanel {
final RepositoryCommit commit = commitItem.getModelObject();
// author gravatar
- commitItem.add(new GravatarImage("commitAuthor", commit.getAuthorIdent(), null, 16, false));
+ commitItem.add(new AvatarImage("commitAuthor", commit.getAuthorIdent(), null, 16, false));
// merge icon
if (commit.getParentCount() > 1) {
diff --git a/src/main/java/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java b/src/main/java/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java
index f37cc2aa..447e1789 100644
--- a/src/main/java/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java
@@ -145,7 +145,7 @@ public class RegistrantPermissionsPanel extends BasePanel {
}
Fragment userFragment = new Fragment("registrant", "userRegistrant", RegistrantPermissionsPanel.this);
- userFragment.add(new GravatarImage("userAvatar", ident, 20));
+ userFragment.add(new AvatarImage("userAvatar", ident, 20));
userFragment.add(new Label("userName", entry.registrant));
item.add(userFragment);
} else {
diff --git a/src/main/java/com/gitblit/wicket/panels/TicketListPanel.java b/src/main/java/com/gitblit/wicket/panels/TicketListPanel.java
index 2ac33d53..1fbe87cd 100644
--- a/src/main/java/com/gitblit/wicket/panels/TicketListPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/TicketListPanel.java
@@ -156,7 +156,7 @@ public class TicketListPanel extends BasePanel {
if (responsible == null) {
responsible = new UserModel(ticket.responsible);
}
- GravatarImage avatar = new GravatarImage("responsible", responsible.getDisplayName(),
+ AvatarImage avatar = new AvatarImage("responsible", responsible.getDisplayName(),
responsible.emailAddress, null, 16, true);
avatar.setTooltip(getString("gb.responsible") + ": " + responsible.getDisplayName());
item.add(avatar);
diff --git a/src/main/java/com/gitblit/wicket/panels/UserTitlePanel.java b/src/main/java/com/gitblit/wicket/panels/UserTitlePanel.java
index 2bf5ee7b..063889b2 100644
--- a/src/main/java/com/gitblit/wicket/panels/UserTitlePanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/UserTitlePanel.java
@@ -25,7 +25,7 @@ public class UserTitlePanel extends BasePanel {
public UserTitlePanel(String wicketId, UserModel user, String title) {
super(wicketId);
- add(new GravatarImage("userGravatar", user, "gravatar", 36, false));
+ add(new AvatarImage("userGravatar", user, "gravatar", 36, false));
add(new Label("userDisplayName", user.getDisplayName()));
add(new Label("userTitle", title));
}