manageCodes.xhtml 3.49 KB
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:products="http://java.sun.com/jsf/composite/tools/products" xmlns:tools="http://java.sun.com/jsf/composite/tools" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
<h:body>
	<ui:composition template="#{sessionHandler.template}">
		<f:metadata>
			<f:viewParam name="userid" value="#{userView.userid}" />
			<f:event type="preRenderView" listener="#{licenseView.initAdminView}" />
		</f:metadata>
		<ui:param name="thispage" value="page.license.manageCodes" />


		<ui:define name="content">
			<h:form id="licenseForm">
				<p:dataTable border="1" id="games" value="#{licenseView.licenses}" var="license">
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['game.name']}" />
						</f:facet>
						<h:outputText value="#{license.name}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="edit" />
						</f:facet>
						<p:commandButton  onerror="location.reload(true);" value="muokkaa" update=":editgame" >
							<f:setPropertyActionListener value="#{license}" target="#{licenseView.currentLicense}" />
						</p:commandButton>
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['game.codecount']}" />
						</f:facet>
						<h:outputText value="#{license.licenseCodes.size()}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['game.active']}" />
						</f:facet>
						<h:outputText rendered="#{license.active}" value="X" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['game.product']}" />
						</f:facet>
						<h:outputText value="#{license.product.name}" />
					</p:column>
				</p:dataTable>
			</h:form>
			
			<br /><br />
			
			<h:form  id="editgame" >
				
				<p:panelGrid columns="2">
					<f:facet name="header">  
        				<h:outputLabel rendered="#{licenseView.currentLicense.id == null}" value="#{i18n['game.create']}" />
        				<h:outputLabel rendered="#{licenseView.currentLicense.id != null}" value="#{i18n['game.edit']}" />    
    				</f:facet>
					<h:outputLabel value="#{i18n['license.service']}" />
					<p:inputText value="#{licenseView.currentLicense.service}" />
					<h:outputLabel value="#{i18n['license.name']}" />
					<p:inputText value="#{licenseView.currentLicense.name}" />
					<h:outputLabel value="#{i18n['license.description']}" />
					<p:inputText value="#{licenseView.currentLicense.description}" />
					<h:outputLabel value="#{i18n['license.url']}" />
					<p:inputText value="#{licenseView.currentLicense.codeUrl}" />
					<h:outputLabel value="#{i18n['license.active']}" />
					<p:selectBooleanCheckbox value="#{licenseView.currentLicense.active}" />
					
					<h:outputLabel value="#{i18n['license.product']}" />
					<h:selectOneMenu converter="#{productConverter}" value="#{licenseView.currentLicense.product}">
						<f:selectItems var="product" itemLabel="#{product.name}" value="#{licenseView.productsForLicenses}" />
					</h:selectOneMenu>
					
					
					
					<p:commandButton onerror="location.reload(true);" action="#{licenseView.saveCurrentLicense}" update=":licenseForm" value="#{i18n['license.save']}" />
				</p:panelGrid>
			</h:form>
			
		</ui:define>
	</ui:composition>
</h:body>
</html>