Commit 21974dc8 by Antti Tonkyra

Tournament admin views

1 parent 05a25dbb
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['tournament.admin.control']}" /> <h:outputText value="#{i18n['tournament.admin.control']}" />
</f:facet> </f:facet>
<p:commandButton value="#{i18n['tournament.admin.view']}" action="#{tournamentParticipantsView.showView(tournament.id)}"/>
<p:commandButton value="#{i18n['tournament.admin.edit']}" action="#{tournamentEditView.showEdit(tournament.id)}"/> <p:commandButton value="#{i18n['tournament.admin.edit']}" action="#{tournamentEditView.showEdit(tournament.id)}"/>
<p:commandButton value="#{i18n['tournament.admin.delete']}" action="#{tournamentDeleteView.showConfirm(tournament.id)}"/> <p:commandButton value="#{i18n['tournament.admin.delete']}" action="#{tournamentDeleteView.showConfirm(tournament.id)}"/>
</p:column> </p:column>
......
<!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:metadata>
<ui:define name="content">
<h1>#{i18n['tournaments.admin.view_tournament_title']} #{tournamentParticipantsView.tournament.tournamentName}</h1>
<p>#{i18n['tournaments.admin.view_tournament_description']}</p>
<h:form>
<p:dataTable value="#{tournamentParticipantsView.tournament.participants}" var="participant">
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['tournament.participant_nick']}" />
</f:facet>
<h:outputText value="#{participant.participator.nick}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['tournament.participant_gameid']}" />
</f:facet>
<h:outputText value="derp" />
</p:column>
</p:dataTable>
</h:form>
<h:form>
<p:commandButton value="#{i18n['tournament.admin.back_to_index']}" action="#{tournamentParticipantsView.cancel}" />
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
<!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:metadata>
<ui:define name="content">
<h1>#{i18n['tournaments.admin.view_tournament_title']} #{tournamentParticipantsView.tournament.tournamentName}</h1>
<p>#{i18n['tournaments.admin.view_tournament_description']}</p>
<p>#{i18n['tournaments.admin.view_tournament_description_teamview_addition']}</p>
<h:form>
<p:dataTable value="#{tournamentParticipantsView.tournament.participants}" var="participant">
<p:column style="width:2%">
<p:rowToggler />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['tournament.team_name']}" />
</f:facet>
<h:outputText value="#{participant.teamName}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['tournament.participant_captain']}" />
</f:facet>
<h:outputText value="#{participant.participator.nick}" />
</p:column>
<p:rowExpansion>
<h:panelGrid id="display" columns="2" cellpadding="4" styleClass=" ui-widget-content grid">
<h:outputText value="#{i18n['tournament.team_members']}" />
<h:panelGroup>
<ul>
<ui:repeat var="member" value="#{participant.teamMembers}">
<li>
<h:outputText value="#{member.eventUser.nick}" />
(<h:outputText value="GAMEID" />)
</li>
</ui:repeat>
</ul>
</h:panelGroup>
</h:panelGrid>
</p:rowExpansion>
</p:dataTable>
</h:form>
<h:form>
<p:commandButton value="#{i18n['tournament.admin.back_to_index']}" action="#{tournamentParticipantsView.cancel}" />
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
...@@ -1016,6 +1016,7 @@ tournament.admin.delete = Delete ...@@ -1016,6 +1016,7 @@ tournament.admin.delete = Delete
tournament.admin.delete_cancel = Cancel Deletion tournament.admin.delete_cancel = Cancel Deletion
tournament.admin.delete_confirm = Confirm Deletion tournament.admin.delete_confirm = Confirm Deletion
tournament.admin.edit = Edit tournament.admin.edit = Edit
tournament.admin.view = View
tournament.already_participated_into_tournament = Already participated into the selected tournament! tournament.already_participated_into_tournament = Already participated into the selected tournament!
tournament.backup_player_successfully_added_to_team = Backup player added tournament.backup_player_successfully_added_to_team = Backup player added
tournament.cannot_add_anon_user = Cannot add anonymous user tournament.cannot_add_anon_user = Cannot add anonymous user
...@@ -1027,6 +1028,8 @@ tournament.fillamount = Places taken ...@@ -1027,6 +1028,8 @@ tournament.fillamount = Places taken
tournament.game = Game tournament.game = Game
tournament.name = Tournament name tournament.name = Tournament name
tournament.not_within_participation_time = Not within the participation time for the tournament tournament.not_within_participation_time = Not within the participation time for the tournament
tournament.participant_gameid = Game-ID
tournament.participant_nick = Nickname
tournament.participants = Participants tournament.participants = Participants
tournament.participate = Participate tournament.participate = Participate
tournament.participation_failed = Participation failed tournament.participation_failed = Participation failed
...@@ -1038,6 +1041,7 @@ tournament.playerspermatch_slash_teamsize = Players / team size ...@@ -1038,6 +1041,7 @@ tournament.playerspermatch_slash_teamsize = Players / team size
tournament.rules = Rules tournament.rules = Rules
tournament.rules_for_tournament = Rules for tournament tournament.rules_for_tournament = Rules for tournament
tournament.status = Status tournament.status = Status
tournament.team_members = Team Members
tournament.team_name = Team Name tournament.team_name = Team Name
tournament.team_name_required = Team name is required tournament.team_name_required = Team name is required
tournament.teammember.delete = Delete tournament.teammember.delete = Delete
...@@ -1068,6 +1072,9 @@ tournaments.admin.select_a_game = Select a game ...@@ -1068,6 +1072,9 @@ tournaments.admin.select_a_game = Select a game
tournaments.admin.select_a_ruleset = Select a ruleset tournaments.admin.select_a_ruleset = Select a ruleset
tournaments.admin.set_time_constraints = Set time constraints tournaments.admin.set_time_constraints = Set time constraints
tournaments.admin.title = Tournaments management tournaments.admin.title = Tournaments management
tournaments.admin.view_tournament_description = You may view tournament participants and verify details and make minor edits for the teams. You may also remove any invalid participations.
tournaments.admin.view_tournament_description_teamview_addition = Team listing is of form TeamMember (Game-ID).
tournaments.admin.view_tournament_title = View tournament:
tournaments.back_to_tournament_list = Back to tournament list tournaments.back_to_tournament_list = Back to tournament list
tournaments.backup_players = Max backup players tournaments.backup_players = Max backup players
tournaments.cancel_participation = Cancel participation tournaments.cancel_participation = Cancel participation
......
...@@ -1001,6 +1001,7 @@ tournament.admin.delete = Poista ...@@ -1001,6 +1001,7 @@ tournament.admin.delete = Poista
tournament.admin.delete_cancel = Peruuta tournament.admin.delete_cancel = Peruuta
tournament.admin.delete_confirm = Vahvista Poisto tournament.admin.delete_confirm = Vahvista Poisto
tournament.admin.edit = Muokkaa tournament.admin.edit = Muokkaa
tournament.admin.view = Tarkastele
tournament.already_participated_into_tournament = Olet jo osallistunut valittuun turnaukseen! tournament.already_participated_into_tournament = Olet jo osallistunut valittuun turnaukseen!
tournament.backup_player_successfully_added_to_team = Varapelaaja lis\u00E4tty tournament.backup_player_successfully_added_to_team = Varapelaaja lis\u00E4tty
tournament.cannot_add_anon_user = Ei voida lis\u00E4t\u00E4 anomuumia tournament.cannot_add_anon_user = Ei voida lis\u00E4t\u00E4 anomuumia
...@@ -1012,6 +1013,8 @@ tournament.fillamount = Osallistujaa ilmottautunut ...@@ -1012,6 +1013,8 @@ tournament.fillamount = Osallistujaa ilmottautunut
tournament.game = Peli tournament.game = Peli
tournament.name = Turnauksen nimi tournament.name = Turnauksen nimi
tournament.not_within_participation_time = Turnauksen ilmoittautuminen ei ole aktiivinen tournament.not_within_participation_time = Turnauksen ilmoittautuminen ei ole aktiivinen
tournament.participant_gameid = Peli-ID
tournament.participant_nick = Nimimerkki
tournament.participants = Osallistujat tournament.participants = Osallistujat
tournament.participate = Osallistu tournament.participate = Osallistu
tournament.participation_failed = Turnausilmoittautuminen ep\u00E4onnistui tournament.participation_failed = Turnausilmoittautuminen ep\u00E4onnistui
...@@ -1023,6 +1026,7 @@ tournament.playerspermatch_slash_teamsize = Pelaajat / tiimin koko ...@@ -1023,6 +1026,7 @@ tournament.playerspermatch_slash_teamsize = Pelaajat / tiimin koko
tournament.rules = S\u00E4\u00E4nn\u00F6t tournament.rules = S\u00E4\u00E4nn\u00F6t
tournament.rules_for_tournament = S\u00E4\u00E4nn\u00F6t turnaukselle tournament.rules_for_tournament = S\u00E4\u00E4nn\u00F6t turnaukselle
tournament.status = Tilanne tournament.status = Tilanne
tournament.team_members = Joukkueen j\u00E4senet
tournament.team_name = Joukkueen nimi tournament.team_name = Joukkueen nimi
tournament.team_name_required = Joukkueen nimi vaaditaan tournament.team_name_required = Joukkueen nimi vaaditaan
tournament.teammember.delete = Poista tournament.teammember.delete = Poista
...@@ -1053,6 +1057,9 @@ tournaments.admin.select_a_game = Valitse peli ...@@ -1053,6 +1057,9 @@ tournaments.admin.select_a_game = Valitse peli
tournaments.admin.select_a_ruleset = Valitse s\u00E4\u00E4nn\u00F6st\u00F6 tournaments.admin.select_a_ruleset = Valitse s\u00E4\u00E4nn\u00F6st\u00F6
tournaments.admin.set_time_constraints = Aseta aikarajat tournaments.admin.set_time_constraints = Aseta aikarajat
tournaments.admin.title = Turnauksien hallinnointi tournaments.admin.title = Turnauksien hallinnointi
tournaments.admin.view_tournament_description = Voit t\u00E4ss\u00E4 n\u00E4kym\u00E4ss\u00E4 tarkastella osallistujien tietoja sek\u00E4 poistaa ep\u00E4kelvot osallistumiset.
tournaments.admin.view_tournament_description_teamview_addition = Joukkuelistaus on muotoa TiiminJ\u00E4sen (Peli-ID).
tournaments.admin.view_tournament_title = Tarkastele turnausta:
tournaments.back_to_tournament_list = Takaisin turnauslistaukseen tournaments.back_to_tournament_list = Takaisin turnauslistaukseen
tournaments.backup_players = Maksimim\u00E4\u00E4r\u00E4 varapelaajia tournaments.backup_players = Maksimim\u00E4\u00E4r\u00E4 varapelaajia
tournaments.cancel_participation = Peruuta osallistuminen tournaments.cancel_participation = Peruuta osallistuminen
......
package fi.codecrew.moya.web.cdiview.tournaments;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.inject.Named;
import fi.codecrew.moya.beans.TournamentBeanLocal;
import fi.codecrew.moya.model.Tournament;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named
@ConversationScoped
public class TournamentParticipantsView extends GenericCDIView {
private static final long serialVersionUID = -6066216858686165211L;
@EJB private TournamentBeanLocal tournamentBean;
private Tournament tournament = null;
public String showView(Integer tournamentId) {
this.beginConversation();
this.setTournament(tournamentBean.getTournamentById(tournamentId));
if(this.tournament.getPlayersPerTeam() == 1)
return "/tournaments/admin/view_tournament_single.xhtml";
else
return "/tournaments/admin/view_tournament_team.xhtml";
}
public String cancel() {
this.endConversation();
return "/tournaments/admin/index.xhtml";
}
public Tournament getTournament() {
return tournament;
}
public void setTournament(Tournament tournament) {
this.tournament = tournament;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!