Commit 63d0a5c9 by Petri Jarvisalo

ui juttuja

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