Commit 2067f874 by Tuukka Kivilahti

Merge branch 'devel' of codecrew.fi:bortal into devel

Conflicts:
	code/MoyaWeb/src/fi/codecrew/moya/resources/i18n.properties
2 parents 4e3429fe 7559e360
......@@ -29,6 +29,8 @@ public class BootstrapBean implements BootstrapBeanLocal {
dbUpdates.add(new String[] { "" }); // first version, no changes
dbUpdates.add(new String[] { "ALTER TABLE tournaments ADD COLUMN game integer NOT NULL REFERENCES tournament_games(id)" });
dbUpdates.add(new String[] { "ALTER TABLE tournaments ADD COLUMN rules integer NOT NULL REFERENCES tournament_rules(id)" });
dbUpdates.add(new String[] { "ALTER TABLE tournaments ADD COLUMN max_participants integer NOT NULL DEFAULT 0" });
dbUpdates.add(new String[] { "ALTER TABLE tournament_participants ADD COLUMN tournament integer NOT NULL REFERENCES tournaments(id)" });
// dbUpdates.add(new String[] { "ALTER TABLE users ALTER COLUMN birthday TYPE date" });
}
......
......@@ -221,6 +221,7 @@ public class MenuBean implements MenuBeanLocal {
lognavi.addPage(menuitemfacade.findOrCreate("/actionlog/taskview"), UserPermission.VIEW_ALL).setVisible(false);
MenuNavigation compoMenu = adminevent.addPage(null, null);
compoMenu.setKey("topnavi.compos");
compoMenu.addPage(menuitemfacade.findOrCreate("/voting/admincompolist"), CompoPermission.VIEW_COMPOS);
compoMenu.addPage(menuitemfacade.findOrCreate("/voting/create"), CompoPermission.MANAGE);
......
......@@ -43,8 +43,8 @@ public class TournamentBean implements TournamentBeanLocal {
}
@Override
public void createGame(TournamentGame tg) {
tournamentGameFacade.create(tg);
public TournamentGame createGame(TournamentGame tg) {
return tournamentGameFacade.create(tg);
}
@Override
......
......@@ -13,7 +13,7 @@ public interface TournamentBeanLocal {
List<TournamentGame> getGames();
List<TournamentRule> getRulesByGame(TournamentGame tg);
void createGame(TournamentGame tg);
TournamentGame createGame(TournamentGame tg);
TournamentRule createRule(TournamentRule tr);
TournamentGame findGame(Integer id);
TournamentRule findRule(Integer id);
......
......@@ -51,6 +51,7 @@ public class Tournament extends GenericEntity implements Serializable {
@Enumerated(EnumType.STRING)
private TournamentStatus tournamentStatus;
@OneToOne
@JoinColumn(name="tournament_root")
private TournamentMatch tournamentRoot;
......@@ -60,9 +61,14 @@ public class Tournament extends GenericEntity implements Serializable {
@Column(name="players_per_team")
private Integer playersPerTeam;
@Column(name="max_participants")
private Integer maxParticipants;
@ManyToOne
@JoinColumn(name="game", nullable=false)
private TournamentGame tournamentGame;
@ManyToOne
@JoinColumn(name="rules", nullable=false)
private TournamentRule rules;
......@@ -70,6 +76,9 @@ public class Tournament extends GenericEntity implements Serializable {
@OrderBy("id ASC")
private List<Tournament> subTournaments;
@OneToMany
private List<TournamentParticipant> participants;
public Tournament() { super(); }
public Integer getTalynTournamentId() {
......@@ -182,4 +191,20 @@ public class Tournament extends GenericEntity implements Serializable {
public void setRules(TournamentRule rules) {
this.rules = rules;
}
public Integer getMaxParticipants() {
return maxParticipants;
}
public void setMaxParticipants(Integer maxParticipants) {
this.maxParticipants = maxParticipants;
}
public List<TournamentParticipant> getParticipants() {
return participants;
}
public void setTournamentParticipants(List<TournamentParticipant> participants) {
this.participants = participants;
}
}
......@@ -25,6 +25,10 @@ public class TournamentParticipant extends GenericEntity implements Serializable
@OneToMany
private List<EventUser> teamMembers;
@ManyToOne
@JoinColumn(name="tournament")
private Tournament tournament;
public TournamentParticipant() {
super();
}
......
......@@ -3,4 +3,16 @@ package fi.codecrew.moya.enums;
public enum TournamentType {
SINGLE_ELIMINATION,
DOUBLE_ELIMINATION
;
private final String key;
private static final String I18N_HEADER = "bortalApplication.tournament.";
private TournamentType() {
key = I18N_HEADER + name();
}
public String getI18nKey() {
return key;
}
}
......@@ -15,9 +15,12 @@
<ui:define name="title">
<h1>#{i18n['placegroupview.header']}</h1>
<!-- <users:usertabs tabId="groups" /> -->
</ui:define>
<ui:define name="edittab">
<users:usertabs tabId="groups" />
</ui:define>
<ui:define name="content">
<h:outputText rendered="#{empty placeGroupView.groupMemberships}" value="#{i18n['placegroupview.noMemberships']}" />
<h:form rendered="#{!empty placeGroupView.groupMemberships}" id="placelistform">
......
......@@ -15,6 +15,9 @@
<ui:define name="title">
<h1>#{i18n['user.shop.title']}</h1>
<!-- <users:usertabs tabId="shop" /> -->
</ui:define>
<ui:define name="edittab">
<users:usertabs tabId="shop" />
</ui:define>
<ui:define name="content">
......
......@@ -77,13 +77,19 @@
<br />
<h:selectOneMenu value="#{tournamentCreateView.tournament.tournamentType}">
<f:selectItems value="#{tournamentCreateView.tournamentTypes}" var="val" itemLabel="#{val}" />
<f:selectItems value="#{tournamentCreateView.tournamentTypes}" var="val" itemLabel="#{i18n[val.i18nKey]}" />
</h:selectOneMenu>
<br />
<h:outputText value="#{i18n['tournaments.players_per_match']}" />
<h:panelGrid columns="1" style="margin-bottom:10px">
<p:inputText id="playerSlider" value="#{tournamentCreateView.tournament.playersPerMatch}" />
<p:inputText id="maxPartSlider" value="#{tournamentCreateView.tournament.maxParticipants}" />
<p:slider for="maxPartSlider" />
</h:panelGrid>
<h:outputText value="#{i18n['tournaments.players_per_match']}" />
<h:panelGrid columns="1" style="margin-bottom:10px">
<p:inputText id="playerSlider" value="#{tournamentCreateView.tournament.playersPerMatch}" />
<p:slider for="playerSlider" />
</h:panelGrid>
......
......@@ -34,6 +34,12 @@
</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.playerspermatch_slash_teamsize']}" />
</f:facet>
<h:outputText value="#{tournament.playersPerMatch}/#{tournament.playersPerTeam}" />
......
......@@ -13,6 +13,9 @@
</f:metadata>
<ui:define name="title">
<h1>#{i18n['user.accountevents']}</h1>
<!-- <users:usertabs tabId="accountevents" /> -->
</ui:define>
<ui:define name="edittab">
<users:usertabs tabId="accountevents" />
</ui:define>
<ui:define name="content">
......
......@@ -21,6 +21,9 @@
<ui:define name="title">
<h1>#{i18n['user.foodwavelist.title']}</h1>
<!-- <users:usertabs tabId="foodwave" /> -->
</ui:define>
<ui:define name="edittab">
<users:usertabs tabId="foodwave" />
</ui:define>
<ui:define name="content">
......
......@@ -14,10 +14,12 @@
</f:metadata>
<ui:define name="title">
<h1>#{i18n['sendPicture.header']}</h1>
<!-- <users:usertabs tabId="picture" /> -->
</ui:define>
<ui:define name="edittab">
<users:usertabs tabId="picture" />
</ui:define>
<ui:define name="content">
......
......@@ -76,8 +76,6 @@
</h:dataTable>
</h:form>
</ui:define>
</ui:composition>
</h:body>
......
......@@ -81,6 +81,8 @@ bortalApplication.shop.SHOP_TO_OTHERS = Shop to other users
bortalApplication.terminal.CASHIER = Access cashier terminal functions
bortalApplication.terminal.CUSTOMER = Access client terminal functions
bortalApplication.terminal.SELFHELP = Self help terminal
bortalApplication.tournament.DOUBLE_ELIMINATION = Double elimination
bortalApplication.tournament.SINGLE_ELIMINATION = Single Elimination
bortalApplication.user = User permissions
bortalApplication.user.ANYUSER = All users have this anyways
bortalApplication.user.CREATE_NEW = Create new user
......
......@@ -927,6 +927,7 @@ submenu.useradmin.listCardTemplates = Card templates
submenu.useradmin.sendPicture = Send a picture
submenu.useradmin.showTakePicture = Show webcam
submenu.useradmin.validateUser = Validate user
submenu.voting.admincompolist = Compos
submenu.voting.compolist = Compos
submenu.voting.create = Create new compo
submenu.voting.myEntries = My entries
......
......@@ -910,6 +910,7 @@ submenu.useradmin.listCardTemplates = Listaa korttipohjat
submenu.useradmin.sendPicture = L\u00E4het\u00E4 kuva
submenu.useradmin.showTakePicture = N\u00E4yt\u00E4 webcam
submenu.useradmin.validateUser = Validoi k\u00E4ytt\u00E4j\u00E4
submenu.voting.admincompolist = Kilpailut
submenu.voting.compolist = Kilpailut
submenu.voting.create = Uusi kilpailu
submenu.voting.myEntries = Omat entryt
......@@ -1108,7 +1109,7 @@ voting.allcompos.submitEntry = L\u00E4het\u00E4 entry
voting.allcompos.submitStart = Lis\u00E4ys auki
voting.allcompos.voteEnd = \u00C4\u00E4nestys kiinni
voting.allcompos.voteStart = \u00C4\u00E4nestys auki
voting.compo.submit = L\u00E4het\u00E4 kappale
voting.compo.submit = L\u00E4het\u00E4 teos
voting.compo.vote = \u00C4\u00E4nest\u00E4
voting.compoentryadd.button = L\u00E4het\u00E4
voting.compoentryadd.description = Ilmoittaudu kilpailuun:
......
......@@ -50,11 +50,13 @@ public class TournamentCreateView extends GenericCDIView {
this.beginConversation();
tournament = new Tournament();
tournament.setPlayersPerMatch(0);
tournament.setMaxParticipants(0);
backupPlayers = 0;
tournamentGames = tournamentBean.getGames();
}
}
public String save() {
tournament.setPlayersPerTeam(tournament.getPlayersPerMatch() + backupPlayers);
tournament.setLanEvent(eventBean.getCurrentEvent());
......@@ -95,7 +97,7 @@ public class TournamentCreateView extends GenericCDIView {
tg.setDescription(tournamentGameDescription);
tg.setLanEvent(eventBean.getCurrentEvent());
tournamentBean.createGame(tg);
game = tournamentBean.createGame(tg);
}
tournamentRules = tournamentBean.getRulesByGame(game);
......
package fi.codecrew.moya.web.cdiview.tournaments;
public class TournamentListView {
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!