viewCodes.xhtml 3.43 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}">
		<ui:param name="thispage" value="page.gamecode.viewCodes" />
		<f:metadata>
			<f:viewParam name="userid" value="#{userView.userid}" />
			<f:event type="preRenderView" listener="#{licenseView.initUserView}" />
		</f:metadata>
		<ui:define name="content">



			<h:form>
			
				<h1><h:outputLabel value="#{i18n['game.codes.opened']}" /></h1>
				<h:outputLabel rendered="#{licenseView.noLicenseCodes}" value="#{i18n['game.noGameCodes']}" />
				<p:dataTable rendered="#{not licenseView.noLicenseCodes}" columnClasses="nowrap,numalign,numalign,nowrap,numalign" styleClass="bordertable" id="codes" value="#{licenseView.licenseCodes}" var="code">
					<p:column sortBy="#{code.license.service}">
						<f:facet name="header">
							<h:outputText value="#{i18n['game.service']}" />
						</f:facet>
						<h:outputText value="#{code.licenseTarget.service}" />
					</p:column>
					<p:column sortBy="#{code.license.name}">
						<f:facet name="header">
							<h:outputText value="#{i18n['game.name']}" />
						</f:facet>
						<h:outputText value="#{code.licenseTarget.name}" />
					</p:column>
					<p:column sortBy="#{code.license.description}">
						<f:facet name="header">
							<h:outputText value="#{i18n['game.description']}" />
						</f:facet>
						<h:outputText value="#{code.licenseTarget.description}" />
					</p:column>
					<p:column sortBy="#{code.code}">
						<f:facet name="header">
							<h:outputText value="#{i18n['game.code']}" />
						</f:facet>
						<h:outputText rendered="#{code.accessed}" value="#{code.code}" />
						<h:outputText rendered="#{not code.accessed}" value="ei avattu, ota yhteyttä ylläpitoon" />
					</p:column>
				</p:dataTable>
			</h:form>
			<br /><br /><br />
			<h:form>
				<h1><h:outputLabel rendered="#{not licenseView.noLicenses}" value="#{i18n['game.codes.available']}" /></h1>
				<p:dataTable rendered="#{not licenseView.noLicenses}" columnClasses="nowrap,numalign,numalign,nowrap,numalign" styleClass="bordertable" id="codes" value="#{licenseView.licenses}" var="license">
					<p:column sortBy="#{license.service}">
						<f:facet name="header">
							<h:outputText value="#{i18n['game.service']}" />
						</f:facet>
						<h:outputText value="#{license.service}" />
					</p:column>
					<p:column sortBy="#{license.name}">
						<f:facet name="header">
							<h:outputText value="#{i18n['game.name']}" />
						</f:facet>
						<h:outputText value="#{license.name}" />
					</p:column>
					<p:column sortBy="#{license.description}">
						<f:facet name="header">
							<h:outputText value="#{i18n['game.description']}" />
						</f:facet>
						<h:outputText value="#{license.description}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['game.open']}" />
						</f:facet>
						<h:commandButton value="#{i18n['game.open']}" action="#{licenseView.openSelectedCode}" />
					</p:column>
				</p:dataTable>
			</h:form>
			
		</ui:define>
	</ui:composition>
</h:body>
</html>