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"?>
<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>
<ejb-client-jar>MoyaBeansClient.jar</ejb-client-jar>
</ejb-jar>
\ No newline at end of file
......@@ -27,6 +27,7 @@ public class BootstrapBean implements BootstrapBeanLocal {
static {
// {"Query1","Query2",...}
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" });
}
......
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;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
......@@ -39,7 +40,9 @@ public class DBModelFacade extends GenericFacade<DBModel> {
CriteriaQuery<DBModel> cq = cb.createQuery(DBModel.class);
Root<DBModel> root = cq.from(DBModel.class);
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
......
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 {
@Column(name="players_per_team")
private Integer playersPerTeam;
@JoinColumn(name="game", nullable=false)
private TournamentGame tournamentGame;
@OneToMany
@OrderBy("id ASC")
private List<Tournament> subTournaments;
......@@ -105,4 +108,12 @@ public class Tournament extends GenericEntity implements Serializable {
public void setTournamentType(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"?>
<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">
<display-name>moya-ear</display-name>
<module>
<ejb>moya-beans-0.2.0.jar</ejb>
</module>
<module>
<web>
<web-uri>moya-web-0.2.0.war</web-uri>
<context-root>/MoyaWeb</context-root>
</web>
</module>
<library-directory>lib</library-directory>
<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">
<display-name>moya-ear</display-name>
<module>
<ejb>moya-beans-0.2.0.jar</ejb>
</module>
<module>
<web>
<web-uri>moya-web-0.2.0.war</web-uri>
<context-root>/MoyaWeb</context-root>
</web>
</module>
<library-directory>lib</library-directory>
</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
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 @@
<f:facet name="header">#{i18n['lanEventProperty.value']}</f:facet>
<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 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}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText>
......@@ -125,7 +125,7 @@
<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}" />
<h:message rendered="#{eventPropertyView.property.key.date}" for="textval" />
<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:message rendered="#{eventPropertyView.property.key.boolean}" for="booleanval" />
......
......@@ -2,7 +2,7 @@
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: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>
<ui:composition template="#{sessionHandler.template}">
<ui:param name="thispage" value="page.place.mygroups" />
......@@ -18,41 +18,41 @@
<h:outputText rendered="#{empty placeGroupView.groupMemberships}" value="#{i18n['placegroupview.noMemberships']}" />
<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">
<h:outputText value="#{i18n['placegroupview.reservationName']}" />
</f:facet>
<h:outputText value="#{member.placeReservation.name}" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['placegroupview.reservationProduct']}" />
</f:facet>
<h:outputText value="#{member.placeReservation.product.name}" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['placegroupview.token']}" />
</f:facet>
<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:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['placegroupview.groupCreator']}" />
</f:facet>
<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:column>
</p:column>
</h:dataTable>
</p:dataTable>
</h:form>
<p>
......
......@@ -67,15 +67,15 @@
<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: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: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: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: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: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: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: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: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: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:panelGrid>
......
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"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"
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">
<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">
<composite:interface>
......@@ -16,30 +15,23 @@
<!-- <h:outputScript target="head" library="script" name="shopscript.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">
<h:column>
<p:dataTable columnClasses="nowrap,numalign,numalign,numalign,nowrap" id="billcart" value="#{cc.attrs.items}" var="cart">
<p:column>
<f:facet name="header">
<h:outputText id="name" value="${i18n['product.name']}" />
</f:facet>
<h:outputText value="#{cart.product.name}" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="${i18n['product.price']}" />
</f:facet>
<h:outputText id="price" value="#{cart.product.price.abs()}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<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>
</p:column>
<p:column style="text-align: center;">
<f:facet name="header">
<h:outputText id="count" value="${i18n['product.cart.count']}" />
</f:facet>
......@@ -55,48 +47,61 @@
<f:ajax render="@form" />
</h:commandButton>
</h:column>
<h:column rendered="#{productShopView.hasLimits}">
</p:column>
<p:column rendered="#{productShopView.hasLimits}">
<f:facet name="header">
<h:outputText value="#{i18n['productshop.limits']}" />
</f:facet>
<h:outputText value="#{cart.limit}">
<f:convertNumber maxIntegerDigits="2" minFractionDigits="0" />
</h:outputText>
</h:column>
<h:column>
</p:column>
<p:column>
<h:dataTable border="0" var="disc" value="#{cart.discounts}">
<h:column>
<p:column>
<h:outputText value="#{disc.shortdesc}" />
</h:column>
</p:column>
<h:column>
<p:column>
<h:outputText value="#{cart.getDiscount(disc.id)}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
</h:outputText>
</h:column>
</p:column>
</h:dataTable>
</h:column>
</h:dataTable>
<hr />
<div>
<h:outputText value="#{i18n['productshop.total']} " />
<h:outputText value="#{productShopView.cartPrice}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
</h:outputText>
</div>
<h:panelGrid columns="3" >
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="${i18n['product.totalPrice']}" />
</f:facet>
<h:outputText id="total" value="#{cart.price}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
</h:outputText>
</p:column>
<p:columnGroup type="footer">
<p:row>
<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:selectBooleanCheckbox id="allowStats" value="#{productShopView.allowStatistics}" />
<h:message for="allowStats" />
</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']}" />
<div> <h:commandButton action="#{cc.attrs.commitaction}" id="commitbutton-botton" value="#{cc.attrs.commitValue}" /></div>
</composite:implementation>
</html>
......
......@@ -4,7 +4,7 @@
<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:tools="http://java.sun.com/jsf/composite/tools" xmlns:p="http://primefaces.org/ui">
<composite:interface>
......@@ -14,22 +14,22 @@
<h:form>
<h:dataTable border="1" id="productListTable"
<p:dataTable border="1" id="productListTable"
value="#{productView.userShoppableProducts}" var="product">
<h:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['product.name']}" />
</f:facet>
<h:outputText value="#{product.name}" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['product.price']}" />
</f:facet>
<h:outputText value="#{product.price}" />
</h:column>
</p:column>
</h:dataTable>
</p:dataTable>
</h:form>
......
......@@ -7,6 +7,10 @@
}
#menu {
padding: 1em;
}
#aside {
margin: 1em;
width: 200px;
}
......@@ -39,6 +43,7 @@
#main {
font-family: Oxygen, Calibri;
font-size: 10pt;
padding-right: 1em;
}
#main p {
......@@ -143,7 +148,7 @@ h1 {
}
nav {
min-width: 225px;
min-width: 200px;
background: white;
min-height: 400px;
border-bottom: 1px solid #aaa;
......@@ -155,7 +160,6 @@ nav {
margin-right: 1em;
border-right: 1px solid #aaa;
border-bottom: 1px solid #aaa;
background: white;
}
......
......@@ -100,7 +100,7 @@
</section>
<aside class="flex1">
<div id="menu">
<div id="aside">
<div class="ui-widget-header">Login</div>
<div class="ui-widget-content" style="text-align: center">
......
......@@ -29,7 +29,7 @@
<p:column style="width:25%">
[kuva]
</p:column>
</p:column>
<p:column style="width:75%;">
<p:inputText />
......
......@@ -5,37 +5,37 @@
<h:body>
<ui:composition template="#{sessionHandler.template}">
<f:metadata>
<!-- <f:event type="preRenderView" listener="#{userOverviewView.initView()}" /> -->
<f:event type="preRenderView" listener="#{tournamentCreateView.initView()}" />
</f:metadata>
<ui:define name="content">
<h1>Create tournament</h1>
<h1>#{i18n['actionlog.tournaments.admin.create_tournament']}</h1>
<h:form>
<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" />
Select a game
<h2>#{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>
<h2>Create new game</h2>
<h2>#{i18n['actionlog.tournaments.admin.create_a_game']}</h2>
<h:panelGrid columns="2">
<h:outputText value="Name" />
<h:outputText value="Description" />
<h:outputText value="#{i18n['actionlog.tournaments.admin.game_name']}" />
<h:outputText value="#{i18n['actionlog.tournaments.admin.game_description']}" />
<p:inputText />
<p:inputText />
<h:outputText value="Upload image" />
<h:outputText value="#{i18n['actionlog.tournaments.admin.upload_game_image']}" />
<h:outputText value="" />
<p:fileUpload mode="simple" />
......@@ -43,10 +43,10 @@
</p:panel>
</p:tab>
<p:tab id="selectRuleset" title="Select a ruleset">
<p:panel header="Select a ruleset">
<p:tab id="selectRuleset" title="#{i18n['actionlog.tournaments.admin.rules']}">
<p:panel>
<h:messages errorClass="error" />
Select a ruleset
<h2>#{i18n['actionlog.tournaments.admin.select_a_ruleset']}</h2>
<p:selectOneMenu>
<f:selectItem itemLabel="" />
<f:selectItem itemLabel="Pro-rules" />
......@@ -54,39 +54,38 @@
</p:selectOneMenu>
<br />
<h2>Create new ruleset</h2>
<h:outputText value="Rule Name" />
<h2>#{i18n['actionlog.tournaments.admin.create_new_ruleset']}</h2>
<h:outputText value="#{i18n['actionlog.tournaments.ruleset_name']}" />
<br />
<p:inputText />
<br />
<h:outputText value="Description" />
<h:outputText value="#{i18n['actionlog.tournaments.ruleset_description']}" />
<br />
<p:inputTextarea />
</p:panel>
</p:tab>
<p:tab id="selectRegTimes" title="Set registration times">
<p:panel header="Select registration times">
<p:tab id="selectRegTimes" title="#{i18n['actionlog.tournaments.admin.set_time_constraints']}">
<p:panel>
<h:messages errorClass="error" />
<h2>Registration</h2>
<h2>#{i18n['actionlog.tournaments.admin.registration_time_constraints']}</h2>
<h:panelGrid columns="2">
<h:outputText value="Opens" />
<h:outputText value="Closees" />
<h:outputText value="#{i18n['actionlog.tournaments.registration_opens']}" />
<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" />
</h:panelGrid>
<h2>Event Start time</h2>
<h2>#{i18n['actionlog.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="Create event" />
<p:commandButton icon="apply" value="#{i18n['actionlog.tournaments.admin.create_tournament']}" />
</div>
</p:tab>
</p:wizard>
</h:form>
......
......@@ -12,7 +12,7 @@
<h1>Tournaments</h1>
</ui:define>
</ui:composition>
......
<!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:f="http://java.sun.com/jsf/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: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>
<ui:composition template="#{sessionHandler.template}">
<f:metadata>
......@@ -14,63 +13,67 @@
<h1>#{i18n['user.accountevents']}</h1>
</ui:define>
<ui:define name="content">
<h:outputLabel value="#{i18n['user.accountBalance']}: " for="accountbalance" />
<h:outputText id="accountbalance" value="#{userView.user.accountBalance}" />
<h:dataTable border="1" id="ac" value="#{userView.user.accountEvents}" var="ac">
<h:column>
<p:dataTable border="1" id="ac" value="#{userView.user.accountEvents}" var="ac">
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['accountEvent.productname']}" />
</f:facet>
<h:outputText value="#{ac.product.name}" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['accountEvent.quantity']}" />
</f:facet>
<h:outputText value="#{ac.quantity}">
<f:convertNumber minFractionDigits="2" maxFractionDigits="2" />
</h:outputText>
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['accountEvent.unitPrice']}" />
</f:facet>
<h:outputText value="#{ac.unitPrice}">
<f:convertNumber minFractionDigits="2" maxFractionDigits="2" />
</h:outputText>
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['accountEvent.total']}" />
</f:facet>
<h:outputText value="#{ac.total}">
<f:convertNumber minFractionDigits="2" maxFractionDigits="2" />
</h:outputText>
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['accountEvent.eventTime']}" />
</f:facet>
<h:outputText value="#{ac.eventTime.time}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText>
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['accountEvent.delivered']}" />
</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}" />
</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>
<!-- <h:column> -->
<!-- <p:column> -->
<!-- <h:link outcome="/user/editAccountevent" value="#{i18n['accountEvent.edit']}"> -->
<!-- <f:param name="accountid" value="#{ac.id}" /> -->
<!-- </h:link> -->
<!-- </h:column> -->
</h:dataTable>
<!-- </p:column> -->
</p:dataTable>
</ui:define>
</ui:composition>
</h:body>
......
......@@ -2,7 +2,11 @@ package fi.codecrew.moya.web.cdiview.tournaments;
import java.io.Serializable;
import fi.codecrew.moya.beans.TournamentBeanLocal;
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 javax.ejb.EJB;
......@@ -14,23 +18,29 @@ import org.primefaces.event.FlowEvent;
@Named
@ConversationScoped
public class TournamentCreateView implements Serializable {
/**
*
*/
public class TournamentCreateView extends GenericCDIView {
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 String onFlowProcess(FlowEvent event) {
System.out.println(event.getOldStep());
return event.getNewStep();
}
}
......@@ -316,9 +316,10 @@ public class UserView extends GenericCDIView {
return permbean.isCurrentUser(user);
}
public void setCardState()
public String setCardState()
{
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!