Search in sources :

Example 11 with ResponsiveRow

use of com.jarektoro.responsivelayout.ResponsiveRow in project cia by Hack23.

the class MinistryRankingMenuItemFactoryImpl method createOverviewPage.

@Override
public void createOverviewPage(final VerticalLayout panelContent) {
    final ResponsiveRow grid = createGridLayout(panelContent);
    createButtonLink(grid, POLITICAL_WORK_SUMMARY_TEXT, VaadinIcons.GROUP, COMMAND_DATAGRID, "Scoreboard all ministries with current/total members and politican days served");
    createButtonLink(grid, CURRENT_MINISTRIES_CURRENT_MEMBERS_TEXT, VaadinIcons.GROUP, COMMAND_CHARTS_CURRENT_MINISTRIES_BY_HEADCOUNT, "Chart over current ministries by headcount");
    createButtonLink(grid, CURRENT_PARTIES_ACTIVE_IN_MINISTRIES_HEAD_COUNT_TEXT, VaadinIcons.GROUP, COMMAND_CHARTS_CURRENT_PARTIES_BY_HEADCOUNT, "Chart over current parties active in ministries by headcount");
    createButtonLink(grid, ALL_PARTIES_TOTAL_DAYS_SERVED_IN_MINISTRIES_TEXT, VaadinIcons.GROUP, COMMAND_CHARTS_ALLMINISTRIES_BY_TOTAL_DAYS, "Chart over all parties hold positons in ministries by headcount");
    createButtonLink(grid, ALL_MINISTRIES_TOTAL_MEMBERS_TEXT, VaadinIcons.GROUP, COMMAND_CHARTS_ALL_MINISTRIES_BY_HEADCOUNT, "Chart over all ministries by total headcount");
    createButtonLink(grid, GOVERNMENT_BODIES, VaadinIcons.GROUP, COMMAND_GOVERNMENT_BODIES, "Chart over total headcount for all goverment bodies governed by ministries ");
    createButtonLink(grid, GOVERNMENT_ROLES_CHART, VaadinIcons.GROUP, COMMAND_CHARTS_ALL_GOVERNMENT_ROLE_GANTT, "Gantt chart all goverment roles");
    createButtonLink(grid, PAGE_VISIT_HISTORY_TEXT, VaadinIcons.GROUP, COMMAND_PAGEVISITHISTORY, "View history of page visit for this page.");
}
Also used : ResponsiveRow(com.jarektoro.responsivelayout.ResponsiveRow)

Example 12 with ResponsiveRow

use of com.jarektoro.responsivelayout.ResponsiveRow in project cia by Hack23.

the class ParliamentMenuItemFactoryImpl method createOverviewPage.

@Override
public void createOverviewPage(final VerticalLayout panelContent) {
    final ResponsiveRow grid = createGridLayout(panelContent);
    createButtonLink(grid, PARTY_WINNER, VaadinIcons.INSTITUTION, COMMAND_CHARTS_PARTY_WINNER, CHART_DAILY_BALLOT_SUMMARY_PERCENTAGE_BALLOTS_THAT_DAY_THE_VOTED_IN_WINNING_SIDE);
    createButtonLink(grid, PARTY_GENDER, VaadinIcons.INSTITUTION, COMMAND_CHARTS_PARTY_GENDER, CHART_PARTY_AVERAGE_GENDER_ALL_BALLOTS);
    createButtonLink(grid, PARTY_AGE, VaadinIcons.INSTITUTION, COMMAND_CHARTS_PARTY_AGE, CHART_PARTY_AGE_ALL_BALLOTS);
    createButtonLink(grid, RISK_SUMMARY, VaadinIcons.INSTITUTION, COMMAND_RISK_SUMMARY, RISK_SUMMARY);
    createButtonLink(grid, RULE_VIOLATIONS, VaadinIcons.INSTITUTION, COMMAND_RULE_VIOLATION, RULE_VIOLATIONS);
    createButtonLink(grid, DOCUMENT_ACTIVITY_BY_TYPE, VaadinIcons.INSTITUTION, COMMAND_DOCUMENT_ACTIVITY, CHART_DOCUMENT_ACTIVITY_BY_TYPE);
    createButtonLink(grid, DECISION_ACTIVITY_BY_TYPE, VaadinIcons.INSTITUTION, COMMAND_DECISION_ACTIVITY, CHART_DECISIONS_BY_DECISION_TYPE);
    createButtonLink(grid, DECISION_FLOW, VaadinIcons.INSTITUTION, COMMAND_CHARTS_DECISION_FLOW, DECISION_FLOW_DESCRIPTION);
    createButtonLink(grid, PAGE_VISIT_HISTORY_TEXT, VaadinIcons.INSTITUTION, COMMAND_PAGEVISITHISTORY, VIEW_HISTORY_OF_PAGE_VISIT_FOR_THIS_PAGE);
}
Also used : ResponsiveRow(com.jarektoro.responsivelayout.ResponsiveRow)

