manageCodes.xhtml 3.4 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="/layout/#{sessionHandler.layout}/template.xhtml">
		<f:metadata>
			<f:viewParam name="userid" value="#{userView.userid}" />
			<f:event type="preRenderView" listener="#{gameCodeView.initAdminView}" />
		</f:metadata>
		<ui:param name="thispage" value="page.gamecode.manageCodes" />


		<ui:define name="content">
			<h:form>
				<p:dataTable border="1" id="games" value="#{gameCodeView.games}" var="game">
					<p:column>
						<f:facet name="header">
							<h:outputText value="${i18n['game.name']}" />
						</f:facet>
						<h:outputText value="#{game.name}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="edit" />
						</f:facet>
						<p:commandButton value="muokkaa" update=":editgame" >
							<f:setPropertyActionListener value="#{game}" target="#{gameCodeView.currentGame}" />
						</p:commandButton>
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="game.codecount" />
						</f:facet>
						<h:outputText value="#{game.gameCodes.size()}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="GENEROI" />
						</f:facet>
						<p:commandButton value="generoi kaikille paikoille" action="#{gameCodeView.generateSelectedToAllPlaces}">
							<f:setPropertyActionListener value="#{game}" target="#{gameCodeView.currentGame}" />
						</p:commandButton>
					</p:column>
				</p:dataTable>
			</h:form>
			
			<br /><br />
			
			<h:form  id="editgame" >
				<p:panelGrid columns="2">
					<f:facet name="header">  
        				<h:outputLabel rendered="#{gameCodeView.currentGame.id == null}" value="#{i18n['game.create']}" />
        				<h:outputLabel rendered="#{gameCodeView.currentGame.id != null}" value="#{i18n['game.edit']}" />    
    				</f:facet>
					<h:outputLabel value="service" />
					<p:inputText value="#{gameCodeView.currentGame.service}" />
					<h:outputLabel value="name" />
					<p:inputText value="#{gameCodeView.currentGame.name}" />
					<h:outputLabel value="description" />
					<p:inputText value="#{gameCodeView.currentGame.description}" />
					<h:outputLabel value="url" />
					<p:inputText value="#{gameCodeView.currentGame.codeUrl}" />
					<p:commandButton action="#{gameCodeView.saveCurrentGame}" value="save" />
				</p:panelGrid>
			</h:form>
			
			

				<h:form>
					<p:commandButton  id="cancelbtn"  onclick="confirmation.show()" value="#{i18n['bill.cancel']}" />
				
					<p:confirmDialog id="confirmDialog" message="#{i18n['generic.sure.message']}" header="#{i18n['generic.sure.header']}" severity="alert" widgetVar="confirmation">
												
							<p:commandButton value="#{i18n['generic.sure.yes']}" onclick="confirmation.hide()" actionListener="#{billEditView.expireBill()}" ajax="false" />
							<p:commandButton  value="#{i18n['generic.sure.no']}" onclick="confirmation.hide()" type="button" />
						
					</p:confirmDialog>
				</h:form>
			
		
			
			
		</ui:define>
	</ui:composition>
</h:body>
</html>