index.xhtml 12.6 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:users="http://java.sun.com/jsf/composite/cditools/user"
	xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core">
<h:body>
	<ui:composition template="#{sessionHandler.template}">
		<f:metadata>
			<f:event type="preRenderView" listener="#{tournamentListView.initView()}" />

		</f:metadata>

		<ui:define name="content">
			<h:form id="tournaments" styleClass="moya_datatable2">
				<p:messages autoUpdate="true" redisplay="false"></p:messages>
				<h1>#{i18n['tournaments.title']}</h1>
				<p>#{i18n['tournaments.description']}</p>
				<h2>#{i18n['tournaments.open_tournaments']}</h2>
				<p:dataTable value="#{tournamentListView.setupPhaseTournaments}" var="tournament" styleClass="moya_datatable2">

					<p:column style="width:20px">
						<p:rowToggler />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.name']}" />
						</f:facet>
						<h:outputText value="#{tournament.tournamentName}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.game']}" />
						</f:facet>
						<h:outputText value="#{tournament.tournamentGame.name}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.status']}" />
						</f:facet>
						<h:outputText value="#{i18n[tournament.tournamentStatus.i18nKey]}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.type']}" />
						</f:facet>
						<h:outputText value="#{i18n[tournament.tournamentType.i18nKey]}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.fillamount']}" />
						</f:facet>
						<h:outputText value="#{tournament.participants.size()}/#{tournament.maxParticipants}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.participation_time']}" />
						</f:facet>
						<h:outputText value="#{tournament.registrationOpensAt}">
							<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
						</h:outputText>
						 - 
						<h:outputText value="#{tournament.registrationClosesAt}">
							<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
						</h:outputText>
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.rules']}" />
						</f:facet>
						<h:link value="#{tournament.rules.name}" outcome="/tournaments/showrules.xhtml">
							<f:param name="tournament_id" value="#{tournament.id}" />
						</h:link>
					</p:column>
					<p:column rendered="#{tournamentListView.canParticipate()}">
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.control']}" />
						</f:facet>
						<h:panelGroup>
							<p:commandButton value="#{i18n['tournament.participate']}" action="#{tournamentParticipateView.participate(tournament.id)}"
								rendered="#{tournamentParticipateView.canParticipate(tournament.id) and (tournament.participants.size() lt tournament.maxParticipants)}" ajax="false" onerror="location.reload(true);"/>
							<h:outputText value="#{i18n['tournament.full']}" rendered="#{tournament.participants.size() ge tournament.maxParticipants}" />
						</h:panelGroup>
					</p:column>
					<p:rowExpansion>
						<h:panelGrid id="display" columns="2" cellpadding="4" styleClass=" ui-widget-content grid">
							<h:outputText value="#{i18n['tournament.participants']}" />
							<h:panelGroup>
								<ul>
									<ui:repeat var="participant" value="#{tournament.participants}">
										<li><h:outputText value="#{participant.teamName}" rendered="#{not empty participant.teamName}" /> <h:outputText value="#{participant.participator.user.nick}"
												rendered="#{empty participant.teamName}" /></li>
									</ui:repeat>
								</ul>
							</h:panelGroup>
						</h:panelGrid>
					</p:rowExpansion>
				</p:dataTable>


				<p></p>
				<h2>#{i18n['tournaments.setup_closed_tournaments']}</h2>
				<p:dataTable value="#{tournamentListView.setupClosedPhaseTournaments}" var="tournament" styleClass="moya_datatable2">>
					<p:column style="width:20px">
						<p:rowToggler />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.name']}" />
						</f:facet>
						<h:outputText value="#{tournament.tournamentName}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.game']}" />
						</f:facet>
						<h:outputText value="#{tournament.tournamentGame.name}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.status']}" />
						</f:facet>
						<h:outputText value="#{i18n[tournament.tournamentStatus.i18nKey]}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.type']}" />
						</f:facet>
						<h:outputText value="#{i18n[tournament.tournamentType.i18nKey]}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.fillamount']}" />
						</f:facet>
						<h:outputText value="#{tournament.participants.size()}/#{tournament.maxParticipants}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.participation_time']}" />
						</f:facet>
						<h:outputText value="#{tournament.registrationOpensAt}">
							<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
						</h:outputText>
						 - 
						<h:outputText value="#{tournament.registrationClosesAt}">
							<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
						</h:outputText>
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.rules']}" />
						</f:facet>
						<h:link value="#{tournament.rules.name}" outcome="/tournaments/showrules.xhtml">
							<f:param name="tournament_id" value="#{tournament.id}" />
						</h:link>
					</p:column>
					<p:rowExpansion>
						<h:panelGrid id="display" columns="2" cellpadding="4" styleClass=" ui-widget-content grid">
							<h:outputText value="#{i18n['tournament.participants']}" />
							<h:panelGroup>
								<ul>
									<ui:repeat var="participant" value="#{tournament.participants}">
										<li><h:outputText value="#{participant.teamName}" rendered="#{not empty participant.teamName}" /> <h:outputText value="#{participant.participator.user.nick}"
												rendered="#{empty participant.teamName}" /></li>
									</ui:repeat>
								</ul>
							</h:panelGroup>
						</h:panelGrid>
					</p:rowExpansion>
				</p:dataTable>
				<!-- 
				<h2>#{i18n['tournaments.in_progress_tournaments']}</h2>
				<p:dataTable value="#{tournamentListView.inProgressTournaments}" var="tournament">
					<p:column style="width:2%">
						<p:rowToggler />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.name']}" />
						</f:facet>
						<h:outputText value="#{tournament.tournamentName}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.game']}" />
						</f:facet>
						<h:outputText value="#{tournament.tournamentGame.name}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.status']}" />
						</f:facet>
						<h:outputText value="#{i18n[tournament.tournamentStatus.i18nKey]}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.type']}" />
						</f:facet>
						<h:outputText value="#{i18n[tournament.tournamentType.i18nKey]}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.fillamount']}" />
						</f:facet>
						<h:outputText value="#{tournament.participants.size()}/#{tournament.maxParticipants}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.participation_time']}" />
						</f:facet>
						<h:outputText value="#{tournament.registrationOpensAt}">
							<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
						</h:outputText>
						 - 
						<h:outputText value="#{tournament.registrationClosesAt}">
							<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
						</h:outputText>
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.rules']}" />
						</f:facet>
						<h:link value="#{tournament.rules.name}" outcome="/tournaments/showrules.xhtml">
							<f:param name="tournament_id" value="#{tournament.id}" />
						</h:link>
					</p:column>
					<p:rowExpansion>
						<h:panelGrid id="display" columns="2" cellpadding="4" styleClass=" ui-widget-content grid">
							<h:outputText value="#{i18n['tournament.participants']}" />
							<h:panelGroup>
								<ul>
									<ui:repeat var="participant" value="#{tournament.participants}">
										<li><h:outputText value="#{participant.teamName}" rendered="#{not empty participant.teamName}" /> <h:outputText value="#{participant.participator.user.nick}"
												rendered="#{empty participant.teamName}" /></li>
									</ui:repeat>
								</ul>
							</h:panelGroup>
						</h:panelGrid>
					</p:rowExpansion>
				</p:dataTable>
				<h2>#{i18n['tournaments.completed_tournaments']}</h2>
				<p:dataTable value="#{tournamentListView.completedTournaments}" var="tournament">
					<p:column style="width:2%">
						<p:rowToggler />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.name']}" />
						</f:facet>
						<h:outputText value="#{tournament.tournamentName}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.game']}" />
						</f:facet>
						<h:outputText value="#{tournament.tournamentGame.name}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.status']}" />
						</f:facet>
						<h:outputText value="#{i18n[tournament.tournamentStatus.i18nKey]}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.type']}" />
						</f:facet>
						<h:outputText value="#{i18n[tournament.tournamentType.i18nKey]}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.fillamount']}" />
						</f:facet>
						<h:outputText value="#{tournament.participants.size()}/#{tournament.maxParticipants}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.participation_time']}" />
						</f:facet>
						<h:outputText value="#{tournament.registrationOpensAt}">
							<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
						</h:outputText>
						 - 
						<h:outputText value="#{tournament.registrationClosesAt}">
							<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
						</h:outputText>
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="#{i18n['tournament.rules']}" />
						</f:facet>
						<h:link value="#{tournament.rules.name}" outcome="/tournaments/showrules.xhtml">
							<f:param name="tournament_id" value="#{tournament.id}" />
						</h:link>
					</p:column>
					<p:rowExpansion>
						<h:panelGrid id="display" columns="2" cellpadding="4" styleClass=" ui-widget-content grid">
							<h:outputText value="#{i18n['tournament.participants']}" />
							<h:panelGroup>
								<ul>
									<ui:repeat var="participant" value="#{tournament.participants}">
										<li><h:outputText value="#{participant.teamName}" rendered="#{not empty participant.teamName}" /> <h:outputText value="#{participant.participator.user.nick}"
												rendered="#{empty participant.teamName}" /></li>
									</ui:repeat>
								</ul>
							</h:panelGroup>
						</h:panelGrid>
					</p:rowExpansion>
				</p:dataTable>
				-->
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>