- Revised committer verification to require a matching displayname or account name AND the email address
- Serve repositories on both /r and /git, displaying /r because it is shorter
- Eliminate HEAD from the blob, blame, and tree pages. That assumed a resource was available in HEAD and it may not be.
+ - Eliminate Gravatar profile linking.
additions:
- Added color modes for the blame page (issue-2)
- Added an optional MirrorService which will periodically fetch ref updates from source repositories for mirrors (issue-5). Repositories must be manually cloned using native git and "--mirror".
import com.gitblit.wicket.pages.ForkPage;
import com.gitblit.wicket.pages.ForksPage;
import com.gitblit.wicket.pages.GitSearchPage;
-import com.gitblit.wicket.pages.GravatarProfilePage;
import com.gitblit.wicket.pages.HistoryPage;
import com.gitblit.wicket.pages.LogPage;
import com.gitblit.wicket.pages.LogoutPage;
mount("/registration", FederationRegistrationPage.class, "u", "n");
mount("/activity", ActivityPage.class, "r", "h");
- mount("/gravatar", GravatarProfilePage.class, "h");
mount("/lucene", LuceneSearchPage.class);
mount("/project", ProjectPage.class, "p");
mount("/projects", ProjectsPage.class);
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" \r
- xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd" \r
- xml:lang="en" \r
- lang="en"> \r
-<body>\r
-<wicket:extend>\r
-<div class="container">\r
- <div class="pageTitle">\r
- <h2>Gravatar<small> / <span wicket:id="username">[username]</span></small></h2>\r
- </div>\r
- <img class="gravatar" wicket:id="profileImage"></img>\r
- <h2 wicket:id="displayName"></h2>\r
- <div style="color:#888;"wicket:id="location"></div>\r
- <div style="padding-top:5px;" wicket:id="aboutMe"></div>\r
- <p></p>\r
- <a wicket:id="profileLink"><wicket:message key="gb.completeGravatarProfile">[Complete profile on Gravatar.com]</wicket:message></a>\r
- <p></p>\r
-</div>\r
-</wicket:extend>\r
-</body>\r
-</html>
\ No newline at end of file
+++ /dev/null
-/*\r
- * Copyright 2011 gitblit.com.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package com.gitblit.wicket.pages;\r
-\r
-import java.io.IOException;\r
-import java.text.MessageFormat;\r
-\r
-import org.apache.wicket.PageParameters;\r
-import org.apache.wicket.markup.html.basic.Label;\r
-import org.apache.wicket.markup.html.link.ExternalLink;\r
-\r
-import com.gitblit.models.GravatarProfile;\r
-import com.gitblit.utils.ActivityUtils;\r
-import com.gitblit.wicket.ExternalImage;\r
-import com.gitblit.wicket.WicketUtils;\r
-\r
-/**\r
- * Gravatar Profile Page shows the Gravatar information, if available.\r
- *\r
- * @author James Moger\r
- *\r
- */\r
-public class GravatarProfilePage extends RootPage {\r
-\r
- public GravatarProfilePage(PageParameters params) {\r
- super();\r
- setupPage("", "");\r
- String object = WicketUtils.getObject(params);\r
- GravatarProfile profile = null;\r
- try {\r
- if (object.indexOf('@') > -1) {\r
- profile = ActivityUtils.getGravatarProfileFromAddress(object);\r
- } else {\r
- profile = ActivityUtils.getGravatarProfile(object);\r
- }\r
- } catch (IOException e) {\r
- error(MessageFormat.format(getString("gb.failedToFindGravatarProfile"), object), e, true);\r
- }\r
-\r
- if (profile == null) {\r
- error(MessageFormat.format(getString("gb.failedToFindGravatarProfile"), object), true);\r
- }\r
- add(new Label("displayName", profile.displayName));\r
- add(new Label("username", profile.preferredUsername));\r
- add(new Label("location", profile.currentLocation));\r
- add(new Label("aboutMe", profile.aboutMe));\r
- ExternalImage image = new ExternalImage("profileImage", profile.thumbnailUrl + "?s=256&d=identicon");\r
- add(image);\r
- add(new ExternalLink("profileLink", profile.profileUrl));\r
- }\r
-}\r
boolean standardLogin = session.authenticationType.isStandard();\r
\r
if (app().settings().getBoolean(Keys.web.allowGravatar, true)) {\r
- add(new GravatarImage("username", user.getDisplayName(),\r
- user.emailAddress, "navbarGravatar", 20, false, false));\r
+ add(new GravatarImage("username", user, "navbarGravatar", 20, false));\r
} else {\r
add(new Label("username", user.getDisplayName()));\r
}\r
final RepositoryCommit commit = commitItem.getModelObject();\r
\r
// author gravatar\r
- commitItem.add(new GravatarImage("commitAuthor", commit.getAuthorIdent().getName(),\r
- commit.getAuthorIdent().getEmailAddress(), null, 16, false, false));\r
+ commitItem.add(new GravatarImage("commitAuthor", commit.getAuthorIdent(), null, 16, false));\r
\r
// merge icon\r
if (commit.getParentCount() > 1) {\r
xml:lang="en" \r
lang="en">\r
<wicket:panel>\r
-<a href="#" wicket:id="link"><img wicket:id="image"></img></a>\r
+<img wicket:id="image"></img>\r
</wicket:panel>\r
</html>
\ No newline at end of file
*/\r
package com.gitblit.wicket.panels;\r
\r
-import java.text.MessageFormat;\r
-\r
-import org.apache.wicket.behavior.SimpleAttributeModifier;\r
-import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
-import org.apache.wicket.markup.html.link.Link;\r
import org.eclipse.jgit.lib.PersonIdent;\r
\r
import com.gitblit.Keys;\r
+import com.gitblit.models.UserModel;\r
import com.gitblit.utils.ActivityUtils;\r
-import com.gitblit.utils.StringUtils;\r
import com.gitblit.wicket.ExternalImage;\r
import com.gitblit.wicket.WicketUtils;\r
-import com.gitblit.wicket.pages.GravatarProfilePage;\r
\r
/**\r
- * Represents a Gravatar image and links to the Gravatar profile page.\r
+ * Represents a Gravatar image.\r
*\r
* @author James Moger\r
*\r
}\r
\r
public GravatarImage(String id, PersonIdent person, int width) {\r
- this(id, person, width, true);\r
+ this(id, person.getName(), person.getEmailAddress(), "gravatar", width, true);\r
+ }\r
+\r
+ public GravatarImage(String id, PersonIdent person, String cssClass, int width, boolean identicon) {\r
+ this(id, person.getName(), person.getEmailAddress(), cssClass, width, identicon);\r
}\r
\r
- public GravatarImage(String id, PersonIdent person, int width, boolean linked) {\r
- this(id, person.getName(), person.getEmailAddress(), "gravatar", width, linked, true);\r
+ public GravatarImage(String id, UserModel user, String cssClass, int width, boolean identicon) {\r
+ this(id, user.getDisplayName(), user.emailAddress, cssClass, width, identicon);\r
}\r
\r
- public GravatarImage(String id, String username, String emailaddress, String cssClass, int width, boolean linked, boolean identicon) {\r
+ public GravatarImage(String id, String username, String emailaddress, String cssClass, int width, boolean identicon) {\r
super(id);\r
\r
String email = emailaddress == null ? username.toLowerCase() : emailaddress.toLowerCase();\r
- String hash = StringUtils.getMD5(email);\r
- Link<Void> link = new BookmarkablePageLink<Void>("link", GravatarProfilePage.class,\r
- WicketUtils.newObjectParameter(hash));\r
- link.add(new SimpleAttributeModifier("target", "_blank"));\r
String url;\r
if (identicon) {\r
url = ActivityUtils.getGravatarIdenticonUrl(email, width);\r
if (cssClass != null) {\r
WicketUtils.setCssClass(image, cssClass);\r
}\r
- link.add(image);\r
- if (linked) {\r
- WicketUtils.setHtmlTooltip(link,\r
- MessageFormat.format("View Gravatar profile for {0}", username));\r
- } else {\r
- WicketUtils.setHtmlTooltip(link, username);\r
- }\r
- add(link.setEnabled(linked));\r
+ add(image);\r
+ WicketUtils.setHtmlTooltip(image, username);\r
setVisible(app().settings().getBoolean(Keys.web.allowGravatar, true));\r
}\r
}
\ No newline at end of file
final RepositoryCommit commit = commitItem.getModelObject();\r
\r
// author gravatar\r
- commitItem.add(new GravatarImage("commitAuthor", commit.getAuthorIdent().getName(),\r
- commit.getAuthorIdent().getEmailAddress(), null, 16, false, false));\r
+ commitItem.add(new GravatarImage("commitAuthor", commit.getAuthorIdent(), null, 16, false));\r
\r
// merge icon\r
if (commit.getParentCount() > 1) {\r
}
Fragment userFragment = new Fragment("registrant", "userRegistrant", RegistrantPermissionsPanel.this);
- userFragment.add(new GravatarImage("userAvatar", ident, 20, false));
+ userFragment.add(new GravatarImage("userAvatar", ident, 20));
userFragment.add(new Label("userName", entry.registrant));
item.add(userFragment);
} else {