Commit 863ae773 by Antti Tonkyra

tournament stuffation

1 parent 1dec9471
...@@ -54,7 +54,14 @@ ...@@ -54,7 +54,14 @@
<br /> <br />
<h:outputText value="#{i18n['tournaments.ruleset_description']}" /> <h:outputText value="#{i18n['tournaments.ruleset_description']}" />
<br /> <br />
<p:inputTextarea value="#{tournamentCreateView.rulesetDescription}"/> <p:inputText value="#{tournamentCreateView.rulesetDescription}"/>
<br />
<h:outputText value="#{i18n['tournaments.ruleset_rules']}" />
<br />
<p:inputTextarea value="#{tournamentCreateView.rulesetRules}"/>
<br />
</p:panel> </p:panel>
</p:tab> </p:tab>
...@@ -70,7 +77,7 @@ ...@@ -70,7 +77,7 @@
<br /> <br />
<h:selectOneMenu value="#{tournamentCreateView.tournament.tournamentType}"> <h:selectOneMenu value="#{tournamentCreateView.tournament.tournamentType}">
<f:selectItems value="#{tournamentCreateView.tournamentTypes}" var="val" itemLabel="val" /> <f:selectItems value="#{tournamentCreateView.tournamentTypes}" var="val" itemLabel="#{val}" />
</h:selectOneMenu> </h:selectOneMenu>
<h:outputText value="#{i18n['tournaments.players_per_match']}" /> <h:outputText value="#{i18n['tournaments.players_per_match']}" />
...@@ -100,11 +107,12 @@ ...@@ -100,11 +107,12 @@
<h:outputText value="Start time" /> <h:outputText value="Start time" />
<p:calendar stepHour="1" stepMinute="10" pattern="dd.MM.yyyy hh:mm" value="#{tournamentCreateView.tournament.beginsAt}"/> <p:calendar stepHour="1" stepMinute="10" pattern="dd.MM.yyyy hh:mm" value="#{tournamentCreateView.tournament.beginsAt}"/>
</h:panelGrid> </h:panelGrid>
<br />
</p:panel> </p:panel>
<div style="float: right;"> <div style="float: right;">
<p:commandButton icon="apply" value="#{i18n['tournaments.admin.create_tournament']}" actionListener="#{tournamentCreateView.save}"/> <p:commandButton icon="apply" value="#{i18n['tournaments.admin.create_tournament']}" actionListener="#{tournamentCreateView.save}"/>
</div> </div>
</p:tab> </p:tab>
</p:wizard> </p:wizard>
</h:form> </h:form>
......
<!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="#{userOverviewView.initView()}" /> -->
</f:metadata>
<ui:define name="content">
<h1>#{i18n['tournaments.admin.title']}</h1>
<p>#{i18n['tournaments.admin.description']}</p>
<h2>#{i18n['tournaments.active_tournaments']}</h2>
<!-- <p:dataTable styleClass="bordertable" id="actionlogtable" value="#{actionLogMessageView.messages}" var="message" paginator="true" rows="30" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="10,20,30,50,100" > -->
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
package fi.codecrew.moya.web.cdiview.tournaments;
import java.util.List;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
import fi.codecrew.moya.beans.TournamentBeanLocal;
import fi.codecrew.moya.model.Tournament;
@RequestScoped
@Named
public class TournamentAdminView {
@EJB private TournamentBeanLocal tournamentBean;
public List<Tournament> getActiveTournaments() {
return null;
}
}
...@@ -37,6 +37,7 @@ public class TournamentCreateView extends GenericCDIView { ...@@ -37,6 +37,7 @@ public class TournamentCreateView extends GenericCDIView {
private String rulesetName; private String rulesetName;
private String rulesetDescription; private String rulesetDescription;
private String rulesetRules;
private Integer backupPlayers; private Integer backupPlayers;
...@@ -100,7 +101,8 @@ public class TournamentCreateView extends GenericCDIView { ...@@ -100,7 +101,8 @@ public class TournamentCreateView extends GenericCDIView {
if(rulesetName != null && rulesetName.length() > 0) { if(rulesetName != null && rulesetName.length() > 0) {
TournamentRule tr = new TournamentRule(); TournamentRule tr = new TournamentRule();
tr.setName(rulesetName); tr.setName(rulesetName);
tr.setRules(rulesetDescription); tr.setDescription(rulesetDescription);
tr.setRules(rulesetRules);
tr.setTournamentGame(game); tr.setTournamentGame(game);
rules = tournamentBean.createRule(tr); rules = tournamentBean.createRule(tr);
...@@ -174,4 +176,12 @@ public class TournamentCreateView extends GenericCDIView { ...@@ -174,4 +176,12 @@ public class TournamentCreateView extends GenericCDIView {
public void setBackupPlayers(Integer backupPlayers) { public void setBackupPlayers(Integer backupPlayers) {
this.backupPlayers = backupPlayers; this.backupPlayers = backupPlayers;
} }
public String getRulesetRules() {
return rulesetRules;
}
public void setRulesetRules(String rulesetRules) {
this.rulesetRules = rulesetRules;
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!