Search in sources :

Example 1 with NavbarButton

use of de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarButton in project ocvn by devgateway.

the class BasePage method newMyDashboardsMenu.

protected NavbarButton<ListMyDashboardsPage> newMyDashboardsMenu() {
    // home
    NavbarButton<ListMyDashboardsPage> menu = new NavbarButton<>(ListMyDashboardsPage.class, this.getPageParameters(), new ResourceModel("mydashboards"));
    menu.setIconType(GlyphIconType.filter);
    MetaDataRoleAuthorizationStrategy.authorize(menu, Component.RENDER, SecurityConstants.Roles.ROLE_PROCURING_ENTITY);
    return menu;
}
Also used : ListMyDashboardsPage(org.devgateway.ocds.forms.wicket.page.list.ListMyDashboardsPage) NavbarButton(de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarButton) ResourceModel(org.apache.wicket.model.ResourceModel) StringResourceModel(org.apache.wicket.model.StringResourceModel)

Example 2 with NavbarButton

use of de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarButton in project ocvn by devgateway.

the class BasePage method newHomeMenu.

protected NavbarButton<Homepage> newHomeMenu() {
    // home
    NavbarButton<Homepage> homeMenu = new NavbarButton<>(Homepage.class, this.getPageParameters(), new ResourceModel("home"));
    homeMenu.setIconType(GlyphIconType.home);
    MetaDataRoleAuthorizationStrategy.authorize(homeMenu, Component.RENDER, SecurityConstants.Roles.ROLE_USER);
    return homeMenu;
}
Also used : NavbarButton(de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarButton) ResourceModel(org.apache.wicket.model.ResourceModel) StringResourceModel(org.apache.wicket.model.StringResourceModel)

Example 3 with NavbarButton

use of de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarButton in project ocvn by devgateway.

the class BasePage method newAccountMenu.

protected NavbarButton<EditUserPage> newAccountMenu() {
    PageParameters pageParametersForAccountPage = new PageParameters();
    Person person = SecurityUtil.getCurrentAuthenticatedPerson();
    // account menu
    Model<String> account = null;
    if (person != null) {
        account = Model.of(person.getFirstName());
        pageParametersForAccountPage.add(WebConstants.PARAM_ID, person.getId());
    }
    NavbarButton<EditUserPage> accountMenu = new NavbarButton<>(EditUserPage.class, pageParametersForAccountPage, account);
    accountMenu.setIconType(GlyphIconType.user);
    MetaDataRoleAuthorizationStrategy.authorize(accountMenu, Component.RENDER, SecurityConstants.Roles.ROLE_USER);
    return accountMenu;
}
Also used : NavbarButton(de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarButton) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) EditUserPage(org.devgateway.toolkit.forms.wicket.page.user.EditUserPage) Person(org.devgateway.toolkit.persistence.dao.Person)

Example 4 with NavbarButton

use of de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarButton in project ocvn by devgateway.

the class BasePage method newLogoutMenu.

protected NavbarButton<LogoutPage> newLogoutMenu() {
    // logout menu
    NavbarButton<LogoutPage> logoutMenu = new NavbarButton<LogoutPage>(LogoutPage.class, new StringResourceModel("navbar.logout", this, null));
    logoutMenu.setIconType(GlyphIconType.logout);
    MetaDataRoleAuthorizationStrategy.authorize(logoutMenu, Component.RENDER, SecurityConstants.Roles.ROLE_USER);
    return logoutMenu;
}
Also used : NavbarButton(de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarButton) LogoutPage(org.devgateway.toolkit.forms.wicket.page.user.LogoutPage) StringResourceModel(org.apache.wicket.model.StringResourceModel)

Aggregations

NavbarButton (de.agilecoders.wicket.core.markup.html.bootstrap.navbar.NavbarButton)4 StringResourceModel (org.apache.wicket.model.StringResourceModel)3 ResourceModel (org.apache.wicket.model.ResourceModel)2 PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)1 ListMyDashboardsPage (org.devgateway.ocds.forms.wicket.page.list.ListMyDashboardsPage)1 EditUserPage (org.devgateway.toolkit.forms.wicket.page.user.EditUserPage)1 LogoutPage (org.devgateway.toolkit.forms.wicket.page.user.LogoutPage)1 Person (org.devgateway.toolkit.persistence.dao.Person)1