Пример #1
0
  public GravatarImage(String id, PersonIdent person, int width) {
    super(id);

    String email =
        person.getEmailAddress() == null
            ? person.getName().toLowerCase()
            : person.getEmailAddress().toLowerCase();
    String hash = StringUtils.getMD5(email);
    Link<Void> link =
        new BookmarkablePageLink<Void>(
            "link", GravatarProfilePage.class, WicketUtils.newObjectParameter(hash));
    link.add(new SimpleAttributeModifier("target", "_blank"));
    String url = ActivityUtils.getGravatarThumbnailUrl(email, width);
    ExternalImage image = new ExternalImage("image", url);
    WicketUtils.setCssClass(image, "gravatar");
    link.add(image);
    WicketUtils.setHtmlTooltip(
        link, MessageFormat.format("View Gravatar profile for {0}", person.getName()));
    add(link);
    setVisible(GitBlit.getBoolean(Keys.web.allowGravatar, true));
  }
Пример #2
0
  protected void setupPage(String repositoryName, String pageName) {
    add(new Label("title", getPageTitle(repositoryName)));

    String rootLinkUrl =
        app()
            .settings()
            .getString(
                Keys.web.rootLink, urlFor(GitBlitWebApp.get().getHomePage(), null).toString());
    ExternalLink rootLink = new ExternalLink("rootLink", rootLinkUrl);
    WicketUtils.setHtmlTooltip(
        rootLink, app().settings().getString(Keys.web.siteName, Constants.NAME));
    add(rootLink);

    // Feedback panel for info, warning, and non-fatal error messages
    add(new FeedbackPanel("feedback"));

    add(new Label("gbVersion", "v" + Constants.getVersion()));
    if (app().settings().getBoolean(Keys.web.aggressiveHeapManagement, false)) {
      System.gc();
    }
  }