Example 13 with ResponsiveRow

use of com.jarektoro.responsivelayout.ResponsiveRow in project cia by Hack23.

the class AdminUserAccountPageModContentFactoryImpl method createContent.

@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout content = createPanelContent();
    final String pageId = getPageId(parameters);
    final int pageNr = getPageNr(parameters);
    getMenuItemFactory().createMainPageMenuBar(menuBar);
    LabelFactory.createHeader2Label(content, ADMIN_USERACCOUNT);
    final DataContainer<UserAccount, Long> dataContainer = getApplicationManager().getDataContainer(UserAccount.class);
    final List<UserAccount> pageOrderBy = dataContainer.getPageOrderBy(pageNr, DEFAULT_RESULTS_PER_PAGE, UserAccount_.createdDate);
    createPagingControls(content, NAME, pageId, dataContainer.getSize(), pageNr, DEFAULT_RESULTS_PER_PAGE);
    getGridFactory().createBasicBeanItemGrid(content, UserAccount.class, pageOrderBy, USER_ACCOUNT, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);
    if (pageId != null && !pageId.isEmpty()) {
        final UserAccount userAccount = dataContainer.load(Long.valueOf(pageId));
        if (userAccount != null) {
            getFormFactory().addFormPanelTextFields(content, userAccount, UserAccount.class, AS_LIST);
            final VerticalLayout overviewLayout = new VerticalLayout();
            overviewLayout.setSizeFull();
            content.addComponent(overviewLayout);
            content.setExpandRatio(overviewLayout, ContentRatio.LARGE);
            final ResponsiveRow grid = createGridLayout(overviewLayout);
            for (final AccountOperation accountOperation : ManageUserAccountRequest.AccountOperation.values()) {
                final ManageUserAccountRequest request = new ManageUserAccountRequest();
                request.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
                request.setAccountOperation(accountOperation);
                request.setUserAcountId(userAccount.getUserId());
                final Button accountOperationButton = new Button(MessageFormat.format(BUTTON_PATTERN, accountOperation), VaadinIcons.BULLSEYE);
                accountOperationButton.addClickListener(new ManageUserAccountClickListener(request));
                accountOperationButton.setId(MessageFormat.format(BUTTON_ID_PATTERN, ViewAction.START_AGENT_BUTTON, accountOperation));
                createRowItem(grid, accountOperationButton, "Will perform useraccount action");
            }
        }
    }
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_USERACCOUNT_VIEW, ApplicationEventGroup.ADMIN, NAME, null, pageId);
    return content;
}
Also used : Button(com.vaadin.ui.Button) ResponsiveRow(com.jarektoro.responsivelayout.ResponsiveRow) ManageUserAccountClickListener(com.hack23.cia.web.impl.ui.application.views.pageclicklistener.ManageUserAccountClickListener) ManageUserAccountRequest(com.hack23.cia.service.api.action.admin.ManageUserAccountRequest) VerticalLayout(com.vaadin.ui.VerticalLayout) AccountOperation(com.hack23.cia.service.api.action.admin.ManageUserAccountRequest.AccountOperation) UserAccount(com.hack23.cia.model.internal.application.user.impl.UserAccount) Secured(org.springframework.security.access.annotation.Secured)

Example 14 with ResponsiveRow

use of com.jarektoro.responsivelayout.ResponsiveRow in project cia by Hack23.

the class PartyMenuItemFactoryImpl method createOverviewPage.

