Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
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 6d438f93
authored
Oct 23, 2013
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'devel' into tabmenu
2 parents
fe0fc79a
b2317e5d
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
317 additions
and
58 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/CardPrintBean.java
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/MoyaWeb/WebContent/resources/cditools/user/usertabs.xhtml
code/MoyaWeb/WebContent/tournaments/admin/view_tournament_single.xhtml
code/MoyaWeb/WebContent/tournaments/admin/view_tournament_team.xhtml
code/MoyaWeb/WebContent/tournaments/index.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/CardPrintBean.java
View file @
6d438f9
...
@@ -129,11 +129,9 @@ public class CardPrintBean implements CardPrintBeanLocal {
...
@@ -129,11 +129,9 @@ public class CardPrintBean implements CardPrintBeanLocal {
CardTemplate
cardTemplate
=
printedCard
.
getTemplate
();
CardTemplate
cardTemplate
=
printedCard
.
getTemplate
();
BufferedImage
cardBackground
=
ImageIO
.
read
(
new
ByteArrayInputStream
(
BufferedImage
cardBackground
=
ImageIO
.
read
(
new
ByteArrayInputStream
(
cardTemplate
.
getImage
()));
cardTemplate
.
getImage
()));
BufferedImage
faceBufferedImage
=
ImageIO
BufferedImage
faceBufferedImage
=
ImageIO
.
read
(
new
ByteArrayInputStream
(
user
.
getCurrentImage
().
getImageData
()));
.
read
(
new
ByteArrayInputStream
(
user
.
getCurrentImage
().
getImageData
()));
/*
/*
* if (faceBufferedImage.getWidth() > 1024 ||
* if (faceBufferedImage.getWidth() > 1024 ||
...
@@ -141,6 +139,7 @@ public class CardPrintBean implements CardPrintBeanLocal {
...
@@ -141,6 +139,7 @@ public class CardPrintBean implements CardPrintBeanLocal {
* Exception("Image dimensions too large, please take/upload smaller!"
* Exception("Image dimensions too large, please take/upload smaller!"
* ); }
* ); }
*/
*/
// force image aspect ratio.
int
originalWidth
=
faceBufferedImage
.
getWidth
();
int
originalWidth
=
faceBufferedImage
.
getWidth
();
int
originalHeight
=
faceBufferedImage
.
getHeight
();
int
originalHeight
=
faceBufferedImage
.
getHeight
();
...
@@ -160,16 +159,14 @@ public class CardPrintBean implements CardPrintBeanLocal {
...
@@ -160,16 +159,14 @@ public class CardPrintBean implements CardPrintBeanLocal {
Page
page
=
new
Page
(
pdf
,
new
float
[]
{
pagex
,
pagey
});
Page
page
=
new
Page
(
pdf
,
new
float
[]
{
pagex
,
pagey
});
// Render background image
// Render background image
Image
templateImage
=
new
Image
(
pdf
,
Image
templateImage
=
new
Image
(
pdf
,
convertBufferedImageToPng
(
cardBackground
),
ImageType
.
PNG
);
convertBufferedImageToPng
(
cardBackground
),
ImageType
.
PNG
);
templateImage
.
setPosition
(
0
,
0
);
templateImage
.
setPosition
(
0
,
0
);
templateImage
.
scaleBy
(
0.245
);
templateImage
.
scaleBy
(
0.245
);
templateImage
.
drawOn
(
page
);
templateImage
.
drawOn
(
page
);
// Render face image
// Render face image
Image
faceImage
=
new
Image
(
pdf
,
Image
faceImage
=
new
Image
(
pdf
,
convertBufferedImageToPng
(
faceBufferedImage
),
ImageType
.
PNG
);
convertBufferedImageToPng
(
faceBufferedImage
),
ImageType
.
PNG
);
faceImage
.
setPosition
(
55
,
75
);
faceImage
.
setPosition
(
15.5
,
67
);
//faceImage.setPosition(175, 222);
//faceImage.setPosition(175, 222);
// faceImage.scaleBy(0.32);
// faceImage.scaleBy(0.32);
faceImage
.
scaleBy
(((
410.0
*
0.245
)
/
faceImage
.
getHeight
()));
faceImage
.
scaleBy
(((
410.0
*
0.245
)
/
faceImage
.
getHeight
()));
...
@@ -178,14 +175,15 @@ public class CardPrintBean implements CardPrintBeanLocal {
...
@@ -178,14 +175,15 @@ public class CardPrintBean implements CardPrintBeanLocal {
// Render texts
// Render texts
// Big font for nick
// Big font for nick
com
.
pdfjet
.
Font
nickFont
=
new
com
.
pdfjet
.
Font
(
pdf
,
CoreFont
.
HELVETICA
);
com
.
pdfjet
.
Font
nickFont
=
new
com
.
pdfjet
.
Font
(
pdf
,
CoreFont
.
HELVETICA
);
nickFont
.
setSize
(
1
6
.0
);
nickFont
.
setSize
(
1
7
.0
);
int
[]
white
=
new
int
[]
{
255
,
255
,
255
};
// User nick text
// User nick text
TextLine
nickTextLine
=
new
TextLine
(
nickFont
);
TextLine
nickTextLine
=
new
TextLine
(
nickFont
);
nickTextLine
.
setText
(
user
.
getUser
().
getNick
());
nickTextLine
.
setText
(
user
.
getUser
().
getNick
());
nickTextLine
.
setPosition
(
1
9.0
,
193
.0
);
nickTextLine
.
setPosition
(
1
7.0
,
195
.0
);
nickTextLine
.
setColor
(
new
int
[]
{
1
,
1
,
1
}
);
nickTextLine
.
setColor
(
white
);
nickTextLine
.
drawOn
(
page
);
nickTextLine
.
drawOn
(
page
);
// Smaller font
// Smaller font
...
@@ -193,19 +191,18 @@ public class CardPrintBean implements CardPrintBeanLocal {
...
@@ -193,19 +191,18 @@ public class CardPrintBean implements CardPrintBeanLocal {
font
.
setSize
(
10.0
);
font
.
setSize
(
10.0
);
// Full name text
// Full name text
String
wholeName
=
user
.
getUser
().
getFirstnames
()
+
" "
String
wholeName
=
user
.
getUser
().
getFirstnames
()
+
" "
+
user
.
getUser
().
getLastname
();
+
user
.
getUser
().
getLastname
();
TextLine
wholeNameText
=
new
TextLine
(
font
);
TextLine
wholeNameText
=
new
TextLine
(
font
);
wholeNameText
.
setText
(
wholeName
);
wholeNameText
.
setText
(
wholeName
);
wholeNameText
.
setPosition
(
17.0
,
21
2
.0
);
wholeNameText
.
setPosition
(
17.0
,
21
1
.0
);
wholeNameText
.
setColor
(
new
int
[]
{
1
,
1
,
1
}
);
wholeNameText
.
setColor
(
white
);
wholeNameText
.
drawOn
(
page
);
wholeNameText
.
drawOn
(
page
);
// Role text
// Role text
TextLine
roleTextLine
=
new
TextLine
(
font
);
TextLine
roleTextLine
=
new
TextLine
(
font
);
roleTextLine
.
setText
(
cardTemplate
.
getName
());
roleTextLine
.
setText
(
cardTemplate
.
getName
());
roleTextLine
.
setPosition
(
17.0
,
22
3
.0
);
roleTextLine
.
setPosition
(
17.0
,
22
4
.0
);
roleTextLine
.
setColor
(
new
int
[]
{
1
,
1
,
1
}
);
roleTextLine
.
setColor
(
white
);
roleTextLine
.
drawOn
(
page
);
roleTextLine
.
drawOn
(
page
);
// Barcode
// Barcode
...
@@ -215,12 +212,13 @@ public class CardPrintBean implements CardPrintBeanLocal {
...
@@ -215,12 +212,13 @@ public class CardPrintBean implements CardPrintBeanLocal {
// barcodeString = barcodeString.substring(barcodeString.length() -
// barcodeString = barcodeString.substring(barcodeString.length() -
// 12);
// 12);
BufferedImage
barCodeBufferedImage
=
ImageIO
.
read
(
barcodeBean
.
getCardBarcode
(
printedCard
));
// No barcode in insomnia..
Image
barCodeImage
=
new
Image
(
pdf
,
convertBufferedImageToPng
(
barCodeBufferedImage
),
ImageType
.
PNG
);
/* BufferedImage barCodeBufferedImage = ImageIO.read(barcodeBean.getCardBarcode(printedCard));
barCodeImage
.
setPosition
(
0.0
,
230
);
// 243.5);
Image barCodeImage = new Image(pdf, convertBufferedImageToPng(barCodeBufferedImage), ImageType.PNG);
barCodeImage
.
scaleBy
(
0.7
);
barCodeImage.setPosition(0.0, 230);// 243.5);
barCodeImage
.
drawOn
(
page
);
barCodeImage.scaleBy(0.7);
barCodeImage.drawOn(page);
*/
mpr
.
getAffectedUsers
().
add
(
user
);
mpr
.
getAffectedUsers
().
add
(
user
);
}
}
pdf
.
flush
();
pdf
.
flush
();
...
@@ -254,24 +252,27 @@ public class CardPrintBean implements CardPrintBeanLocal {
...
@@ -254,24 +252,27 @@ public class CardPrintBean implements CardPrintBeanLocal {
g
.
drawImage
(
base
,
0
,
0
,
base
.
getWidth
(),
base
.
getHeight
(),
null
);
g
.
drawImage
(
base
,
0
,
0
,
base
.
getWidth
(),
base
.
getHeight
(),
null
);
// g.drawImage(face, AffineTransform.getScaleInstance(0.31, 0.31),
// g.drawImage(face, AffineTransform.getScaleInstance(0.31, 0.31),
// null);
// null);
g
.
drawImage
(
face
,
174
,
237
,
301
,
410
,
null
);
g
.
drawImage
(
face
,
250
,
300
,
301
,
410
,
null
);
g
.
setFont
(
new
Font
(
"Century gothic"
,
Font
.
PLAIN
,
70
));
Font
nickfont
=
new
Font
(
"Century gothic"
,
Font
.
BOLD
,
65
);
Font
font
=
new
Font
(
"Century gothic"
,
Font
.
PLAIN
,
70
);
Font
font
=
new
Font
(
"Century gothic"
,
Font
.
BOLD
,
45
);
int
nickWidth
=
g
.
getFontMetrics
(
font
).
stringWidth
(
user
.
getUser
().
getNick
());
int
nickX
=
(
646
/
2
)
-
(
nickWidth
/
2
);
//int nickWidth = g.getFontMetrics(font).stringWidth(user.getUser().getNick());
int
nickY
=
750
;
//int nickX = (646 / 2) - (nickWidth / 2);
int
nickX
=
60
;
int
nickY
=
800
;
//Color transparentWhite = new Color(255, 255, 255, 140);
//Color transparentWhite = new Color(255, 255, 255, 140);
//g.setColor(transparentWhite);
//g.setColor(transparentWhite);
//g.fillRect(nickX - 20, nickY - 50, nickWidth + 40, 50);
//g.fillRect(nickX - 20, nickY - 50, nickWidth + 40, 50);
g
.
setColor
(
Color
.
black
);
g
.
setColor
(
Color
.
white
);
g
.
setFont
(
font
);
g
.
setFont
(
nick
font
);
g
.
drawString
(
user
.
getUser
().
getNick
(),
nickX
,
nickY
);
g
.
drawString
(
user
.
getUser
().
getNick
(),
nickX
,
nickY
);
g
.
setFont
(
new
Font
(
"Century gothic"
,
Font
.
BOLD
,
45
)
);
g
.
setFont
(
font
);
StringBuilder
wholeName
=
new
StringBuilder
();
StringBuilder
wholeName
=
new
StringBuilder
();
wholeName
.
append
(
user
.
getUser
().
getFirstnames
()).
append
(
" "
).
append
(
user
.
getUser
().
getLastname
());
wholeName
.
append
(
user
.
getUser
().
getFirstnames
()).
append
(
" "
).
append
(
user
.
getUser
().
getLastname
());
...
@@ -284,25 +285,26 @@ public class CardPrintBean implements CardPrintBeanLocal {
...
@@ -284,25 +285,26 @@ public class CardPrintBean implements CardPrintBeanLocal {
// g.drawString(owner.getId().toString(), 60, 948);
// g.drawString(owner.getId().toString(), 60, 948);
g
.
setFont
(
new
Font
(
"Century gothic"
,
Font
.
BOLD
,
40
));
g
.
setFont
(
new
Font
(
"Century gothic"
,
Font
.
BOLD
,
40
));
g
.
drawString
(
wholeName
.
toString
(),
60
,
950
);
g
.
drawString
(
wholeName
.
toString
(),
60
,
865
);
//
g.drawString(card.getTemplate().getName(), 60, 915);
g
.
drawString
(
card
.
getTemplate
().
getName
(),
60
,
915
);
PrintedCard
printedCard
=
cardTemplateBean
.
checkPrintedCard
(
user
);
//g.drawString(card.getTemplate().getName(), 60, 915);
g
.
setFont
(
new
Font
(
"Century gothic"
,
Font
.
PLAIN
,
30
));
g
.
setColor
(
Color
.
white
);
BufferedImage
barCodeBufferedImage
=
null
;
if
(
printedCard
!=
null
)
{
int
barcodeX
=
(
base
.
getWidth
()
-
400
)
/
2
;
int
barcodeY
=
base
.
getHeight
()
-
50
;
g
.
drawString
(
barcodeBean
.
getVrAuthCodeForCard
(
printedCard
),
445
,
905
);
barCodeBufferedImage
=
ImageIO
.
read
(
barcodeBean
.
getCardBarcode
(
printedCard
));
g
.
drawImage
(
barCodeBufferedImage
,
barcodeX
,
barcodeY
,
400
,
barCodeBufferedImage
.
getHeight
(),
null
);
g
.
setColor
(
Color
.
white
);
}
//PrintedCard printedCard = cardTemplateBean.checkPrintedCard(user);
/* Ei insomniassa
g.setFont(new Font("Century gothic", Font.PLAIN, 30));
g.setColor(Color.white);
BufferedImage barCodeBufferedImage = null;
if (printedCard != null) {
int barcodeX = (base.getWidth() - 400) / 2;
int barcodeY = base.getHeight() - 50;
g.drawString(barcodeBean.getVrAuthCodeForCard(printedCard), 445, 905);
barCodeBufferedImage = ImageIO.read(barcodeBean.getCardBarcode(printedCard));
g.drawImage(barCodeBufferedImage, barcodeX, barcodeY, 400, barCodeBufferedImage.getHeight(), null);
g.setColor(Color.white);
}
*/
g
.
fillRect
(
0
,
base
.
getHeight
()
-
20
,
base
.
getWidth
(),
base
.
getHeight
());
g
.
fillRect
(
0
,
base
.
getHeight
()
-
20
,
base
.
getWidth
(),
base
.
getHeight
());
g
.
dispose
();
g
.
dispose
();
...
...
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/TournamentBean.java
View file @
6d438f9
...
@@ -98,8 +98,14 @@ public class TournamentBean implements TournamentBeanLocal {
...
@@ -98,8 +98,14 @@ public class TournamentBean implements TournamentBeanLocal {
@Override
@Override
@RolesAllowed
(
TournamentPermission
.
S_VIEW
)
@RolesAllowed
(
TournamentPermission
.
S_VIEW
)
public
List
<
Tournament
>
getTournamentsInStatus
(
TournamentStatus
status
,
boolean
useTimeConstraints
)
{
public
List
<
Tournament
>
getTournamentsInStatus
(
TournamentStatus
status
,
boolean
useTimeConstraints
,
boolean
invertMatch
)
{
return
tournamentFacade
.
getTournamentsInStatusWithParticipationTimeIn
(
status
,
eventBean
.
getCurrentEvent
());
if
(
useTimeConstraints
)
if
(!
invertMatch
)
return
tournamentFacade
.
getTournamentsInStatusWithParticipationTimeIn
(
status
,
eventBean
.
getCurrentEvent
());
else
return
tournamentFacade
.
getTournamentsInStatusWithParticipationTimeNotIn
(
status
,
eventBean
.
getCurrentEvent
());
else
return
tournamentFacade
.
getTournamentsInStatus
(
status
,
eventBean
.
getCurrentEvent
());
}
}
@Override
@Override
...
...
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentFacade.java
View file @
6d438f9
...
@@ -68,6 +68,23 @@ public class TournamentFacade extends IntegerPkGenericFacade<Tournament> {
...
@@ -68,6 +68,23 @@ public class TournamentFacade extends IntegerPkGenericFacade<Tournament> {
return
getEm
().
createQuery
(
cq
).
getResultList
();
return
getEm
().
createQuery
(
cq
).
getResultList
();
}
}
public
List
<
Tournament
>
getTournamentsInStatusWithParticipationTimeNotIn
(
TournamentStatus
status
,
LanEvent
event
)
{
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
.
equal
(
root
.
get
(
Tournament_
.
lanEvent
),
event
),
cb
.
not
(
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 @
6d438f9
...
@@ -28,6 +28,7 @@ public interface TournamentBeanLocal {
...
@@ -28,6 +28,7 @@ public interface TournamentBeanLocal {
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
);
List
<
Tournament
>
getTournamentsInStatus
(
TournamentStatus
status
,
boolean
useTimeConstraints
,
boolean
invertMatch
);
}
}
code/MoyaWeb/WebContent/resources/cditools/user/usertabs.xhtml
View file @
6d438f9
...
@@ -47,6 +47,7 @@
...
@@ -47,6 +47,7 @@
</ul>
</ul>
</div>
</div>
<div
style=
"clear: both;"
>
</div>
</composite:implementation>
</composite:implementation>
</html>
</html>
code/MoyaWeb/WebContent/tournaments/admin/view_tournament_single.xhtml
View file @
6d438f9
...
@@ -24,6 +24,12 @@
...
@@ -24,6 +24,12 @@
</f:facet>
</f:facet>
<h:outputText
value=
"#{tournamentParticipantsView.eventUserGameID[participant.participator.id]}"
/>
<h:outputText
value=
"#{tournamentParticipantsView.eventUserGameID[participant.participator.id]}"
/>
</p:column>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['tournament.participant_email']}"
/>
</f:facet>
<h:outputText
value=
"#{participant.participator.email}"
/>
</p:column>
</p:dataTable>
</p:dataTable>
</h:form>
</h:form>
...
...
code/MoyaWeb/WebContent/tournaments/admin/view_tournament_team.xhtml
View file @
6d438f9
...
@@ -35,8 +35,15 @@
...
@@ -35,8 +35,15 @@
<ul>
<ul>
<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=
"#{tournamentParticipantsView.eventUserGameID[member.eventUser.id]}"
/>
)
<ul>
<li>
<h:outputText
value=
"#{tournamentParticipantsView.eventUserGameID[member.eventUser.id]}"
/>
</li>
<li>
<h:outputText
value=
"#{member.eventUser.email}"
/>
</li>
</ul>
</li>
</li>
</ui:repeat>
</ui:repeat>
</ul>
</ul>
...
...
code/MoyaWeb/WebContent/tournaments/index.xhtml
View file @
6d438f9
...
@@ -94,6 +94,213 @@
...
@@ -94,6 +94,213 @@
</h:panelGrid>
</h:panelGrid>
</p:rowExpansion>
</p:rowExpansion>
</p:dataTable>
</p:dataTable>
<h2>
#{i18n['tournaments.setup_closed_tournaments']}
</h2>
<p:dataTable
value=
"#{tournamentListView.setupClosedPhaseTournaments}"
var=
"tournament"
>
<p:column
style=
"width:2%"
>
<p:rowToggler
/>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['tournament.name']}"
/>
</f:facet>
<h:outputText
value=
"#{tournament.tournamentName}"
/>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['tournament.game']}"
/>
</f:facet>
<h:outputText
value=
"#{tournament.tournamentGame.name}"
/>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['tournament.status']}"
/>
</f:facet>
<h:outputText
value=
"#{i18n[tournament.tournamentStatus.i18nKey]}"
/>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['tournament.type']}"
/>
</f:facet>
<h:outputText
value=
"#{i18n[tournament.tournamentType.i18nKey]}"
/>
</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.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.rules']}"
/>
</f:facet>
<h:link
value=
"#{tournament.rules.name}"
outcome=
"/tournaments/showrules.xhtml"
>
<f:param
name=
"tournament_id"
value=
"#{tournament.id}"
/>
</h:link>
</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>
<h2>
#{i18n['tournaments.in_progress_tournaments']}
</h2>
<p:dataTable
value=
"#{tournamentListView.inProgressTournaments}"
var=
"tournament"
>
<p:column
style=
"width:2%"
>
<p:rowToggler
/>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['tournament.name']}"
/>
</f:facet>
<h:outputText
value=
"#{tournament.tournamentName}"
/>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['tournament.game']}"
/>
</f:facet>
<h:outputText
value=
"#{tournament.tournamentGame.name}"
/>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['tournament.status']}"
/>
</f:facet>
<h:outputText
value=
"#{i18n[tournament.tournamentStatus.i18nKey]}"
/>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['tournament.type']}"
/>
</f:facet>
<h:outputText
value=
"#{i18n[tournament.tournamentType.i18nKey]}"
/>
</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.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.rules']}"
/>
</f:facet>
<h:link
value=
"#{tournament.rules.name}"
outcome=
"/tournaments/showrules.xhtml"
>
<f:param
name=
"tournament_id"
value=
"#{tournament.id}"
/>
</h:link>
</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>
<h2>
#{i18n['tournaments.completed_tournaments']}
</h2>
<p:dataTable
value=
"#{tournamentListView.completedTournaments}"
var=
"tournament"
>
<p:column
style=
"width:2%"
>
<p:rowToggler
/>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['tournament.name']}"
/>
</f:facet>
<h:outputText
value=
"#{tournament.tournamentName}"
/>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['tournament.game']}"
/>
</f:facet>
<h:outputText
value=
"#{tournament.tournamentGame.name}"
/>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['tournament.status']}"
/>
</f:facet>
<h:outputText
value=
"#{i18n[tournament.tournamentStatus.i18nKey]}"
/>
</p:column>
<p:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['tournament.type']}"
/>
</f:facet>
<h:outputText
value=
"#{i18n[tournament.tournamentType.i18nKey]}"
/>
</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.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.rules']}"
/>
</f:facet>
<h:link
value=
"#{tournament.rules.name}"
outcome=
"/tournaments/showrules.xhtml"
>
<f:param
name=
"tournament_id"
value=
"#{tournament.id}"
/>
</h:link>
</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>
</h:form>
</h:form>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_en.properties
View file @
6d438f9
...
@@ -1032,6 +1032,7 @@ tournament.game = Game
...
@@ -1032,6 +1032,7 @@ 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_captain
=
Captain
tournament.participant_email
=
Participant E-Mail
tournament.participant_gameid
=
Game-ID
tournament.participant_gameid
=
Game-ID
tournament.participant_nick
=
Nickname
tournament.participant_nick
=
Nickname
tournament.participants
=
Participants
tournament.participants
=
Participants
...
@@ -1082,7 +1083,9 @@ tournaments.admin.view_tournament_title = View tournamen
...
@@ -1082,7 +1083,9 @@ tournaments.admin.view_tournament_title = View tournamen
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
tournaments.completed_tournaments
=
Completed tournaments
tournaments.description
=
You can view & participate into tournaments from this page.
tournaments.description
=
You can view & participate into tournaments from this page.
tournaments.in_progress_tournaments
=
In progress
tournaments.max_participants
=
Max participants
tournaments.max_participants
=
Max participants
tournaments.menutitle
=
Tournaments
tournaments.menutitle
=
Tournaments
tournaments.open_tournaments
=
Open tournaments
tournaments.open_tournaments
=
Open tournaments
...
@@ -1103,6 +1106,7 @@ tournaments.registration_opens = Set registrati
...
@@ -1103,6 +1106,7 @@ tournaments.registration_opens = Set registrati
tournaments.ruleset_description
=
Ruleset description
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.setup_closed_tournaments
=
Participation closed
tournaments.start_time
=
Start Time
tournaments.start_time
=
Start Time
tournaments.team_details
=
Team Details
tournaments.team_details
=
Team Details
tournaments.title
=
Tournaments
tournaments.title
=
Tournaments
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_fi.properties
View file @
6d438f9
...
@@ -1017,6 +1017,7 @@ tournament.game = Peli
...
@@ -1017,6 +1017,7 @@ 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_captain
=
Kapteeni
tournament.participant_email
=
Osallistujan s
\u
00E4hk
\u
00F6posti
tournament.participant_gameid
=
Peli-ID
tournament.participant_gameid
=
Peli-ID
tournament.participant_nick
=
Nimimerkki
tournament.participant_nick
=
Nimimerkki
tournament.participants
=
Osallistujat
tournament.participants
=
Osallistujat
...
@@ -1067,7 +1068,9 @@ tournaments.admin.view_tournament_title = Tarkastele tur
...
@@ -1067,7 +1068,9 @@ tournaments.admin.view_tournament_title = Tarkastele tur
tournaments.back_to_tournament_list
=
Takaisin turnauslistaukseen
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.completed_tournaments
=
Menneet turnaukset
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.
tournaments.in_progress_tournaments
=
K
\u
00E4ynniss
\u
00E4
tournaments.max_participants
=
Maksimiosallistujam
\u
00E4
\u
00E4r
\u
00E4
tournaments.max_participants
=
Maksimiosallistujam
\u
00E4
\u
00E4r
\u
00E4
tournaments.menutitle
=
Turnaukset
tournaments.menutitle
=
Turnaukset
tournaments.open_tournaments
=
Avoimet turnaukset
tournaments.open_tournaments
=
Avoimet turnaukset
...
@@ -1088,6 +1091,7 @@ tournaments.registration_opens = Rekister\u00F6
...
@@ -1088,6 +1091,7 @@ tournaments.registration_opens = Rekister\u00F6
tournaments.ruleset_description
=
S
\u
00E4
\u
00E4nn
\u
00F6st
\u
00F6n kuvaus
tournaments.ruleset_description
=
S
\u
00E4
\u
00E4nn
\u
00F6st
\u
00F6n kuvaus
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.setup_closed_tournaments
=
Ilmoittautuminen suljettu
tournaments.start_time
=
Aloitusaika
tournaments.start_time
=
Aloitusaika
tournaments.team_details
=
Joukkuekohtaiset tiedot
tournaments.team_details
=
Joukkuekohtaiset tiedot
tournaments.title
=
Turnaukset
tournaments.title
=
Turnaukset
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/tournaments/TournamentListView.java
View file @
6d438f9
...
@@ -32,14 +32,18 @@ public class TournamentListView extends GenericCDIView {
...
@@ -32,14 +32,18 @@ public class TournamentListView extends GenericCDIView {
}
}
public
List
<
Tournament
>
getSetupPhaseTournaments
()
{
public
List
<
Tournament
>
getSetupPhaseTournaments
()
{
return
tournamentBean
.
getTournamentsInStatus
(
TournamentStatus
.
SETUP
,
true
);
return
tournamentBean
.
getTournamentsInStatus
(
TournamentStatus
.
SETUP
,
true
,
false
);
}
public
List
<
Tournament
>
getSetupClosedPhaseTournaments
()
{
return
tournamentBean
.
getTournamentsInStatus
(
TournamentStatus
.
SETUP
,
true
,
true
);
}
}
public
List
<
Tournament
>
getInProgressTournaments
()
{
public
List
<
Tournament
>
getInProgressTournaments
()
{
return
tournamentBean
.
getTournamentsInStatus
(
TournamentStatus
.
IN_PROGRESS
,
false
);
return
tournamentBean
.
getTournamentsInStatus
(
TournamentStatus
.
IN_PROGRESS
,
false
,
false
);
}
}
public
List
<
Tournament
>
getCompletedTournaments
()
{
public
List
<
Tournament
>
getCompletedTournaments
()
{
return
tournamentBean
.
getTournamentsInStatus
(
TournamentStatus
.
COMPLETED
,
false
);
return
tournamentBean
.
getTournamentsInStatus
(
TournamentStatus
.
COMPLETED
,
false
,
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