}
List<MenuItem> standardItems = new ArrayList<MenuItem>();
standardItems.add(new MenuDivider());
if (user.canAdmin() || user.canCreate()) {
standardItems.add(new PageLinkMenuItem("gb.newRepository", app().getNewRepositoryPage()));
}
standardItems.add(new PageLinkMenuItem("gb.myProfile", UserPage.class,
WicketUtils.newUsernameParameter(user.username)));
if (editCredentials) {
standardItems.add(new PageLinkMenuItem("gb.changePassword", ChangePasswordPage.class));
}
standardItems.add(new MenuDivider());
add(newSubmenu("standardMenu", user.getDisplayName(), standardItems));
if (showAdmin) {
// admin menu
List<MenuItem> adminItems = new ArrayList<MenuItem>();
adminItems.add(new MenuDivider());
adminItems.add(new PageLinkMenuItem("gb.users", UsersPage.class));
adminItems.add(new PageLinkMenuItem("gb.teams", TeamsPage.class));
boolean showRegistrations = app().federation().canFederate()
&& app().settings().getBoolean(Keys.web.showFederationRegistrations, false);
if (showRegistrations) {
adminItems.add(new PageLinkMenuItem("gb.federation", FederationPage.class));
}
adminItems.add(new MenuDivider());
add(newSubmenu("adminMenu", getString("gb.administration"), adminItems));
} else {