<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core">
< body >
< ui:composition template = "./template/templatePlantilla.xhtml" >
< ui:define name = "top" >
INVENTARIO
< / ui:define >
< ui:define name = "content" >
< div class = "card crud-demo" >
< h:form id = "form" >
< p:growl id = "messages" showDetail = "true" / >
< p:toolbar >
< p:toolbarGroup >
< p:commandButton value = "Nuevo Rol " icon = "pi pi-plus" actionListener = "#{rolBean.prepararNuevoRol()}"
update=":dialogs:manage-product-content" oncomplete="PF('manageProductDialog').show()"
styleClass="ui-button-raised ui-button-flat" style="margin-right: 0.5rem"
rendered="#{not login.esOperador()}">>
< p:resetInput target = ":dialogs:manage-product-content" / >
< / p:commandButton >
< / p:toolbarGroup >
< / p:toolbar >
< p:dataTable id = "dt-rol" widgetVar = "dtrol" var = "rol" value = "#{rolBean.roles}"
reflow="true" styleClass="products-table"
rowKey="#{rolBean.rol.idRol}" paginator="true" rows="10" rowSelectMode="add" paginatorPosition="bottom">
< f:facet name = "header" >
< div class = "products-table-header" >
< span style = "font-weight: bold" > Rol< / span >
< span class = "filter-container ui-input-icon-left" > < i class = "pi pi-search" > < / i >
< p:inputText id = "globalFilter" onkeyup = "PF('dtrol').filter()" placeholder = "Search" / >
< / span >
< / div >
< / f:facet >
< p:column headerText = "No.°" sortBy = "#{rol.idRol}" filterBy = "#{rol.idRol}" >
< h:outputText value = "#{rol.idRol}" / >
< / p:column >
< p:column headerText = "Nombre" sortBy = "#{rol.nombreRol}" filterBy = "#{rol.nombreRol}" >
< h:outputText value = "#{rol.nombreRol}" / >
< / p:column >
< p:column headerText = "Permisos" sortBy = "#{rol.descripcion}" filterBy = "#{rol.descripcion}" >
< h:outputText value = "#{rol.descripcion}" / >
< / p:column >
< p:column headerText = "Acciones" rendered = "#{not login.esOperador()}" >
< p:commandButton icon = "pi pi-pencil" update = ":dialogs:manage-product-content"
oncomplete="PF('manageProductDialog').show()"
styleClass="rounded-button ui-button-info" process="@this"
actionListener="#{rolBean.prepararEditarRol(rol)}">
< p:resetInput target = ":dialogs:manage-product-content" / >
< / p:commandButton >
< / p:column >
< / p:dataTable >
< / h:form >
< h:form id = "dialogs" >
< p:dialog header = "Detalles de Rol" showEffect = "fade" modal = "true" widgetVar = "manageProductDialog"
responsive="true">
< p:outputPanel id = "manage-product-content" styleClass = "ui-fluid" >
< p:outputPanel >
< h:panelGrid columns = "2" >
< p:outputLabel value = "Nombre" for = "nombreRol" / >
< p:inputText id = "nombreRol" value = "#{rolBean.rol.nombreRol}" title = "NombreRol" required = "true" requiredMessage = "El nombre es requerido" validatorMessage = "Solo se pueden introducir letras" >
< f:validateRegex pattern = "[A-Za-z\s]+" for = "nombre" > < / f:validateRegex >
< / p:inputText >
< p:outputLabel value = "Descripcion:" for = "descripcion" / >
< p:inputText id = "descripcion" value = "#{rolBean.rol.descripcion}" title = "Descripcion" required = "true" requiredMessage = "La descripcion es requerida" validatorMessage = "Solo se pueden introducir letras" >
< f:validateRegex pattern = "[A-Za-z\s]+" for = "nombre" > < / f:validateRegex >
< / p:inputText >
< / h:panelGrid >
< / p:outputPanel >
< / p:outputPanel >
< f:facet name = "footer" >
< div style = "text-align: center;" >
< p:commandButton value = "Guardar" icon = "pi pi-save"
styleClass="ui-button-raised ui-button-flat" actionListener="#{rolBean.agregarRol()}"
update="manage-product-content" process="manage-product-content @this" />
< / div >
< / f:facet >
< / p:dialog >
< / h:form >
< / div >
< / ui:define >
< / ui:composition >
< / body >
< / html >