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 521247ce
authored
Aug 31, 2013
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'devel' of codecrew.fi:bortal into devel
2 parents
8b6bd034
49b442a1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
549 additions
and
77 deletions
code/MoyaAuthModule/.settings/org.eclipse.core.resources.prefs
code/MoyaAuthModuleClient/.settings/org.eclipse.core.resources.prefs
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/MenuBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/TournamentBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/MenuitemFacade.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentGameFacade.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentRuleFacade.java
code/MoyaBeansClient/ejbModule/fi/codecrew/moya/beans/TournamentBeanLocal.java
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentGame.java
code/MoyaWeb/WebContent/admin/incoming/printCard.xhtml
code/MoyaWeb/WebContent/eventorg/editEvent.xhtml
code/MoyaWeb/WebContent/license/manageCodes.xhtml
code/MoyaWeb/WebContent/tournaments/admin/createwizard.xhtml
code/MoyaWeb/WebContent/voting/admincompolist.xhtml
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n.properties
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/TournamentCreateView.java
code/MoyaWeb/src/fi/codecrew/moya/web/converter/TournamentGameConverter.java
code/MoyaWeb/src/fi/codecrew/moya/web/converter/TournamentRuleConverter.java
code/MoyaAuthModule/.settings/org.eclipse.core.resources.prefs
deleted
100644 → 0
View file @
8b6bd03
eclipse.preferences.version=1
encoding/<project>=UTF-8
code/MoyaAuthModuleClient/.settings/org.eclipse.core.resources.prefs
deleted
100644 → 0
View file @
8b6bd03
eclipse.preferences.version=1
encoding/<project>=UTF-8
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/MenuBean.java
View file @
521247c
...
...
@@ -79,7 +79,7 @@ public class MenuBean implements MenuBeanLocal {
usermenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/permissionDenied"
),
null
).
setVisible
(
false
);
usermenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/auth/login"
),
null
).
setVisible
(
false
);
usermenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/auth/loginError"
),
null
).
setVisible
(
false
);
//
usermenu.addPage(menuitemfacade.findOrCreate("/auth/logout"), null).setVisible(false); // disabled
//
usermenu.addPage(menuitemfacade.findOrCreate("/auth/logout"), null).setVisible(false); // disabled
usermenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/auth/logoutResponse"
),
null
).
setVisible
(
false
);
usermenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/auth/resetPassword"
),
null
).
setVisible
(
false
);
usermenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/auth/resetmailSent"
),
null
).
setVisible
(
false
);
...
...
@@ -153,7 +153,9 @@ public class MenuBean implements MenuBeanLocal {
adminroles
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/role/list"
),
UserPermission
.
READ_ROLES
);
adminroles
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/role/create"
),
UserPermission
.
WRITE_ROLES
);
adminroles
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/role/edit"
),
null
).
setVisible
(
false
);
adminroles
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/orgrole/list"
),
UserPermission
.
READ_ORGROLES
);
adminroles
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/orgrole/create"
),
UserPermission
.
WRITE_ORGROLES
);
MenuNavigation
adminEventCards
=
adminuser
.
addPage
(
null
,
null
);
adminEventCards
.
setKey
(
"subnavi.cards"
);
adminEventCards
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/useradmin/listCardTemplates"
),
UserPermission
.
READ_ROLES
);
...
...
@@ -198,8 +200,8 @@ public class MenuBean implements MenuBeanLocal {
MenuNavigation
mapnavi
=
adminPlaces
.
addPage
(
null
,
null
);
mapnavi
.
setKey
(
"topnavi.maps"
);
mapnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/map/list"
),
MapPermission
.
MANAGE_MAPS
);
mapnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/map/create"
),
MapPermission
.
MANAGE_MAPS
);
mapnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/map/list"
),
MapPermission
.
MANAGE_MAPS
);
mapnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/map/edit"
),
null
).
setVisible
(
false
);
...
...
@@ -218,6 +220,15 @@ public class MenuBean implements MenuBeanLocal {
lognavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/actionlog/messagelist"
),
UserPermission
.
VIEW_ALL
);
lognavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/actionlog/taskview"
),
UserPermission
.
VIEW_ALL
).
setVisible
(
false
);
MenuNavigation
compoMenu
=
adminevent
.
addPage
(
null
,
null
);
compoMenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/voting/admincompolist"
),
CompoPermission
.
VIEW_COMPOS
);
compoMenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/voting/create"
),
CompoPermission
.
MANAGE
);
MenuNavigation
gamenavi
=
adminevent
.
addPage
(
null
,
null
);
gamenavi
.
setKey
(
"topnavi.license"
);
gamenavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/license/manageCodes"
),
LicensePermission
.
MANAGE
);
adminevent
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/eventorg/list"
),
EventPermission
.
MANAGE_PROPERTIES
);
navifacade
.
create
(
adminmenu
);
...
...
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/TournamentBean.java
View file @
521247c
package
fi
.
codecrew
.
moya
.
beans
;
import
java.util.List
;
import
javax.ejb.EJB
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
fi.codecrew.moya.facade.TournamentGameFacade
;
import
fi.codecrew.moya.facade.TournamentRuleFacade
;
import
fi.codecrew.moya.model.Tournament
;
import
fi.codecrew.moya.model.TournamentGame
;
import
fi.codecrew.moya.model.TournamentRule
;
/**
* Session Bean implementation class TournamentBean
*/
...
...
@@ -10,11 +19,43 @@ import javax.ejb.Stateless;
@LocalBean
public
class
TournamentBean
implements
TournamentBeanLocal
{
@EJB
private
TournamentRuleFacade
tournamentRuleFacade
;
@EJB
private
TournamentGameFacade
tournamentGameFacade
;
/**
* Default constructor.
*/
public
TournamentBean
()
{
// TODO Auto-generated constructor stub
}
@Override
public
List
<
TournamentRule
>
getRulesByGame
(
TournamentGame
tg
)
{
return
tournamentRuleFacade
.
getRulesByGame
(
tg
);
}
@Override
public
List
<
TournamentGame
>
getGames
()
{
return
tournamentGameFacade
.
getGames
();
}
@Override
public
void
createGame
(
TournamentGame
tg
)
{
tournamentGameFacade
.
create
(
tg
);
}
@Override
public
void
createRule
(
TournamentRule
tr
)
{
tournamentRuleFacade
.
create
(
tr
);
}
@Override
public
TournamentGame
findGame
(
Integer
id
)
{
return
tournamentGameFacade
.
find
(
id
);
}
@Override
public
TournamentRule
findRule
(
Integer
id
)
{
return
tournamentRuleFacade
.
find
(
id
);
}
}
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/MenuitemFacade.java
View file @
521247c
...
...
@@ -6,6 +6,9 @@ import javax.persistence.criteria.CriteriaBuilder;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Root
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
fi.codecrew.moya.model.Menuitem_
;
import
fi.codecrew.moya.model.Menuitem
;
...
...
@@ -13,6 +16,9 @@ import fi.codecrew.moya.model.Menuitem;
@LocalBean
public
class
MenuitemFacade
extends
IntegerPkGenericFacade
<
Menuitem
>
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
MenuitemFacade
.
class
);
public
MenuitemFacade
()
{
super
(
Menuitem
.
class
);
...
...
@@ -23,17 +29,23 @@ public class MenuitemFacade extends IntegerPkGenericFacade<Menuitem> {
return
null
;
}
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
Menuitem
>
cq
=
cb
.
createQuery
(
Menuitem
.
class
);
Root
<
Menuitem
>
root
=
cq
.
from
(
Menuitem
.
class
);
cq
.
where
(
cb
.
equal
(
root
.
get
(
Menuitem_
.
url
),
url
));
Menuitem
ret
=
super
.
getSingleNullableResult
(
getEm
().
createQuery
(
cq
));
if
(
ret
==
null
)
{
ret
=
new
Menuitem
();
ret
.
setUrl
(
url
);
create
(
ret
);
try
{
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
Menuitem
>
cq
=
cb
.
createQuery
(
Menuitem
.
class
);
Root
<
Menuitem
>
root
=
cq
.
from
(
Menuitem
.
class
);
cq
.
where
(
cb
.
equal
(
root
.
get
(
Menuitem_
.
url
),
url
));
Menuitem
ret
=
super
.
getSingleNullableResult
(
getEm
()
.
createQuery
(
cq
));
if
(
ret
==
null
)
{
ret
=
new
Menuitem
();
ret
.
setUrl
(
url
);
create
(
ret
);
}
return
ret
;
}
catch
(
Throwable
e
)
{
logger
.
warn
(
"Exception menussa"
+
url
,
e
);
}
return
ret
;
return
null
;
}
}
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentGameFacade.java
View file @
521247c
package
fi
.
codecrew
.
moya
.
facade
;
import
java.util.List
;
import
javax.ejb.EJB
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Root
;
import
fi.codecrew.moya.beans.EventBean
;
import
fi.codecrew.moya.model.TournamentGame
;
import
fi.codecrew.moya.model.TournamentGame_
;
import
fi.codecrew.moya.model.TournamentRule
;
import
fi.codecrew.moya.model.TournamentRule_
;
@Stateless
@LocalBean
public
class
TournamentGameFacade
extends
IntegerPkGenericFacade
<
TournamentGame
>
{
@EJB
private
EventBean
eventBean
;
public
TournamentGameFacade
()
{
super
(
TournamentGame
.
class
);
}
public
List
<
TournamentGame
>
getGames
()
{
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
TournamentGame
>
cq
=
cb
.
createQuery
(
TournamentGame
.
class
);
Root
<
TournamentGame
>
root
=
cq
.
from
(
TournamentGame
.
class
);
cq
.
where
(
cb
.
equal
(
root
.
get
(
TournamentGame_
.
lanEvent
),
eventBean
.
getCurrentEvent
()));
return
getEm
().
createQuery
(
cq
).
getResultList
();
}
}
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentRuleFacade.java
View file @
521247c
package
fi
.
codecrew
.
moya
.
facade
;
import
java.util.List
;
import
javax.ejb.EJB
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Root
;
import
fi.codecrew.moya.beans.EventBean
;
import
fi.codecrew.moya.model.Role
;
import
fi.codecrew.moya.model.Role_
;
import
fi.codecrew.moya.model.TournamentGame
;
import
fi.codecrew.moya.model.TournamentRule
;
import
fi.codecrew.moya.model.TournamentRule_
;
@Stateless
@LocalBean
public
class
TournamentRuleFacade
extends
IntegerPkGenericFacade
<
TournamentRule
>
{
public
TournamentRuleFacade
()
{
super
(
TournamentRule
.
class
);
}
public
List
<
TournamentRule
>
getRulesByGame
(
TournamentGame
tg
)
{
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
TournamentRule
>
cq
=
cb
.
createQuery
(
TournamentRule
.
class
);
Root
<
TournamentRule
>
root
=
cq
.
from
(
TournamentRule
.
class
);
cq
.
where
(
cb
.
equal
(
root
.
get
(
TournamentRule_
.
tournamentGame
),
tg
));
return
getEm
().
createQuery
(
cq
).
getResultList
();
}
}
code/MoyaBeansClient/ejbModule/fi/codecrew/moya/beans/TournamentBeanLocal.java
View file @
521247c
package
fi
.
codecrew
.
moya
.
beans
;
import
java.util.List
;
import
javax.ejb.Local
;
import
fi.codecrew.moya.model.TournamentGame
;
import
fi.codecrew.moya.model.TournamentRule
;
@Local
public
interface
TournamentBeanLocal
{
List
<
TournamentGame
>
getGames
();
List
<
TournamentRule
>
getRulesByGame
(
TournamentGame
tg
);
void
createGame
(
TournamentGame
tg
);
void
createRule
(
TournamentRule
tr
);
TournamentGame
findGame
(
Integer
id
);
TournamentRule
findRule
(
Integer
id
);
}
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentGame.java
View file @
521247c
...
...
@@ -59,4 +59,20 @@ public class TournamentGame extends GenericEntity implements Serializable {
public
void
setAvailableRules
(
List
<
TournamentRule
>
availableRules
)
{
this
.
availableRules
=
availableRules
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
LanEvent
getLanEvent
()
{
return
lanEvent
;
}
public
void
setLanEvent
(
LanEvent
lanEvent
)
{
this
.
lanEvent
=
lanEvent
;
}
}
code/MoyaWeb/WebContent/admin/incoming/printCard.xhtml
View file @
521247c
...
...
@@ -25,9 +25,10 @@
</h:panelGroup>
<h:panelGroup>
<h:form>
<h:outputLabel
value=
"Kuvan rajaus:"
/>
<p:imageCropper
value=
"#{userView.croppedImage}"
aspectRatio=
"0.7317073170731707"
image=
"/dydata/userimage/#{userView.user.currentImage.id}.jpg"
/>
<br
/>
<h:commandButton
action=
"#{userView.crop}"
value=
"#{i18n['user.cropImage']}"
/>
<h:commandButton
action=
"#{userView.cancelCrop}"
value=
"#{i18n['user.cropImage']}"
/>
</h:form>
</h:panelGroup>
<h:panelGroup>
...
...
code/MoyaWeb/WebContent/eventorg/editEvent.xhtml
View file @
521247c
...
...
@@ -50,6 +50,7 @@
<h:commandButton
id=
"commitbtn"
action=
"#{eventorgView.saveEvent()}"
value=
"#{i18n['event.save']}"
/>
</h:form>
<h2>
#{i18n['event.domains.title']}
</h2>
<h:form>
<h:inputText
value=
"#{eventorgView.newdomain}"
/>
...
...
@@ -67,7 +68,7 @@
</h:dataTable>
</h:form>
<h2>
Properties
</h2>
<h2>
#{i18n['event.properties.title']}
</h2>
<h:form>
<h:dataTable
var=
"prop"
value=
"#{eventPropertyView.properties}"
>
<h:column>
...
...
@@ -137,7 +138,7 @@
<ui:fragment
rendered=
"#{eventPropertyView.privatePropertyPermission}"
>
<h2>
Private Properties
</h2>
<h2>
#{i18n['event.privateProperties.title']}
</h2>
<h:form>
<h:dataTable
var=
"prop"
value=
"#{eventPropertyView.privateProperties}"
>
<h:column>
...
...
code/MoyaWeb/WebContent/license/manageCodes.xhtml
View file @
521247c
...
...
@@ -58,25 +58,25 @@
<h:outputLabel
rendered=
"#{licenseView.currentLicense.id == null}"
value=
"#{i18n['game.create']}"
/>
<h:outputLabel
rendered=
"#{licenseView.currentLicense.id != null}"
value=
"#{i18n['game.edit']}"
/>
</f:facet>
<h:outputLabel
value=
"
service
"
/>
<h:outputLabel
value=
"
#{i18n['license.service']}
"
/>
<p:inputText
value=
"#{licenseView.currentLicense.service}"
/>
<h:outputLabel
value=
"
name
"
/>
<h:outputLabel
value=
"
#{i18n['license.name']}
"
/>
<p:inputText
value=
"#{licenseView.currentLicense.name}"
/>
<h:outputLabel
value=
"
description
"
/>
<h:outputLabel
value=
"
#{i18n['license.description']}
"
/>
<p:inputText
value=
"#{licenseView.currentLicense.description}"
/>
<h:outputLabel
value=
"
url
"
/>
<h:outputLabel
value=
"
#{i18n['license.url']}
"
/>
<p:inputText
value=
"#{licenseView.currentLicense.codeUrl}"
/>
<h:outputLabel
value=
"
active
"
/>
<h:outputLabel
value=
"
#{i18n['license.active']}
"
/>
<p:selectBooleanCheckbox
value=
"#{licenseView.currentLicense.active}"
/>
<h:outputLabel
value=
"
product
"
/>
<h:outputLabel
value=
"
#{i18n['license.product']}
"
/>
<h:selectOneMenu
converter=
"#{productConverter}"
value=
"#{licenseView.currentLicense.product}"
>
<f:selectItems
var=
"product"
itemLabel=
"#{product.name}"
value=
"#{licenseView.productsForLicenses}"
/>
</h:selectOneMenu>
<p:commandButton
action=
"#{licenseView.saveCurrentLicense}"
update=
":licenseForm"
value=
"
save
"
/>
<p:commandButton
action=
"#{licenseView.saveCurrentLicense}"
update=
":licenseForm"
value=
"
#{i18n['license.save']}
"
/>
</p:panelGrid>
</h:form>
...
...
code/MoyaWeb/WebContent/tournaments/admin/createwizard.xhtml
View file @
521247c
...
...
@@ -9,82 +9,78 @@
</f:metadata>
<ui:define
name=
"content"
>
<h1>
#{i18n['
actionlog.
tournaments.admin.create_tournament']}
</h1>
<h1>
#{i18n['tournaments.admin.create_tournament']}
</h1>
<h:form>
<p:wizard
widgetVar=
"wiz"
flowListener=
"#{tournamentCreateView.onFlowProcess}"
>
<p:tab
id=
"selectGame"
title=
"#{i18n['
actionlog.
tournaments.admin.select_a_game']}"
>
<p:tab
id=
"selectGame"
title=
"#{i18n['tournaments.admin.select_a_game']}"
>
<p:panel>
<h:messages
errorClass=
"error"
/>
<h
2>
#{i18n['actionlog.tournaments.admin.select_a_game']}
</h2
>
<p:selectOneMenu
>
<
f:selectItem
itemLabel=
""
/
>
<f:selectItem
itemLabel=
"spurdo spärde
"
/>
<
f:selectItem
itemLabel=
"cockmaster"
/
>
</
p:selectOneMenu
>
<h
:panelGroup
rendered=
"#{tournamentCreateView.tournamentGames.isEmpty() eq false}"
>
<h2>
#{i18n['tournaments.admin.select_a_game']}
</h2
>
<
h:selectOneMenu
value=
"#{tournamentCreateView.game}"
converter=
"#{tournamentGameConverter}"
>
<f:selectItems
var=
"game"
itemLabel=
"#{game.name}"
value=
"#{tournamentCreateView.tournamentGames}"
itemValue=
"#{game.id}
"
/>
<
/h:selectOneMenu
>
</
h:panelGroup
>
<h2>
#{i18n['
actionlog.
tournaments.admin.create_a_game']}
</h2>
<h2>
#{i18n['tournaments.admin.create_a_game']}
</h2>
<h:panelGrid
columns=
"2"
>
<h:outputText
value=
"#{i18n['
actionlog.
tournaments.admin.game_name']}"
/>
<h:outputText
value=
"#{i18n['
actionlog.
tournaments.admin.game_description']}"
/>
<h:outputText
value=
"#{i18n['tournaments.admin.game_name']}"
/>
<h:outputText
value=
"#{i18n['tournaments.admin.game_description']}"
/>
<p:inputText
/>
<p:inputText
/>
<h:outputText
value=
"#{i18n['actionlog.tournaments.admin.upload_game_image']}"
/>
<h:outputText
value=
""
/>
<p:fileUpload
mode=
"simple"
/>
<p:inputText
value=
"#{tournamentCreateView.tournamentGameName}"
/>
<p:inputText
value=
"#{tournamentCreateView.tournamentGameDescription}"
/>
</h:panelGrid>
</p:panel>
</p:tab>
<p:tab
id=
"selectRuleset"
title=
"#{i18n['
actionlog.
tournaments.admin.rules']}"
>
<p:tab
id=
"selectRuleset"
title=
"#{i18n['tournaments.admin.rules']}"
>
<p:panel>
<h:messages
errorClass=
"error"
/>
<h2>
#{i18n['actionlog.tournaments.admin.select_a_ruleset']}
</h2>
<p:selectOneMenu>
<f:selectItem
itemLabel=
""
/>
<f:selectItem
itemLabel=
"Pro-rules"
/>
<f:selectItem
itemLabel=
"N00b-rules"
/>
</p:selectOneMenu>
<h:panelGroup
rendered=
"#{tournamentCreateView.tournamentRules.isEmpty() eq false}"
>
<h2>
#{i18n['tournaments.admin.select_a_ruleset']}
</h2>
<h:selectOneMenu
value=
"#{tournamentCreateView.rules}"
converter=
"#{tournamentRuleConverter}"
>
<f:selectItems
var=
"rule"
itemLabel=
"#{rule.name}"
value=
"#{tournamentCreateView.tournamentRules}"
itemValue=
"#{rule.id}"
/>
</h:selectOneMenu>
</h:panelGroup>
<br
/>
<h2>
#{i18n['
actionlog.
tournaments.admin.create_new_ruleset']}
</h2>
<h:outputText
value=
"#{i18n['
actionlog.
tournaments.ruleset_name']}"
/>
<h2>
#{i18n['tournaments.admin.create_new_ruleset']}
</h2>
<h:outputText
value=
"#{i18n['tournaments.ruleset_name']}"
/>
<br
/>
<p:inputText
/>
<p:inputText
value=
"#{tournamentCreateView.rulesetName}"
/>
<br
/>
<h:outputText
value=
"#{i18n['
actionlog.
tournaments.ruleset_description']}"
/>
<h:outputText
value=
"#{i18n['tournaments.ruleset_description']}"
/>
<br
/>
<p:inputTextarea
/>
<p:inputTextarea
value=
"#{tournamentCreateView.rulesetDescription}"
/>
</p:panel>
</p:tab>
<p:tab
id=
"selectRegTimes"
title=
"#{i18n['
actionlog.
tournaments.admin.set_time_constraints']}"
>
<p:tab
id=
"selectRegTimes"
title=
"#{i18n['tournaments.admin.set_time_constraints']}"
>
<p:panel>
<h:messages
errorClass=
"error"
/>
<h2>
#{i18n['
actionlog.
tournaments.admin.registration_time_constraints']}
</h2>
<h2>
#{i18n['tournaments.admin.registration_time_constraints']}
</h2>
<h:panelGrid
columns=
"2"
>
<h:outputText
value=
"#{i18n['
actionlog.
tournaments.registration_opens']}"
/>
<h:outputText
value=
"#{i18n['
actionlog.
tournaments.registration_closes']}"
/>
<h:outputText
value=
"#{i18n['tournaments.registration_opens']}"
/>
<h:outputText
value=
"#{i18n['tournaments.registration_closes']}"
/>
<p:calendar
stepHour=
"1"
stepMinute=
"10"
pattern=
"dd.MM.yyyy hh:mm"
/>
<p:calendar
stepHour=
"1"
stepMinute=
"10"
pattern=
"dd.MM.yyyy hh:mm"
/>
</h:panelGrid>
<h2>
#{i18n['
actionlog.
tournaments.admin.begin_time_constraints']}
</h2>
<h2>
#{i18n['tournaments.admin.begin_time_constraints']}
</h2>
<h:panelGrid>
<h:outputText
value=
"Start time"
/>
<p:calendar
stepHour=
"1"
stepMinute=
"10"
pattern=
"dd.MM.yyyy hh:mm"
/>
</h:panelGrid>
</p:panel>
<div
style=
"float: right;"
>
<p:commandButton
icon=
"apply"
value=
"#{i18n['
actionlog.
tournaments.admin.create_tournament']}"
/>
<p:commandButton
icon=
"apply"
value=
"#{i18n['tournaments.admin.create_tournament']}"
/>
</div>
</p:tab>
</p:wizard>
...
...
code/MoyaWeb/WebContent/voting/admincompolist.xhtml
0 → 100644
View file @
521247c
<!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:f=
"http://java.sun.com/jsf/core"
xmlns:p=
"http://primefaces.org/ui"
>
<h:body>
<ui:composition
template=
"#{sessionHandler.template}"
>
<f:metadata>
<f:event
type=
"preRenderView"
listener=
"#{compoView.initListView()}"
/>
</f:metadata>
<ui:define
name=
"content"
>
<h:outputStylesheet
library=
"style"
name=
"insomnia2/css/actionlog.css"
/>
<h1>
#{i18n['voting.allcompos.header']}
</h1>
<p>
#{i18n['voting.allcompos.description']}
</p>
<h:form>
<h:dataTable
styleClass=
"bordertable"
rowClasses=
"roweven,rowodd"
id=
"compolisttable"
value=
"#{compoView.compos}"
var=
"compo"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['voting.allcompos.name']}"
/>
</f:facet>
<h:outputText
value=
"#{compo.name}"
/>
</h:column>
<!-- <h:column rendered="#{compoView.curEntries}"> -->
<!-- <f:facet name="header"> -->
<!-- <h:outputText value="#{i18n['voting.allcompos.curEntries']}" /> -->
<!-- </f:facet> -->
<!-- <h:outputText value="#{compoEntries.size()}" /> -->
<!-- </h:column> -->
<!-- <h:column rendered="#{compoView.maxParts}"> -->
<!-- <f:facet name="header"> -->
<!-- <h:outputText value="#{i18n['voting.allcompos.maxParts']}" /> -->
<!-- </f:facet> -->
<!-- <h:outputText value="#{compo.maxParticipantCount}" /> -->
<!-- </h:column> -->
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['voting.allcompos.startTime']}"
/>
</f:facet>
<h:outputText
value=
"#{compo.startTime.time}"
>
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
</h:outputText>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['voting.allcompos.voteEnd']}"
/>
</f:facet>
<h:outputText
value=
"#{compo.voteEnd.time}"
>
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
</h:outputText>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['voting.allcompos.submitEnd']}"
/>
</f:facet>
<h:outputText
value=
"#{compo.submitEnd.time}"
>
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
</h:outputText>
</h:column>
<h:column>
<h:commandButton
rendered=
"#{compo.vote or compoView.manage}"
action=
"#{compoView.startVote()}"
value=
"#{i18n['voting.compo.vote']}"
/>
</h:column>
<h:column>
<h:commandButton
rendered=
"#{compo.submit or compoView.manage}"
action=
"#{compoView.submitEntry()}"
value=
"#{i18n['voting.compo.submit']}"
/>
</h:column>
<h:column
rendered=
"#{compoView.manage}"
>
<h:link
outcome=
"details"
value=
"#{i18n['compo.edit']}"
>
<f:param
name=
"compoId"
value=
"#{compo.id}"
/>
</h:link>
</h:column>
</h:dataTable>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n.properties
View file @
521247c
...
...
@@ -107,6 +107,24 @@ cardTemplate.emptyCardTemplate = ----
error.contact
=
If this happens again, contact Info with the following code:
error.error
=
You have encountered an error.
event.domains.title
=
Domain
event.edit
=
Edit
event.endTime
=
End time
event.id
=
Event ID
event.name
=
Event name
event.nextBillNumber
=
Initial bill number
event.privateProperties.title
=
Private Properties
event.properties.title
=
Properties
event.referenceNumberBase
=
Reference number base
event.save
=
Save
event.startTime
=
Start time
eventdomain.add
=
Add event domain
eventdomain.domainname
=
Domain
eventdomain.remove
=
Remove
eventmap.active
=
Active
eventorg.create
=
Create
game.active
=
Aktiivinen
...
...
@@ -171,9 +189,11 @@ placegroupview.toptext = \
poll.edit
=
edit
product.providedRole
=
Tuote tarjoaa roolin
product.returnProductEdit
=
Palaa tuotteeseen:
product.saved
=
Tuote tallennettu
print
=
Print
product.providedRole
=
Product defines role
product.returnProductEdit
=
Return to product:
product.saved
=
Product saved
productshop.minusOne
=
-1
productshop.minusTen
=
-10
...
...
@@ -192,6 +212,7 @@ subnavi.cards = \u0009\u0009
topnavi.license
=
Lisenssikoodit
user.cropImage
=
Crop
user.unauthenticated
=
Kirjautumaton
usercart.downloadCsv
=
CSV
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_en.properties
View file @
521247c
...
...
@@ -240,15 +240,20 @@ entry.edit = Edit entry
error.contact
=
If this happens again, contact Info with the following code:
error.error
=
You have encountered an error.
event.defaultRole
=
Default user role
event.edit
=
Edit
event.endTime
=
End time
event.name
=
Event name
event.nextBillNumber
=
Initial bill number
event.referenceNumberBase
=
Reference number base
event.save
=
Save
event.startTime
=
Start time
event.defaultRole
=
Default user role
event.domains.title
=
Domain
event.edit
=
Edit
event.endTime
=
End time
event.id
=
Event ID
event.name
=
Event name
event.nextBillNumber
=
Initial bill number
event.privateProperties.title
=
Private Properties
event.properties.title
=
Properties
event.referenceNumberBase
=
Reference number base
event.save
=
Save
event.startTime
=
Start time
eventdomain.add
=
Add event domain
eventdomain.domainname
=
Domain
eventdomain.remove
=
Remove
...
...
@@ -274,6 +279,7 @@ eventorg.createEvent = Create event
eventorg.createevent
=
Create new event
eventorg.edit
=
Edit
eventorg.events
=
Event of the organisation
eventorg.id
=
Event ID
eventorg.organisation
=
Organisation name
eventorg.save
=
Save
...
...
@@ -416,10 +422,28 @@ javax.validation.constraints.Past.message = must be in the past
javax.validation.constraints.Pattern.message
=
must match "{regexp}"
javax.validation.constraints.Size.message
=
size must be between {min} and {max}
lanEventPrivateProperty.createProperty
=
Create private property
lanEventPrivateProperty.key
=
Private propery key
lanEventPrivateProperty.value
=
Private property value
lanEventProperty.createProperty
=
Create property
lanEventProperty.editProperty
=
Edit property
lanEventProperty.key
=
Property key
lanEventProperty.value
=
Property value
lanEventProperty.valueIsRawdataWarning
=
Raw data warning
layout.editBottom
=
Edit bottom content
layout.editContent
=
Edit center
layout.editTop
=
Edit topcontent
license.active
=
Active
license.description
=
Description
license.name
=
Name
license.product
=
Product
license.save
=
Save
license.service
=
Service
license.url
=
Url
login.login
=
Login
login.logout
=
Logout
login.logoutmessage
=
You have logged out of the system
...
...
@@ -431,6 +455,8 @@ loginerror.header = Login failed
loginerror.message
=
Username of password incorrect.
loginerror.resetpassword
=
Reset password
map.create
=
Create map
map.createTimeMap
=
Create tilemap
map.edit
=
Edit
map.generate
=
Generate places
map.height
=
Place height (px)
...
...
@@ -460,8 +486,13 @@ mapView.errorWhenReservingPlace = Error when reserving place!
mapView.errorWhileBuyingPlaces
=
Error when buying places. Please try again. If error reoccurs please contact organizers.
mapView.notEnoughCreditsToReserve
=
You don't have enough credits to reserve this place.
mapedit.save
=
Save map changes
menu.index
=
Index
menu.item
=
Item
menu.name
=
Name
menu.place.placemap
=
Placemap
menu.poll.index
=
Polls
menu.select
=
Select
menu.sort
=
Sort
menu.toAdmin
=
Adminview
...
...
@@ -471,6 +502,20 @@ menuitem.navigation.key = Product flag
nasty.user
=
Go away!
news.abstract
=
Abstract
news.expire
=
Expire
news.publish
=
Publish
news.save
=
Save
news.title
=
Title
newsgroup.edit
=
Edit
newsgroup.name
=
Newsgroup name
newsgroup.priority
=
Priority
newsgroup.readerRole
=
Reader roles
newsgroup.writerRole
=
Writer roles
newslist.header
=
Newsgroups
org.hibernate.validator.constraints.Email.message
=
not a well-formed email address
org.hibernate.validator.constraints.Length.message
=
length must be between {min} and {max}
org.hibernate.validator.constraints.NotEmpty.message
=
may not be empty
...
...
@@ -484,15 +529,17 @@ page.account.edit.header = Edit account events
page.account.list.header
=
Account events
page.admin.sendimage.header
=
Send image
page.auth.login.header
=
Login error
page.auth.login.loginerror.header
=
Kirjautumisvirhe
page.auth.login.loginerror.header
=
Login error
page.auth.login.loginerror.pagegroup
=
frontpage
page.auth.login.logout.header
=
Uloskirjautuminen
page.auth.login.logout.header
=
Logout
page.auth.login.logout.pagegroup
=
frontpage
page.auth.login.pagegroup
=
frontpage
page.auth.login.title
=
Login error
page.auth.loginerror.header
=
Login failed
page.auth.loginerror.pagegroup
=
frontpage
page.auth.logout.header
=
Logout
page.auth.logout.pagegroup
=
frontpage
page.auth.logoutsuccess.header
=
Logout
page.auth.notauthorized.pagegroup
=
frontpage
page.auth.resetPassword.header
=
Reset password
page.bill.billSummary.header
=
Summary of bills
...
...
@@ -628,6 +675,9 @@ poll.end = Close poll
poll.name
=
Poll name
poll.save
=
Send answers
<<<<<<<
HEAD
print
=
Print
product.barcode
=
Barcode
product.billed
=
Billed
product.boughtTotal
=
Products billed
...
...
@@ -652,6 +702,41 @@ product.totalPrice = Total
product.unitName
=
Unit name
product.vat
=
VAT
=======
product.barcode
=
Barcode
product.billed
=
Billed
product.boughtTotal
=
Products billed
product.buyInPrice
=
Buy in price
product.cart.count
=
To shoppingcart
product.cashed
=
Cashpaid
product.color
=
Color in UI
product.create
=
Create product
product.createDiscount
=
Add volumediscount
product.edit
=
edit
product.inventoryQuantity
=
Inventory count
product.name
=
Name of product
product.paid
=
Paid
product.prepaid
=
Prepaid
product.prepaidInstant
=
Created when prepaid is paid
product.price
=
Price of product
product.providedRole
=
Product defines role
product.returnProductEdit
=
Return to product:
product.save
=
Save
product.saved
=
Product saved
product.shopInstant
=
Create automatic cashpayment
product.sort
=
Sort nr
product.totalPrice
=
Total
product.unitName
=
Unit name
product.vat
=
VAT
productFlag.CREATE_NEW_PLACE_WHEN_BOUGHT
=
Create new place bought
productFlag.PREPAID_CREDIT
=
Prepaid credit
productFlag.PREPAID_INSTANT_CREATE
=
Prepaid instant create
productFlag.RESERVE_PLACE_WHEN_BOUGHT
=
Reserve place when bought
productFlag.USER_SHOPPABLE
=
User shoppable
products.create
=
Create product
>>>>>>>
f4d8f93b7bc34f8ccc2a5df9f9ab5f8db5e3b11e
products.save
=
Save
productsShopView.readBarcode
=
Read
...
...
@@ -712,8 +797,11 @@ role.name = Name
role.parents
=
Parents
role.permissionheader
=
Role permissions
role.read
=
(R)
role.savePermissions
=
Save permissions
role.write
=
(W)
roleView.save
=
Save changes
salespoint.edit
=
Edit
salespoint.name
=
Name
salespoint.noSalesPoints
=
Amount
...
...
@@ -792,6 +880,8 @@ submenu.foodmanager.listFoodwaves = List active foodwaves
submenu.foodwave.list
=
Foodwaves
submenu.foodwave.listTemplates
=
Food provides
submenu.index
=
Frontpage
submenu.license.manageCodes
=
Manage codes
submenu.license.viewCodes
=
View codes
submenu.map.create
=
Create map
submenu.map.list
=
List maps
submenu.orgrole.create
=
Create organisationrole
...
...
@@ -894,6 +984,7 @@ user.changepassword.forUser = For user
user.changepassword.title
=
Change password
user.create
=
Create user
user.createdmessage
=
User has been created successfully. You can now login.
user.cropImage
=
Crop
user.defaultImage
=
Default picture
user.edit
=
Edit
user.edit.title
=
My information
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_fi.properties
View file @
521247c
This diff is collapsed.
Click to expand it.
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/tournaments/TournamentCreateView.java
View file @
521247c
package
fi
.
codecrew
.
moya
.
web
.
cdiview
.
tournaments
;
import
java.io.Serializable
;
import
java.util.List
;
import
fi.codecrew.moya.beans.EventBeanLocal
;
import
fi.codecrew.moya.beans.TournamentBeanLocal
;
import
fi.codecrew.moya.model.Role
;
import
fi.codecrew.moya.model.Tournament
;
...
...
@@ -21,26 +23,121 @@ import org.primefaces.event.FlowEvent;
public
class
TournamentCreateView
extends
GenericCDIView
{
private
static
final
long
serialVersionUID
=
2547358764980373797L
;
private
List
<
TournamentGame
>
tournamentGames
;
private
List
<
TournamentRule
>
tournamentRules
;
private
TournamentRule
rules
=
null
;
private
TournamentGame
game
=
null
;
private
Tournament
tournament
=
null
;
private
String
tournamentGameName
;
private
String
tournamentGameDescription
;
private
String
rulesetName
;
private
String
rulesetDescription
;
@EJB
TournamentBeanLocal
tournamentBean
;
@EJB
EventBeanLocal
eventBean
;
public
void
initView
()
{
if
(
tournament
==
null
)
{
this
.
beginConversation
();
tournament
=
new
Tournament
();
tournamentGames
=
tournamentBean
.
getGames
();
}
}
public
void
save
(
ActionEvent
actionEvent
)
{
}
public
List
<
TournamentGame
>
getTournamentGames
()
{
return
tournamentGames
;
}
public
List
<
TournamentRule
>
getTournamentRules
()
{
return
tournamentRules
;
}
public
void
uploadListener
(
org
.
primefaces
.
event
.
FileUploadEvent
event
)
{
System
.
out
.
println
(
"ZZ"
);
}
public
String
onFlowProcess
(
FlowEvent
event
)
{
switch
(
event
.
getOldStep
())
{
case
"selectGame"
:
if
(
tournamentGameName
.
length
()
>
0
)
{
// oh lurd, we want to create a new gamy now
TournamentGame
tg
=
new
TournamentGame
();
tg
.
setName
(
tournamentGameName
);
tg
.
setDescription
(
tournamentGameDescription
);
tg
.
setLanEvent
(
eventBean
.
getCurrentEvent
());
tournamentBean
.
createGame
(
tg
);
}
tournamentRules
=
tournamentBean
.
getRulesByGame
(
this
.
getGame
());
break
;
case
"selectRuleset"
:
if
(
rulesetName
!=
null
&&
rulesetName
.
length
()
>
0
)
{
TournamentRule
tr
=
new
TournamentRule
();
tr
.
setName
(
rulesetName
);
tr
.
setDescription
(
rulesetDescription
);
tournamentBean
.
createRule
(
tr
);
}
break
;
}
System
.
out
.
println
(
event
.
getOldStep
());
return
event
.
getNewStep
();
}
public
TournamentGame
getGame
()
{
return
game
;
}
public
void
setGame
(
TournamentGame
game
)
{
this
.
game
=
game
;
}
public
TournamentRule
getRules
()
{
return
rules
;
}
public
void
setRules
(
TournamentRule
rules
)
{
this
.
rules
=
rules
;
}
public
String
getTournamentGameName
()
{
return
tournamentGameName
;
}
public
void
setTournamentGameName
(
String
tournamentGameName
)
{
this
.
tournamentGameName
=
tournamentGameName
;
}
public
String
getTournamentGameDescription
()
{
return
tournamentGameDescription
;
}
public
void
setTournamentGameDescription
(
String
tournamentGameDescription
)
{
this
.
tournamentGameDescription
=
tournamentGameDescription
;
}
public
String
getRulesetName
()
{
return
rulesetName
;
}
public
void
setRulesetName
(
String
rulesetName
)
{
this
.
rulesetName
=
rulesetName
;
}
public
String
getRulesetDescription
()
{
return
rulesetDescription
;
}
public
void
setRulesetDescription
(
String
rulesetDescription
)
{
this
.
rulesetDescription
=
rulesetDescription
;
}
}
code/MoyaWeb/src/fi/codecrew/moya/web/converter/TournamentGameConverter.java
0 → 100644
View file @
521247c
package
fi
.
codecrew
.
moya
.
web
.
converter
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.RequestScoped
;
import
javax.inject.Named
;
import
fi.codecrew.moya.beans.TournamentBeanLocal
;
import
fi.codecrew.moya.beans.UserBeanLocal
;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.TournamentGame
;
import
fi.codecrew.moya.utilities.jsf.GenericIntegerEntityConverter
;
@Named
@RequestScoped
public
class
TournamentGameConverter
extends
GenericIntegerEntityConverter
<
TournamentGame
>
{
@EJB
private
TournamentBeanLocal
tournamentBean
;
@Override
protected
TournamentGame
find
(
Integer
id
)
{
return
tournamentBean
.
findGame
(
id
);
}
}
code/MoyaWeb/src/fi/codecrew/moya/web/converter/TournamentRuleConverter.java
0 → 100644
View file @
521247c
package
fi
.
codecrew
.
moya
.
web
.
converter
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.RequestScoped
;
import
javax.inject.Named
;
import
fi.codecrew.moya.beans.TournamentBeanLocal
;
import
fi.codecrew.moya.beans.UserBeanLocal
;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.TournamentGame
;
import
fi.codecrew.moya.model.TournamentRule
;
import
fi.codecrew.moya.utilities.jsf.GenericIntegerEntityConverter
;
@Named
@RequestScoped
public
class
TournamentRuleConverter
extends
GenericIntegerEntityConverter
<
TournamentRule
>
{
@EJB
private
TournamentBeanLocal
tournamentBean
;
@Override
protected
TournamentRule
find
(
Integer
id
)
{
return
tournamentBean
.
findRule
(
id
);
}
}
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