Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Linnea Samila
/
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 6dcac4e2
authored
Oct 10, 2013
by
Antti Tonkyra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show gameids in tournament admin view
1 parent
1d261dd6
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
67 additions
and
5 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/MenuBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/UserBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/GameIDFacade.java
code/MoyaBeansClient/ejbModule/fi/codecrew/moya/beans/UserBeanLocal.java
code/MoyaWeb/WebContent/tournaments/admin/view_tournament_single.xhtml
code/MoyaWeb/WebContent/tournaments/admin/view_tournament_team.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/TournamentParticipantsView.java
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/user/UserGameIDView.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/MenuBean.java
View file @
6dcac4e
...
@@ -118,6 +118,7 @@ public class MenuBean implements MenuBeanLocal {
...
@@ -118,6 +118,7 @@ public class MenuBean implements MenuBeanLocal {
userprofile
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/user/edit"
),
UserPermission
.
VIEW_SELF
);
userprofile
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/user/edit"
),
UserPermission
.
VIEW_SELF
);
userprofile
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/user/changePassword"
),
UserPermission
.
VIEW_SELF
);
userprofile
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/user/changePassword"
),
UserPermission
.
VIEW_SELF
);
userprofile
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/user/gameids"
),
TournamentPermission
.
VIEW
);
userprofile
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/auth/logout"
),
UserPermission
.
LOGOUT
);
userprofile
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/auth/logout"
),
UserPermission
.
LOGOUT
);
MenuNavigation
tournaments
=
usermenu
.
addPage
(
null
,
null
);
MenuNavigation
tournaments
=
usermenu
.
addPage
(
null
,
null
);
...
...
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/UserBean.java
View file @
6dcac4e
...
@@ -551,6 +551,12 @@ public class UserBean implements UserBeanLocal {
...
@@ -551,6 +551,12 @@ public class UserBean implements UserBeanLocal {
gi
.
getEventUser
().
getGameIDs
().
remove
(
gi
);
gi
.
getEventUser
().
getGameIDs
().
remove
(
gi
);
gameIDFacade
.
remove
(
gi
);
gameIDFacade
.
remove
(
gi
);
}
}
@Override
@RolesAllowed
(
SpecialPermission
.
S_USER
)
public
GameID
getGameIDByGameAndUser
(
TournamentGame
tg
,
EventUser
user
)
{
return
gameIDFacade
.
getGameIDByGame
(
tg
,
user
);
}
@Override
@Override
public
boolean
userExists
(
String
login
)
{
public
boolean
userExists
(
String
login
)
{
...
...
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/GameIDFacade.java
View file @
6dcac4e
...
@@ -13,9 +13,13 @@ import javax.persistence.criteria.Root;
...
@@ -13,9 +13,13 @@ import javax.persistence.criteria.Root;
import
fi.codecrew.moya.enums.TournamentStatus
;
import
fi.codecrew.moya.enums.TournamentStatus
;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.GameID
;
import
fi.codecrew.moya.model.GameID
;
import
fi.codecrew.moya.model.GameID_
;
import
fi.codecrew.moya.model.LanEvent
;
import
fi.codecrew.moya.model.LanEvent
;
import
fi.codecrew.moya.model.Tournament
;
import
fi.codecrew.moya.model.Tournament
;
import
fi.codecrew.moya.model.TournamentGame
;
import
fi.codecrew.moya.model.TournamentParticipant
;
import
fi.codecrew.moya.model.TournamentParticipant
;
import
fi.codecrew.moya.model.TournamentRule
;
import
fi.codecrew.moya.model.TournamentRule_
;
import
fi.codecrew.moya.model.Tournament_
;
import
fi.codecrew.moya.model.Tournament_
;
import
fi.codecrew.moya.model.User
;
import
fi.codecrew.moya.model.User
;
import
fi.codecrew.moya.model.User_
;
import
fi.codecrew.moya.model.User_
;
...
@@ -25,6 +29,20 @@ import fi.codecrew.moya.model.User_;
...
@@ -25,6 +29,20 @@ import fi.codecrew.moya.model.User_;
public
class
GameIDFacade
extends
IntegerPkGenericFacade
<
GameID
>
{
public
class
GameIDFacade
extends
IntegerPkGenericFacade
<
GameID
>
{
public
GameIDFacade
()
{
public
GameIDFacade
()
{
super
(
GameID
.
class
);
super
(
GameID
.
class
);
}
public
GameID
getGameIDByGame
(
TournamentGame
tg
,
EventUser
user
)
{
// TODO Auto-generated method stub
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
GameID
>
cq
=
cb
.
createQuery
(
GameID
.
class
);
Root
<
GameID
>
root
=
cq
.
from
(
GameID
.
class
);
cq
.
where
(
cb
.
and
(
cb
.
equal
(
root
.
get
(
GameID_
.
game
),
tg
),
cb
.
equal
(
root
.
get
(
GameID_
.
eventUser
),
user
)));
try
{
return
getEm
().
createQuery
(
cq
).
getSingleResult
();
}
catch
(
Exception
e
)
{
return
null
;
}
}
}
}
}
code/MoyaBeansClient/ejbModule/fi/codecrew/moya/beans/UserBeanLocal.java
View file @
6dcac4e
...
@@ -8,6 +8,7 @@ import javax.ejb.Local;
...
@@ -8,6 +8,7 @@ import javax.ejb.Local;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.Feedback
;
import
fi.codecrew.moya.model.Feedback
;
import
fi.codecrew.moya.model.GameID
;
import
fi.codecrew.moya.model.GroupMembership
;
import
fi.codecrew.moya.model.GroupMembership
;
import
fi.codecrew.moya.model.Role
;
import
fi.codecrew.moya.model.Role
;
import
fi.codecrew.moya.model.TournamentGame
;
import
fi.codecrew.moya.model.TournamentGame
;
...
@@ -96,4 +97,6 @@ public interface UserBeanLocal {
...
@@ -96,4 +97,6 @@ public interface UserBeanLocal {
void
removeGameIdById
(
Integer
gameIdId
);
void
removeGameIdById
(
Integer
gameIdId
);
GameID
getGameIDByGameAndUser
(
TournamentGame
tg
,
EventUser
user
);
}
}
code/MoyaWeb/WebContent/tournaments/admin/view_tournament_single.xhtml
View file @
6dcac4e
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['tournament.participant_gameid']}"
/>
<h:outputText
value=
"#{i18n['tournament.participant_gameid']}"
/>
</f:facet>
</f:facet>
<h:outputText
value=
"
derp
"
/>
<h:outputText
value=
"
#{tournamentParticipantsView.eventUserGameID[participant.participator.id]}
"
/>
</p:column>
</p:column>
</p:dataTable>
</p:dataTable>
</h:form>
</h:form>
...
...
code/MoyaWeb/WebContent/tournaments/admin/view_tournament_team.xhtml
View file @
6dcac4e
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
<ui:repeat
var=
"member"
value=
"#{participant.teamMembers}"
>
<ui:repeat
var=
"member"
value=
"#{participant.teamMembers}"
>
<li>
<li>
<h:outputText
value=
"#{member.eventUser.nick}"
/>
<h:outputText
value=
"#{member.eventUser.nick}"
/>
(
<h:outputText
value=
"
GAMEID
"
/>
)
(
<h:outputText
value=
"
#{tournamentParticipantsView.eventUserGameID[member.eventUser.id]}
"
/>
)
</li>
</li>
</ui:repeat>
</ui:repeat>
</ul>
</ul>
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_en.properties
View file @
6dcac4e
...
@@ -936,6 +936,7 @@ submenu.user.changePassword = Change password
...
@@ -936,6 +936,7 @@ submenu.user.changePassword = Change password
submenu.user.create
=
Create new user
submenu.user.create
=
Create new user
submenu.user.edit
=
My information
submenu.user.edit
=
My information
submenu.user.foodwave
=
Food
submenu.user.foodwave
=
Food
submenu.user.gameids
=
Set GameIDs
submenu.user.invite
=
Invite friends
submenu.user.invite
=
Invite friends
submenu.user.manageuserlinks
=
Manage users
submenu.user.manageuserlinks
=
Manage users
submenu.user.other
=
Other
submenu.user.other
=
Other
...
@@ -1010,6 +1011,7 @@ topnavi.usermgmt = Users
...
@@ -1010,6 +1011,7 @@ topnavi.usermgmt = Users
topnavi.userplaces
=
Computer Places
topnavi.userplaces
=
Computer Places
topnavi.usershop
=
Shop
topnavi.usershop
=
Shop
tournament.admin.back_to_index
=
Back to tournament administration
tournament.admin.control
=
Control
tournament.admin.control
=
Control
tournament.admin.create
=
Create new tournament
tournament.admin.create
=
Create new tournament
tournament.admin.delete
=
Delete
tournament.admin.delete
=
Delete
...
@@ -1028,6 +1030,7 @@ tournament.fillamount = Places taken
...
@@ -1028,6 +1030,7 @@ 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_captain
=
Captain
tournament.participant_gameid
=
Game-ID
tournament.participant_gameid
=
Game-ID
tournament.participant_nick
=
Nickname
tournament.participant_nick
=
Nickname
tournament.participants
=
Participants
tournament.participants
=
Participants
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_fi.properties
View file @
6dcac4e
...
@@ -919,6 +919,7 @@ submenu.user.create = Luo k\u00E4ytt\u00E4j\u00E4
...
@@ -919,6 +919,7 @@ submenu.user.create = Luo k\u00E4ytt\u00E4j\u00E4
submenu.user.createCardTemplate
=
Luo korttiryhm
\u
00E4
submenu.user.createCardTemplate
=
Luo korttiryhm
\u
00E4
submenu.user.edit
=
Omat tiedot
submenu.user.edit
=
Omat tiedot
submenu.user.foodwave
=
Ruoka
submenu.user.foodwave
=
Ruoka
submenu.user.gameids
=
Aseta Peli-IDt
submenu.user.invite
=
Kutsu yst
\u
00E4vi
\u
00E4
submenu.user.invite
=
Kutsu yst
\u
00E4vi
\u
00E4
submenu.user.list
=
Kaikki k
\u
00E4ytt
\u
00E4j
\u
00E4t
submenu.user.list
=
Kaikki k
\u
00E4ytt
\u
00E4j
\u
00E4t
submenu.user.listCardTemplates
=
Korttiryhm
\u
00E4t
submenu.user.listCardTemplates
=
Korttiryhm
\u
00E4t
...
@@ -995,6 +996,7 @@ topnavi.usermgmt = K\u00E4ytt\u00E4j\u00E4t
...
@@ -995,6 +996,7 @@ topnavi.usermgmt = K\u00E4ytt\u00E4j\u00E4t
topnavi.userplaces
=
Konepaikat
topnavi.userplaces
=
Konepaikat
topnavi.usershop
=
Kauppa
topnavi.usershop
=
Kauppa
tournament.admin.back_to_index
=
Takaisin turnauksen yll
\u
00E4pitosivulle
tournament.admin.control
=
Hallitse
tournament.admin.control
=
Hallitse
tournament.admin.create
=
Luo uusi turnaus
tournament.admin.create
=
Luo uusi turnaus
tournament.admin.delete
=
Poista
tournament.admin.delete
=
Poista
...
@@ -1013,6 +1015,7 @@ tournament.fillamount = Osallistujaa i
...
@@ -1013,6 +1015,7 @@ tournament.fillamount = Osallistujaa i
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_captain
=
Kapteeni
tournament.participant_gameid
=
Peli-ID
tournament.participant_gameid
=
Peli-ID
tournament.participant_nick
=
Nimimerkki
tournament.participant_nick
=
Nimimerkki
tournament.participants
=
Osallistujat
tournament.participants
=
Osallistujat
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/tournaments/TournamentParticipantsView.java
View file @
6dcac4e
package
fi
.
codecrew
.
moya
.
web
.
cdiview
.
tournaments
;
package
fi
.
codecrew
.
moya
.
web
.
cdiview
.
tournaments
;
import
java.util.HashMap
;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.ConversationScoped
;
import
javax.enterprise.context.ConversationScoped
;
import
javax.inject.Named
;
import
javax.inject.Named
;
import
fi.codecrew.moya.beans.TournamentBeanLocal
;
import
fi.codecrew.moya.beans.TournamentBeanLocal
;
import
fi.codecrew.moya.beans.UserBeanLocal
;
import
fi.codecrew.moya.model.GameID
;
import
fi.codecrew.moya.model.Tournament
;
import
fi.codecrew.moya.model.Tournament
;
import
fi.codecrew.moya.model.TournamentParticipant
;
import
fi.codecrew.moya.model.TournamentTeamMember
;
import
fi.codecrew.moya.web.cdiview.GenericCDIView
;
import
fi.codecrew.moya.web.cdiview.GenericCDIView
;
@Named
@Named
...
@@ -13,12 +19,27 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView;
...
@@ -13,12 +19,27 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView;
public
class
TournamentParticipantsView
extends
GenericCDIView
{
public
class
TournamentParticipantsView
extends
GenericCDIView
{
private
static
final
long
serialVersionUID
=
-
6066216858686165211L
;
private
static
final
long
serialVersionUID
=
-
6066216858686165211L
;
private
HashMap
<
Integer
,
String
>
eventUserGameID
=
null
;
@EJB
private
UserBeanLocal
userBean
;
@EJB
private
TournamentBeanLocal
tournamentBean
;
@EJB
private
TournamentBeanLocal
tournamentBean
;
private
Tournament
tournament
=
null
;
private
Tournament
tournament
=
null
;
public
String
showView
(
Integer
tournamentId
)
{
public
String
showView
(
Integer
tournamentId
)
{
this
.
beginConversation
();
if
(
eventUserGameID
==
null
)
{
this
.
setTournament
(
tournamentBean
.
getTournamentById
(
tournamentId
));
this
.
setTournament
(
tournamentBean
.
getTournamentById
(
tournamentId
));
this
.
beginConversation
();
eventUserGameID
=
new
HashMap
<
Integer
,
String
>();
for
(
TournamentParticipant
tp
:
tournament
.
getParticipants
())
{
for
(
TournamentTeamMember
ttm
:
tp
.
getTeamMembers
())
{
GameID
gid
=
userBean
.
getGameIDByGameAndUser
(
tournament
.
getTournamentGame
(),
ttm
.
getEventUser
());
if
(
gid
!=
null
)
eventUserGameID
.
put
(
ttm
.
getEventUser
().
getId
(),
gid
.
getIdentifier
());
else
eventUserGameID
.
put
(
ttm
.
getEventUser
().
getId
(),
"n/a"
);
}
}
}
if
(
this
.
tournament
.
getPlayersPerTeam
()
==
1
)
if
(
this
.
tournament
.
getPlayersPerTeam
()
==
1
)
return
"/tournaments/admin/view_tournament_single.xhtml"
;
return
"/tournaments/admin/view_tournament_single.xhtml"
;
else
else
...
@@ -38,5 +59,11 @@ public class TournamentParticipantsView extends GenericCDIView {
...
@@ -38,5 +59,11 @@ public class TournamentParticipantsView extends GenericCDIView {
this
.
tournament
=
tournament
;
this
.
tournament
=
tournament
;
}
}
public
HashMap
<
Integer
,
String
>
getEventUserGameID
()
{
return
eventUserGameID
;
}
public
void
setEventUserGameID
(
HashMap
<
Integer
,
String
>
eventUserGameID
)
{
this
.
eventUserGameID
=
eventUserGameID
;
}
}
}
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/user/UserGameIDView.java
View file @
6dcac4e
package
fi
.
codecrew
.
moya
.
web
.
cdiview
.
user
;
package
fi
.
codecrew
.
moya
.
web
.
cdiview
.
user
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
...
...
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