Commit 25defade by Antti Tönkyrä

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

2 parents a50c8682 ecfd0395
...@@ -80,6 +80,7 @@ public class MenuNavigationFacade extends IntegerPkGenericFacade<MenuNavigation> ...@@ -80,6 +80,7 @@ public class MenuNavigationFacade extends IntegerPkGenericFacade<MenuNavigation>
Query q = getEm().createQuery("delete from MenuNavigation where event = :event"); Query q = getEm().createQuery("delete from MenuNavigation where event = :event");
q.setParameter("event", eventbean.getCurrentEvent()); q.setParameter("event", eventbean.getCurrentEvent());
q.executeUpdate(); q.executeUpdate();
getEm().flush();
} }
} }
...@@ -19,4 +19,6 @@ public interface MenuBeanLocal { ...@@ -19,4 +19,6 @@ public interface MenuBeanLocal {
void flushOldMenu(); void flushOldMenu();
MenuNavigation findNavigationId(Integer id);
} }
.ui-widget,
.ui-widget .ui-widget
{
font-size: 90% !important;
}
body,html { body,html {
width: 100%; width: 100%;
height: 100%; height: 100%;
......
.ui-widget,
.ui-widget .ui-widget, .ui-button-text {
font-size: 90% !important;
}
/* Left column content*/ /* Left column content*/
.left h1 { .left h1 {
font-family: Oxygen, Calibri; font-family: Oxygen, Calibri;
...@@ -20,7 +26,6 @@ ...@@ -20,7 +26,6 @@
} }
.center h2 { .center h2 {
font-family: Oxygen, Calibri; font-family: Oxygen, Calibri;
font-size: 12pt; font-size: 12pt;
border-bottom: 1px solid #B1B7AF; border-bottom: 1px solid #B1B7AF;
...@@ -48,9 +53,7 @@ ...@@ -48,9 +53,7 @@
} }
.center form { .center form {
padding: 2em; padding: 2em;
background: #eaeaea;
border: 1px solid #bbb;
} }
.center form label { .center form label {
...@@ -61,15 +64,9 @@ ...@@ -61,15 +64,9 @@
} }
.ui-widget,
.ui-widget .ui-widget
{
font-size: 90% !important;
}
label { label {
text-shadow: rgba(0,0,0,0.3) 3px 2px 4px; color: #000;
color: #999;
font-weight: 100; font-weight: 100;
font-family: Oxygen; font-family: Oxygen;
...@@ -291,3 +288,4 @@ h1 { ...@@ -291,3 +288,4 @@ h1 {
#header_right { #header_right {
text-align: right; text-align: right;
} }
...@@ -96,14 +96,16 @@ ...@@ -96,14 +96,16 @@
<tools:loginLogout /> <tools:loginLogout />
</div> </div>
</div> </div>
<br />
<div class="ui-widget-header">Select Mode</div> <div class="ui-widget-header">Select Mode</div>
<div class="ui-widget-content" style="text-align: center"> <div class="ui-widget-content" style="text-align: center">
<select> <h:form>
<option jsfc="ui:repeat" var="menuitem" value="#{menuView.getMenu(0)}"> <p:selectOneMenu value="#{menuView.menuChange}">
<h:link outcome="#{menuitem.outcome}" value="#{i18n[menuitem.navigation.key]}" styleClass="#{menuitem.selected?'active':''}" /> <p:ajax listener="#{menuView.menuChangeEvent}" />
</option> <f:selectItems var="menuitem" value="#{menuView.getMenu(0)}" itemLabel="#{i18n[menuitem.navigation.key]}" itemValue="#{menuitem.outcome}" />
</select> </p:selectOneMenu>
</h:form>
</div> </div>
</div> </div>
</div> </div>
......
<!DOCTYPE html <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:users="http://java.sun.com/jsf/composite/cditools/user" <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:users="http://java.sun.com/jsf/composite/cditools/user" xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core">
xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core">
<h:body> <h:body>
<ui:composition template="#{sessionHandler.template}"> <ui:composition template="#{sessionHandler.template}">
<ui:define name="content"> <ui:define name="content">
<p:dataTable value="#{userCartView.usercart}" var="cartItem"> <p:dataTable value="#{userCartView.usercart}" var="cartItem">
<p:column headerText="kuva"> <p:column>
<ui:fragment rendered="#{!empty cartItem.currentImage}"> <ui:fragment rendered="#{!empty cartItem.currentImage}">
<img style="width: 150px;" src="#{request.contextPath}/dydata/userimage/#{cartItem.currentImage.id}.img" alt="image" /> <img style="width: 150px;" src="#{request.contextPath}/dydata/userimage/#{cartItem.currentImage.id}.img" alt="image" />
</ui:fragment> </ui:fragment>
<ui:fragment rendered="#{empty cartItem.currentImage}"> <ui:fragment rendered="#{empty cartItem.currentImage}">
<h:outputText value="#{i18n['overview.noimage']}" /> <h:outputText value="#{i18n['overview.noimage']}" />
</ui:fragment> </ui:fragment>
</p:column> </p:column>
<p:column headerText="nimi"> <p:column>
<h:outputText value="#{cartItem.firstnames} #{cartItem.lastname}" /> <h2><h:outputText value="#{cartItem.nick}" /></h2>
<h:outputText value="#{cartItem.firstnames} #{cartItem.lastname}" />
</p:column> </p:column>
</p:dataTable> <p:column>
</ui:define> <p:commandButton value="OK" />
<p:commandButton value="Notify" />
<p:commandButton value="Reject" />
</p:column>
</p:dataTable>
</ui:define>
</ui:composition> </ui:composition>
</h:body> </h:body>
</html> </html>
\ No newline at end of file
...@@ -9,6 +9,8 @@ import java.util.Map; ...@@ -9,6 +9,8 @@ import java.util.Map;
import javax.ejb.EJB; import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped; import javax.enterprise.context.RequestScoped;
import javax.faces.context.FacesContext; import javax.faces.context.FacesContext;
import javax.faces.event.ValueChangeEvent;
import javax.faces.event.ValueChangeListener;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
...@@ -18,6 +20,7 @@ import org.slf4j.LoggerFactory; ...@@ -18,6 +20,7 @@ import org.slf4j.LoggerFactory;
import fi.codecrew.moya.beans.MenuBeanLocal; import fi.codecrew.moya.beans.MenuBeanLocal;
import fi.codecrew.moya.beans.SitePageBeanLocal; import fi.codecrew.moya.beans.SitePageBeanLocal;
import fi.codecrew.moya.model.MenuNavigation; import fi.codecrew.moya.model.MenuNavigation;
import fi.codecrew.moya.model.Menuitem;
import fi.codecrew.moya.model.PageContent; import fi.codecrew.moya.model.PageContent;
import fi.codecrew.moya.web.cdiview.GenericCDIView; import fi.codecrew.moya.web.cdiview.GenericCDIView;
import fi.codecrew.moya.web.helper.LayoutView; import fi.codecrew.moya.web.helper.LayoutView;
...@@ -48,6 +51,8 @@ public class MenuView extends GenericCDIView { ...@@ -48,6 +51,8 @@ public class MenuView extends GenericCDIView {
@EJB @EJB
private transient SitePageBeanLocal pagebean; private transient SitePageBeanLocal pagebean;
private String menuChange;
@SuppressWarnings("unused") @SuppressWarnings("unused")
private static final Logger logger = LoggerFactory.getLogger(MenuView.class); private static final Logger logger = LoggerFactory.getLogger(MenuView.class);
...@@ -71,10 +76,15 @@ public class MenuView extends GenericCDIView { ...@@ -71,10 +76,15 @@ public class MenuView extends GenericCDIView {
} }
List<JsfMenuitem> ret = menus.get(level); List<JsfMenuitem> ret = menus.get(level);
return ret; return ret;
} }
public void menuChangeEvent() {
super.navihandler.forward(menuChange);
}
public LinkedList<List<JsfMenuitem>> getMenus() public LinkedList<List<JsfMenuitem>> getMenus()
{ {
if (menus == null) if (menus == null)
...@@ -181,4 +191,12 @@ public class MenuView extends GenericCDIView { ...@@ -181,4 +191,12 @@ public class MenuView extends GenericCDIView {
this.layoutview = layoutview; this.layoutview = layoutview;
} }
public String getMenuChange() {
return menuChange;
}
public void setMenuChange(String menuChange) {
this.menuChange = menuChange;
}
} }
package fi.codecrew.moya.web.converter;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
import fi.codecrew.moya.beans.EventMapBeanLocal;
import fi.codecrew.moya.beans.MenuBeanLocal;
import fi.codecrew.moya.model.EventMap;
import fi.codecrew.moya.model.MenuNavigation;
import fi.codecrew.moya.utilities.jsf.GenericIntegerEntityConverter;
@Named()
@RequestScoped
public class MenuNavigationConverter extends GenericIntegerEntityConverter<MenuNavigation> {
@EJB
private MenuBeanLocal menuBean;
@Override
protected MenuNavigation find(Integer id) {
return menuBean.findNavigationId(id);
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!