Search in sources :

Example 1 with AvatarImage

use of com.gitblit.wicket.panels.AvatarImage in project gitblit by gitblit.

the class TicketPage method addUserAttributions.

protected void addUserAttributions(MarkupContainer container, Change entry, int avatarSize) {
    UserModel commenter = app().users().getUserModel(entry.author);
    if (commenter == null) {
        // unknown user
        container.add(new AvatarImage("changeAvatar", entry.author, entry.author, null, avatarSize, false).setVisible(avatarSize > 0));
        container.add(new Label("changeAuthor", entry.author.toLowerCase()));
    } else {
        // known user
        container.add(new AvatarImage("changeAvatar", commenter.getDisplayName(), commenter.emailAddress, avatarSize > 24 ? "gravatar-round" : null, avatarSize, true).setVisible(avatarSize > 0));
        container.add(new LinkPanel("changeAuthor", null, commenter.getDisplayName(), UserPage.class, WicketUtils.newUsernameParameter(commenter.username)));
    }
}
Also used : UserModel(com.gitblit.models.UserModel) Label(org.apache.wicket.markup.html.basic.Label) TicketLabel(com.gitblit.tickets.TicketLabel) AvatarImage(com.gitblit.wicket.panels.AvatarImage) LinkPanel(com.gitblit.wicket.panels.LinkPanel)

Aggregations

UserModel (com.gitblit.models.UserModel)1 TicketLabel (com.gitblit.tickets.TicketLabel)1 AvatarImage (com.gitblit.wicket.panels.AvatarImage)1 LinkPanel (com.gitblit.wicket.panels.LinkPanel)1 Label (org.apache.wicket.markup.html.basic.Label)1