added frist draft of account ui
This commit is contained in:
251
account-ui/src/main/webapp/web/account.xhtml
Normal file
251
account-ui/src/main/webapp/web/account.xhtml
Normal file
@ -0,0 +1,251 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:p="http://primefaces.org/ui"
|
||||
template="/resources/template/template.xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core"
|
||||
xmlns:co="http://java.sun.com/jsf/composite/composite"
|
||||
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
|
||||
xmlns:composite="http://xmlns.jcp.org/jsf/composite/composite">
|
||||
|
||||
<ui:define name="title">
|
||||
Account Overview
|
||||
</ui:define>
|
||||
|
||||
<ui:define name="description">
|
||||
List all accounts
|
||||
</ui:define>
|
||||
|
||||
<ui:define name="body">
|
||||
<h:form id="accountForm">
|
||||
<p:dataTable id="accountTable" value="#{accountView.accounts}" var="account" rowKey="#{account.username}" selectionMode="single" selection="#{accountView.currentAccount}"
|
||||
styleClass="box-primary">
|
||||
<p:ajax event="rowSelect" update="deleteButton,editButton" listener="#{accountView.selectAccount}" />
|
||||
<p:ajax event="rowUnselect" update="deleteButton,editButton" listener="#{accountView.deselectAccount}" />
|
||||
<p:column headerText="Username">
|
||||
<h:outputText value="#{account.username}" />
|
||||
</p:column>
|
||||
<p:column headerText="Lastname">
|
||||
<h:outputText value="#{account.lastname}" />
|
||||
</p:column>
|
||||
<p:column headerText="Firstname">
|
||||
<h:outputText value="#{account.firstname}" />
|
||||
</p:column>
|
||||
<p:column headerText="Email">
|
||||
<h:outputText value="#{account.emailaddress}" />
|
||||
</p:column>
|
||||
<p:column headerText="Last login">
|
||||
<h:outputText value="#{account.lastLogin}" />
|
||||
</p:column>
|
||||
<p:column headerText="Status">
|
||||
<h:outputText value="#{account.status}" />
|
||||
</p:column>
|
||||
<p:column headerText="CreatedOn">
|
||||
<h:outputText value="#{account.createdOn}" >
|
||||
<f:convertDateTime type="both" dateStyle="full" timeStyle="short" timeZone="Europe/Berlin"/>
|
||||
</h:outputText>
|
||||
</p:column>
|
||||
<p:column headerText="CreatedBy">
|
||||
<h:outputText value="#{account.createdBy}" />
|
||||
</p:column>
|
||||
<p:column headerText="LastUpdatedOn">
|
||||
<h:outputText value="#{account.lastUpdatedOn}">
|
||||
<f:convertDateTime type="both" dateStyle="full" timeStyle="short" timeZone="Europe/Berlin"/>
|
||||
</h:outputText>
|
||||
</p:column>
|
||||
<p:column headerText="LastUpdatedBy">
|
||||
<h:outputText value="#{account.lastUpdatedBy}" />
|
||||
</p:column>
|
||||
<f:facet name="footer" >
|
||||
|
||||
<div class="col-sm-12 col-md-3" style="margin-top:10px">
|
||||
<p:spacer height="10px" />
|
||||
<div class="ui-inputgroup" >
|
||||
<h:outputLabel for="includeDisabledCheckbox" value="Include disabled accounts?" />
|
||||
<p:inputSwitch id="includeDisabledCheckbox" value="#{accountView.showDisabledAccounts}" styleClass="btn-teal btn-block" >
|
||||
<p:ajax listener="#{accountView.showDisabledAccountsChange}" update="accountTable" />
|
||||
</p:inputSwitch>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:spacer height="10px" />
|
||||
<p:commandButton value="New" id="newButton" icon="fa fa-plus"
|
||||
update="editDialog" oncomplete="PF('editDialogVar').show();"
|
||||
actionListener="#{accountView.newAccount}" styleClass="btn-primary btn-block" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:spacer height="10px" />
|
||||
<p:commandButton value="Edit" id="editButton" icon="fa fa-pencil"
|
||||
update="editDialog" oncomplete="PF('editDialogVar').show();"
|
||||
actionListener="#{accountView.editAccount}" disabled="#{!accountView.accountSelected}" styleClass="btn-teal btn-block" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:spacer height="10px" />
|
||||
<p:commandButton value="Delete" id="deleteButton" icon="fa fa-fw fa-trash-o"
|
||||
update=":accountForm:accountTable" action="#{accountView.deleteAccount}" disabled="#{!accountView.accountSelected}" styleClass="btn-danger btn-block">
|
||||
<p:confirm header="Confirmation" message="Are you sure?" icon="fa fa-exclamation-triangle" />
|
||||
</p:commandButton>
|
||||
</div>
|
||||
</f:facet>
|
||||
</p:dataTable>
|
||||
|
||||
<composite:confirmationDialog />
|
||||
</h:form>
|
||||
|
||||
|
||||
<p:dialog id="editDialog" widgetVar="editDialogVar" header="Edit account" width="600"
|
||||
modal="true" appendTo="@(body)" showEffect="fade" hideEffect="fade" styleClass="box-solid box-primary" >
|
||||
<h:form id="editDialogForm">
|
||||
<p:messages id="editDialogMessages" showDetail="true" showIcon="true" showSummary="true">
|
||||
<p:autoUpdate />
|
||||
</p:messages>
|
||||
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:outputLabel for="username" value="Username" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<c:if test="#{accountView.currentAccount.createdBy != null}">
|
||||
<h:outputText id="username" value="#{accountView.currentAccount.username}" />
|
||||
</c:if>
|
||||
<c:if test="#{accountView.currentAccount.createdBy == null}">
|
||||
<p:inputText id="username" value="#{accountView.currentAccount.username}" />
|
||||
</c:if>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:message for="username"><p:autoUpdate /></p:message>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:outputLabel for="lastname" value="Lastname" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<p:inputText id="lastname" value="#{accountView.currentAccount.lastname}" size="40" maxlength="100"/>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-3 ">
|
||||
<p:message for="lastname"> <p:autoUpdate /></p:message>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:outputLabel for="firstname" value="Firstname" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<p:inputText id="firstname" value="#{accountView.currentAccount.firstname}" size="40" maxlength="100" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:message for="firstname"> <p:autoUpdate /></p:message>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:outputLabel for="emailaddress" value="emailaddress" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<p:inputText id="emailaddress" value="#{accountView.currentAccount.emailaddress}" size="40" maxlength="200">
|
||||
<f:validator validatorId="de.muehlencord.shared.jeeutil.validator.EmailValidator" />
|
||||
</p:inputText>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:message for="emailaddress"> <p:autoUpdate /></p:message>
|
||||
</div>
|
||||
|
||||
<c:if test="#{accountView.currentAccount.username != null}">
|
||||
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:outputLabel for="status" value="Status" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<p:selectOneMenu id="status" value="#{accountView.currentAccount.status}" >
|
||||
<f:selectItems value="#{accountView.statusList}" />
|
||||
</p:selectOneMenu>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:message for="status" />
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:outputLabel for="lastlogin" value="Lastlogin" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<h:outputText id="lastlogin" value="#{accountView.currentAccount.lastLogin}" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<p:message for="lastlogin" />
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:outputLabel for="createdon" value="Created on" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<h:outputText id="createdon" value="#{accountView.currentAccount.createdOn}" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:message for="createdon" />
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:outputLabel for="createdby" value="Created by" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<h:outputText id="createdby" value="#{accountView.currentAccount.createdBy}" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:message for="createdby" />
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:outputLabel for="lastupdatedon" value="Last updated on" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<h:outputText id="lastupdatedon" value="#{accountView.currentAccount.lastUpdatedOn}" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:message for="lastupdatedon" />
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:outputLabel for="lastupdatedby" value="Last updated by" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<h:outputText id="lastupdatedby" value="#{accountView.currentAccount.lastUpdatedBy}" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:message for="lastupdatedby" />
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:outputLabel for="roles" value="Roles" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<p:selectManyMenu id="roles" var="role" label="#{role.roleName}" value="#{accountView.currentAccountRoles}" converter="omnifaces.SelectItemsConverter" required="true" >
|
||||
<f:selectItems value="#{accountView.allApplicationRoles}" var="roleItem" itemLabel="#{roleItem.roleName}" itemValue="#{role}" />
|
||||
<p:column>
|
||||
<h:outputText value="#{role.roleName}"/>
|
||||
</p:column>
|
||||
</p:selectManyMenu>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:message for="roles" />
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<p:spacer height="10px" />
|
||||
<p:commandButton value="Save" action="#{accountView.saveEditAccount}" styleClass="btn-primary btn-block"
|
||||
oncomplete="if (args && !args.validationFailed) PF('editDialogVar').hide();" update=":accountForm:accountTable" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<p:spacer height="10px" />
|
||||
<p:commandButton value="Cancel" action="#{accountView.cancelEditAccount}" immediate="true" styleClass="btn-teal btn-block"
|
||||
oncomplete="PF('editDialogVar').hide();" />
|
||||
</div>
|
||||
</div>
|
||||
</h:form>
|
||||
</p:dialog>
|
||||
|
||||
</ui:define>
|
||||
|
||||
</ui:composition>
|
||||
76
account-ui/src/main/webapp/web/index.xhtml
Normal file
76
account-ui/src/main/webapp/web/index.xhtml
Normal file
@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:p="http://primefaces.org/ui"
|
||||
template="/resources/template/template.xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core"
|
||||
xmlns:co="http://java.sun.com/jsf/composite/composite"
|
||||
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
|
||||
xmlns:composite="http://xmlns.jcp.org/jsf/composite/composite">
|
||||
|
||||
<ui:define name="title">
|
||||
Applications
|
||||
</ui:define>
|
||||
|
||||
<ui:define name="body" >
|
||||
|
||||
<h:form id="applicationForm">
|
||||
<p:panel styleClass="box-solid">
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<p:selectOneMenu id="applicationSelect" value="#{applicationView.currentApplication}" converter="omnifaces.SelectItemsConverter" required="true">
|
||||
<f:selectItems value="#{applicationView.allApplications}" var="app" itemLabel="#{app.applicationName}" itemValue="#{app}" />
|
||||
</p:selectOneMenu>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:commandButton value="Select" styleClass="btn-primary btn-solid}" actionListener="#{applicationView.selectApplication}" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:commandButton value="New" id="newButton" icon="fa fa-plus"
|
||||
update="editDialog" oncomplete="PF('editDialogVar').show();"
|
||||
actionListener="#{applicationView.newApplication}" styleClass="btn-teal btn-block" />
|
||||
</div>
|
||||
</div>
|
||||
</p:panel>
|
||||
</h:form>
|
||||
|
||||
<p:dialog id="editDialog" widgetVar="editDialogVar" header="Edit account" width="600"
|
||||
modal="true" appendTo="@(body)" showEffect="fade" hideEffect="fade" styleClass="box-solid box-primary" >
|
||||
<h:form id="editDialogForm">
|
||||
<p:messages id="editDialogMessages" showDetail="true" showIcon="true" showSummary="true">
|
||||
<p:autoUpdate />
|
||||
</p:messages>
|
||||
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:outputLabel for="applicationName" value="Application name" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<p:inputText id="applicationName" value="#{applicationView.editApplication.applicationName}">
|
||||
<f:validator validatorId="uniqueApplicationValidator"/>
|
||||
<f:attribute name="applicationName" value="#{applicationView.editApplication.applicationName}" />
|
||||
</p:inputText>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<p:message for="applicationName"><p:autoUpdate /></p:message>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<p:spacer height="10px" />
|
||||
<p:commandButton value="Save" action="#{applicationView.saveEditApplication}" styleClass="btn-primary btn-block"
|
||||
oncomplete="if (args && !args.validationFailed) PF('editDialogVar').hide();" update=":applicationForm" />
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<p:spacer height="10px" />
|
||||
<p:commandButton value="Cancel" action="#{applicationView.cancelEditApplication}" immediate="true" styleClass="btn-teal btn-block"
|
||||
oncomplete="PF('editDialogVar').hide();" />
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</h:form>
|
||||
</p:dialog>
|
||||
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
73
account-ui/src/main/webapp/web/permissions.xhtml
Normal file
73
account-ui/src/main/webapp/web/permissions.xhtml
Normal file
@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:p="http://primefaces.org/ui"
|
||||
template="/resources/template/template.xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core"
|
||||
xmlns:co="http://java.sun.com/jsf/composite/composite"
|
||||
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
|
||||
xmlns:composite="http://xmlns.jcp.org/jsf/composite/composite">
|
||||
|
||||
<ui:define name="title">
|
||||
Permissions
|
||||
</ui:define>
|
||||
|
||||
<ui:define name="description">
|
||||
Edit permissions
|
||||
</ui:define>
|
||||
|
||||
<ui:define name="body">
|
||||
<h:form id="permissionForm">
|
||||
<p:panel styleClass="card no-border">
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="ui-g-12 ui-md-3">
|
||||
<div class="ui-inputgroup">
|
||||
<span class="ui-inputgroup-addon"><i style="font-size: 20px" class="fa fa-edit"></i></span>
|
||||
<p:inputText id="newName" value="#{permissionView.newPermissionName}" maxlength="80" size="30" placeholder="#{msgs.label_name}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-g-12 ui-md-3">
|
||||
<div class="ui-inputgroup">
|
||||
<span class="ui-inputgroup-addon"><i style="font-size: 20px" class="fa fa-edit"></i></span>
|
||||
<p:inputText id="newDescription" value="#{permissionView.newPermissionDescription}" maxlength="200" size="30" placeholder="#{msgs.label_description}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-g-12 ui-md-2">
|
||||
<p:commandButton icon="fa fa-fw fa-save" value="#{msgs.button_save}" action="#{permissionView.savePermission}"
|
||||
update="permissionForm" styleClass="btn-primary btn-block" />
|
||||
</div>
|
||||
<div class="ui-g-12 ui-md-2">
|
||||
<p:commandButton id="editPermissionButton" icon="fa fa-fw fa-pencil" value="#{msgs.button_edit}" action="#{permissionView.editPermission}"
|
||||
update="permissionForm" styleClass="btn-teal btn-block" disabled="#{!permissionView.canEdit}" />
|
||||
</div>
|
||||
<div class="ui-g-12 ui-md-2">
|
||||
<p:commandButton id="deletePermissionButton" icon="fa fa-fw fa-trash-o" value="#{msgs.button_delete}" action="#{permissionView.deletePermission}"
|
||||
update="permissionForm" styleClass="btn-danger btn-block" disabled="#{!permissionView.canDelete}">
|
||||
<p:confirm header="Confirmation" message="Are you sure?" icon="fa fa-fw fa-exclamation-triangle" />
|
||||
</p:commandButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p:dataTable id="permissionTable" value="#{permissionView.appPermissions}" var="permission" rowKey="#{permission.id}"
|
||||
selectionMode="single" selection="#{permissionView.currentPermission}" styleClass="box-primary">
|
||||
<p:ajax event="rowSelect" update=":permissionForm" listener="#{permissionView.selectPermission}" />
|
||||
<p:ajax event="rowUnselect" update=":permissionForm" listener="#{permissionView.deselectPermission}" />
|
||||
|
||||
<p:column headerText="Permission name">
|
||||
<h:outputText value="#{permission.permissionName}" />
|
||||
</p:column>
|
||||
<p:column headerText="Permission description">
|
||||
<h:outputText value="#{permission.permissionDescription}" />
|
||||
</p:column>
|
||||
</p:dataTable>
|
||||
|
||||
<composite:confirmationDialog />
|
||||
</p:panel>
|
||||
</h:form>
|
||||
|
||||
|
||||
|
||||
</ui:define>
|
||||
|
||||
</ui:composition>
|
||||
96
account-ui/src/main/webapp/web/roles.xhtml
Normal file
96
account-ui/src/main/webapp/web/roles.xhtml
Normal file
@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://java.sun.com/jsf/facelets"
|
||||
xmlns:p="http://primefaces.org/ui"
|
||||
template="/resources/template/template.xhtml"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:co="http://java.sun.com/jsf/composite/composite"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core"
|
||||
xmlns:composite="http://xmlns.jcp.org/jsf/composite/composite">
|
||||
|
||||
<ui:define name="title">
|
||||
Group Overview
|
||||
</ui:define>
|
||||
|
||||
<ui:define name="description">
|
||||
List all groups
|
||||
</ui:define>
|
||||
|
||||
<ui:define name="body">
|
||||
<h:form id="groupForm">
|
||||
<p:panel styleClass="card no-border">
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="ui-g-12 ui-md-3">
|
||||
<div class="ui-inputgroup">
|
||||
<span class="ui-inputgroup-addon"><i style="font-size: 20px" class="fa fa-user"></i></span>
|
||||
<p:inputText id="newName" value="#{groupView.newRoleName}" placeholder="#{msgs.label_name}" maxlength="80" size="30" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-g-12 ui-md-3">
|
||||
<div class="ui-inputgroup">
|
||||
<span class="ui-inputgroup-addon"><i style="font-size: 20px" class="fa fa-user"></i></span>
|
||||
<p:inputText id="newDescription" value="#{groupView.newRoleDescription}" placeholder="#{msgs.label_description}" maxlength="200" size="40" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui-g-12 ui-md-2">
|
||||
<p:commandButton icon="fa fa-fw fa-plus" value="#{msgs.button_save}" action="#{groupView.newRole}" update="groupForm" styleClass="btn-primary btn-block"/>
|
||||
</div>
|
||||
<div class="ui-g-12 ui-md-2">
|
||||
<p:commandButton icon="fa fa-fw fa-pencil" value="#{msgs.button_edit}" action="#{groupView.editRole}" update="groupForm" styleClass="btn-teal btn-block"/>
|
||||
</div>
|
||||
<div class="ui-g-12 ui-md-2">
|
||||
<p:commandButton icon="fa fa-fw fa-trash-o" value="#{msgs.button_delete}" action="#{groupView.deleteRole}" update="groupForm" styleClass="btn-danger btn-block">
|
||||
<p:confirm header="Confirmation" message="Are you sure?" icon="fa fa-fw fa-exclamation-triangle" />
|
||||
</p:commandButton>
|
||||
</div>
|
||||
</div>
|
||||
</p:panel>
|
||||
|
||||
|
||||
|
||||
<p:dataTable id="groupTable" value="#{groupView.allRoles}" var="role" rowKey="#{role.id}" styleClass="box-solid box-primary"
|
||||
selectionMode="single" selection="#{groupView.currentRole}">
|
||||
<p:ajax event="rowSelect" update=":groupForm:permissionTable" listener="#{groupView.onRoleSelect}" />
|
||||
<p:column headerText="Role name">
|
||||
<h:outputText value="#{role.roleName}" />
|
||||
</p:column>
|
||||
<p:column headerText="Role description">
|
||||
<h:outputText value="#{role.roleDescription}" />
|
||||
</p:column>
|
||||
</p:dataTable>
|
||||
|
||||
<p:dataTable id="permissionTable" value="#{groupView.rolePermissions}" var="permission" rowKey="#{permission.id}" styleClass="box-teal"
|
||||
selectionMode="single" selection="#{groupView.currentPermission}">
|
||||
<p:ajax event="rowSelect" update="deletePermissionButton" listener="#{groupView.selectPermission}" />
|
||||
<p:ajax event="rowUnselect" update="deletePermissionButton" listener="#{groupView.deselectPermission}" />
|
||||
|
||||
<p:column headerText="Permission name">
|
||||
<h:outputText value="#{permission.permissionName}" />
|
||||
</p:column>
|
||||
<p:column headerText="Permission description">
|
||||
<h:outputText value="#{permission.permissionDescription}" />
|
||||
</p:column>
|
||||
<f:facet name="footer" >
|
||||
<p:selectOneMenu value="#{groupView.newPermission}" converter="omnifaces.SelectItemsConverter" >
|
||||
<f:selectItems id="permissionListItems" value="#{groupView.missingPermissions}" var="missingPermission" itemLabel="#{missingPermission.permissionName}" itemValue="#{missingPermission}" />
|
||||
</p:selectOneMenu>
|
||||
<div class="ui-g-12 ui-md-2">
|
||||
<p:commandButton id="addPermissionButton" icon="fa fa-plus" value="#{msgs.button_new}" action="#{groupView.addRolePermission}"
|
||||
update=":groupForm:permissionTable" styleClass="btn-primary btn-block"/>
|
||||
</div>
|
||||
<div class="ui-g-12 ui-md-2">
|
||||
<p:commandButton id="deletePermissionButton" icon="fa fa-trash-o" value="Delete" update=":groupForm:groupTable,:groupForm:permissionTable"
|
||||
action="#{groupView.removeRolePermission}" styleClass="btn-danger btn-block"
|
||||
disabled="#{!groupView.isPermissionSelected}" >
|
||||
<p:confirm header="Confirmation" message="Are you sure?" icon="fa fa-fw fa-exclamation-triangle" />
|
||||
</p:commandButton>
|
||||
</div>
|
||||
</f:facet>
|
||||
</p:dataTable>
|
||||
|
||||
<composite:confirmationDialog />
|
||||
|
||||
</h:form>
|
||||
</ui:define>
|
||||
|
||||
</ui:composition>
|
||||
Reference in New Issue
Block a user