Commit a28279e8 by Antti Tonkyra

Stuffed chicken, more tournament

1 parent c6e430ea
......@@ -139,6 +139,24 @@
<redirect />
</navigation-case>
</navigation-rule>
<navigation-rule>
<display-name>tournaments/admin/move-to-creation-screen</display-name>
<from-view-id>/tournaments/admin/index.xhtml</from-view-id>
<navigation-case>
<from-outcome>create</from-outcome>
<to-view-id>/tournaments/admin/createwizard.xhtml</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>
<navigation-rule>
<display-name>tournaments/admin/tournament-created</display-name>
<from-view-id>/tournaments/admin/createwizard.xhtml</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/tournaments/admin/index.xhtml</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>
</faces-config>
......
......@@ -110,7 +110,7 @@
<br />
</p:panel>
<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']}" action="#{tournamentCreateView.save}"/>
</div>
</p:tab>
</p:wizard>
......
......@@ -51,8 +51,9 @@
<h:outputText value="#{tournament.rules.name}" />
</p:column>
</p:dataTable>
<h:form>
<p:commandButton value="#{i18n['tournament.admin.create']}" action="#{tournamentAdminView.create}"/>
</h:form>
</ui:define>
</ui:composition>
</h:body>
......
......@@ -18,4 +18,8 @@ public class TournamentAdminView {
List<Tournament> tl = tournamentBean.getActiveTournaments();
return tl;
}
public String create() {
return "create";
}
}
......@@ -54,7 +54,7 @@ public class TournamentCreateView extends GenericCDIView {
}
}
public void save(ActionEvent actionEvent) {
public String save() {
tournament.setPlayersPerTeam(tournament.getPlayersPerMatch() + backupPlayers);
tournament.setLanEvent(eventBean.getCurrentEvent());
tournament.setTournamentStatus(TournamentStatus.SETUP);
......@@ -62,6 +62,8 @@ public class TournamentCreateView extends GenericCDIView {
tournament.setRules(rules);
tournamentBean.createTournament(tournament);
return "success";
}
public List<TournamentGame> getTournamentGames() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!