use of com.jarektoro.responsivelayout.ResponsiveRow in project cia by Hack23.
the class PoliticianRankingMenuItemFactoryImpl method createOverviewPage.
@Override
public void createOverviewPage(final VerticalLayout panelContent) {
final ResponsiveRow grid = createGridLayout(panelContent);
createButtonLink(grid, POLITICAL_EXPERIENCE_SUMMARY, VaadinIcons.BUG, COMMAND_DATAGRID, "All politicans, scoreboard assignments and days served in government, committees, speaker and party positions.");
createButtonLink(grid, ALL_PARTIES, VaadinIcons.GROUP, COMMAND_ALL_PARTIES, "All parties summary by number of roles in parliament");
createButtonLink(grid, CURRENT_PARTIES, VaadinIcons.GROUP, COMMAND_CURRENT_PARTIES, "Current parties roles in parliament");
createButtonLink(grid, PAGE_VISIT_HISTORY_TEXT, VaadinIcons.BUG, COMMAND_PAGEVISITHISTORY, "View history of page visit for this page.");
}
use of com.jarektoro.responsivelayout.ResponsiveRow in project cia by Hack23.
the class AgentOperationsOverviewPageModContentFactoryImpl method createContent.
@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
final VerticalLayout content = createPanelContent();
getMenuItemFactory().createMainPageMenuBar(menuBar);
LabelFactory.createHeader2Label(content, ADMIN_AGENT_OPERATION);
final VerticalLayout overviewLayout = new VerticalLayout();
overviewLayout.setSizeFull();
content.addComponent(overviewLayout);
content.setExpandRatio(overviewLayout, ContentRatio.LARGE);
final ResponsiveRow grid = createGridLayout(overviewLayout);
for (final DataAgentTarget dataAgentTarget : DataAgentTarget.values()) {
final Button importDataButton = new Button(MessageFormat.format(BUTTON_PATTERN, DataAgentOperation.IMPORT, dataAgentTarget), VaadinIcons.BULLSEYE);
importDataButton.addClickListener(new StartAgentClickListener(dataAgentTarget, DataAgentOperation.IMPORT));
importDataButton.setId(MessageFormat.format(BUTTON_ID_PATTERN, ViewAction.START_AGENT_BUTTON, DataAgentOperation.IMPORT, dataAgentTarget));
createRowItem(grid, importDataButton, WILL_FETCH_DATA_FROM_SOURCE);
}
final String pageId = getPageId(parameters);
getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_AGENT_OPERATION_VIEW, ApplicationEventGroup.ADMIN, NAME, null, pageId);
return content;
}
use of com.jarektoro.responsivelayout.ResponsiveRow in project cia by Hack23.
the class DataSummaryOverviewPageModContentFactoryImpl method createContent.
@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
final VerticalLayout content = createPanelContent();
getMenuItemFactory().createMainPageMenuBar(menuBar);
LabelFactory.createHeader2Label(content, ADMIN_DATA_SUMMARY);
final HorizontalLayout horizontalLayout = new HorizontalLayout();
horizontalLayout.setSizeFull();
content.addComponent(horizontalLayout);
content.setExpandRatio(horizontalLayout, ContentRatio.LARGE);
final DataContainer<DataSummary, String> dataContainer = getApplicationManager().getDataContainer(DataSummary.class);
final List<DataSummary> all = dataContainer.getAll();
if (!all.isEmpty()) {
final DataSummary dataSummary = all.get(0);
getFormFactory().addFormPanelTextFields(horizontalLayout, dataSummary, DataSummary.class, DATASUMMARY_FORM_FIELDS);
}
final VerticalLayout overviewLayout = new VerticalLayout();
overviewLayout.setSizeFull();
content.addComponent(overviewLayout);
content.setExpandRatio(overviewLayout, ContentRatio.LARGE);
final ResponsiveRow grid = createGridLayout(overviewLayout);
final Button refreshViewsButton = new Button(REFRESH_VIEWS, VaadinIcons.REFRESH);
refreshViewsButton.addClickListener(new RefreshDataViewsClickListener());
createRowItem(grid, refreshViewsButton, REFRESH_ALL_VIEWS);
final Button updateSearchIndexButton = new Button(UPDATE_SEARCH_INDEX, VaadinIcons.REFRESH);
updateSearchIndexButton.addClickListener(new UpdateSearchIndexClickListener());
createRowItem(grid, updateSearchIndexButton, UPDATE_DOCUMENT_SEARCH_INDEX);
final Button removeDataButton = new Button(REMOVE_POLITICIANS, VaadinIcons.DEL);
removeDataButton.addClickListener(new RemoveDataClickListener(RemoveDataRequest.DataType.POLITICIAN));
createRowItem(grid, removeDataButton, REMOVE_POLITICIANS);
final Button removeDocumentsButton = new Button(REMOVE_DOCUMENTS, VaadinIcons.DEL);
removeDocumentsButton.addClickListener(new RemoveDataClickListener(RemoveDataRequest.DataType.DOCUMENTS));
createRowItem(grid, removeDocumentsButton, REMOVE_DOCUMENTS);
final Button removeApplicationHistoryButton = new Button(REMOVE_APPLICATION_HISTORY, VaadinIcons.DEL);
removeApplicationHistoryButton.addClickListener(new RemoveDataClickListener(RemoveDataRequest.DataType.APPLICATION_HISTORY));
createRowItem(grid, removeApplicationHistoryButton, REMOVE_APPLICATION_HISTORY);
return content;
}
use of com.jarektoro.responsivelayout.ResponsiveRow in project cia by Hack23.
the class UserHomeSecuritySettingsPageModContentFactoryImpl method createContent.
@Secured({ "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
final VerticalLayout panelContent = createPanelContent();
final String pageId = getPageId(parameters);
userHomeMenuItemFactory.createUserHomeMenuBar(menuBar, pageId);
LabelFactory.createHeader2Label(panelContent, SECURITY_SETTINGS);
final Long userIdFromSecurityContext = UserContextUtil.getUserInternalIdFromSecurityContext();
if (userIdFromSecurityContext == null) {
UI.getCurrent().getNavigator().navigateTo(CommonsViews.MAIN_VIEW_NAME);
} else {
final VerticalLayout overviewLayout = new VerticalLayout();
overviewLayout.setSizeFull();
panelContent.addComponent(overviewLayout);
panelContent.setExpandRatio(overviewLayout, ContentRatio.LARGE);
final ResponsiveRow grid = createGridLayout(overviewLayout);
createRowItem(grid, createEnableGoogleAuthButton(), "Enable MFA using google authenticator");
createRowItem(grid, createDisableGoogleAuthButton(), "Disable MFA using google authenticator");
}
panel.setCaption(NAME + "::" + USERHOME + SECURITY_SETTINGS);
getPageActionEventHelper().createPageEvent(ViewAction.VISIT_USER_HOME_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
return panelContent;
}
Aggregations