Commit 004f57d0 by Tuukka Kivilahti

Merge remote-tracking branch 'origin/master' into barcodefix_for_incomingviews

Conflicts:
	code/moya-beans/ejbModule/fi/codecrew/moya/facade/GroupMembershipFacade.java
2 parents 37cc2361 b1c2c9b5
Showing with 473 additions and 254 deletions
...@@ -250,6 +250,12 @@ public class BootstrapBean implements BootstrapBeanLocal { ...@@ -250,6 +250,12 @@ public class BootstrapBean implements BootstrapBeanLocal {
"ALTER TABLE group_memberships DROP COLUMN place_product", "ALTER TABLE group_memberships DROP COLUMN place_product",
}); });
dbUpdates.add(new String[] {
"DELETE FROM products_product_limitations where productlimits_id in (SELECT id FROM product_limitations WHERE TYPE = 'PLACE')",
"DELETE FROM product_limitations WHERE TYPE = 'PLACE'",
});
} }
public BootstrapBean() { public BootstrapBean() {
......
...@@ -280,16 +280,6 @@ public class ProductBean implements ProductBeanLocal { ...@@ -280,16 +280,6 @@ public class ProductBean implements ProductBeanLocal {
switch (limit.getType()) switch (limit.getType())
{ {
case PLACE: {
Long reserved = 0L;
Long available = 0L;
for (Product p : limit.getProducts()) {
reserved += gmfacade.findPlaceProductCount(p);
available += placeFacade.findCountForProduct(p);
}
ret = BigDecimal.valueOf(available - reserved).subtract(count);
break;
}
case GLOBAL_BILLED: { case GLOBAL_BILLED: {
BigDecimal globBillTot = BigDecimal.ZERO; BigDecimal globBillTot = BigDecimal.ZERO;
for (Product p : limit.getProducts()) { for (Product p : limit.getProducts()) {
......
...@@ -72,7 +72,7 @@ public class GroupMembershipFacade extends IntegerPkGenericFacade<GroupMembershi ...@@ -72,7 +72,7 @@ public class GroupMembershipFacade extends IntegerPkGenericFacade<GroupMembershi
} }
public GroupMembership findByToken(String token) { public GroupMembership findByToken(String token) {
if(token == null || token.trim().isEmpty()) if (token == null || token.trim().isEmpty())
return null; return null;
CriteriaBuilder cb = getEm().getCriteriaBuilder(); CriteriaBuilder cb = getEm().getCriteriaBuilder();
...@@ -160,84 +160,54 @@ public class GroupMembershipFacade extends IntegerPkGenericFacade<GroupMembershi ...@@ -160,84 +160,54 @@ public class GroupMembershipFacade extends IntegerPkGenericFacade<GroupMembershi
); );
return getEm().createQuery(cq).getResultList(); return getEm().createQuery(cq).getResultList();
} }
public Long findPlaceProductCount(Product product) {
return null;
/* CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<Long> cq = cb.createQuery(Long.class);
Root<GroupMembership> root = cq.from(GroupMembership.class);
cq.select(cb.count(root));
cq.where(cb.equal(root.get(GroupMembership_.placeProduct), product));
return super.getSingleNullableResult(getEm().createQuery(cq));
*/
}
public Long findGroupMembershipsCount() { public Long findGroupMembershipsCount() {
CriteriaBuilder cb = getEm().getCriteriaBuilder(); CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<Long> cq = cb.createQuery(Long.class); CriteriaQuery<Long> cq = cb.createQuery(Long.class);
Root<GroupMembership> root = cq.from(GroupMembership.class); Root<GroupMembership> root = cq.from(GroupMembership.class);
Path<PlaceGroup> pg = root.get(GroupMembership_.placeGroup); Path<PlaceGroup> pg = root.get(GroupMembership_.placeGroup);
cq.select(cb.count(root)); cq.select(cb.count(root));
cq.where(cb.equal(pg.get(PlaceGroup_.event), eventbean.getCurrentEvent())); cq.where(cb.equal(pg.get(PlaceGroup_.event), eventbean.getCurrentEvent()));
return super.getSingleNullableResult(getEm().createQuery(cq)); return super.getSingleNullableResult(getEm().createQuery(cq));
} }
public Long findGroupMembershipsEnteredCount() { public Long findGroupMembershipsEnteredCount() {
CriteriaBuilder cb = getEm().getCriteriaBuilder(); CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<Long> cq = cb.createQuery(Long.class); CriteriaQuery<Long> cq = cb.createQuery(Long.class);
Root<GroupMembership> root = cq.from(GroupMembership.class); Root<GroupMembership> root = cq.from(GroupMembership.class);
Path<PlaceGroup> pg = root.get(GroupMembership_.placeGroup); Path<PlaceGroup> pg = root.get(GroupMembership_.placeGroup);
cq.select(cb.count(root)); cq.select(cb.count(root));
cq.where(cb.not(cb.isNull(root.get(GroupMembership_.enteredEvent))), cq.where(cb.not(cb.isNull(root.get(GroupMembership_.enteredEvent))),
cb.equal(pg.get(PlaceGroup_.event), eventbean.getCurrentEvent()) cb.equal(pg.get(PlaceGroup_.event), eventbean.getCurrentEvent())
); );
return super.getSingleNullableResult(getEm().createQuery(cq)); return super.getSingleNullableResult(getEm().createQuery(cq));
} }
public List<GroupMembership> findAllEnteredBetween(long startTimestamp, long endTimestamp) { public List<GroupMembership> findAllEnteredBetween(long startTimestamp, long endTimestamp) {
CriteriaBuilder cb = getEm().getCriteriaBuilder(); CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<GroupMembership> cq = cb.createQuery(GroupMembership.class); CriteriaQuery<GroupMembership> cq = cb.createQuery(GroupMembership.class);
Root<GroupMembership> root = cq.from(GroupMembership.class); Root<GroupMembership> root = cq.from(GroupMembership.class);
Path<PlaceGroup> pg = root.get(GroupMembership_.placeGroup); Path<PlaceGroup> pg = root.get(GroupMembership_.placeGroup);
Calendar c1 = Calendar.getInstance(); Calendar c1 = Calendar.getInstance();
Calendar c2 = Calendar.getInstance(); Calendar c2 = Calendar.getInstance();
c1.setTimeInMillis(startTimestamp); c1.setTimeInMillis(startTimestamp);
c2.setTimeInMillis(endTimestamp); c2.setTimeInMillis(endTimestamp);
cq.where(cb.between(root.get(GroupMembership_.enteredEvent), c1, c2), cq.where(cb.between(root.get(GroupMembership_.enteredEvent), c1, c2),
cb.equal(pg.get(PlaceGroup_.event), eventbean.getCurrentEvent())); cb.equal(pg.get(PlaceGroup_.event), eventbean.getCurrentEvent()));
return getEm().createQuery(cq).getResultList(); return getEm().createQuery(cq).getResultList();
} }
} }
...@@ -20,5 +20,10 @@ package fi.codecrew.moya.model; ...@@ -20,5 +20,10 @@ package fi.codecrew.moya.model;
public enum ProductLimitationType { public enum ProductLimitationType {
GLOBAL_BILLED, GLOBAL_BILL_PAID, GLOBAL_ACCOUNTEVENTS, USER_BILLED, USER_BILL_PAID, USER_ACCOUNTEVENTS, PLACE GLOBAL_BILLED,
GLOBAL_BILL_PAID,
GLOBAL_ACCOUNTEVENTS,
USER_BILLED,
USER_BILL_PAID,
USER_ACCOUNTEVENTS
} }
...@@ -131,6 +131,22 @@ ...@@ -131,6 +131,22 @@
<artifactId>jvm-breakglass</artifactId> <artifactId>jvm-breakglass</artifactId>
<version>0.0.7</version> <version>0.0.7</version>
</dependency> </dependency>
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-jaxrs_2.11</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-servlet_2.11</artifactId>
<version>${swagger.version}</version>
</dependency>
</dependencies> </dependencies>
<parent> <parent>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>moya-restpojo</artifactId> <artifactId>moya-restpojo</artifactId>
<groupId>fi.codecrew.moya</groupId> <groupId>fi.codecrew.moya</groupId>
<version>1.0.2</version> <version>1.0.5</version>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
......
...@@ -4,12 +4,16 @@ import javax.xml.bind.annotation.XmlElement; ...@@ -4,12 +4,16 @@ import javax.xml.bind.annotation.XmlElement;
public class UserReservationPlacePojo { public class UserReservationPlacePojo {
@XmlElement @XmlElement(name = "placeid")
private Integer placeid; private Integer placeid;
@XmlElement @XmlElement(name = "placename")
private String placename; private String placename;
@XmlElement @XmlElement(name = "placegiven")
private boolean placegiven; private boolean placegiven;
@XmlElement(name = "productid")
private Integer productId;
@XmlElement(name = "productname")
private String productName;
public String getPlacename() { public String getPlacename() {
return placename; return placename;
...@@ -35,4 +39,20 @@ public class UserReservationPlacePojo { ...@@ -35,4 +39,20 @@ public class UserReservationPlacePojo {
this.placeid = placeid; this.placeid = placeid;
} }
public Integer getProductId() {
return productId;
}
public void setProductId(Integer productId) {
this.productId = productId;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
} }
...@@ -26,6 +26,7 @@ import javax.xml.bind.annotation.XmlRootElement; ...@@ -26,6 +26,7 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement() @XmlRootElement()
public class UserReservationRoot { public class UserReservationRoot {
private EventUserRestPojo user;
private List<UserReservationPlacePojo> reservations = new ArrayList<UserReservationPlacePojo>(); private List<UserReservationPlacePojo> reservations = new ArrayList<UserReservationPlacePojo>();
public UserReservationRoot() { public UserReservationRoot() {
...@@ -40,6 +41,12 @@ public class UserReservationRoot { ...@@ -40,6 +41,12 @@ public class UserReservationRoot {
this.reservations = reservations; this.reservations = reservations;
} }
public EventUserRestPojo getUser() {
return user;
}
public void setUser(EventUserRestPojo user) {
this.user = user;
}
} }
...@@ -16,11 +16,9 @@ ...@@ -16,11 +16,9 @@
listener="#{actionLogMessageView.initView}" /> listener="#{actionLogMessageView.initView}" />
</f:metadata> </f:metadata>
<ui:define name="content"> <ui:define name="content">
<h:outputStylesheet library="style"
name="templates/insomnia2/css/actionlog.css" />
<h1>#{i18n['actionlog.messagelist.header']}</h1> <h1>#{i18n['actionlog.messagelist.header']}</h1>
<p>#{i18n['actionlog.messagelist.description']}</p> <p>#{i18n['actionlog.messagelist.description']}</p>
<h:form id="actionlog"> <h:form id="actionlog" styleClass="moya_datatable4">
<h2>#{i18n['actionlog.create.header']}</h2> <h2>#{i18n['actionlog.create.header']}</h2>
<p:messages /> <p:messages />
<h:panelGrid columns="2"> <h:panelGrid columns="2">
......
...@@ -9,38 +9,40 @@ ...@@ -9,38 +9,40 @@
<f:event type="preRenderView" listener="#{billListView.initSummaryView}" /> <f:event type="preRenderView" listener="#{billListView.initSummaryView}" />
</f:metadata> </f:metadata>
<ui:define name="content"> <ui:define name="content">
<h:dataTable border="0" id="billSummary" value="#{billListView.billsummary}" var="sumline" styleClass="moya_datatable2"> <h:form id="billsummary" styleClass="moya_datatable2">
<h:column> <h:dataTable border="0" id="billSummary" value="#{billListView.billsummary}" var="sumline" styleClass="moya_datatable2">
<f:facet name="header"> <h:column>
<h:outputText value="${i18n['product.name']}" /> <f:facet name="header">
</f:facet> <h:outputText value="${i18n['product.name']}" />
<h:outputText value="#{sumline.name}" /> </f:facet>
</h:column> <h:outputText value="#{sumline.name}" />
<h:column> </h:column>
<f:facet name="header"> <h:column>
<h:outputText value="${i18n['product.boughtTotal']}" /> <f:facet name="header">
</f:facet> <h:outputText value="${i18n['product.boughtTotal']}" />
<h:outputText value="#{sumline.active}"> </f:facet>
<f:convertNumber /> <h:outputText value="#{sumline.active}">
</h:outputText> <f:convertNumber />
</h:column> </h:outputText>
<h:column> </h:column>
<f:facet name="header"> <h:column>
<h:outputText value="${i18n['product.paid']}" /> <f:facet name="header">
</f:facet> <h:outputText value="${i18n['product.paid']}" />
<h:outputText value="#{sumline.paid}"> </f:facet>
<f:convertNumber /> <h:outputText value="#{sumline.paid}">
</h:outputText> <f:convertNumber />
</h:column> </h:outputText>
<h:column> </h:column>
<f:facet name="header"> <h:column>
<h:outputText value="${i18n['product.expired']}" /> <f:facet name="header">
</f:facet> <h:outputText value="${i18n['product.expired']}" />
<h:outputText value="#{sumline.expired}"> </f:facet>
<f:convertNumber /> <h:outputText value="#{sumline.expired}">
</h:outputText> <f:convertNumber />
</h:column> </h:outputText>
</h:dataTable> </h:column>
</h:dataTable>
</h:form>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
</h:body> </h:body>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</p:outputPanel> </p:outputPanel>
</h:form> </h:form>
<h:form id="orgform"> <h:form id="orgform" styleClass="moya_datatable1">
<p:fieldset legend="#{i18n['eventorg.basicDetails']}"> <p:fieldset legend="#{i18n['eventorg.basicDetails']}">
<p:panelGrid columns="3"> <p:panelGrid columns="3">
<p:outputLabel for="id" value="#{i18n['event.id']}:" /> <p:outputLabel for="id" value="#{i18n['event.id']}:" />
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
<br /><br /><br /><br /><br /> <br /><br /><br /><br /><br />
<h2>#{i18n['event.domains.title']}</h2> <h2>#{i18n['event.domains.title']}</h2>
<h:form id="newDomainForm"> <h:form id="newDomainForm" styleClass="moya_datatable2">
<h:inputText value="#{eventorgView.newdomain}" /> <h:inputText value="#{eventorgView.newdomain}" />
<h:commandButton action="#{eventorgView.addDomain()}" value="#{i18n['eventdomain.add']}" /> <h:commandButton action="#{eventorgView.addDomain()}" value="#{i18n['eventdomain.add']}" />
<h:dataTable var="domain" value="#{eventorgView.eventdomains}"> <h:dataTable var="domain" value="#{eventorgView.eventdomains}">
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</h:form> </h:form>
<h2>#{i18n['event.properties.title']}</h2> <h2>#{i18n['event.properties.title']}</h2>
<h:form id="propertyListForm"> <h:form id="propertyListForm" styleClass="moya_datatable2">
<h:dataTable var="prop" id="propertyListTable" value="#{eventPropertyView.properties}"> <h:dataTable var="prop" id="propertyListTable" value="#{eventPropertyView.properties}">
<h:column> <h:column>
<f:facet name="header">#{i18n['lanEventProperty.key']}</f:facet> <f:facet name="header">#{i18n['lanEventProperty.key']}</f:facet>
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
</h:dataTable> </h:dataTable>
</h:form> </h:form>
<h:form id="propertyCreateForm"> <h:form id="propertyCreateForm" styleClass="moya_datatable1">
<h:selectOneMenu id="propval" value="#{eventPropertyView.createKey}"> <h:selectOneMenu id="propval" value="#{eventPropertyView.createKey}">
<f:selectItems value="#{eventPropertyView.availablePropertyKeys}" /> <f:selectItems value="#{eventPropertyView.availablePropertyKeys}" />
</h:selectOneMenu> </h:selectOneMenu>
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<h:message for="propval" /> <h:message for="propval" />
</h:form> </h:form>
<h:form id="propertyEditForm" rendered="#{!empty eventPropertyView.property}" enctype="#{eventPropertyView.property.key.data?'multipart/form-data':''}"> <h:form id="propertyEditForm" rendered="#{!empty eventPropertyView.property}" enctype="#{eventPropertyView.property.key.data?'multipart/form-data':''}" styleClass="moya_datatable2">
<h:panelGrid columns="3"> <h:panelGrid columns="3">
<h:outputLabel for="key" value="#{i18n['lanEventProperty.key']}" /> <h:outputLabel for="key" value="#{i18n['lanEventProperty.key']}" />
<h:outputText value="#{eventPropertyView.property.key}" id="key" /> <h:outputText value="#{eventPropertyView.property.key}" id="key" />
...@@ -168,10 +168,10 @@ ...@@ -168,10 +168,10 @@
<p:commandButton ajax="false" action="#{eventPropertyView.saveProperty}" value="#{i18n['lanEventProperty.save']}" update=":propertyEditForm,:propertyListForm" /> <p:commandButton ajax="false" action="#{eventPropertyView.saveProperty}" value="#{i18n['lanEventProperty.save']}" update=":propertyEditForm,:propertyListForm" />
</h:form> </h:form>
<h2>#{i18n['event.privateProperties.title']}</h2>
<ui:fragment id="privatePropertyEditor" rendered="#{eventPropertyView.privatePropertyPermission}"> <ui:fragment id="privatePropertyEditor" rendered="#{eventPropertyView.privatePropertyPermission}">
<h2>#{i18n['event.privateProperties.title']}</h2> <h:form id="privPropList" styleClass="moya_datatable2">
<h:form id="privPropList">
<h:dataTable var="prop" value="#{eventPropertyView.privateProperties}"> <h:dataTable var="prop" value="#{eventPropertyView.privateProperties}">
<h:column> <h:column>
<f:facet name="header">#{i18n['lanEventPrivateProperty.key']}</f:facet> <f:facet name="header">#{i18n['lanEventPrivateProperty.key']}</f:facet>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<h1>#{i18n['foodWave.list']}</h1> <h1>#{i18n['foodWave.list']}</h1>
</ui:define> </ui:define>
<ui:define name="content"> <ui:define name="content">
<h:form> <h:form id="listFoodwaves" styleClass="moya_datatable2">
<p:dataTable styleClass="bordertable" value="#{foodWaveView.foodWaves}" sortBy="#{foodwave.time}" sortOrder="ascending" var="foodwave" editable="true" rowStyleClass="#{not foodwave.isOrderable() ? foodwave.isDelivered() ? 'hidden' : 'closed' : null}"> <p:dataTable styleClass="bordertable" value="#{foodWaveView.foodWaves}" sortBy="#{foodwave.time}" sortOrder="ascending" var="foodwave" editable="true" rowStyleClass="#{not foodwave.isOrderable() ? foodwave.isDelivered() ? 'hidden' : 'closed' : null}">
<p:ajax event="rowEdit" listener="#{foodWaveView.onEditFoodWave}" /> <p:ajax event="rowEdit" listener="#{foodWaveView.onEditFoodWave}" />
<f:facet name="header"> <f:facet name="header">
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<br /> <br />
<br /> <br />
<h:form> <h:form id="listfoodwaves_delivered" styleClass="moya_datatable2">
<p:dataTable styleClass="bordertable" value="#{foodWaveView.foodWaves}" sortBy="#{foodwave.time}" sortOrder="ascending" var="foodwave" editable="true" rowStyleClass="#{not foodwave.isOrderable() ? foodwave.isDelivered() ? 'closed' : 'hidden' : 'hidden'}"> <p:dataTable styleClass="bordertable" value="#{foodWaveView.foodWaves}" sortBy="#{foodwave.time}" sortOrder="ascending" var="foodwave" editable="true" rowStyleClass="#{not foodwave.isOrderable() ? foodwave.isDelivered() ? 'closed' : 'hidden' : 'hidden'}">
<!-- rowStyleClass="#{foodWave.closed ? 'old' : null} --> <!-- rowStyleClass="#{foodWave.closed ? 'old' : null} -->
<p:ajax event="rowEdit" listener="#{foodWaveView.onEditFoodWave}" /> <p:ajax event="rowEdit" listener="#{foodWaveView.onEditFoodWave}" />
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<ui:define name="content"> <ui:define name="content">
<infoview:userselector /> <infoview:userselector />
<br /><br /><br /><br /><br /><br /> <br /><br />
<reader:multireaderselect /> <reader:multireaderselect />
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<ui:define name="content"> <ui:define name="content">
<h:form id="viewlecturesform"> <h:form id="viewlecturesform" styleClass="moya_datatable2">
<p:fieldset rendered="#{lectureReportsView.lectureGroupsVisible}" id="lectureGroups" legend="#{i18n['lecture.selectgroup']}"> <p:fieldset rendered="#{lectureReportsView.lectureGroupsVisible}" id="lectureGroups" legend="#{i18n['lecture.selectgroup']}">
<p:dataTable value="#{lectureReportsView.lectureGroups}" var="lectureGroup"> <p:dataTable value="#{lectureReportsView.lectureGroups}" var="lectureGroup">
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<ui:define name="content"> <ui:define name="content">
<h:form id="managelecturegroups"> <h:form id="managelecturegroups" styleClass="moya_datatable2">
<p:dataTable id="lecturegroups" var="lectureGroup" value="#{lectureGroupView.lectureGroups}"> <p:dataTable id="lecturegroups" var="lectureGroup" value="#{lectureGroupView.lectureGroups}">
<p:column headerText="#{i18n['lectureGroup.name']}"> <p:column headerText="#{i18n['lectureGroup.name']}">
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<p:commandButton value="#{i18n['no']}" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" /> <p:commandButton value="#{i18n['no']}" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
</p:confirmDialog> </p:confirmDialog>
<p:fieldset legend="#{lectureReportsView.currentLecture.name}"> <p:fieldset legend="#{lectureReportsView.currentLecture.name}" styleClass="moya_datatable2">
<p:panelGrid columns="2"> <p:panelGrid columns="2">
<p:outputLabel value="#{i18n['lecture.description']}" /> <p:outputLabel value="#{i18n['lecture.description']}" />
<h:outputText value="#{lectureReportsView.currentLecture.description}" /> <h:outputText value="#{lectureReportsView.currentLecture.description}" />
...@@ -37,10 +37,7 @@ ...@@ -37,10 +37,7 @@
</p:panelGrid> </p:panelGrid>
</p:fieldset> </p:fieldset>
<br /> <br />
<br /> <h:form id="manageParticipants" styleClass="moya_datatable2">
<br />
<br />
<h:form id="manageParticipants">
<p:dataTable id="participants" value="#{lectureReportsView.currentLecture.participants}" var="user"> <p:dataTable id="participants" value="#{lectureReportsView.currentLecture.participants}" var="user">
<p:column> <p:column>
<h:outputText value="#{user.user.nick}" /> <h:outputText value="#{user.user.nick}" />
...@@ -69,9 +66,6 @@ ...@@ -69,9 +66,6 @@
</p:dataTable> </p:dataTable>
</h:form> </h:form>
<br /> <br />
<br />
<br />
<br />
<h:form> <h:form>
<p:fieldset styleClass="no_print" legend="#{i18n['manageparticipants.addUser']}"> <p:fieldset styleClass="no_print" legend="#{i18n['manageparticipants.addUser']}">
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</p:outputPanel> </p:outputPanel>
<p:fieldset rendered="#{lectureUserView.lectureGroupsVisible}" id="lectureGroups" legend="#{i18n['lecture.selectgroup']}"> <p:fieldset rendered="#{lectureUserView.lectureGroupsVisible}" id="lectureGroups" legend="#{i18n['lecture.selectgroup']}">
<p:dataTable value="#{lectureUserView.lectureGroups}" var="lectureGroup"> <p:dataTable value="#{lectureUserView.lectureGroups}" var="lectureGroup" >
<p:column headerText="#{i18n['lectureGroup.name']}"> <p:column headerText="#{i18n['lectureGroup.name']}">
<h:outputText value="#{lectureGroup.name}" /> <h:outputText value="#{lectureGroup.name}" />
</p:column> </p:column>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<ui:define name="content"> <ui:define name="content">
<h:form id="licenseForm"> <h:form id="licenseForm" styleClass="moya_datatable2">
<p:dataTable border="1" id="games" value="#{licenseView.licenses}" var="license"> <p:dataTable border="1" id="games" value="#{licenseView.licenses}" var="license">
<p:column> <p:column>
<f:facet name="header"> <f:facet name="header">
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<br /><br /> <br /><br />
<h:form id="editgame" > <h:form id="editgame" styleClass="moya_datatable6">
<p:panelGrid columns="2"> <p:panelGrid columns="2">
<f:facet name="header"> <f:facet name="header">
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<f:event type="preRenderView" listener="#{networkAssociationView.initView}" /> <f:event type="preRenderView" listener="#{networkAssociationView.initView}" />
</f:metadata> </f:metadata>
<ui:define name="content"> <ui:define name="content">
<h:form> <h:form id="networkassociation" styleClass="moya_datatable2">
<p:commandButton style="width: 0px; height: 0px;" value="#{i18n['networkassociation.create_association']}" action="#{networkAssociationView.createAssociation}" update="@form"/> <p:commandButton style="width: 0px; height: 0px;" value="#{i18n['networkassociation.create_association']}" action="#{networkAssociationView.createAssociation}" update="@form"/>
<p:messages autoUpdate="true" redisplay="false"></p:messages> <p:messages autoUpdate="true" redisplay="false"></p:messages>
<h1>#{i18n['networkassociation.current_associations']}</h1> <h1>#{i18n['networkassociation.current_associations']}</h1>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<p:commandButton value="#{i18n['networkassociation.drop_association']}" action="#{networkAssociationView.dropAssociation(activeAssoc.id)}" update="@form" immediate="true"/> <p:commandButton value="#{i18n['networkassociation.drop_association']}" action="#{networkAssociationView.dropAssociation(activeAssoc.id)}" update="@form" immediate="true"/>
</p:column> </p:column>
</p:dataTable> </p:dataTable>
<br />
<h1>#{i18n['networkassociation.pending_associations']}</h1> <h1>#{i18n['networkassociation.pending_associations']}</h1>
<p:dataTable var="activeAssoc" value="#{networkAssociationView.pendingAssociations}"> <p:dataTable var="activeAssoc" value="#{networkAssociationView.pendingAssociations}">
<p:column headerText="#{i18n['networkassociation.create_time']}"> <p:column headerText="#{i18n['networkassociation.create_time']}">
...@@ -88,8 +88,10 @@ ...@@ -88,8 +88,10 @@
</p:column> </p:column>
</p:dataTable> </p:dataTable>
<br /> <br />
<h:panelGrid columns="3">
<h:outputText value="#{i18n['networkassociation.ip_address']}" /> <h:panelGrid columns="3" id="ip_mac_address">
<h:outputText value="#{i18n['networkassociation.ip_address']}"/>
<h:outputText value="#{i18n['networkassociation.mac_address']}" /> <h:outputText value="#{i18n['networkassociation.mac_address']}" />
<h:outputText value="" /> <h:outputText value="" />
......
...@@ -10,37 +10,39 @@ ...@@ -10,37 +10,39 @@
</f:metadata> </f:metadata>
<ui:define name="content"> <ui:define name="content">
<h:form id="pageslist" styleClass="moya_datatable2">
<h1>#{i18n['sitepagelist.header']}</h1> <h1>#{i18n['sitepagelist.header']}</h1>
<h:dataTable styleClass="bordertable" id="user" value="#{sitePageView.pages}" var="page"> <h:dataTable styleClass="bordertable" id="user" value="#{sitePageView.pages}" var="page">
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
# #
</f:facet> </f:facet>
<h:outputText value="#{page.id}" /> <h:outputText value="#{page.id}" />
</h:column> </h:column>
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['sitepage.name']}" /> <h:outputText value="#{i18n['sitepage.name']}" />
</f:facet> </f:facet>
<h:outputText value="#{page.name}" /> <h:outputText value="#{page.name}" />
</h:column> </h:column>
<h:column > <h:column >
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['sitepage.roles']}" /> <h:outputText value="#{i18n['sitepage.roles']}" />
</f:facet> </f:facet>
<ul> <ul>
<ui:repeat var="r" value="#{page.allowedRoles}"> <ui:repeat var="r" value="#{page.allowedRoles}">
<li><h:outputText value="#{r.name}" /></li> <li><h:outputText value="#{r.name}" /></li>
</ui:repeat> </ui:repeat>
</ul> </ul>
</h:column> </h:column>
<h:column> <h:column>
<h:link outcome="/pages/edit" value="#{i18n['sitepage.edit']}"> <h:link outcome="/pages/edit" value="#{i18n['sitepage.edit']}">
<f:param name="id" value="#{page.id}" /> <f:param name="id" value="#{page.id}" />
</h:link> </h:link>
</h:column> </h:column>
</h:dataTable> </h:dataTable>
</h:form>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
</h:body> </h:body>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<composite:implementation> <composite:implementation>
<h:form> <h:form id="maplist" styleClass="moya_datatable2">
<h:dataTable border="1" id="productListTable" value="#{mapManageView.maps}" var="map"> <h:dataTable border="1" id="productListTable" value="#{mapManageView.maps}" var="map">
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<composite:implementation> <composite:implementation>
<h:form id="orgrolelist"> <h:form id="orgrolelist" styleClass="moya_datatable2">
<h:dataTable border="1" id="user" value="#{orgRoleDataView.orgRoles}" <h:dataTable border="1" id="user" value="#{orgRoleDataView.orgRoles}"
var="orgRole"> var="orgRole">
<h:column> <h:column>
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<composite:implementation> <composite:implementation>
<h:form> <h:form id="product_list" styleClass="moya_datatable2">
<h:dataTable border="1" id="product" value="#{productListView.results}" var="product"> <h:dataTable border="1" id="product" value="#{productListView.results}" styleClass="moya_datatable2" var="product">
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="${i18n['product.name']}" /> <h:outputText value="${i18n['product.name']}" />
......
...@@ -22,7 +22,7 @@ xmlns:reader="http://java.sun.com/jsf/composite/cditools/reader" ...@@ -22,7 +22,7 @@ xmlns:reader="http://java.sun.com/jsf/composite/cditools/reader"
<composite:implementation> <composite:implementation>
<h:form id="autopoller"> <h:form id="autopoller" styleClass="moya_datatable2">
<h:panelGroup id="reader_autopoll"> <h:panelGroup id="reader_autopoll">
<p:poll rendered="#{readerView.pollingMode}" interval="2" listener="#{cc.attrs.selectaction}" onerror="location.reload();" /> <p:poll rendered="#{readerView.pollingMode}" interval="2" listener="#{cc.attrs.selectaction}" onerror="location.reload();" />
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
<composite:implementation> <composite:implementation>
<h:form> <h:form styleClass="moya_datatable2">
Valitut lukijat, valitse "vaihda lukija" poistaaksesi kaikki <h3>Valitut lukijat, valitse "vaihda lukija" poistaaksesi kaikki </h3>
<p:dataTable border="1" value="#{readerListDataView.selectedReaders}" var="rr"> <p:dataTable border="1" value="#{readerListDataView.selectedReaders}" var="rr">
<p:column> <p:column>
<f:facet name="header"> <f:facet name="header">
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
</p:column> </p:column>
</p:dataTable> </p:dataTable>
<br />
Valitse uusi / ensimmäinen lukija <h3>Valitse uusi / ensimmäinen lukija</h3>
<p:dataTable border="1" id="reader" value="#{readerListDataView.readers}" var="rr"> <p:dataTable border="1" id="reader" value="#{readerListDataView.readers}" var="rr">
<p:column> <p:column>
<f:facet name="header"> <f:facet name="header">
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<composite:implementation> <composite:implementation>
<h:form id="rolelist" > <h:form id="rolelist" styleClass="moya_datatable2">
<h:dataTable border="1" id="user" value="#{roleDataView.roles}" var="role"> <h:dataTable border="1" id="user" value="#{roleDataView.roles}" var="role">
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
<composite:implementation> <composite:implementation>
<h:outputScript library="primefaces" name="jquery/jquery.js" target="head" /> <h:outputScript library="primefaces" name="jquery/jquery.js" target="head" />
<p:panelGrid columns="3" cellpadding="1" columnClasses="topalign,topalign,topalign" styleClass="noBorders"> <p:panelGrid columns="2" columnClasses="topalign,topalign,topalign" styleClass="noBorders user_profile_page">
<h:form id="userform" enctype="multipart/form-data"> <h:form id="userform" enctype="multipart/form-data">
<p:fieldset legend="#{i18n['user.image']}"> <p:fieldset legend="#{i18n['user.image']}">
<p:panelGrid columns="1" cellpadding="1"> <p:panelGrid columns="1" styleClass="user_image">
<ui:fragment rendered="#{not empty userView.selectedUser.id}"> <ui:fragment rendered="#{not empty userView.selectedUser.id}">
<p:dialog id="chartPanel" for="webcamButton" dynamic="true" widgetVar="webcamDialog"> <p:dialog id="chartPanel" for="webcamButton" dynamic="true" widgetVar="webcamDialog">
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
</p:dialog> </p:dialog>
<h:outputText rendered="#{empty userView.selectedUser.currentImage}" value="#{i18n['user.noCurrentImage']}" /> <h:outputText rendered="#{empty userView.selectedUser.currentImage}" value="#{i18n['user.noCurrentImage']}" />
<ui:fragment rendered="#{!empty userView.selectedUser.currentImage}"> <ui:fragment rendered="#{!empty userView.selectedUser.currentImage}">
<img style="width: 150px;" src="#{request.contextPath}/dydata/userimage/#{userView.selectedUser.currentImage.id}.img" alt="image" /> <img style="width: 150px;" src="#{request.contextPath}/dydata/userimage/#{userView.selectedUser.currentImage.id}.img" alt="image" />
</ui:fragment> </ui:fragment>
...@@ -34,13 +35,10 @@ ...@@ -34,13 +35,10 @@
<p:commandButton onerror="location.reload(true);" rendered="#{!cc.attrs.camAlwaysOn}" id="webcamButton" value="#{i18n['userimage.webcam']}" onclick="PF('webcamDialog').show()" type="button" /> <p:commandButton onerror="location.reload(true);" rendered="#{!cc.attrs.camAlwaysOn}" id="webcamButton" value="#{i18n['userimage.webcam']}" onclick="PF('webcamDialog').show()" type="button" />
<br /> <br />
<br />
<ui:fragment rendered="#{cc.attrs.camAlwaysOn}"> <ui:fragment rendered="#{cc.attrs.camAlwaysOn}">
<p:photoCam widgetVar="pc" listener="#{userView.oncapture}" update="#{cc.attrs.photocamupdate}" /> <p:photoCam widgetVar="pc" listener="#{userView.oncapture}" update="#{cc.attrs.photocamupdate}" />
<p:commandButton type="button" value="Capture" onclick="PF('pc').capture()" onerror="location.reload(true);" update="#{cc.attrs.photocamupdate}" /> <p:commandButton type="button" value="Capture" onclick="PF('pc').capture()" onerror="location.reload(true);" update="#{cc.attrs.photocamupdate}" />
</ui:fragment> </ui:fragment>
&nbsp;
<p:fileUpload id="uploadfile" value="#{userView.image}" mode="simple" required="true" requiredMessage="Required!" invalidSizeMessage="#{i18n['user.imageTooBig']}" sizeLimit="1024" /> <p:fileUpload id="uploadfile" value="#{userView.image}" mode="simple" required="true" requiredMessage="Required!" invalidSizeMessage="#{i18n['user.imageTooBig']}" sizeLimit="1024" />
<p:message for="uploadfile" /> <p:message for="uploadfile" />
...@@ -55,24 +53,22 @@ ...@@ -55,24 +53,22 @@
</p:inplace> </p:inplace>
<p:message for="login" /> <p:message for="login" />
<br /> <br />
</ui:fragment> </ui:fragment>
<br />
<h:outputLabel rendered="#{cc.attrs.creating}" value="#{i18n['user.password']}" for="password" /> <h:outputLabel rendered="#{cc.attrs.creating}" value="#{i18n['user.password']}" for="password" />
<br />
<p:inplace rendered="#{cc.attrs.creating}" emptyLabel="#{i18n['user.insert']}"> <p:inplace rendered="#{cc.attrs.creating}" emptyLabel="#{i18n['user.insert']}">
<p:password validator="#{userValidator.password}" id="password" value="#{userView.password}" /> <p:password validator="#{userValidator.password}" id="password" value="#{userView.password}" />
</p:inplace> </p:inplace>
<p:message rendered="#{cc.attrs.creating}" for="password" /> <p:message rendered="#{cc.attrs.creating}" for="password" />
<br />
<p:outputLabel rendered="#{cc.attrs.creating}" value="#{i18n['user.passwordcheck']}" for="passwordcheck" /> <p:outputLabel rendered="#{cc.attrs.creating}" value="#{i18n['user.passwordcheck']}" for="passwordcheck" />
<br />
<p:inplace rendered="#{cc.attrs.creating}" emptyLabel="#{i18n['user.insert']}"> <p:inplace rendered="#{cc.attrs.creating}" emptyLabel="#{i18n['user.insert']}">
<p:password validator="#{userValidator.password}" id="passwordcheck" value="#{userView.passwordcheck}" /> <p:password validator="#{userValidator.password}" id="passwordcheck" value="#{userView.passwordcheck}" />
</p:inplace> </p:inplace>
<p:message rendered="#{cc.attrs.creating}" for="passwordcheck" /> <p:message rendered="#{cc.attrs.creating}" for="passwordcheck" />
<br />
</p:panelGrid> </p:panelGrid>
</p:fieldset> </p:fieldset>
...@@ -80,7 +76,7 @@ ...@@ -80,7 +76,7 @@
<h:form> <h:form>
<p:fieldset legend="#{i18n['user.edit']}"> <p:fieldset legend="#{i18n['user.edit']}">
<p:panelGrid columns="3" styleClass="noBorders"> <p:panelGrid columns="3" styleClass="noBorders user_edit">
<p:outputLabel value="#{i18n['user.login']}" /> <p:outputLabel value="#{i18n['user.login']}" />
<h:outputText size="25" value="#{userView.selectedUser.login}" id="login" /> <h:outputText size="25" value="#{userView.selectedUser.login}" id="login" />
<h:message for="login" /> <h:message for="login" />
...@@ -170,25 +166,28 @@ ...@@ -170,25 +166,28 @@
</p:fieldset> </p:fieldset>
</h:form> </h:form>
</ui:fragment> </ui:fragment>
</p:panelGrid>
<p:panelGrid>
<h:form id="userSelectableRoles"> <h:form id="userSelectableRoles">
<p:fieldset legend="#{i18n['user.userSelectableRoles']}" rendered="#{userView.showUserSelectableRoles and cc.attrs.showRoles}"> <p:fieldset legend="#{i18n['user.userSelectableRoles']}" rendered="#{userView.showUserSelectableRoles and cc.attrs.showRoles}">
<p:panelGrid columns="2" styleClass="noBorders"> <p:panelGrid columns="2" styleClass="noBorders">
<p:selectManyCheckbox converter="#{roleConverter}" layout="pageDirection" value="#{userView.userSelectableRoles}"> <p:selectManyCheckbox converter="#{roleConverter}" layout="pageDirection" value="#{userView.userSelectableRoles}">
<f:selectItems value="#{roleDataView.userSelectableRoles}" var="roleitem" itemLabel="#{roleitem.name}" itemValue="#{roleitem}" /> <f:selectItems value="#{roleDataView.userSelectableRoles}" var="roleitem" itemLabel="#{roleitem.name}" itemValue="#{roleitem}" />
</p:selectManyCheckbox> </p:selectManyCheckbox>
<div> <div>
<h:message rendered="#{roleView.canReadRoles}" for="roles" /> <h:message rendered="#{roleView.canReadRoles}" for="roles" />
</div> </div>
</p:panelGrid> </p:panelGrid>
<p:commandButton action="#{userView.saveUserSelectableRoles}" value="#{i18n['user.saveUserSelectableRoles']}" /> <p:commandButton action="#{userView.saveUserSelectableRoles}" value="#{i18n['user.saveUserSelectableRoles']}" />
</p:fieldset> </p:fieldset>
</h:form> </h:form>
</p:panelGrid> </p:panelGrid>
</composite:implementation> </composite:implementation>
</html> </html>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<p:dataTable styleClass="bordertable" id="usertable" value="#{userSearchView.eventuserModel}" rows="100" paginator="true" lazy="true" var="user"> <p:dataTable styleClass="bordertable moya_datatable4" id="usertable" value="#{userSearchView.eventuserModel}" rows="100" paginator="true" lazy="true" var="user">
<p:column headerText="#{i18n['user.nick']}" sortBy="#{user.nick}"> <p:column headerText="#{i18n['user.nick']}" sortBy="#{user.nick}">
<h:outputText styleClass="hoverable" value="#{(empty user.nick)?'----':user.nick}" /> <h:outputText styleClass="hoverable" value="#{(empty user.nick)?'----':user.nick}" />
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<composite:implementation> <composite:implementation>
<h:outputScript library="primefaces" name="jquery/jquery.js" target="head" /> <h:outputScript library="primefaces" name="jquery/jquery.js" target="head" />
<p:dataTable id="user" value="#{userSearchView.userModel}" rows="100" var="wra" paginator="true" lazy="true"> <p:dataTable id="user" value="#{userSearchView.userModel}" styleClass="moya_datatable4" rows="100" var="wra" paginator="true" lazy="true">
<p:column sortBy="#{wra.user.nick}" headerText="#{i18n['user.nick']}"> <p:column sortBy="#{wra.user.nick}" headerText="#{i18n['user.nick']}">
<h:outputText value="#{(empty wra.user.nick)?'----':wra.user.nick}" /> <h:outputText value="#{(empty wra.user.nick)?'----':wra.user.nick}" />
......
@media print { @media print {
header#top { display: none; }
#left-bar { display: none; }
} }
\ No newline at end of file
...@@ -291,7 +291,8 @@ input, textarea, .ui-inputfield, select { ...@@ -291,7 +291,8 @@ input, textarea, .ui-inputfield, select {
textarea { textarea {
border-radius: 5px; border-radius: 5px;
} }
input[type=text] { input[type=text],
input[type=password]{
border-radius: 5px; border-radius: 5px;
margin: 0 5px 0 0 !important; margin: 0 5px 0 0 !important;
min-height: 30px; min-height: 30px;
...@@ -393,6 +394,7 @@ HEADER ...@@ -393,6 +394,7 @@ HEADER
background: #70cbc3; background: #70cbc3;
text-align: center; text-align: center;
height: 101px; height: 101px;
line-height: 101px;
} }
#header_first a { #header_first a {
display: table; display: table;
...@@ -400,6 +402,9 @@ HEADER ...@@ -400,6 +402,9 @@ HEADER
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
#header_first a img {
vertica-align: middle;
}
#header_first a h1 { #header_first a h1 {
text-decoration: none; text-decoration: none;
color: #FFF; color: #FFF;
...@@ -614,6 +619,13 @@ USER MODE AND LOGIN ...@@ -614,6 +619,13 @@ USER MODE AND LOGIN
text-align: center; text-align: center;
line-height: 100px; line-height: 100px;
} }
.user_profile_page table.user_edit td {
vertical-align: top;
min-height: 40px;
}
.user_profile_page table.user_edit td label {
text-transform: capitalize;
}
/* /*
...@@ -801,9 +813,6 @@ The Grid For Content ...@@ -801,9 +813,6 @@ The Grid For Content
Table Styles Table Styles
*/ */
#main table {
width: 100%;
}
#main table.ui-panelgrid { #main table.ui-panelgrid {
background: none; background: none;
border-bottom: 0; border-bottom: 0;
...@@ -846,7 +855,7 @@ Table Styles ...@@ -846,7 +855,7 @@ Table Styles
width: 100%; width: 100%;
} }
#main .ui-menu { #main .ui-menu {
background: #70cbc3; background: #263238;
} }
#main .ui-menu ul.ui-menu-list li a { #main .ui-menu ul.ui-menu-list li a {
color: #FFF; color: #FFF;
...@@ -879,11 +888,43 @@ Table Styles ...@@ -879,11 +888,43 @@ Table Styles
margin: 0 5px; margin: 0 5px;
} }
#advancedSearch {
padding: 25px;
background: #eeE;
margin: 10px 0;
}
/* /*
TABLE STYLES TABLE STYLES
*/ */
#main .useradmin_list table td a {
margin: 0 0 10px 0;
background: #70cbc3;
color: #FFF;
padding: 10px;
display: inline-block;
cursor: pointer;
}
.changePassword table td {
padding: 5px 0;
}
#main #networkassociation\:ip_mac_address tr:first-child td {
border: 0 !important;
font-weight: 800;
}
#main .moya_datatable1 table,
#main .moya_datatable2 table,
#main .moya_datatable3 table,
#main .moya_datatable4 table,
#main .moya_datatable5 table,
#main .moya_datatable6 table{
width: 100%;
}
#main .moya_datatable1 tr, #main .moya_datatable1 tr,
#main .moya_datatable1 table tr { #main .moya_datatable1 table tr {
margin-bottom: 10px; margin-bottom: 10px;
...@@ -994,4 +1035,121 @@ TABLE STYLES ...@@ -994,4 +1035,121 @@ TABLE STYLES
#main .moya_datatable3 tfoot td:last-child { #main .moya_datatable3 tfoot td:last-child {
font-weight: 800 !important; font-weight: 800 !important;
color: #000 !important; color: #000 !important;
}
#main .moya_datatable4 table table td {
border: 0 !important;
}
#main .moya_datatable4 table thead th {
background: #70cbc3;
color: #FFF;
}
#main .moya_datatable4 table tr {
margin: 5px 0 !important;
padding: 5px 0 !important;
}
#main .moya_datatable4 table td {
padding: 10px !important;
border-bottom: 1px solid #eee !important;
border-right: 1px solid #ccc !important;
}
#main .moya_datatable4 table td:last-child {
border-right: 0 !important;
}
#main .moya_datatable4 table tr:nth-child(even) {
background: #f9f9f9;
}
#main .moya_datatable4 table input {
min-height: 20px !important;
border-radius:3px;
margin: 0 3px !important;
padding: 5px 10px !important;
}
#main .moya_datatable4 table thead th {
padding: 10px !important;
}
#main .moya_datatable4 tfoot td {
border: 0 !important;
color: #000;
font-weight: 300 !important;
padding: 10px !important;
}
#main .moya_datatable4 tfoot td:last-child {
font-weight: 800 !important;
color: #000 !important;
}
#main .moya_datatable4 .ui-paginator {
min-height: 30px;
}
#main .moya_datatable4 .ui-paginator span.ui-icon {
margin: 5px;
height: 16px;
width: 16px;
}
#main .moya_datatable4 .ui-paginator .ui-paginator-page {
margin: 0 5px;
}
#main .moya_datatable4 table td a,
#main .moya_datatable4 table td button {
background: #70cbc3;
color: #FFF;
border: 0;
cursor: pointer;
padding: 7px 10px;
transition: background 0.3s ease-in-out;
}
#main .moya_datatable4 table td a:hover,
#main .moya_datatable4 table td button:hover {
background: #555;
}
#main .moya_datatable6 table table td {
border: 0 !important;
}
#main .moya_datatable6 table thead th {
background: #70cbc3;
color: #FFF;
}
#main .moya_datatable6 table tr {
margin: 5px 0 !important;
padding: 5px 0 !important;
}
#main .moya_datatable6 table td {
padding: 10px !important;
border-bottom: 1px solid #eee !important;
border-right: 1px solid #ccc !important;
}
#main .moya_datatable6 table td:last-child {
border-right: 0 !important;
}
#main .moya_datatable6 table tr:nth-child(even) {
background: #f9f9f9;
}
#main .moya_datatable6 table input {
min-height: 20px !important;
border-radius:3px;
margin: 0 3px !important;
padding: 5px 10px !important;
}
#main .moya_datatable6 table thead th {
padding: 10px !important;
}
#main .moya_datatable6 tfoot td {
border: 0 !important;
color: #000;
font-weight: 300 !important;
padding: 10px !important;
}
#main .moya_datatable6 tfoot td:last-child {
font-weight: 800 !important;
color: #000 !important;
}
#main .moya_datatable6 .ui-widget-header {
color: #FFF;
text-shadow: 0 0 0;
}
#main .moya_datatable2 table td button span {
padding: 7px 10px !important;
font-size: 12px;
} }
\ No newline at end of file
...@@ -7,11 +7,16 @@ $ = jQuery; ...@@ -7,11 +7,16 @@ $ = jQuery;
$(document).ready(function() { $(document).ready(function() {
$('#open-user-login').click(function() { $('#open-user-login').click(function() {
$('#not-logged').slideToggle(300); $('#not-logged').slideToggle(300);
$(this).toggleClass('active'); $(this).toggleClass('active');
}); });
$('#toggle-navigation').click(function() { $('#toggle-navigation').click(function() {
$('#left-bar').slideToggle(300); $('#left-bar').slideToggle(300);
}); });
$('#show_advanced_search').click(function() {
$('#advancedSearch').slideToggle(300);
});
}); });
\ No newline at end of file
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<h:link outcome="/index"> <h:link outcome="/index">
<c:choose> <c:choose>
<c:when test="#{sessionHandler.isInDevelopmentMode()}"> <c:when test="#{sessionHandler.isInDevelopmentMode()}">
<h1>Development</h1> <img src="#{request.contextPath}/resources/templates/moyav2/img/dev_logo.png" alt="Development" />
</c:when> </c:when>
<c:otherwise> <c:otherwise>
<p:graphicImage rendered="#{layoutView.headerIsImage}" value="#{layoutView.headerimage}" /> <p:graphicImage rendered="#{layoutView.headerIsImage}" value="#{layoutView.headerimage}" />
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<h1>#{i18n['tournaments.admin.title']}</h1> <h1>#{i18n['tournaments.admin.title']}</h1>
<p>#{i18n['tournaments.admin.description']}</p> <p>#{i18n['tournaments.admin.description']}</p>
<h2>#{i18n['tournaments.active_tournaments']}</h2> <h2>#{i18n['tournaments.active_tournaments']}</h2>
<h:form> <h:form id="tournamentsadmin" styleClass="moya_datatable2">
<p:dataTable value="#{tournamentAdminView.activeTournaments}" var="tournament"> <p:dataTable value="#{tournamentAdminView.activeTournaments}" var="tournament">
<p:column> <p:column>
<f:facet name="header"> <f:facet name="header">
......
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
</f:metadata> </f:metadata>
<ui:define name="content"> <ui:define name="content">
<h:form> <h:form id="tournaments" styleClass="moya_datatable2">
<p:messages autoUpdate="true" redisplay="false"></p:messages> <p:messages autoUpdate="true" redisplay="false"></p:messages>
<h1>#{i18n['tournaments.title']}</h1> <h1>#{i18n['tournaments.title']}</h1>
<p>#{i18n['tournaments.description']}</p> <p>#{i18n['tournaments.description']}</p>
<h2>#{i18n['tournaments.open_tournaments']}</h2> <h2>#{i18n['tournaments.open_tournaments']}</h2>
<p:dataTable value="#{tournamentListView.setupPhaseTournaments}" var="tournament"> <p:dataTable value="#{tournamentListView.setupPhaseTournaments}" var="tournament" styleClass="moya_datatable2">
<p:column style="width:20px"> <p:column style="width:20px">
<p:rowToggler /> <p:rowToggler />
...@@ -95,8 +95,9 @@ ...@@ -95,8 +95,9 @@
</h:panelGrid> </h:panelGrid>
</p:rowExpansion> </p:rowExpansion>
</p:dataTable> </p:dataTable>
<p></p>
<h2>#{i18n['tournaments.setup_closed_tournaments']}</h2> <h2>#{i18n['tournaments.setup_closed_tournaments']}</h2>
<p:dataTable value="#{tournamentListView.setupClosedPhaseTournaments}" var="tournament"> <p:dataTable value="#{tournamentListView.setupClosedPhaseTournaments}" var="tournament" styleClass="moya_datatable2">>
<p:column style="width:20px"> <p:column style="width:20px">
<p:rowToggler /> <p:rowToggler />
</p:column> </p:column>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<ui:define name="content"> <ui:define name="content">
<h1>#{i18n['tournament.my_participations']}</h1> <h1>#{i18n['tournament.my_participations']}</h1>
<h:form> <h:form>
<p:dataTable value="#{tournamentEditParticipationView.ownParticipations}" var="participation"> <p:dataTable value="#{tournamentEditParticipationView.ownParticipations}" var="participation" styleClass="moya_datatable2">>
<p:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['tournament.name']}" /> <h:outputText value="#{i18n['tournament.name']}" />
......
...@@ -16,14 +16,14 @@ ...@@ -16,14 +16,14 @@
</ui:define> </ui:define>
<ui:define name="content"> <ui:define name="content">
<h:form id="userform"> <h:form id="user_change_password" styleClass="changePassword">
<h:panelGrid columns="2"> <h:panelGrid columns="2">
<h:outputLabel for="oldPwd" value="#{i18n['user.oldPassword']}:" /> <h:outputLabel for="oldPwd" value="#{i18n['user.oldPassword']}:" />
<h:inputSecret id="oldPwd" value="#{passwordView.oldPassword}" /> <h:inputSecret id="oldPwd" value="#{passwordView.oldPassword}" />
<h:outputLabel value="#{i18n['user.password']}:" /> <h:outputLabel value="#{i18n['user.password']}:" />
<h:inputSecret id="password" value="#{passwordView.password}" /> <h:inputSecret id="password" value="#{passwordView.password}" />
<h:outputLabel value="#{i18n['user.passwordcheck']}:" /> <h:outputLabel value="#{i18n['user.passwordcheck']}:" />
<h:inputSecret id="passwordcheck" value="#{passwordView.passwordcheck}" /> <h:inputSecret id="passwordcheck" value="#{passwordView.passwordcheck}" />
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<h:form> <h:form>
<p:messages autoUpdate="true" redisplay="false"></p:messages> <p:messages autoUpdate="true" redisplay="false"></p:messages>
<h2>#{i18n['user.game.current_gameids']}</h2> <h2>#{i18n['user.game.current_gameids']}</h2>
<p:dataTable value="#{userGameIDView.eventUser.gameIDs}" var="gameid"> <p:dataTable value="#{userGameIDView.eventUser.gameIDs}" var="gameid" styleClass="moya_datatable2">
<p:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['tournament.game']}" /> <h:outputText value="#{i18n['tournament.game']}" />
......
...@@ -19,25 +19,24 @@ ...@@ -19,25 +19,24 @@
<h1>#{i18n['userlist.header']}</h1> <h1>#{i18n['userlist.header']}</h1>
<h:form id="pageform"> <h:form styleClass="useradmin_list">
<h:panelGrid columns="2"> <h:panelGrid columns="2">
<h:panelGroup> <h:panelGroup>
<a onclick="$('#advancedSearch').show(); $(this).hide();"><h:outputText value="#{i18n['userlist.showAdvancedSearch']}" /></a> <a id="show_advanced_search"><h:outputText value="#{i18n['userlist.showAdvancedSearch']}" /></a>
<div id="advancedSearch" style="display: none;"> <div id="advancedSearch" style="display: none;">
<h:selectBooleanCheckbox id="placeassoc" value="#{userSearchView.searchQuery.placeAssoc}" /> <h:selectBooleanCheckbox id="placeassoc" value="#{userSearchView.searchQuery.placeAssoc}" />
<h:outputLabel for="placeassoc" value="#{i18n['userlist.placeassoc']}" /> <h:outputLabel for="placeassoc" value="#{i18n['userlist.placeassoc']}" />
<br /> <br />
<h:outputLabel for="saldofilter" value="#{i18n['userlist.saldofilter']}" /> <h:outputLabel for="saldofilter" value="#{i18n['userlist.saldofilter']}" />
<h:selectOneMenu value="#{userSearchView.searchQuery.accountSaldoCompare}"> <h:selectOneMenu value="#{userSearchView.searchQuery.accountSaldoCompare}">
<f:selectItems value="#{userSearchView.searchQuery.accountCompareValues}" /> <f:selectItems value="#{userSearchView.searchQuery.accountCompareValues}" />
</h:selectOneMenu> </h:selectOneMenu>
<h:inputText value="#{userSearchView.searchQuery.accountSaldo}"> <h:inputText value="#{userSearchView.searchQuery.accountSaldo}">
<f:convertNumber minFractionDigits="0" maxFractionDigits="2" /> <f:convertNumber minFractionDigits="0" maxFractionDigits="2" />
</h:inputText> </h:inputText>
<br /><br />
<!-- <!--
<br /> <br />
<h:outputLabel for="rolefilter" value="#{i18n['userlist.rolefilter']}" /> <h:outputLabel for="rolefilter" value="#{i18n['userlist.rolefilter']}" />
...@@ -45,9 +44,8 @@ ...@@ -45,9 +44,8 @@
value="#{userSearchView.searchQuery.filterRoles}" converter="#{roleConverter}"> value="#{userSearchView.searchQuery.filterRoles}" converter="#{roleConverter}">
</h:inputText> </h:inputText>
--> -->
<br />
<h:outputLabel for="rolefilter" value="#{i18n['userlist.rolefilter']}" /> <strong><h:outputLabel for="rolefilter" value="#{i18n['userlist.rolefilter']}" /></strong><br />
<h:selectManyCheckbox layout="pageDirection" styleClass="nowrap" id="rolefilter" value="#{userSearchView.searchQuery.filterRoles}" converter="#{roleConverter}"> <h:selectManyCheckbox layout="pageDirection" styleClass="nowrap" id="rolefilter" value="#{userSearchView.searchQuery.filterRoles}" converter="#{roleConverter}">
<f:selectItems value="#{roleDataView.roles}" var="r" itemLabel="#{r.name}" /> <f:selectItems value="#{roleDataView.roles}" var="r" itemLabel="#{r.name}" />
</h:selectManyCheckbox> </h:selectManyCheckbox>
...@@ -72,7 +70,7 @@ ...@@ -72,7 +70,7 @@
<h:commandButton value="#{i18n['userlist.search']}" action="#{userSearchView.newSearch()}" /> <h:commandButton value="#{i18n['userlist.search']}" action="#{userSearchView.newSearch()}" />
</h:panelGroup> </h:panelGroup>
<h:panelGroup> <h:panelGroup>
<a onclick="$('#pageform\\:usercart').show(); $(this).hide();"><h:outputText value="#{i18n['usercart.showCart']}" /></a> <a id="show_user_cart" onclick="$('#pageform\\:usercart').slideToggle(300);"><h:outputText value="#{i18n['usercart.showCart']}" /></a>
<p:panelGrid columns="1" id="usercart" styleClass="noborderTable" style="display:none;"> <p:panelGrid columns="1" id="usercart" styleClass="noborderTable" style="display:none;">
<h:commandButton actionListener="#{userSearchView.addToCart}" value="#{i18n['usercart.addSearchedUsers']}" /> <h:commandButton actionListener="#{userSearchView.addToCart}" value="#{i18n['usercart.addSearchedUsers']}" />
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<f:event type="preRenderView" listener="#{cardView.initCardTemplatelist()}" /> <f:event type="preRenderView" listener="#{cardView.initCardTemplatelist()}" />
</f:metadata> </f:metadata>
<ui:define name="content"> <ui:define name="content">
<h:form id="cardTemplates"> <h:form id="cardTemplates" styleClass="moya_datatable2">
<h:dataTable value="#{cardView.cardTemplates}" var="card"> <h:dataTable value="#{cardView.cardTemplates}" var="card">
<h:column> <h:column>
#{card.id} #{card.id}
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
<f:event type="preRenderView" listener="#{compoView.initAdminListView()}" /> <f:event type="preRenderView" listener="#{compoView.initAdminListView()}" />
</f:metadata> </f:metadata>
<ui:define name="content"> <ui:define name="content">
<h:outputStylesheet library="style" name="insomnia2/css/actionlog.css" /> <h:form id="admincompolist" styleClass="moya_datatable2">
<h1>#{i18n['voting.allcompos.header']}</h1> <h1>#{i18n['voting.allcompos.header']}</h1>
<p>#{i18n['voting.allcompos.description']}</p> <p>#{i18n['voting.allcompos.description']}</p>
<h:form>
<p:dataTable styleClass="bordertable" rowClasses="roweven,rowodd" id="compolisttable" value="#{compoView.compos}" var="compo"> <p:dataTable styleClass="bordertable" rowClasses="roweven,rowodd" id="compolisttable" value="#{compoView.compos}" var="compo">
<p:column headerText="#{i18n['voting.allcompos.name']}"> <p:column headerText="#{i18n['voting.allcompos.name']}">
<h:outputText value="#{compo.name}" /> <h:outputText value="#{compo.name}" />
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<configuration> <configuration>
<warSourceDirectory>WebContent</warSourceDirectory> <warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml> <failOnMissingWebXml>false</failOnMissingWebXml>
<packagingIncludes>WEB-INF/lib/swagger*,WEB-INF/lib/moya-restpojo*,WEB-INF/lib/javamelody-core*,WEB-INF/lib/primefaces*,WEB-INF/lib/*-1.0.8.jar,**/*.xml,**/*.xhtml,**/*.properties,**/*.class,**/*.png,**/*.css,**/*.js,resources/*</packagingIncludes> <packagingIncludes>WEB-INF/lib/moya-restpojo*,WEB-INF/lib/javamelody-core*,WEB-INF/lib/primefaces*,WEB-INF/lib/*-1.0.8.jar,**/*.xml,**/*.xhtml,**/*.properties,**/*.class,**/*.png,**/*.css,**/*.js,resources/*</packagingIncludes>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
...@@ -41,31 +41,20 @@ ...@@ -41,31 +41,20 @@
<version>1.0.8</version> <version>1.0.8</version>
<type>pom</type> <type>pom</type>
</dependency> </dependency>
<dependency> <dependency>
<groupId>fi.codecrew.moya</groupId> <groupId>fi.codecrew.moya</groupId>
<artifactId>moya-restpojo</artifactId> <artifactId>moya-restpojo</artifactId>
<version>1.0.2</version> <version>1.0.5</version>
</dependency>
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-servlet_2.11</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-jaxrs_2.11</artifactId>
<version>${swagger.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<parent> <parent>
<groupId>fi.codecrew.moya</groupId> <groupId>fi.codecrew.moya</groupId>
<artifactId>moya-parent</artifactId> <artifactId>moya-parent</artifactId>
<version>1.0</version> <version>1.0</version>
<relativePath>../moya-parent/pom.xml</relativePath> <relativePath>../moya-parent/pom.xml</relativePath>
</parent> </parent>
</project> </project>
...@@ -19,9 +19,8 @@ ...@@ -19,9 +19,8 @@
package fi.codecrew.moya; package fi.codecrew.moya;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter;
import java.security.Principal;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.security.Principal;
import javax.ejb.EJB; import javax.ejb.EJB;
import javax.faces.application.ProjectStage; import javax.faces.application.ProjectStage;
...@@ -35,8 +34,8 @@ import javax.servlet.ServletResponse; ...@@ -35,8 +34,8 @@ import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter; import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.http.HttpRequest;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.slf4j.MDC; import org.slf4j.MDC;
...@@ -53,6 +52,7 @@ import fi.codecrew.moya.rest.RestApplicationEntrypoint; ...@@ -53,6 +52,7 @@ import fi.codecrew.moya.rest.RestApplicationEntrypoint;
@WebFilter(filterName = "hostnameFilter", displayName = "hostname and authentication filter", urlPatterns = { "/*" }) @WebFilter(filterName = "hostnameFilter", displayName = "hostname and authentication filter", urlPatterns = { "/*" })
public class HostnameFilter implements Filter { public class HostnameFilter implements Filter {
private static final String SESSION_HOSTNAMESTORE = "moya-session-hostname";
private static final Logger logger = LoggerFactory.getLogger(HostnameFilter.class); private static final Logger logger = LoggerFactory.getLogger(HostnameFilter.class);
private static final String HTTP_HOSTNAME_ID = "moya_hostname_session_id"; private static final String HTTP_HOSTNAME_ID = "moya_hostname_session_id";
private boolean developmentMode = false; private boolean developmentMode = false;
...@@ -137,7 +137,7 @@ public class HostnameFilter implements Filter { ...@@ -137,7 +137,7 @@ public class HostnameFilter implements Filter {
*/ */
private static final String[] NOAUTH_RESTPATHS = new String[] { private static final String[] NOAUTH_RESTPATHS = new String[] {
"/reader/EventRole/","/user/auth" "/reader/EventRole/", "/user/auth"
}; };
...@@ -147,6 +147,7 @@ public class HostnameFilter implements Filter { ...@@ -147,6 +147,7 @@ public class HostnameFilter implements Filter {
// logger.info("HostnameFilter called!"); // logger.info("HostnameFilter called!");
HttpServletRequest httpRequest = null; HttpServletRequest httpRequest = null;
AuthType authtype = AuthType.UNKNOWN; AuthType authtype = AuthType.UNKNOWN;
if (request != null && request instanceof HttpServletRequest) { if (request != null && request instanceof HttpServletRequest) {
httpRequest = ((HttpServletRequest) request); httpRequest = ((HttpServletRequest) request);
parseHostname(httpRequest); parseHostname(httpRequest);
...@@ -208,7 +209,6 @@ public class HostnameFilter implements Filter { ...@@ -208,7 +209,6 @@ public class HostnameFilter implements Filter {
private boolean restAuth(HttpServletRequest httpRequest, ServletResponse response) { private boolean restAuth(HttpServletRequest httpRequest, ServletResponse response) {
String sp = httpRequest.getPathInfo(); String sp = httpRequest.getPathInfo();
for (String s : NOAUTH_RESTPATHS) { for (String s : NOAUTH_RESTPATHS) {
if (sp.startsWith(s)) { if (sp.startsWith(s)) {
...@@ -274,9 +274,16 @@ public class HostnameFilter implements Filter { ...@@ -274,9 +274,16 @@ public class HostnameFilter implements Filter {
boolean ssl = proto.equals("https"); boolean ssl = proto.equals("https");
BortalLocalContextHolder.setSsl(ssl); BortalLocalContextHolder.setSsl(ssl);
HttpSession session = httpRequest.getSession();
Object sessionHostname = session.getAttribute(SESSION_HOSTNAMESTORE);
if (sessionHostname == null) {
session.setAttribute(SESSION_HOSTNAMESTORE, hostname);
} else if (!hostname.equals(sessionHostname)) {
throw new RuntimeException("Hostname mismatch!");
}
BortalLocalContextHolder.setHostname(hostname); BortalLocalContextHolder.setHostname(hostname);
BortalLocalContextHolder.setInDevelopmentMode(developmentMode); BortalLocalContextHolder.setInDevelopmentMode(developmentMode);
} }
} }
...@@ -8,6 +8,7 @@ import javax.xml.bind.annotation.XmlElement; ...@@ -8,6 +8,7 @@ import javax.xml.bind.annotation.XmlElement;
import fi.codecrew.moya.model.EventMap; import fi.codecrew.moya.model.EventMap;
import fi.codecrew.moya.model.EventUser; import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.GroupMembership;
import fi.codecrew.moya.model.Place; import fi.codecrew.moya.model.Place;
import fi.codecrew.moya.model.PrintedCard; import fi.codecrew.moya.model.PrintedCard;
import fi.codecrew.moya.model.Product; import fi.codecrew.moya.model.Product;
...@@ -27,6 +28,7 @@ import fi.codecrew.moya.rest.pojo.userinfo.v1.CardRoot; ...@@ -27,6 +28,7 @@ import fi.codecrew.moya.rest.pojo.userinfo.v1.CardRoot;
import fi.codecrew.moya.rest.pojo.userinfo.v1.EventUserRestPojo; import fi.codecrew.moya.rest.pojo.userinfo.v1.EventUserRestPojo;
import fi.codecrew.moya.rest.pojo.userinfo.v1.PrintedCardRestPojo; import fi.codecrew.moya.rest.pojo.userinfo.v1.PrintedCardRestPojo;
import fi.codecrew.moya.rest.pojo.userinfo.v1.SimpleEventuserRoot; import fi.codecrew.moya.rest.pojo.userinfo.v1.SimpleEventuserRoot;
import fi.codecrew.moya.rest.pojo.userinfo.v1.UserReservationPlacePojo;
public class PojoUtils { public class PojoUtils {
public static EventUserRestPojo initEventUserRestPojo(EventUser user) public static EventUserRestPojo initEventUserRestPojo(EventUser user)
...@@ -275,4 +277,18 @@ public class PojoUtils { ...@@ -275,4 +277,18 @@ public class PojoUtils {
ret.setHeight(map.getHeight()); ret.setHeight(map.getHeight());
return ret; return ret;
} }
public static UserReservationPlacePojo initUserReservationPlace(GroupMembership g) {
UserReservationPlacePojo ur = new UserReservationPlacePojo();
ur.setPlacegiven(g.getEnteredEvent() != null);
Place place = g.getPlaceReservation();
if (place != null) {
ur.setPlaceid(place.getId());
ur.setPlacename(place.getName());
ur.setProductId(place.getProduct().getId());
ur.setProductName(place.getProduct().getName());
}
return ur;
}
} }
...@@ -48,11 +48,15 @@ import com.wordnik.swagger.annotations.ApiOperation; ...@@ -48,11 +48,15 @@ import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiParam; import com.wordnik.swagger.annotations.ApiParam;
import fi.codecrew.moya.beans.CardTemplateBeanLocal; import fi.codecrew.moya.beans.CardTemplateBeanLocal;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.PermissionBeanLocal; import fi.codecrew.moya.beans.PermissionBeanLocal;
import fi.codecrew.moya.beans.PlaceGroupBeanLocal; import fi.codecrew.moya.beans.PlaceGroupBeanLocal;
import fi.codecrew.moya.beans.ReaderBeanLocal;
import fi.codecrew.moya.beans.TicketBeanLocal;
import fi.codecrew.moya.beans.UserBeanLocal; import fi.codecrew.moya.beans.UserBeanLocal;
import fi.codecrew.moya.model.EventUser; import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.GroupMembership; import fi.codecrew.moya.model.GroupMembership;
import fi.codecrew.moya.model.ReaderEvent;
import fi.codecrew.moya.rest.pojo.userinfo.v1.EventUserRestPojo; import fi.codecrew.moya.rest.pojo.userinfo.v1.EventUserRestPojo;
import fi.codecrew.moya.rest.pojo.userinfo.v1.PrintedCardRestPojo; import fi.codecrew.moya.rest.pojo.userinfo.v1.PrintedCardRestPojo;
import fi.codecrew.moya.rest.pojo.userinfo.v1.SimpleEventuserRoot; import fi.codecrew.moya.rest.pojo.userinfo.v1.SimpleEventuserRoot;
...@@ -86,19 +90,47 @@ public class UserRestView { ...@@ -86,19 +90,47 @@ public class UserRestView {
@EJB @EJB
private PlaceGroupBeanLocal placegroupbean; private PlaceGroupBeanLocal placegroupbean;
@EJB
private ReaderBeanLocal readerbean;
@EJB
private TicketBeanLocal ticketbean;
@GET
@Path("/reservationswithcode/{code}")
public Response getPlacesWithCode(@PathParam("code") String code) {
EventUser curruser = permbean.getCurrentUser();
ReaderEvent revent = readerbean.checkCode("restapi: " + curruser.getLogin(), code);
if (revent != null && revent.getUser() != null) {
EventUser eu = revent.getUser();
List<GroupMembership> gms = ticketbean.findMembershipPrintlistForUser(eu);
UserReservationRoot ret = new UserReservationRoot();
ret.setUser(PojoUtils.initEventUserRestPojo(eu));
for (GroupMembership g : gms) {
ret.getReservations().add(PojoUtils.initUserReservationPlace(g));
}
return Response.ok(ret).build();
}
return Response.status(Status.NOT_FOUND).build();
}
@GET @GET
@Path("/{userid}/reservations") @Path("/{userid}/reservations")
public Response usersPlaces(@QueryParam("userid") Integer userid) { public Response usersPlaces(@PathParam("userid") Integer userid) {
EventUser eu = userbean.findByUserId(userid, false); EventUser eu = userbean.findByUserId(userid, false);
if (eu != null) { if (eu != null) {
List<GroupMembership> gms = placegroupbean.getMemberships(eu);
List<GroupMembership> gms = ticketbean.findMembershipPrintlistForUser(eu);
UserReservationRoot ret = new UserReservationRoot(); UserReservationRoot ret = new UserReservationRoot();
ret.setUser(PojoUtils.initEventUserRestPojo(eu));
for (GroupMembership g : gms) { for (GroupMembership g : gms) {
UserReservationPlacePojo ur = new UserReservationPlacePojo(); ret.getReservations().add(PojoUtils.initUserReservationPlace(g));
ur.setPlaceid(g.getPlaceReservation().getId());
ur.setPlacegiven(g.getEnteredEvent() != null);
ur.setPlacename(g.getPlaceReservation().getName());
ret.getReservations().add(ur);
} }
return Response.ok(ret).build(); return Response.ok(ret).build();
} }
......
No preview for this file type
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!