use of com.google.gerrit.client.AvatarImage in project gerrit by GerritCodeReview.
the class ChangeScreen method renderUploader.
private void renderUploader(ChangeInfo changeInfo, RevisionInfo revInfo) {
AccountInfo uploader = revInfo.uploader();
boolean isOwner = uploader == null || uploader._accountId() == changeInfo.owner()._accountId();
renderPushCertificate(revInfo, isOwner ? ownerPanel : uploaderPanel);
if (isOwner) {
uploaderRow.getStyle().setDisplay(Display.NONE);
return;
}
uploaderRow.getStyle().setDisplay(Display.TABLE_ROW);
if (uploader.avatar(AvatarInfo.DEFAULT_SIZE) != null) {
uploaderPanel.insert(new AvatarImage(uploader), 0);
}
String name = name(uploader);
uploaderName.setText(name);
uploaderName.setTitle(email(uploader, name));
}
use of com.google.gerrit.client.AvatarImage in project gerrit by GerritCodeReview.
the class CommitBox method formatLink.
private static void formatLink(GitPerson person, FlowPanel p, InlineHyperlink name, Element date, ChangeInfo change) {
// no avatar plugin is installed
if (change.owner().hasAvatarInfo()) {
AvatarImage avatar;
if (sameEmail(change.owner(), person)) {
avatar = new AvatarImage(change.owner());
} else {
avatar = new AvatarImage(AccountInfo.create(0, person.name(), person.email(), null));
}
p.insert(avatar, 0);
}
name.setText(renderName(person));
name.setTargetHistoryToken(PageLinks.toAccountQuery(owner(person), change.status()));
date.setInnerText(FormatUtil.mediumFormat(person.date()));
}
use of com.google.gerrit.client.AvatarImage in project gerrit by GerritCodeReview.
the class ChangeScreen method renderOwner.
private void renderOwner(ChangeInfo info) {
// TODO info card hover
String name = name(info.owner());
if (info.owner().avatar(AvatarInfo.DEFAULT_SIZE) != null) {
ownerPanel.insert(new AvatarImage(info.owner()), 0);
}
ownerLink.setText(name);
ownerLink.setTitle(email(info.owner(), name));
ownerLink.setTargetHistoryToken(PageLinks.toAccountQuery(info.owner().name() != null ? info.owner().name() : info.owner().email() != null ? info.owner().email() : String.valueOf(info.owner()._accountId()), Change.Status.NEW));
}
use of com.google.gerrit.client.AvatarImage in project gerrit by GerritCodeReview.
the class MyProfileScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
HorizontalPanel h = new HorizontalPanel();
add(h);
if (Gerrit.info().plugin().hasAvatars()) {
VerticalPanel v = new VerticalPanel();
v.addStyleName(Gerrit.RESOURCES.css().avatarInfoPanel());
h.add(v);
avatar = new AvatarImage();
v.add(avatar);
changeAvatar = new Anchor(Util.C.changeAvatar(), "", "_blank");
changeAvatar.setVisible(false);
v.add(changeAvatar);
}
if (LocaleInfo.getCurrentLocale().isRTL()) {
labelIdx = 1;
fieldIdx = 0;
} else {
labelIdx = 0;
fieldIdx = 1;
}
info = new Grid((Gerrit.info().auth().siteHasUsernames() ? 1 : 0) + 4, 2);
info.setStyleName(Gerrit.RESOURCES.css().infoBlock());
info.addStyleName(Gerrit.RESOURCES.css().accountInfoBlock());
h.add(info);
int row = 0;
if (Gerrit.info().auth().siteHasUsernames()) {
infoRow(row++, Util.C.userName());
}
infoRow(row++, Util.C.fullName());
infoRow(row++, Util.C.preferredEmail());
infoRow(row++, Util.C.registeredOn());
infoRow(row++, Util.C.accountId());
final CellFormatter fmt = info.getCellFormatter();
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(row - 1, 0, Gerrit.RESOURCES.css().bottomheader());
}
Aggregations