@Override
public void createOverviewPage(final VerticalLayout panelContent, final String pageId) {
    final ResponsiveRow grid = createGridLayout(panelContent);
    createButtonLink(grid, CURRENT_LEADERS, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.CURRENTLEADERS.toString(), pageId), "Current leaders");
    createButtonLink(grid, LEADER_HISTORY, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.LEADERHISTORY.toString(), pageId), "Leader history");
    createButtonLink(grid, CURRENT_MEMBERS_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.CURRENTMEMBERS.toString(), pageId), "Current members");
    createButtonLink(grid, MEMBER_HISTORY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.MEMBERHISTORY.toString(), pageId), "Current and past members");
    createButtonLink(grid, GOVERMENT_ROLES, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.GOVERNMENTROLES.toString(), pageId), "Government roles hold");
    createButtonLink(grid, COMMITTEE_ROLES, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.COMMITTEEROLES.toString(), pageId), "Committe roles hold");
    createButtonLink(grid, ROLE_CHART_PARTY_LEADERS, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.ROLEGHANT.toString(), pageId), "Gantt chart all party leaders");
    createButtonLink(grid, DOCUMENT_ACTIVITY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.DOCUMENTACTIVITY.toString(), pageId), "Chart over document activity by type");
    createButtonLink(grid, DOCUMENT_HISTORY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.DOCUMENTHISTORY.toString(), pageId), "List all document history");
    createButtonLink(grid, VOTE_HISTORY, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.VOTEHISTORY.toString(), pageId), VOTE_HISTORY);
    createButtonLink(grid, BALLOT_DECISION_SUMMARY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.COMMITTEEBALLOTDECISIONSUMMARY.toString(), pageId), "Ballot decision summary");
    createButtonLink(grid, PARTY_WON_DAILY_SUMMARY_CHART, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PartyPageMode.PARTYWONDAILYSUMMARYCHART.toString(), pageId), "Chart for Party over won,absent and party rebel votes");
    createButtonLink(grid, PAGE_VISIT_HISTORY_TEXT, VaadinIcons.GROUP, new PageModeMenuCommand(UserViews.PARTY_VIEW_NAME, PageMode.PAGEVISITHISTORY, pageId), "View history of page visit for this page.");
}
Also used : PageModeMenuCommand(com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand) ResponsiveRow(com.jarektoro.responsivelayout.ResponsiveRow)

Example 15 with ResponsiveRow

use of com.jarektoro.responsivelayout.ResponsiveRow in project cia by Hack23.

the class PoliticianMenuItemFactoryImpl method createOverviewPage.

@Override
public void createOverviewPage(final VerticalLayout panelContent, final String pageId) {
    final ResponsiveRow grid = createGridLayout(panelContent);
    createButtonLink(grid, INDICATORS_TEXT, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PageMode.INDICATORS, pageId), "Daily summary of ballots breakdown by won,party rebel,absent and number of ballots");
    createButtonLink(grid, TOTAL_EXPERIENCE, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.ROLESUMMARY.toString(), pageId), "Experience summary in EU,government,parliament,committess and party roles");
    createButtonLink(grid, ROLE_LIST, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.ROLELIST.toString(), pageId), "List all roles");
    createButtonLink(grid, ROLE_GHANT_TEXT, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.ROLEGHANT.toString(), pageId), "Gantt chart of all roles");
    createButtonLink(grid, DOCUMENT_ACTIVITY_TEXT, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.DOCUMENTACTIVITY.toString(), pageId), "Document activity by document type");
    createButtonLink(grid, DOCUMENT_HISTORY_TEXT, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.DOCUMENTHISTORY.toString(), pageId), "Document history list");
    createButtonLink(grid, VOTE_HISTORY, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.VOTEHISTORY.toString(), pageId), "Summary of all votes");
    createButtonLink(grid, BALLOT_DECISION_SUMMARY_TEXT, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PoliticianPageMode.BALLOTDECISIONSUMMARY.toString(), pageId), "Summary of all ballot decisions");
    createButtonLink(grid, PAGE_VISIT_HISTORY_TEXT, VaadinIcons.BUG, new PageModeMenuCommand(UserViews.POLITICIAN_VIEW_NAME, PageMode.PAGEVISITHISTORY, pageId), "View history of page visit for this page.");
}
Also used : PageModeMenuCommand(com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand) ResponsiveRow(com.jarektoro.responsivelayout.ResponsiveRow)

Aggregations

ResponsiveRow (com.jarektoro.responsivelayout.ResponsiveRow)19 PageModeMenuCommand (com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand)7 VerticalLayout (com.vaadin.ui.VerticalLayout)6 Secured (org.springframework.security.access.annotation.Secured)6 Button (com.vaadin.ui.Button)3 ClickListener (com.vaadin.ui.Button.ClickListener)2 FormLayout (com.vaadin.ui.FormLayout)2 Panel (com.vaadin.ui.Panel)2 DataAgentTarget (com.hack23.cia.model.internal.application.data.impl.DataAgentTarget)1 UserAccount (com.hack23.cia.model.internal.application.user.impl.UserAccount)1 DataSummary (com.hack23.cia.service.api.DataSummary)1 ManageUserAccountRequest (com.hack23.cia.service.api.action.admin.ManageUserAccountRequest)1 AccountOperation (com.hack23.cia.service.api.action.admin.ManageUserAccountRequest.AccountOperation)1 LoginRequest (com.hack23.cia.service.api.action.application.LoginRequest)1 RegisterUserRequest (com.hack23.cia.service.api.action.application.RegisterUserRequest)1 ApplicationLoginListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.ApplicationLoginListener)1 ManageUserAccountClickListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.ManageUserAccountClickListener)1 RefreshDataViewsClickListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.RefreshDataViewsClickListener)1 RegisterUserClickListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.RegisterUserClickListener)1 RemoveDataClickListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.RemoveDataClickListener)1