diff options
author | James Moger <james.moger@gitblit.com> | 2014-03-03 17:41:54 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-03-03 17:51:21 -0500 |
commit | 94e12c168f5eec300fd23d0de25c7dc93a96c429 (patch) | |
tree | 635d6b3c48e4bf518eeaa4a3a0dbf132516f71ca /src/main/java/com/gitblit/wicket/pages | |
parent | f7df31e369b7ddd0f7d2e61b4328a2fc4c377451 (diff) | |
download | gitblit-94e12c168f5eec300fd23d0de25c7dc93a96c429.tar.gz gitblit-94e12c168f5eec300fd23d0de25c7dc93a96c429.zip |
Eliminate Gravatar profile linking and improve api
Diffstat (limited to 'src/main/java/com/gitblit/wicket/pages')
3 files changed, 1 insertions, 88 deletions
diff --git a/src/main/java/com/gitblit/wicket/pages/GravatarProfilePage.html b/src/main/java/com/gitblit/wicket/pages/GravatarProfilePage.html deleted file mode 100644 index b4531a1b..00000000 --- a/src/main/java/com/gitblit/wicket/pages/GravatarProfilePage.html +++ /dev/null @@ -1,22 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd"
- xml:lang="en"
- lang="en">
-<body>
-<wicket:extend>
-<div class="container">
- <div class="pageTitle">
- <h2>Gravatar<small> / <span wicket:id="username">[username]</span></small></h2>
- </div>
- <img class="gravatar" wicket:id="profileImage"></img>
- <h2 wicket:id="displayName"></h2>
- <div style="color:#888;"wicket:id="location"></div>
- <div style="padding-top:5px;" wicket:id="aboutMe"></div>
- <p></p>
- <a wicket:id="profileLink"><wicket:message key="gb.completeGravatarProfile">[Complete profile on Gravatar.com]</wicket:message></a>
- <p></p>
-</div>
-</wicket:extend>
-</body>
-</html>
\ No newline at end of file diff --git a/src/main/java/com/gitblit/wicket/pages/GravatarProfilePage.java b/src/main/java/com/gitblit/wicket/pages/GravatarProfilePage.java deleted file mode 100644 index 984b2972..00000000 --- a/src/main/java/com/gitblit/wicket/pages/GravatarProfilePage.java +++ /dev/null @@ -1,64 +0,0 @@ -/*
- * Copyright 2011 gitblit.com.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gitblit.wicket.pages;
-
-import java.io.IOException;
-import java.text.MessageFormat;
-
-import org.apache.wicket.PageParameters;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.link.ExternalLink;
-
-import com.gitblit.models.GravatarProfile;
-import com.gitblit.utils.ActivityUtils;
-import com.gitblit.wicket.ExternalImage;
-import com.gitblit.wicket.WicketUtils;
-
-/**
- * Gravatar Profile Page shows the Gravatar information, if available.
- *
- * @author James Moger
- *
- */
-public class GravatarProfilePage extends RootPage {
-
- public GravatarProfilePage(PageParameters params) {
- super();
- setupPage("", "");
- String object = WicketUtils.getObject(params);
- GravatarProfile profile = null;
- try {
- if (object.indexOf('@') > -1) {
- profile = ActivityUtils.getGravatarProfileFromAddress(object);
- } else {
- profile = ActivityUtils.getGravatarProfile(object);
- }
- } catch (IOException e) {
- error(MessageFormat.format(getString("gb.failedToFindGravatarProfile"), object), e, true);
- }
-
- if (profile == null) {
- error(MessageFormat.format(getString("gb.failedToFindGravatarProfile"), object), true);
- }
- add(new Label("displayName", profile.displayName));
- add(new Label("username", profile.preferredUsername));
- add(new Label("location", profile.currentLocation));
- add(new Label("aboutMe", profile.aboutMe));
- ExternalImage image = new ExternalImage("profileImage", profile.thumbnailUrl + "?s=256&d=identicon");
- add(image);
- add(new ExternalLink("profileLink", profile.profileUrl));
- }
-}
diff --git a/src/main/java/com/gitblit/wicket/pages/RootPage.java b/src/main/java/com/gitblit/wicket/pages/RootPage.java index 9141b4e3..5ccc3a4c 100644 --- a/src/main/java/com/gitblit/wicket/pages/RootPage.java +++ b/src/main/java/com/gitblit/wicket/pages/RootPage.java @@ -576,8 +576,7 @@ public abstract class RootPage extends BasePage { boolean standardLogin = session.authenticationType.isStandard();
if (app().settings().getBoolean(Keys.web.allowGravatar, true)) {
- add(new GravatarImage("username", user.getDisplayName(),
- user.emailAddress, "navbarGravatar", 20, false, false));
+ add(new GravatarImage("username", user, "navbarGravatar", 20, false));
} else {
add(new Label("username", user.getDisplayName()));
}
|