Commit 24efb803 by Antti Jaakkola

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

2 parents 0619344e 4cdd2643
Showing with 244 additions and 145 deletions
eclipse.preferences.version=1
encoding/<project>=UTF-8
eclipse.preferences.version=1
line.separator=\n
eclipse.preferences.version=1
encoding/<project>=UTF-8
eclipse.preferences.version=1
line.separator=\n
eclipse.preferences.version=1
encoding/<project>=UTF-8
eclipse.preferences.version=1
line.separator=\n
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" version="3.1"> <ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:ejb="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" version="3.1">
<display-name>MoyaBeans</display-name> <display-name>MoyaBeans</display-name>
<ejb-client-jar>MoyaBeansClient.jar</ejb-client-jar> <ejb-client-jar>MoyaBeansClient.jar</ejb-client-jar>
</ejb-jar> </ejb-jar>
\ No newline at end of file
...@@ -27,6 +27,7 @@ public class BootstrapBean implements BootstrapBeanLocal { ...@@ -27,6 +27,7 @@ public class BootstrapBean implements BootstrapBeanLocal {
static { static {
// {"Query1","Query2",...} // {"Query1","Query2",...}
dbUpdates.add(new String[] { "" }); // first version, no changes dbUpdates.add(new String[] { "" }); // first version, no changes
dbUpdates.add(new String[] { "ALTER TABLE tournaments ADD COLUMN game integer NOT NULL REFERENCES tournament_games(id)" });
// dbUpdates.add(new String[] { "ALTER TABLE users ALTER COLUMN birthday TYPE date" }); // dbUpdates.add(new String[] { "ALTER TABLE users ALTER COLUMN birthday TYPE date" });
} }
......
package fi.codecrew.moya.beans;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
/**
* Session Bean implementation class TournamentBean
*/
@Stateless
@LocalBean
public class TournamentBean implements TournamentBeanLocal {
/**
* Default constructor.
*/
public TournamentBean() {
// TODO Auto-generated constructor stub
}
}
...@@ -5,6 +5,7 @@ import javax.ejb.Stateless; ...@@ -5,6 +5,7 @@ import javax.ejb.Stateless;
import javax.persistence.EntityManager; import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext; import javax.persistence.PersistenceContext;
import javax.persistence.Query; import javax.persistence.Query;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root; import javax.persistence.criteria.Root;
...@@ -39,7 +40,9 @@ public class DBModelFacade extends GenericFacade<DBModel> { ...@@ -39,7 +40,9 @@ public class DBModelFacade extends GenericFacade<DBModel> {
CriteriaQuery<DBModel> cq = cb.createQuery(DBModel.class); CriteriaQuery<DBModel> cq = cb.createQuery(DBModel.class);
Root<DBModel> root = cq.from(DBModel.class); Root<DBModel> root = cq.from(DBModel.class);
cq.orderBy(cb.desc(root.get(DBModel_.revision))); cq.orderBy(cb.desc(root.get(DBModel_.revision)));
return getSingleNullableResult(getEm().createQuery(cq)); TypedQuery<DBModel> q = getEm().createQuery(cq);
q.setMaxResults(1);
return getSingleNullableResult(q);
} }
@PersistenceContext @PersistenceContext
......
eclipse.preferences.version=1
encoding/<project>=UTF-8
eclipse.preferences.version=1
line.separator=\n
package fi.codecrew.moya.beans;
import javax.ejb.Local;
@Local
public interface TournamentBeanLocal {
}
eclipse.preferences.version=1
encoding/<project>=UTF-8
eclipse.preferences.version=1
line.separator=\n
eclipse.preferences.version=1
encoding/<project>=UTF-8
eclipse.preferences.version=1
line.separator=\n
...@@ -60,6 +60,9 @@ public class Tournament extends GenericEntity implements Serializable { ...@@ -60,6 +60,9 @@ public class Tournament extends GenericEntity implements Serializable {
@Column(name="players_per_team") @Column(name="players_per_team")
private Integer playersPerTeam; private Integer playersPerTeam;
@JoinColumn(name="game", nullable=false)
private TournamentGame tournamentGame;
@OneToMany @OneToMany
@OrderBy("id ASC") @OrderBy("id ASC")
private List<Tournament> subTournaments; private List<Tournament> subTournaments;
...@@ -105,4 +108,12 @@ public class Tournament extends GenericEntity implements Serializable { ...@@ -105,4 +108,12 @@ public class Tournament extends GenericEntity implements Serializable {
public void setTournamentType(TournamentType tournamentType) { public void setTournamentType(TournamentType tournamentType) {
this.tournamentType = tournamentType; this.tournamentType = tournamentType;
} }
public TournamentGame getTournamentGame() {
return tournamentGame;
}
public void setTournamentGame(TournamentGame tournamentGame) {
this.tournamentGame = tournamentGame;
}
} }
eclipse.preferences.version=1
encoding/<project>=UTF-8
eclipse.preferences.version=1
line.separator=\n
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd" version="7">
xmlns="http://xmlns.jcp.org/xml/ns/javaee" <display-name>moya-ear</display-name>
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd" <module>
version="7"> <ejb>moya-beans-0.2.0.jar</ejb>
<display-name>moya-ear</display-name> </module>
<module> <module>
<ejb>moya-beans-0.2.0.jar</ejb> <web>
</module> <web-uri>moya-web-0.2.0.war</web-uri>
<module> <context-root>/MoyaWeb</context-root>
<web> </web>
<web-uri>moya-web-0.2.0.war</web-uri> </module>
<context-root>/MoyaWeb</context-root> <library-directory>lib</library-directory>
</web>
</module>
<library-directory>lib</library-directory>
</application> </application>
\ No newline at end of file
eclipse.preferences.version=1
encoding/<project>=UTF-8
eclipse.preferences.version=1
line.separator=\n
eclipse.preferences.version=1 eclipse.preferences.version=1
encoding//WebContent/resources/templates/template1/css/style.css=UTF-8 encoding//WebContent/resources/templates/template1/css/style.css=UTF-8
encoding/<project>=UTF-8
eclipse.preferences.version=1
line.separator=\n
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
<f:facet name="header">#{i18n['lanEventProperty.value']}</f:facet> <f:facet name="header">#{i18n['lanEventProperty.value']}</f:facet>
<h:outputText rendered="#{prop.key.text}" value="#{prop.textvalue}" /> <h:outputText rendered="#{prop.key.text}" value="#{prop.textvalue}" />
<h:outputText rendered="#{prop.key.boolean and prop.booleanValue}" value="true" /> <h:outputText rendered="#{prop.key.boolean and prop.booleanValue}" value="true" />
<h:outputText rendered="#{prop.key.boolean and not prop.booleanValue}" value="false" /> <h:outputText rendered="#{prop.key.boolean and ( not prop.booleanValue)}" value="false" />
<h:outputText rendered="#{prop.key.date}" value="#{prop.dateValue}"> <h:outputText rendered="#{prop.key.date}" value="#{prop.dateValue}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
<h:outputLabel rendered="#{eventPropertyView.property.key.date}" for="textval" value="#{i18n['lanEventProperty.textValue']}" /> <h:outputLabel rendered="#{eventPropertyView.property.key.date}" for="textval" value="#{i18n['lanEventProperty.textValue']}" />
<p:calendar rendered="#{eventPropertyView.property.key.date}" value="#{eventPropertyView.property.dateValue}" pattern="#{sessionHandler.datetimeFormat}" /> <p:calendar rendered="#{eventPropertyView.property.key.date}" value="#{eventPropertyView.property.dateValue}" pattern="#{sessionHandler.datetimeFormat}" />
<h:message rendered="#{eventPropertyView.property.key.date}" for="textval" /> <h:message rendered="#{eventPropertyView.property.key.date}" for="textval" />
<h:outputLabel rendered="#{eventPropertyView.property.key.boolean}" for="booleanval" value="#{i18n['lanEventProperty.booleanValue']}" /> <h:outputLabel rendered="#{eventPropertyView.property.key.boolean}" for="booleanval" value="#{i18n['lanEventProperty.booleanValue']}" />
<h:selectBooleanCheckbox rendered="#{eventPropertyView.property.key.boolean}" id="booleanval" value="#{eventPropertyView.property.booleanValue}" /> <h:selectBooleanCheckbox rendered="#{eventPropertyView.property.key.boolean}" id="booleanval" value="#{eventPropertyView.property.booleanValue}" />
<h:message rendered="#{eventPropertyView.property.key.boolean}" for="booleanval" /> <h:message rendered="#{eventPropertyView.property.key.boolean}" for="booleanval" />
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "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:c="http://java.sun.com/jsp/jstl/core" <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:c="http://java.sun.com/jsp/jstl/core"
xmlns:users="http://java.sun.com/jsf/composite/cditools/user" xmlns:f="http://java.sun.com/jsf/core"> xmlns:users="http://java.sun.com/jsf/composite/cditools/user" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
<h:body> <h:body>
<ui:composition template="#{sessionHandler.template}"> <ui:composition template="#{sessionHandler.template}">
<ui:param name="thispage" value="page.place.mygroups" /> <ui:param name="thispage" value="page.place.mygroups" />
...@@ -18,41 +18,41 @@ ...@@ -18,41 +18,41 @@
<h:outputText rendered="#{empty placeGroupView.groupMemberships}" value="#{i18n['placegroupview.noMemberships']}" /> <h:outputText rendered="#{empty placeGroupView.groupMemberships}" value="#{i18n['placegroupview.noMemberships']}" />
<h:form rendered="#{!empty placeGroupView.groupMemberships}" id="placelistform"> <h:form rendered="#{!empty placeGroupView.groupMemberships}" id="placelistform">
<h:dataTable value="#{placeGroupView.groupMemberships}" var="member"> <p:dataTable value="#{placeGroupView.groupMemberships}" var="member">
<h:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['placegroupview.reservationName']}" /> <h:outputText value="#{i18n['placegroupview.reservationName']}" />
</f:facet> </f:facet>
<h:outputText value="#{member.placeReservation.name}" /> <h:outputText value="#{member.placeReservation.name}" />
</h:column> </p:column>
<h:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['placegroupview.reservationProduct']}" /> <h:outputText value="#{i18n['placegroupview.reservationProduct']}" />
</f:facet> </f:facet>
<h:outputText value="#{member.placeReservation.product.name}" /> <h:outputText value="#{member.placeReservation.product.name}" />
</h:column> </p:column>
<h:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['placegroupview.token']}" /> <h:outputText value="#{i18n['placegroupview.token']}" />
</f:facet> </f:facet>
<h:outputText rendered="#{empty member.user}" value="#{member.inviteToken}" /> <h:outputText rendered="#{empty member.user}" value="#{member.inviteToken}" />
<h:outputText rendered="#{!empty member.user}" value="#{member.user.firstnames} #{member.user.lastname} (#{member.user.nick})" /> <h:outputText rendered="#{!empty member.user}" value="#{member.user.firstnames} #{member.user.lastname} (#{member.user.nick})" />
</h:column> </p:column>
<h:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['placegroupview.groupCreator']}" /> <h:outputText value="#{i18n['placegroupview.groupCreator']}" />
</f:facet> </f:facet>
<h:outputText value="#{member.placeGroup.creator.firstnames} #{member.placeGroup.creator.lastname} (#{member.placeGroup.creator.nick})" /> <h:outputText value="#{member.placeGroup.creator.firstnames} #{member.placeGroup.creator.lastname} (#{member.placeGroup.creator.nick})" />
</h:column> </p:column>
<h:column> <p:column>
<h:commandButton rendered="#{placeGroupView.canModifyCurrent and placeGroupView.currentMemberUserNotNull}" action="#{placeGroupView.releasePlace()}" value="#{i18n['placegroupview.releasePlace']}" /> <h:commandButton rendered="#{placeGroupView.canModifyCurrent and placeGroupView.currentMemberUserNotNull}" action="#{placeGroupView.releasePlace()}" value="#{i18n['placegroupview.releasePlace']}" />
</h:column> </p:column>
</h:dataTable> </p:dataTable>
</h:form> </h:form>
<p> <p>
......
...@@ -67,15 +67,15 @@ ...@@ -67,15 +67,15 @@
<h:outputText rendered="#{!empty cc.attrs.bill.event.organiser.billAddress4}" value="&lt;br />" escape="false" /> <h:outputText rendered="#{!empty cc.attrs.bill.event.organiser.billAddress4}" value="&lt;br />" escape="false" />
<h:outputText id="recAddr4" value="#{cc.attrs.bill.event.organiser.billAddress4}" /> <h:outputText id="recAddr4" value="#{cc.attrs.bill.event.organiser.billAddress4}" />
</h:panelGroup> </h:panelGroup>
<h:outputLabel rendered="#{!cc.attrs.bill.expired and sessionHandler.isEventBoolProperty('ALLOW_BILLING') and !empty cc.attrs.bill.event.organiser.bankName1}" for="bankname1" value="#{i18n['eventorg.bankName1']}" /> <h:outputLabel rendered="#{!cc.attrs.bill.expired and (sessionHandler.isEventBoolProperty('ALLOW_BILLING')) and !empty cc.attrs.bill.event.organiser.bankName1}" for="bankname1" value="#{i18n['eventorg.bankName1']}" />
<h:outputText rendered="#{!cc.attrs.bill.expired and sessionHandler.isEventBoolProperty('ALLOW_BILLING') and !empty cc.attrs.bill.event.organiser.bankName1}" id="bankname1" value="#{cc.attrs.bill.event.organiser.bankName1}" /> <h:outputText rendered="#{!cc.attrs.bill.expired and (sessionHandler.isEventBoolProperty('ALLOW_BILLING')) and !empty cc.attrs.bill.event.organiser.bankName1}" id="bankname1" value="#{cc.attrs.bill.event.organiser.bankName1}" />
<h:outputLabel rendered="#{!cc.attrs.bill.expired and sessionHandler.isEventBoolProperty('ALLOW_BILLING') and !empty cc.attrs.bill.event.organiser.bankNumber1}" for="banknumber1" value="#{i18n['eventorg.bankNumber1']}" /> <h:outputLabel rendered="#{!cc.attrs.bill.expired and (sessionHandler.isEventBoolProperty('ALLOW_BILLING')) and !empty cc.attrs.bill.event.organiser.bankNumber1}" for="banknumber1" value="#{i18n['eventorg.bankNumber1']}" />
<h:outputText rendered="#{!cc.attrs.bill.expired and sessionHandler.isEventBoolProperty('ALLOW_BILLING') and !empty cc.attrs.bill.event.organiser.bankNumber1}" id="banknumber1" value="#{cc.attrs.bill.event.organiser.bankNumber1}" /> <h:outputText rendered="#{!cc.attrs.bill.expired and (sessionHandler.isEventBoolProperty('ALLOW_BILLING')) and !empty cc.attrs.bill.event.organiser.bankNumber1}" id="banknumber1" value="#{cc.attrs.bill.event.organiser.bankNumber1}" />
<h:outputLabel rendered="#{!cc.attrs.bill.expired and sessionHandler.isEventBoolProperty('ALLOW_BILLING') and !empty cc.attrs.bill.event.organiser.bankName2}" for="bankname2" value="#{i18n['eventorg.bankName2']}" /> <h:outputLabel rendered="#{!cc.attrs.bill.expired and (sessionHandler.isEventBoolProperty('ALLOW_BILLING')) and !empty cc.attrs.bill.event.organiser.bankName2}" for="bankname2" value="#{i18n['eventorg.bankName2']}" />
<h:outputText rendered="#{!cc.attrs.bill.expired and sessionHandler.isEventBoolProperty('ALLOW_BILLING') and !empty cc.attrs.bill.event.organiser.bankName2}" id="bankname2" value="#{cc.attrs.bill.event.organiser.bankName2}" /> <h:outputText rendered="#{!cc.attrs.bill.expired and (sessionHandler.isEventBoolProperty('ALLOW_BILLING')) and !empty cc.attrs.bill.event.organiser.bankName2}" id="bankname2" value="#{cc.attrs.bill.event.organiser.bankName2}" />
<h:outputLabel rendered="#{!cc.attrs.bill.expired and sessionHandler.isEventBoolProperty('ALLOW_BILLING') and !empty cc.attrs.bill.event.organiser.bankNumber2}" for="banknumber2" value="#{i18n['eventorg.bankNumber2']}" /> <h:outputLabel rendered="#{!cc.attrs.bill.expired and (sessionHandler.isEventBoolProperty('ALLOW_BILLING')) and !empty cc.attrs.bill.event.organiser.bankNumber2}" for="banknumber2" value="#{i18n['eventorg.bankNumber2']}" />
<h:outputText rendered="#{!cc.attrs.bill.expired and sessionHandler.isEventBoolProperty('ALLOW_BILLING') and !empty cc.attrs.bill.event.organiser.bankNumber2}" id="banknumber2" value="#{cc.attrs.bill.event.organiser.bankNumber2}" /> <h:outputText rendered="#{!cc.attrs.bill.expired and (sessionHandler.isEventBoolProperty('ALLOW_BILLING')) and !empty cc.attrs.bill.event.organiser.bankNumber2}" id="banknumber2" value="#{cc.attrs.bill.event.organiser.bankNumber2}" />
</h:panelGrid> </h:panelGrid>
......
<?xml version='1.0' encoding='UTF-8' ?> <?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite" <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools" xmlns:p="http://primefaces.org/ui">
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools" xmlns:p="http://primefaces.org/ui">
<composite:interface> <composite:interface>
...@@ -16,30 +15,23 @@ ...@@ -16,30 +15,23 @@
<!-- <h:outputScript target="head" library="script" name="shopscript.js" /> --> <!-- <h:outputScript target="head" library="script" name="shopscript.js" /> -->
<h:outputScript library="primefaces" name="jquery/jquery.js" /> <h:outputScript library="primefaces" name="jquery/jquery.js" />
<h:dataTable columnClasses="nowrap,numalign,numalign,nowrap,numalign" styleClass="bordertable" id="billcart" value="#{cc.attrs.items}" var="cart"> <p:dataTable columnClasses="nowrap,numalign,numalign,numalign,nowrap" id="billcart" value="#{cc.attrs.items}" var="cart">
<h:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText id="name" value="${i18n['product.name']}" /> <h:outputText id="name" value="${i18n['product.name']}" />
</f:facet> </f:facet>
<h:outputText value="#{cart.product.name}" /> <h:outputText value="#{cart.product.name}" />
</h:column> </p:column>
<h:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="${i18n['product.price']}" /> <h:outputText value="${i18n['product.price']}" />
</f:facet> </f:facet>
<h:outputText id="price" value="#{cart.product.price.abs()}"> <h:outputText id="price" value="#{cart.product.price.abs()}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" /> <f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
</h:outputText> </h:outputText>
</h:column> </p:column>
<h:column>
<f:facet name="header"> <p:column style="text-align: center;">
<h:outputText value="${i18n['product.totalPrice']}" />
</f:facet>
<h:outputText id="total" value="#{cart.price}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
</h:outputText>
</h:column>
<h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText id="count" value="${i18n['product.cart.count']}" /> <h:outputText id="count" value="${i18n['product.cart.count']}" />
</f:facet> </f:facet>
...@@ -55,48 +47,61 @@ ...@@ -55,48 +47,61 @@
<f:ajax render="@form" /> <f:ajax render="@form" />
</h:commandButton> </h:commandButton>
</h:column> </p:column>
<h:column rendered="#{productShopView.hasLimits}"> <p:column rendered="#{productShopView.hasLimits}">
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['productshop.limits']}" /> <h:outputText value="#{i18n['productshop.limits']}" />
</f:facet> </f:facet>
<h:outputText value="#{cart.limit}"> <h:outputText value="#{cart.limit}">
<f:convertNumber maxIntegerDigits="2" minFractionDigits="0" /> <f:convertNumber maxIntegerDigits="2" minFractionDigits="0" />
</h:outputText> </h:outputText>
</h:column> </p:column>
<h:column> <p:column>
<h:dataTable border="0" var="disc" value="#{cart.discounts}"> <h:dataTable border="0" var="disc" value="#{cart.discounts}">
<h:column> <p:column>
<h:outputText value="#{disc.shortdesc}" /> <h:outputText value="#{disc.shortdesc}" />
</h:column> </p:column>
<h:column> <p:column>
<h:outputText value="#{cart.getDiscount(disc.id)}"> <h:outputText value="#{cart.getDiscount(disc.id)}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" /> <f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
</h:outputText> </h:outputText>
</h:column> </p:column>
</h:dataTable> </h:dataTable>
</h:column> </p:column>
<p:column>
</h:dataTable> <f:facet name="header">
<h:outputText value="${i18n['product.totalPrice']}" />
<hr /> </f:facet>
<div> <h:outputText id="total" value="#{cart.price}">
<h:outputText value="#{i18n['productshop.total']} " /> <f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
<h:outputText value="#{productShopView.cartPrice}"> </h:outputText>
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" /> </p:column>
</h:outputText> <p:columnGroup type="footer">
</div> <p:row>
<h:panelGrid columns="3" > <p:column style="text-align: right;" colspan="4" footerText="#{i18n['productshop.total']}" />
<p:column footerText="#{productShopView.cartPrice}" />
</p:row>
</p:columnGroup>
</p:dataTable>
<br />
<h:panelGrid columns="3">
<h:outputText for="allowStats" value="#{i18n['bill.allowStatistics']}" /> <h:outputText for="allowStats" value="#{i18n['bill.allowStatistics']}" />
<h:selectBooleanCheckbox id="allowStats" value="#{productShopView.allowStatistics}" /> <h:selectBooleanCheckbox id="allowStats" value="#{productShopView.allowStatistics}" />
<h:message for="allowStats" /> <h:message for="allowStats" />
</h:panelGrid> </h:panelGrid>
<br />
<p:commandButton action="#{cc.attrs.commitaction}" id="commitbutton-botton" value="#{cc.attrs.commitValue}" />
<p:inputTextarea cols="50" rendered="#{productShopView.gatherBillInfo}" value="#{productShopView.otherInfo}" label="#{i18n['otherInfo']}" /> <p:inputTextarea cols="50" rendered="#{productShopView.gatherBillInfo}" value="#{productShopView.otherInfo}" label="#{i18n['otherInfo']}" />
<div> <h:commandButton action="#{cc.attrs.commitaction}" id="commitbutton-botton" value="#{cc.attrs.commitValue}" /></div>
</composite:implementation> </composite:implementation>
</html> </html>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite" xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:tools="http://java.sun.com/jsf/composite/tools"> xmlns:tools="http://java.sun.com/jsf/composite/tools" xmlns:p="http://primefaces.org/ui">
<composite:interface> <composite:interface>
...@@ -14,22 +14,22 @@ ...@@ -14,22 +14,22 @@
<h:form> <h:form>
<h:dataTable border="1" id="productListTable" <p:dataTable border="1" id="productListTable"
value="#{productView.userShoppableProducts}" var="product"> value="#{productView.userShoppableProducts}" var="product">
<h:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['product.name']}" /> <h:outputText value="#{i18n['product.name']}" />
</f:facet> </f:facet>
<h:outputText value="#{product.name}" /> <h:outputText value="#{product.name}" />
</h:column> </p:column>
<h:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['product.price']}" /> <h:outputText value="#{i18n['product.price']}" />
</f:facet> </f:facet>
<h:outputText value="#{product.price}" /> <h:outputText value="#{product.price}" />
</h:column> </p:column>
</h:dataTable> </p:dataTable>
</h:form> </h:form>
......
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
} }
#menu { #menu {
padding: 1em;
}
#aside {
margin: 1em; margin: 1em;
width: 200px; width: 200px;
} }
...@@ -39,6 +43,7 @@ ...@@ -39,6 +43,7 @@
#main { #main {
font-family: Oxygen, Calibri; font-family: Oxygen, Calibri;
font-size: 10pt; font-size: 10pt;
padding-right: 1em;
} }
#main p { #main p {
...@@ -143,7 +148,7 @@ h1 { ...@@ -143,7 +148,7 @@ h1 {
} }
nav { nav {
min-width: 225px; min-width: 200px;
background: white; background: white;
min-height: 400px; min-height: 400px;
border-bottom: 1px solid #aaa; border-bottom: 1px solid #aaa;
...@@ -155,7 +160,6 @@ nav { ...@@ -155,7 +160,6 @@ nav {
margin-right: 1em; margin-right: 1em;
border-right: 1px solid #aaa; border-right: 1px solid #aaa;
border-bottom: 1px solid #aaa; border-bottom: 1px solid #aaa;
background: white; background: white;
} }
......
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
</section> </section>
<aside class="flex1"> <aside class="flex1">
<div id="menu"> <div id="aside">
<div class="ui-widget-header">Login</div> <div class="ui-widget-header">Login</div>
<div class="ui-widget-content" style="text-align: center"> <div class="ui-widget-content" style="text-align: center">
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<p:column style="width:25%"> <p:column style="width:25%">
[kuva] [kuva]
</p:column> </p:column>
<p:column style="width:75%;"> <p:column style="width:75%;">
<p:inputText /> <p:inputText />
......
...@@ -5,37 +5,37 @@ ...@@ -5,37 +5,37 @@
<h:body> <h:body>
<ui:composition template="#{sessionHandler.template}"> <ui:composition template="#{sessionHandler.template}">
<f:metadata> <f:metadata>
<!-- <f:event type="preRenderView" listener="#{userOverviewView.initView()}" /> --> <f:event type="preRenderView" listener="#{tournamentCreateView.initView()}" />
</f:metadata> </f:metadata>
<ui:define name="content"> <ui:define name="content">
<h1>Create tournament</h1> <h1>#{i18n['actionlog.tournaments.admin.create_tournament']}</h1>
<h:form> <h:form>
<p:wizard widgetVar="wiz" flowListener="#{tournamentCreateView.onFlowProcess}"> <p:wizard widgetVar="wiz" flowListener="#{tournamentCreateView.onFlowProcess}">
<p:tab id="selectGame" title="Select a game"> <p:tab id="selectGame" title="#{i18n['actionlog.tournaments.admin.select_a_game']}">
<p:panel header="Select a game"> <p:panel>
<h:messages errorClass="error" /> <h:messages errorClass="error" />
Select a game <h2>#{i18n['actionlog.tournaments.admin.select_a_game']}</h2>
<p:selectOneMenu> <p:selectOneMenu>
<f:selectItem itemLabel="" /> <f:selectItem itemLabel="" />
<f:selectItem itemLabel="spurdo spärde" /> <f:selectItem itemLabel="spurdo spärde" />
<f:selectItem itemLabel="cockmaster" /> <f:selectItem itemLabel="cockmaster" />
</p:selectOneMenu> </p:selectOneMenu>
<h2>Create new game</h2> <h2>#{i18n['actionlog.tournaments.admin.create_a_game']}</h2>
<h:panelGrid columns="2"> <h:panelGrid columns="2">
<h:outputText value="Name" /> <h:outputText value="#{i18n['actionlog.tournaments.admin.game_name']}" />
<h:outputText value="Description" /> <h:outputText value="#{i18n['actionlog.tournaments.admin.game_description']}" />
<p:inputText /> <p:inputText />
<p:inputText /> <p:inputText />
<h:outputText value="Upload image" /> <h:outputText value="#{i18n['actionlog.tournaments.admin.upload_game_image']}" />
<h:outputText value="" /> <h:outputText value="" />
<p:fileUpload mode="simple" /> <p:fileUpload mode="simple" />
...@@ -43,10 +43,10 @@ ...@@ -43,10 +43,10 @@
</p:panel> </p:panel>
</p:tab> </p:tab>
<p:tab id="selectRuleset" title="Select a ruleset"> <p:tab id="selectRuleset" title="#{i18n['actionlog.tournaments.admin.rules']}">
<p:panel header="Select a ruleset"> <p:panel>
<h:messages errorClass="error" /> <h:messages errorClass="error" />
Select a ruleset <h2>#{i18n['actionlog.tournaments.admin.select_a_ruleset']}</h2>
<p:selectOneMenu> <p:selectOneMenu>
<f:selectItem itemLabel="" /> <f:selectItem itemLabel="" />
<f:selectItem itemLabel="Pro-rules" /> <f:selectItem itemLabel="Pro-rules" />
...@@ -54,39 +54,38 @@ ...@@ -54,39 +54,38 @@
</p:selectOneMenu> </p:selectOneMenu>
<br /> <br />
<h2>Create new ruleset</h2> <h2>#{i18n['actionlog.tournaments.admin.create_new_ruleset']}</h2>
<h:outputText value="Rule Name" /> <h:outputText value="#{i18n['actionlog.tournaments.ruleset_name']}" />
<br /> <br />
<p:inputText /> <p:inputText />
<br /> <br />
<h:outputText value="Description" /> <h:outputText value="#{i18n['actionlog.tournaments.ruleset_description']}" />
<br /> <br />
<p:inputTextarea /> <p:inputTextarea />
</p:panel> </p:panel>
</p:tab> </p:tab>
<p:tab id="selectRegTimes" title="Set registration times"> <p:tab id="selectRegTimes" title="#{i18n['actionlog.tournaments.admin.set_time_constraints']}">
<p:panel header="Select registration times"> <p:panel>
<h:messages errorClass="error" /> <h:messages errorClass="error" />
<h2>Registration</h2> <h2>#{i18n['actionlog.tournaments.admin.registration_time_constraints']}</h2>
<h:panelGrid columns="2"> <h:panelGrid columns="2">
<h:outputText value="Opens" /> <h:outputText value="#{i18n['actionlog.tournaments.registration_opens']}" />
<h:outputText value="Closees" /> <h:outputText value="#{i18n['actionlog.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" />
<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> </h:panelGrid>
<h2>Event Start time</h2> <h2>#{i18n['actionlog.tournaments.admin.begin_time_constraints']}</h2>
<h:panelGrid> <h:panelGrid>
<h:outputText value="Start time" /> <h:outputText value="Start time" />
<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> </h:panelGrid>
</p:panel> </p:panel>
<div style="float: right;"> <div style="float: right;">
<p:commandButton icon="apply" value="Create event" /> <p:commandButton icon="apply" value="#{i18n['actionlog.tournaments.admin.create_tournament']}" />
</div> </div>
</p:tab> </p:tab>
</p:wizard> </p:wizard>
</h:form> </h:form>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<h1>Tournaments</h1> <h1>Tournaments</h1>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
......
<!DOCTYPE html <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "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" <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:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
xmlns:f="http://java.sun.com/jsf/core">
<h:body> <h:body>
<ui:composition template="#{sessionHandler.template}"> <ui:composition template="#{sessionHandler.template}">
<f:metadata> <f:metadata>
...@@ -14,63 +13,67 @@ ...@@ -14,63 +13,67 @@
<h1>#{i18n['user.accountevents']}</h1> <h1>#{i18n['user.accountevents']}</h1>
</ui:define> </ui:define>
<ui:define name="content"> <ui:define name="content">
<h:outputLabel value="#{i18n['user.accountBalance']}: " for="accountbalance" />
<h:outputText id="accountbalance" value="#{userView.user.accountBalance}" /> <p:dataTable border="1" id="ac" value="#{userView.user.accountEvents}" var="ac">
<h:dataTable border="1" id="ac" value="#{userView.user.accountEvents}" var="ac"> <p:column>
<h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['accountEvent.productname']}" /> <h:outputText value="#{i18n['accountEvent.productname']}" />
</f:facet> </f:facet>
<h:outputText value="#{ac.product.name}" /> <h:outputText value="#{ac.product.name}" />
</h:column> </p:column>
<h:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['accountEvent.quantity']}" /> <h:outputText value="#{i18n['accountEvent.quantity']}" />
</f:facet> </f:facet>
<h:outputText value="#{ac.quantity}"> <h:outputText value="#{ac.quantity}">
<f:convertNumber minFractionDigits="2" maxFractionDigits="2" /> <f:convertNumber minFractionDigits="2" maxFractionDigits="2" />
</h:outputText> </h:outputText>
</h:column> </p:column>
<h:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['accountEvent.unitPrice']}" /> <h:outputText value="#{i18n['accountEvent.unitPrice']}" />
</f:facet> </f:facet>
<h:outputText value="#{ac.unitPrice}"> <h:outputText value="#{ac.unitPrice}">
<f:convertNumber minFractionDigits="2" maxFractionDigits="2" /> <f:convertNumber minFractionDigits="2" maxFractionDigits="2" />
</h:outputText> </h:outputText>
</h:column> </p:column>
<h:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['accountEvent.total']}" /> <h:outputText value="#{i18n['accountEvent.total']}" />
</f:facet> </f:facet>
<h:outputText value="#{ac.total}"> <h:outputText value="#{ac.total}">
<f:convertNumber minFractionDigits="2" maxFractionDigits="2" /> <f:convertNumber minFractionDigits="2" maxFractionDigits="2" />
</h:outputText> </h:outputText>
</h:column> </p:column>
<h:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['accountEvent.eventTime']}" /> <h:outputText value="#{i18n['accountEvent.eventTime']}" />
</f:facet> </f:facet>
<h:outputText value="#{ac.eventTime.time}"> <h:outputText value="#{ac.eventTime.time}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</h:column> </p:column>
<h:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['accountEvent.delivered']}" /> <h:outputText value="#{i18n['accountEvent.delivered']}" />
</f:facet> </f:facet>
<h:outputText rendered="#{!empty ac.delivered}" value="#{ac.delivered.time}"> <h:outputText rendered="#{!empty ac.delivered}" value="#{ac.delivered.time}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</h:column> </p:column>
<p:columnGroup type="footer">
<p:row>
<p:column colspan="3" style="text-align: right;" footerText="#{i18n['user.accountBalance']}" />
<p:column footerText="#{userView.user.accountBalance}" style="text-align: left;" />
</p:row>
</p:columnGroup>
<!-- <p:column> -->
<!-- <h:column> -->
<!-- <h:link outcome="/user/editAccountevent" value="#{i18n['accountEvent.edit']}"> --> <!-- <h:link outcome="/user/editAccountevent" value="#{i18n['accountEvent.edit']}"> -->
<!-- <f:param name="accountid" value="#{ac.id}" /> --> <!-- <f:param name="accountid" value="#{ac.id}" /> -->
<!-- </h:link> --> <!-- </h:link> -->
<!-- </h:column> --> <!-- </p:column> -->
</h:dataTable> </p:dataTable>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
</h:body> </h:body>
......
...@@ -2,7 +2,11 @@ package fi.codecrew.moya.web.cdiview.tournaments; ...@@ -2,7 +2,11 @@ package fi.codecrew.moya.web.cdiview.tournaments;
import java.io.Serializable; import java.io.Serializable;
import fi.codecrew.moya.beans.TournamentBeanLocal;
import fi.codecrew.moya.model.Role; import fi.codecrew.moya.model.Role;
import fi.codecrew.moya.model.Tournament;
import fi.codecrew.moya.model.TournamentGame;
import fi.codecrew.moya.model.TournamentRule;
import fi.codecrew.moya.web.cdiview.GenericCDIView; import fi.codecrew.moya.web.cdiview.GenericCDIView;
import javax.ejb.EJB; import javax.ejb.EJB;
...@@ -14,23 +18,29 @@ import org.primefaces.event.FlowEvent; ...@@ -14,23 +18,29 @@ import org.primefaces.event.FlowEvent;
@Named @Named
@ConversationScoped @ConversationScoped
public class TournamentCreateView implements Serializable { public class TournamentCreateView extends GenericCDIView {
/**
*
*/
private static final long serialVersionUID = 2547358764980373797L; private static final long serialVersionUID = 2547358764980373797L;
private TournamentRule rules = null;
private TournamentGame game = null;
private Tournament tournament = null;
@EJB TournamentBeanLocal tournamentBean;
public void initView() {
if(tournament == null) {
this.beginConversation();
tournament = new Tournament();
}
}
// called on finish
public void save(ActionEvent actionEvent) { public void save(ActionEvent actionEvent) {
} }
public String onFlowProcess(FlowEvent event) { public String onFlowProcess(FlowEvent event) {
System.out.println(event.getOldStep());
return event.getNewStep(); return event.getNewStep();
} }
} }
...@@ -316,9 +316,10 @@ public class UserView extends GenericCDIView { ...@@ -316,9 +316,10 @@ public class UserView extends GenericCDIView {
return permbean.isCurrentUser(user); return permbean.isCurrentUser(user);
} }
public void setCardState() public String setCardState()
{ {
printedCard = cardBean.saveCard(printedCard); printedCard = cardBean.saveCard(printedCard);
return null;
} }
/** /**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!