Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Max Mecklin
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9f958648
authored
Sep 16, 2013
by
Antti Tonkyra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tournament stuff
1 parent
627d76d9
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
169 additions
and
23 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/TournamentBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentFacade.java
code/MoyaBeansClient/ejbModule/fi/codecrew/moya/beans/TournamentBeanLocal.java
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentParticipant.java
code/MoyaUtilities/src/main/java/fi/codecrew/moya/enums/BortalApplication.java
code/MoyaUtilities/src/main/java/fi/codecrew/moya/enums/apps/TournamentPermission.java
code/MoyaWeb/WebContent/tournaments/admin/index.xhtml
code/MoyaWeb/WebContent/tournaments/index.xhtml
code/MoyaWeb/WebContent/tournaments/participate_multi.xhtml
code/MoyaWeb/WebContent/tournaments/showrules.xhtml
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_en.properties
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_fi.properties
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/tournaments/TournamentListView.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/TournamentBean.java
View file @
9f95864
package
fi
.
codecrew
.
moya
.
beans
;
package
fi
.
codecrew
.
moya
.
beans
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
javax.annotation.security.RolesAllowed
;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
import
javax.ejb.LocalBean
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
javax.ejb.Stateless
;
import
fi.codecrew.moya.enums.TournamentStatus
;
import
fi.codecrew.moya.enums.TournamentStatus
;
import
fi.codecrew.moya.enums.TournamentTeamMemberRole
;
import
fi.codecrew.moya.enums.TournamentTeamMemberRole
;
import
fi.codecrew.moya.enums.apps.TournamentPermission
;
import
fi.codecrew.moya.facade.EventUserFacade
;
import
fi.codecrew.moya.facade.EventUserFacade
;
import
fi.codecrew.moya.facade.TournamentFacade
;
import
fi.codecrew.moya.facade.TournamentFacade
;
import
fi.codecrew.moya.facade.TournamentGameFacade
;
import
fi.codecrew.moya.facade.TournamentGameFacade
;
...
@@ -44,94 +47,114 @@ public class TournamentBean implements TournamentBeanLocal {
...
@@ -44,94 +47,114 @@ public class TournamentBean implements TournamentBeanLocal {
}
}
@Override
@Override
@RolesAllowed
(
TournamentPermission
.
S_VIEW
)
public
List
<
TournamentRule
>
getRulesByGame
(
TournamentGame
tg
)
{
public
List
<
TournamentRule
>
getRulesByGame
(
TournamentGame
tg
)
{
return
tournamentRuleFacade
.
getRulesByGame
(
tg
);
return
tournamentRuleFacade
.
getRulesByGame
(
tg
);
}
}
@Override
@Override
@RolesAllowed
(
TournamentPermission
.
S_VIEW
)
public
List
<
TournamentGame
>
getGames
()
{
public
List
<
TournamentGame
>
getGames
()
{
return
tournamentGameFacade
.
getGames
();
return
tournamentGameFacade
.
getGames
();
}
}
@Override
@Override
@RolesAllowed
(
TournamentPermission
.
S_MANAGE_ALL
)
public
TournamentGame
createGame
(
TournamentGame
tg
)
{
public
TournamentGame
createGame
(
TournamentGame
tg
)
{
return
tournamentGameFacade
.
create
(
tg
);
return
tournamentGameFacade
.
create
(
tg
);
}
}
@Override
@Override
@RolesAllowed
(
TournamentPermission
.
S_MANAGE_ALL
)
public
TournamentRule
createRule
(
TournamentRule
tr
)
{
public
TournamentRule
createRule
(
TournamentRule
tr
)
{
return
tournamentRuleFacade
.
create
(
tr
);
return
tournamentRuleFacade
.
create
(
tr
);
}
}
@Override
@Override
@RolesAllowed
(
TournamentPermission
.
S_VIEW
)
public
TournamentGame
findGame
(
Integer
id
)
{
public
TournamentGame
findGame
(
Integer
id
)
{
return
tournamentGameFacade
.
find
(
id
);
return
tournamentGameFacade
.
find
(
id
);
}
}
@Override
@Override
@RolesAllowed
(
TournamentPermission
.
S_VIEW
)
public
TournamentRule
findRule
(
Integer
id
)
{
public
TournamentRule
findRule
(
Integer
id
)
{
return
tournamentRuleFacade
.
find
(
id
);
return
tournamentRuleFacade
.
find
(
id
);
}
}
@Override
@Override
@RolesAllowed
(
TournamentPermission
.
S_MANAGE_ALL
)
public
void
createTournament
(
Tournament
tournament
)
{
public
void
createTournament
(
Tournament
tournament
)
{
tournamentFacade
.
create
(
tournament
);
tournamentFacade
.
create
(
tournament
);
}
}
@Override
@Override
public
List
<
Tournament
>
getTournamentsInStatus
(
TournamentStatus
status
)
{
@RolesAllowed
(
TournamentPermission
.
S_VIEW
)
return
tournamentFacade
.
getTournamentsInStatus
(
status
);
public
List
<
Tournament
>
getTournamentsInStatus
(
TournamentStatus
status
,
boolean
useTimeConstraints
)
{
return
tournamentFacade
.
getTournamentsInStatusWithParticipationTimeIn
(
status
);
}
}
@Override
@Override
@RolesAllowed
(
TournamentPermission
.
S_VIEW
)
public
List
<
Tournament
>
getActiveTournaments
()
{
public
List
<
Tournament
>
getActiveTournaments
()
{
return
tournamentFacade
.
getTournamentsNotInStatus
(
TournamentStatus
.
COMPLETED
);
return
tournamentFacade
.
getTournamentsNotInStatus
(
TournamentStatus
.
COMPLETED
);
}
}
@Override
@Override
@RolesAllowed
(
TournamentPermission
.
S_VIEW
)
public
Tournament
getTournamentById
(
Integer
tournamentId
)
{
public
Tournament
getTournamentById
(
Integer
tournamentId
)
{
return
tournamentFacade
.
find
(
tournamentId
);
return
tournamentFacade
.
find
(
tournamentId
);
}
}
@Override
@Override
@RolesAllowed
(
TournamentPermission
.
S_MANAGE_ALL
)
public
void
editTournament
(
Tournament
tournament
)
{
public
void
editTournament
(
Tournament
tournament
)
{
tournamentFacade
.
merge
(
tournament
);
tournamentFacade
.
merge
(
tournament
);
}
}
@Override
@Override
@RolesAllowed
(
TournamentPermission
.
S_MANAGE_ALL
)
public
void
deleteTournament
(
Tournament
tournament
)
{
public
void
deleteTournament
(
Tournament
tournament
)
{
tournament
=
tournamentFacade
.
merge
(
tournament
);
tournament
=
tournamentFacade
.
merge
(
tournament
);
tournamentFacade
.
remove
(
tournament
);
tournamentFacade
.
remove
(
tournament
);
}
}
@Override
@Override
@RolesAllowed
(
TournamentPermission
.
S_PARTICIPATE
)
public
void
createParticipation
(
TournamentParticipant
tournamentParticipant
)
throws
Exception
{
public
void
createParticipation
(
TournamentParticipant
tournamentParticipant
)
throws
Exception
{
Tournament
t
=
tournamentFacade
.
find
(
tournamentParticipant
.
getTournament
().
getId
());
Tournament
t
=
tournamentFacade
.
find
(
tournamentParticipant
.
getTournament
().
getId
());
// Assert participant size is smaller than max
Date
currentTime
=
new
Date
();
if
(
t
.
getParticipants
().
size
()
<
t
.
getMaxParticipants
())
{
TournamentTeamMember
capt
=
null
;
if
(
t
.
getRegistrationOpensAt
()
!=
null
&&
t
.
getRegistrationClosesAt
()
!=
null
&&
currentTime
.
after
(
t
.
getRegistrationOpensAt
())
&&
currentTime
.
before
(
t
.
getRegistrationClosesAt
()))
{
for
(
TournamentTeamMember
ttm
:
tournamentParticipant
.
getTeamMembers
())
if
(
ttm
.
getRole
()
==
TournamentTeamMemberRole
.
CAPTAIN
)
capt
=
ttm
;
// Assert participant size is smaller than max
if
(
t
.
getParticipants
().
size
()
<
t
.
getMaxParticipants
())
{
// Assert team has a captain
TournamentTeamMember
capt
=
null
;
if
(
capt
!=
null
)
{
for
(
TournamentTeamMember
ttm
:
tournamentParticipant
.
getTeamMembers
())
if
(
ttm
.
getRole
()
==
TournamentTeamMemberRole
.
CAPTAIN
)
capt
=
ttm
;
// Assert team has the correct number of players for a match
// Assert team has a captain
if
(
tournamentParticipant
.
getTeamMembers
().
size
()
>=
tournamentParticipant
.
getTournament
().
getPlayersPerTeam
())
{
if
(
capt
!=
null
)
{
tournamentParticipant
=
tournamentParticipantFacade
.
create
(
tournamentParticipant
);
t
.
getParticipants
().
add
(
tournamentParticipant
);
// Assert team has the correct number of players for a match
if
(
tournamentParticipant
.
getTeamMembers
().
size
()
>=
tournamentParticipant
.
getTournament
().
getPlayersPerTeam
())
{
tournamentParticipant
=
tournamentParticipantFacade
.
create
(
tournamentParticipant
);
t
.
getParticipants
().
add
(
tournamentParticipant
);
}
else
{
throw
new
Exception
(
"tournament.not_enough_players"
);
}
}
else
{
}
else
{
throw
new
Exception
(
"tournament.no
t_enough_players
"
);
throw
new
Exception
(
"tournament.no
_captain
"
);
}
}
}
else
{
}
else
{
throw
new
Exception
(
"tournament.
no_captain
"
);
throw
new
Exception
(
"tournament.
participation_full
"
);
}
}
}
else
{
}
else
{
throw
new
Exception
(
"tournament.
participation_full
"
);
throw
new
Exception
(
"tournament.
not_within_participation_time
"
);
}
}
}
}
@Override
@Override
@RolesAllowed
(
TournamentPermission
.
S_VIEW
)
public
boolean
hasParticipations
(
EventUser
currentUser
,
Tournament
tournament
)
{
public
boolean
hasParticipations
(
EventUser
currentUser
,
Tournament
tournament
)
{
for
(
TournamentParticipant
tp
:
tournament
.
getParticipants
())
{
for
(
TournamentParticipant
tp
:
tournament
.
getParticipants
())
{
for
(
TournamentTeamMember
tm
:
tp
.
getTeamMembers
())
{
for
(
TournamentTeamMember
tm
:
tp
.
getTeamMembers
())
{
...
@@ -147,6 +170,7 @@ public class TournamentBean implements TournamentBeanLocal {
...
@@ -147,6 +170,7 @@ public class TournamentBean implements TournamentBeanLocal {
}
}
@Override
@Override
@RolesAllowed
(
TournamentPermission
.
S_VIEW
)
public
EventUser
findAvailablePlayerForTournamentByLogin
(
Tournament
t
,
String
login
)
throws
Exception
{
public
EventUser
findAvailablePlayerForTournamentByLogin
(
Tournament
t
,
String
login
)
throws
Exception
{
EventUser
u
=
eventUserFacade
.
findByLogin
(
login
);
EventUser
u
=
eventUserFacade
.
findByLogin
(
login
);
if
(
u
!=
null
)
{
if
(
u
!=
null
)
{
...
...
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentFacade.java
View file @
9f95864
package
fi
.
codecrew
.
moya
.
facade
;
package
fi
.
codecrew
.
moya
.
facade
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
javax.ejb.LocalBean
;
import
javax.ejb.LocalBean
;
...
@@ -40,6 +42,20 @@ public class TournamentFacade extends IntegerPkGenericFacade<Tournament> {
...
@@ -40,6 +42,20 @@ public class TournamentFacade extends IntegerPkGenericFacade<Tournament> {
return
getEm
().
createQuery
(
cq
).
getResultList
();
return
getEm
().
createQuery
(
cq
).
getResultList
();
}
}
public
List
<
Tournament
>
getTournamentsInStatusWithParticipationTimeIn
(
TournamentStatus
status
)
{
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
Tournament
>
cq
=
cb
.
createQuery
(
Tournament
.
class
);
Root
<
Tournament
>
root
=
cq
.
from
(
Tournament
.
class
);
cq
.
where
(
cb
.
and
(
cb
.
equal
(
root
.
get
(
Tournament_
.
tournamentStatus
),
status
),
cb
.
between
(
cb
.
currentDate
(),
root
.
get
(
Tournament_
.
registrationOpensAt
),
root
.
get
(
Tournament_
.
registrationClosesAt
))
)
);
return
getEm
().
createQuery
(
cq
).
getResultList
();
}
}
}
code/MoyaBeansClient/ejbModule/fi/codecrew/moya/beans/TournamentBeanLocal.java
View file @
9f95864
...
@@ -22,12 +22,12 @@ public interface TournamentBeanLocal {
...
@@ -22,12 +22,12 @@ public interface TournamentBeanLocal {
TournamentRule
findRule
(
Integer
id
);
TournamentRule
findRule
(
Integer
id
);
void
createTournament
(
Tournament
tournament
);
void
createTournament
(
Tournament
tournament
);
List
<
Tournament
>
getActiveTournaments
();
List
<
Tournament
>
getActiveTournaments
();
List
<
Tournament
>
getTournamentsInStatus
(
TournamentStatus
status
);
Tournament
getTournamentById
(
Integer
tournamentId
);
Tournament
getTournamentById
(
Integer
tournamentId
);
void
editTournament
(
Tournament
tournament
);
void
editTournament
(
Tournament
tournament
);
void
deleteTournament
(
Tournament
tournament
);
void
deleteTournament
(
Tournament
tournament
);
void
createParticipation
(
TournamentParticipant
tournamentParticipant
)
throws
Exception
;
void
createParticipation
(
TournamentParticipant
tournamentParticipant
)
throws
Exception
;
boolean
hasParticipations
(
EventUser
currentUser
,
Tournament
tournament
);
boolean
hasParticipations
(
EventUser
currentUser
,
Tournament
tournament
);
EventUser
findAvailablePlayerForTournamentByLogin
(
Tournament
t
,
String
login
)
throws
Exception
;
EventUser
findAvailablePlayerForTournamentByLogin
(
Tournament
t
,
String
login
)
throws
Exception
;
List
<
Tournament
>
getTournamentsInStatus
(
TournamentStatus
status
,
boolean
useTimeConstraints
);
}
}
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentParticipant.java
View file @
9f95864
...
@@ -19,6 +19,9 @@ import org.eclipse.persistence.annotations.OptimisticLockingType;
...
@@ -19,6 +19,9 @@ import org.eclipse.persistence.annotations.OptimisticLockingType;
public
class
TournamentParticipant
extends
GenericEntity
implements
Serializable
{
public
class
TournamentParticipant
extends
GenericEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@Column
(
name
=
"team_name"
,
nullable
=
true
)
private
String
teamName
;
@JoinColumn
(
name
=
"participator"
)
@JoinColumn
(
name
=
"participator"
)
private
EventUser
participator
;
private
EventUser
participator
;
...
@@ -56,5 +59,13 @@ public class TournamentParticipant extends GenericEntity implements Serializable
...
@@ -56,5 +59,13 @@ public class TournamentParticipant extends GenericEntity implements Serializable
public
void
setTournament
(
Tournament
tournament
)
{
public
void
setTournament
(
Tournament
tournament
)
{
this
.
tournament
=
tournament
;
this
.
tournament
=
tournament
;
}
}
public
String
getTeamName
()
{
return
teamName
;
}
public
void
setTeamName
(
String
teamName
)
{
this
.
teamName
=
teamName
;
}
}
}
code/MoyaUtilities/src/main/java/fi/codecrew/moya/enums/BortalApplication.java
View file @
9f95864
...
@@ -11,6 +11,7 @@ import fi.codecrew.moya.enums.apps.PollPermission;
...
@@ -11,6 +11,7 @@ import fi.codecrew.moya.enums.apps.PollPermission;
import
fi.codecrew.moya.enums.apps.SalespointPermission
;
import
fi.codecrew.moya.enums.apps.SalespointPermission
;
import
fi.codecrew.moya.enums.apps.ShopPermission
;
import
fi.codecrew.moya.enums.apps.ShopPermission
;
import
fi.codecrew.moya.enums.apps.TerminalPermission
;
import
fi.codecrew.moya.enums.apps.TerminalPermission
;
import
fi.codecrew.moya.enums.apps.TournamentPermission
;
import
fi.codecrew.moya.enums.apps.UserPermission
;
import
fi.codecrew.moya.enums.apps.UserPermission
;
public
enum
BortalApplication
{
public
enum
BortalApplication
{
...
@@ -25,6 +26,7 @@ public enum BortalApplication {
...
@@ -25,6 +26,7 @@ public enum BortalApplication {
COMPO
(
CompoPermission
.
class
),
COMPO
(
CompoPermission
.
class
),
EVENT
(
EventPermission
.
class
),
EVENT
(
EventPermission
.
class
),
LICENSE
(
LicensePermission
.
class
),
LICENSE
(
LicensePermission
.
class
),
TOURNAMENT
(
TournamentPermission
.
class
)
;
;
...
...
code/MoyaUtilities/src/main/java/fi/codecrew/moya/enums/apps/TournamentPermission.java
0 → 100644
View file @
9f95864
package
fi
.
codecrew
.
moya
.
enums
.
apps
;
import
fi.codecrew.moya.enums.BortalApplication
;
public
enum
TournamentPermission
implements
IAppPermission
{
VIEW
,
MANAGE_ALL
,
PARTICIPATE
;
public
static
final
String
S_VIEW
=
"TOURNAMENT/VIEW"
;
public
static
final
String
S_MANAGE_ALL
=
"TOURNAMENT/MANAGE_ALL"
;
public
static
final
String
S_PARTICIPATE
=
"TOURNAMENT/PARTICIPATE"
;
private
final
String
fullName
;
private
final
String
key
;
private
static
final
String
I18N_HEADER
=
"bortalApplication.tournament."
;
private
TournamentPermission
()
{
key
=
I18N_HEADER
+
name
();
fullName
=
new
StringBuilder
().
append
(
getParent
().
toString
()).
append
(
DELIMITER
).
append
(
toString
()).
toString
();
}
@Override
public
BortalApplication
getParent
()
{
return
BortalApplication
.
TOURNAMENT
;
}
@Override
public
String
getFullName
()
{
return
fullName
;
}
@Override
public
String
getI18nKey
()
{
return
key
;
}
}
code/MoyaWeb/WebContent/tournaments/admin/index.xhtml
View file @
9f95864
...
@@ -57,6 +57,18 @@
...
@@ -57,6 +57,18 @@
</p:column>
</p:column>
<p:column>
<p:column>
<f:facet
name=
"header"
>
<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.admin.control']}"
/>
<h:outputText
value=
"#{i18n['tournament.admin.control']}"
/>
</f:facet>
</f:facet>
<p:commandButton
value=
"#{i18n['tournament.admin.edit']}"
action=
"#{tournamentEditView.showEdit(tournament.id)}"
/>
<p:commandButton
value=
"#{i18n['tournament.admin.edit']}"
action=
"#{tournamentEditView.showEdit(tournament.id)}"
/>
...
...
code/MoyaWeb/WebContent/tournaments/index.xhtml
View file @
9f95864
...
@@ -14,6 +14,9 @@
...
@@ -14,6 +14,9 @@
<p>
#{i18n['tournaments.description']}
</p>
<p>
#{i18n['tournaments.description']}
</p>
<h2>
#{i18n['tournaments.open_tournaments']}
</h2>
<h2>
#{i18n['tournaments.open_tournaments']}
</h2>
<p:dataTable
value=
"#{tournamentListView.setupPhaseTournaments}"
var=
"tournament"
>
<p:dataTable
value=
"#{tournamentListView.setupPhaseTournaments}"
var=
"tournament"
>
<p:column
style=
"width:2%"
>
<p:rowToggler
/>
</p:column>
<p:column>
<p:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['tournament.name']}"
/>
<h:outputText
value=
"#{i18n['tournament.name']}"
/>
...
@@ -73,6 +76,21 @@
...
@@ -73,6 +76,21 @@
<h:outputText
value=
"#{i18n['tournament.full']}"
rendered=
"#{tournament.participants.size() ge tournament.maxParticipants}"
/>
<h:outputText
value=
"#{i18n['tournament.full']}"
rendered=
"#{tournament.participants.size() ge tournament.maxParticipants}"
/>
</h:panelGroup>
</h:panelGroup>
</p:column>
</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:dataTable>
</h:form>
</h:form>
</ui:define>
</ui:define>
...
...
code/MoyaWeb/WebContent/tournaments/participate_multi.xhtml
View file @
9f95864
...
@@ -15,6 +15,11 @@
...
@@ -15,6 +15,11 @@
<h2>
#{i18n['tournaments.participate_team_members']}
</h2>
<h2>
#{i18n['tournaments.participate_team_members']}
</h2>
<p:messages
autoUpdate=
"true"
redisplay=
"false"
></p:messages>
<p:messages
autoUpdate=
"true"
redisplay=
"false"
></p:messages>
<h:form>
<h:form>
<h3>
#{i18n['tournaments.team_details']}
</h3>
<h:panelGrid
columns=
"2"
>
<h:outputText
value=
"#{i18n['tournament.team_name']}"
/>
<p:inputText
value=
"#{tournamentParticipateView.tournamentParticipant.teamName}"
required=
"true"
requiredMessage=
"#{i18n['tournament.team_name_required']}"
/>
</h:panelGrid>
<h3>
#{i18n['tournaments.participate_actual_team_members']}
</h3>
<h3>
#{i18n['tournaments.participate_actual_team_members']}
</h3>
<p:dataTable
id=
"teammember_table"
value=
"#{tournamentParticipateView.players}"
var=
"teamMember"
>
<p:dataTable
id=
"teammember_table"
value=
"#{tournamentParticipateView.players}"
var=
"teamMember"
>
<p:column>
<p:column>
...
@@ -38,9 +43,9 @@
...
@@ -38,9 +43,9 @@
<p:commandButton
value=
"#{i18n['tournaments.add_player_to_team']}"
action=
"#{tournamentParticipateView.addMainPlayerToTeam}"
update=
"@form"
/>
<p:commandButton
value=
"#{i18n['tournaments.add_player_to_team']}"
action=
"#{tournamentParticipateView.addMainPlayerToTeam}"
update=
"@form"
/>
</h:panelGrid>
</h:panelGrid>
<h:panelGroup
rendered=
"#{tournamentParticipateView.backupMax >
tournamentParticipateView.backupPlayerCount
}"
>
<h:panelGroup
rendered=
"#{tournamentParticipateView.backupMax >
0
}"
>
<h3>
#{i18n['tournaments.participate_backup_team_members']}
</h3>
<h3>
#{i18n['tournaments.participate_backup_team_members']}
</h3>
<p:dataTable
id=
"backup_teammember_table"
value=
"#{tournamentParticipateView.backupPlayers}"
var=
"teamMember"
rendered=
"#{tournamentParticipateView.backupMax > 0}"
>
<p:dataTable
id=
"backup_teammember_table"
value=
"#{tournamentParticipateView.backupPlayers}"
var=
"teamMember"
>
<p:column>
<p:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['tournament.teammember.name']}"
/>
<h:outputText
value=
"#{i18n['tournament.teammember.name']}"
/>
...
@@ -56,7 +61,7 @@
...
@@ -56,7 +61,7 @@
</h:panelGroup>
</h:panelGroup>
</p:column>
</p:column>
</p:dataTable>
</p:dataTable>
<h:panelGrid
columns=
"3"
>
<h:panelGrid
columns=
"3"
rendered=
"#{tournamentParticipateView.backupMax > tournamentParticipateView.backupPlayerCount}"
>
<h:outputText
value=
"#{i18n['tournament.teammember.login']}"
/>
<h:outputText
value=
"#{i18n['tournament.teammember.login']}"
/>
<p:inputText
value=
"#{tournamentParticipateView.selectedBackupPlayerLogin}"
/>
<p:inputText
value=
"#{tournamentParticipateView.selectedBackupPlayerLogin}"
/>
<p:commandButton
value=
"#{i18n['tournaments.add_backup_player_to_team']}"
action=
"#{tournamentParticipateView.addBackupPlayerToTeam}"
update=
"@form"
/>
<p:commandButton
value=
"#{i18n['tournaments.add_backup_player_to_team']}"
action=
"#{tournamentParticipateView.addBackupPlayerToTeam}"
update=
"@form"
/>
...
...
code/MoyaWeb/WebContent/tournaments/showrules.xhtml
View file @
9f95864
...
@@ -10,8 +10,14 @@
...
@@ -10,8 +10,14 @@
</f:metadata>
</f:metadata>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<p>
<h:link
outcome=
"/tournaments/index.xhtml"
value=
"#{i18n['tournaments.back_to_tournament_list']}"
/>
</p>
<h1>
#{i18n['tournament.rules_for_tournament']} #{tournamentRulesView.tournament.tournamentName} (#{tournamentRulesView.tournament.rules.name})
</h1>
<h1>
#{i18n['tournament.rules_for_tournament']} #{tournamentRulesView.tournament.tournamentName} (#{tournamentRulesView.tournament.rules.name})
</h1>
<h:outputText
value=
"#{tournamentRulesView.tournament.rules.rules}"
escape=
"false"
/>
<h:outputText
value=
"#{tournamentRulesView.tournament.rules.rules}"
escape=
"false"
/>
<p>
<h:link
outcome=
"/tournaments/index.xhtml"
value=
"#{i18n['tournaments.back_to_tournament_list']}"
/>
</p>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
</h:body>
</h:body>
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_en.properties
View file @
9f95864
...
@@ -1024,6 +1024,8 @@ tournament.edit = Edit tournament
...
@@ -1024,6 +1024,8 @@ tournament.edit = Edit tournament
tournament.fillamount
=
Places taken
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.participants
=
Participants
tournament.participate
=
Participate
tournament.participate
=
Participate
tournament.participation_failed
=
Participation failed
tournament.participation_failed
=
Participation failed
tournament.participation_success
=
Successfully participated into tournament
tournament.participation_success
=
Successfully participated into tournament
...
@@ -1034,6 +1036,8 @@ tournament.playerspermatch_slash_teamsize = Players / team size
...
@@ -1034,6 +1036,8 @@ 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_name
=
Team Name
tournament.team_name_required
=
Team name is required
tournament.teammember.delete
=
Delete
tournament.teammember.delete
=
Delete
tournament.teammember.login
=
Login
tournament.teammember.login
=
Login
tournament.teammember.name
=
Name
tournament.teammember.name
=
Name
...
@@ -1062,6 +1066,7 @@ tournaments.admin.select_a_game = Select a game
...
@@ -1062,6 +1066,7 @@ 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.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
tournaments.description
=
You can view & participate into tournaments from this page.
tournaments.description
=
You can view & participate into tournaments from this page.
...
@@ -1083,6 +1088,7 @@ tournaments.ruleset_description = Ruleset description
...
@@ -1083,6 +1088,7 @@ tournaments.ruleset_description = Ruleset description
tournaments.ruleset_name
=
Ruleset name
tournaments.ruleset_name
=
Ruleset name
tournaments.ruleset_rules
=
Tournament ruleset
tournaments.ruleset_rules
=
Tournament ruleset
tournaments.start_time
=
Start Time
tournaments.start_time
=
Start Time
tournaments.team_details
=
Team Details
tournaments.title
=
Tournaments
tournaments.title
=
Tournaments
tournaments.tournament_details
=
Tournament details
tournaments.tournament_details
=
Tournament details
tournaments.tournament_name
=
Tournament name
tournaments.tournament_name
=
Tournament name
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_fi.properties
View file @
9f95864
...
@@ -1008,6 +1008,8 @@ tournament.edit = Muokkaa turnausta
...
@@ -1008,6 +1008,8 @@ tournament.edit = Muokkaa turnausta
tournament.fillamount
=
Osallistujaa ilmottautunut
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.participants
=
Osallistujat
tournament.participate
=
Osallistu
tournament.participate
=
Osallistu
tournament.participation_failed
=
Turnausilmoittautuminen ep
\u
00E4onnistui
tournament.participation_failed
=
Turnausilmoittautuminen ep
\u
00E4onnistui
tournament.participation_success
=
Osallistuminen vastaanotettu
tournament.participation_success
=
Osallistuminen vastaanotettu
...
@@ -1018,6 +1020,8 @@ tournament.playerspermatch_slash_teamsize = Pelaajat / tiimin koko
...
@@ -1018,6 +1020,8 @@ tournament.playerspermatch_slash_teamsize = Pelaajat / tiimin koko
tournament.rules
=
S
\u
00E4
\u
00E4nn
\u
00F6t
tournament.rules
=
S
\u
00E4
\u
00E4nn
\u
00F6t
tournament.rules_for_tournament
=
S
\u
00E4
\u
00E4nn
\u
00F6t turnaukselle
tournament.rules_for_tournament
=
S
\u
00E4
\u
00E4nn
\u
00F6t turnaukselle
tournament.status
=
Tilanne
tournament.status
=
Tilanne
tournament.team_name
=
Joukkueen nimi
tournament.team_name_required
=
Joukkueen nimi vaaditaan
tournament.teammember.delete
=
Poista
tournament.teammember.delete
=
Poista
tournament.teammember.login
=
Kirjautumistunnus
tournament.teammember.login
=
Kirjautumistunnus
tournament.teammember.name
=
Nimi
tournament.teammember.name
=
Nimi
...
@@ -1046,6 +1050,7 @@ tournaments.admin.select_a_game = Valitse peli
...
@@ -1046,6 +1050,7 @@ tournaments.admin.select_a_game = Valitse peli
tournaments.admin.select_a_ruleset
=
Valitse s
\u
00E4
\u
00E4nn
\u
00F6st
\u
00F6
tournaments.admin.select_a_ruleset
=
Valitse s
\u
00E4
\u
00E4nn
\u
00F6st
\u
00F6
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.back_to_tournament_list
=
Takaisin turnauslistaukseen
tournaments.backup_players
=
Maksimim
\u
00E4
\u
00E4r
\u
00E4 varapelaajia
tournaments.backup_players
=
Maksimim
\u
00E4
\u
00E4r
\u
00E4 varapelaajia
tournaments.cancel_participation
=
Peruuta osallistuminen
tournaments.cancel_participation
=
Peruuta osallistuminen
tournaments.description
=
Voit osallistua sek
\u
00E4 katselmoida turnauksia t
\u
00E4ll
\u
00E4 sivulla.
tournaments.description
=
Voit osallistua sek
\u
00E4 katselmoida turnauksia t
\u
00E4ll
\u
00E4 sivulla.
...
@@ -1067,6 +1072,7 @@ tournaments.ruleset_description = S\u00E4\u00E4nn\u00F6st\u00F6n
...
@@ -1067,6 +1072,7 @@ tournaments.ruleset_description = S\u00E4\u00E4nn\u00F6st\u00F6n
tournaments.ruleset_name
=
S
\u
00E4
\u
00E4nn
\u
00F6st
\u
00F6n nimi
tournaments.ruleset_name
=
S
\u
00E4
\u
00E4nn
\u
00F6st
\u
00F6n nimi
tournaments.ruleset_rules
=
Turnauksen s
\u
00E4
\u
00E4nn
\u
00F6t
tournaments.ruleset_rules
=
Turnauksen s
\u
00E4
\u
00E4nn
\u
00F6t
tournaments.start_time
=
Aloitusaika
tournaments.start_time
=
Aloitusaika
tournaments.team_details
=
Joukkuekohtaiset tiedot
tournaments.title
=
Turnaukset
tournaments.title
=
Turnaukset
tournaments.tournament_details
=
Turnauksen yksityiskohdat
tournaments.tournament_details
=
Turnauksen yksityiskohdat
tournaments.tournament_name
=
Turnauksen nimi
tournaments.tournament_name
=
Turnauksen nimi
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/tournaments/TournamentListView.java
View file @
9f95864
...
@@ -17,14 +17,14 @@ public class TournamentListView {
...
@@ -17,14 +17,14 @@ public class TournamentListView {
@EJB
private
TournamentBeanLocal
tournamentBean
;
@EJB
private
TournamentBeanLocal
tournamentBean
;
public
List
<
Tournament
>
getSetupPhaseTournaments
()
{
public
List
<
Tournament
>
getSetupPhaseTournaments
()
{
return
tournamentBean
.
getTournamentsInStatus
(
TournamentStatus
.
SETUP
);
return
tournamentBean
.
getTournamentsInStatus
(
TournamentStatus
.
SETUP
,
true
);
}
}
public
List
<
Tournament
>
getInProgressTournaments
()
{
public
List
<
Tournament
>
getInProgressTournaments
()
{
return
tournamentBean
.
getTournamentsInStatus
(
TournamentStatus
.
IN_PROGRESS
);
return
tournamentBean
.
getTournamentsInStatus
(
TournamentStatus
.
IN_PROGRESS
,
false
);
}
}
public
List
<
Tournament
>
getCompletedTournaments
()
{
public
List
<
Tournament
>
getCompletedTournaments
()
{
return
tournamentBean
.
getTournamentsInStatus
(
TournamentStatus
.
COMPLETED
);
return
tournamentBean
.
getTournamentsInStatus
(
TournamentStatus
.
COMPLETED
,
false
);
}
}
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment