Merge branch 'master' of https://git.bukova.info/repos/git/isspst
This commit is contained in:
@@ -3,38 +3,33 @@ package info.bukova.isspst.data;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
|
||||
@Entity
|
||||
@Table(name="BUILDING")
|
||||
@Table(name = "BUILDING")
|
||||
public class Building extends BaseData implements DataModel {
|
||||
|
||||
|
||||
@Column(name="CODE", unique=true)
|
||||
@Column(name = "CODE", unique = true)
|
||||
private String code;
|
||||
|
||||
@Column(name="NAME")
|
||||
@Column(name = "NAME")
|
||||
private String name;
|
||||
|
||||
@Column(name="DESCRIPTION")
|
||||
@Column(name = "DESCRIPTION")
|
||||
private String description;
|
||||
|
||||
|
||||
/**
|
||||
* @return the code
|
||||
*/
|
||||
@NotBlank(message = "${labels.BuildingsFormCodeConstr}")
|
||||
@NotNull(message = "${labels.BuildingsFormCodeConstr}")
|
||||
@NotEmpty(message = "${labels.BuildingsFormCodeConstr}")
|
||||
@NotBlank(message = "{BuildingsFormCodeConstr}")
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param code the code to set
|
||||
* @param code
|
||||
* the code to set
|
||||
*/
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
@@ -48,7 +43,8 @@ public class Building extends BaseData implements DataModel {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param name the name to set
|
||||
* @param name
|
||||
* the name to set
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
@@ -62,7 +58,8 @@ public class Building extends BaseData implements DataModel {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param description the description to set
|
||||
* @param description
|
||||
* the description to set
|
||||
*/
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package info.bukova.isspst.filters;
|
||||
|
||||
import static info.bukova.isspst.StringUtils.nullStr;
|
||||
import info.bukova.isspst.data.Building;
|
||||
|
||||
import org.hamcrest.Description;
|
||||
import org.hamcrest.Factory;
|
||||
import org.hamcrest.Matcher;
|
||||
import org.hamcrest.TypeSafeMatcher;
|
||||
|
||||
public class BuildingFilter implements Filter<Building> {
|
||||
|
||||
private Building condBuilding;
|
||||
|
||||
public BuildingFilter(Building condBuilding) {
|
||||
this.condBuilding = condBuilding;
|
||||
}
|
||||
|
||||
private static class BuildingMatcher extends TypeSafeMatcher<Building> {
|
||||
|
||||
private Building condBuilding;
|
||||
|
||||
public BuildingMatcher(Building cond) {
|
||||
this.condBuilding = cond;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void describeTo(Description desc) {
|
||||
desc.appendText("buildings matches");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matchesSafely(Building item) {
|
||||
return nullStr(item.getCode()).toLowerCase().contains(nullStr(condBuilding.getCode()).toLowerCase())
|
||||
&& nullStr(item.getName()).toLowerCase().contains(nullStr(condBuilding.getName()).toLowerCase())
|
||||
&& nullStr(item.getDescription()).toLowerCase().contains(nullStr(condBuilding.getDescription()).toLowerCase());
|
||||
}
|
||||
|
||||
@Factory
|
||||
public static Matcher<Building> matchBuilding(Building building) {
|
||||
return new BuildingMatcher(building);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BuildingMatcher matcher() {
|
||||
return new BuildingMatcher(condBuilding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String queryString() {
|
||||
// TODO query string
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package info.bukova.isspst.ui;
|
||||
|
||||
import info.bukova.isspst.data.Building;
|
||||
import info.bukova.isspst.filters.BuildingFilter;
|
||||
import info.bukova.isspst.services.buildings.BuildingService;
|
||||
|
||||
import org.zkoss.bind.annotation.Init;
|
||||
@@ -16,6 +17,7 @@ public class BuildingList extends ListViewModel<Building> {
|
||||
service = buildingService;
|
||||
dataClass = Building.class;
|
||||
formZul = "buildingForm.zul";
|
||||
dataFilter = new BuildingFilter(getFilterTemplate());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
BuildingsFormCodeConstr=Zadejte k\u00f3d budovy...
|
||||
@@ -1,8 +1,9 @@
|
||||
# Default file
|
||||
AppName=Objednávkový systém SPŠ Třebíč
|
||||
|
||||
AgendaBuildings=Budovy
|
||||
|
||||
BuildingsFormCode=Kód
|
||||
BuildingsFormCodeConstr=Zadejte kód budovy...
|
||||
BuildingsFormName=Název
|
||||
BuildingsFormDescription=Popis
|
||||
|
||||
@@ -15,6 +16,8 @@ ButtonSave=Uložit
|
||||
|
||||
FormBuilding=Budova
|
||||
|
||||
HeaderText=Hlavička
|
||||
|
||||
ToolbarRecNew=Nový záznam
|
||||
ToolbarRecEdit=Úprava aktuálního záznamu
|
||||
ToolbarRecDelete=Odstranit aktuální záznam
|
||||
|
||||
@@ -23,6 +23,12 @@
|
||||
<addon-uri>/WEB-INF/ckez-bind-lang-addon.xml</addon-uri>
|
||||
</language-config>
|
||||
|
||||
<desktop-config>
|
||||
<theme-uri>/css/zk-modify.css</theme-uri>
|
||||
<theme-uri>/css/form.css</theme-uri>
|
||||
<theme-uri>/css/page.css</theme-uri>
|
||||
</desktop-config>
|
||||
|
||||
<!-- <library-property>
|
||||
<name>org.zkoss.zul.progressbox.position</name>
|
||||
<value>center</value>
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
viewModel="@id('vm') @init('info.bukova.isspst.ui.addressbook.AddressFindResult')"
|
||||
closable="true" width="700px">
|
||||
|
||||
<style src="/app/form.css"/>
|
||||
|
||||
<listbox model="@load(vm.listResult)" height="300px" selectedItem="@bind(vm.selectedAddr)">
|
||||
<listhead>
|
||||
<listheader label="Firma" sort="auto(company)"/>
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
viewModel="@id('vm') @init('info.bukova.isspst.ui.addressbook.AddressForm')"
|
||||
closable="true" width="600px">
|
||||
|
||||
<style src="/app/form.css"/>
|
||||
|
||||
<grid width="580px">
|
||||
<columns>
|
||||
<column label="" hflex="min"/>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
viewModel="@id('vm') @init('info.bukova.isspst.ui.addressbook.AddressList')">
|
||||
|
||||
<include src="/app/toolbar.zul"/>
|
||||
<style src="/app/form.css"/>
|
||||
|
||||
<hbox width="100%">
|
||||
<listbox id="dataGrid" model="@load(vm.dataList)" selectedItem="@bind(vm.dataBean)"
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<zk>
|
||||
<window id="editWin" title="Uživatel" border="normal" closable="true" width="550px" apply="org.zkoss.bind.BindComposer"
|
||||
viewModel="@id('vm') @init('info.bukova.isspst.ui.users.PermissionForm')">
|
||||
<style src="/app/form.css"/>
|
||||
|
||||
<label value="@load(vm.dataBean.description)" style="font-weight: bold;"/>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<zk>
|
||||
<window id="editWin" title="Uživatel" border="normal" closable="true" width="450px" apply="org.zkoss.bind.BindComposer"
|
||||
viewModel="@id('vm') @init('info.bukova.isspst.ui.users.UserForm')">
|
||||
<style src="/app/form.css"/>
|
||||
|
||||
<grid width="440px">
|
||||
<columns>
|
||||
<column hflex="min"></column>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?page title="${labels.HeaderText}" contentType="text/html;charset=UTF-8"?>
|
||||
<zk>
|
||||
<style src="/css/page.css"/>
|
||||
<div id="header">
|
||||
${labels.AppName}
|
||||
</div>
|
||||
</zk>
|
||||
@@ -1,70 +0,0 @@
|
||||
/*body {
|
||||
font-family: sans-serif;
|
||||
}*/
|
||||
|
||||
#container {
|
||||
min-height:100%;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
#header{
|
||||
width: auto;
|
||||
height:40px;
|
||||
border: 1px solid #ccc;
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
#leftcolumn{
|
||||
width:140px;
|
||||
/* margin: 20px 20px 20px 0px;*/
|
||||
padding:10px;
|
||||
float: left;
|
||||
/* border: 1px solid #ccc;*/
|
||||
}
|
||||
|
||||
#navbar{
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
#maincolumn{
|
||||
padding:10px;
|
||||
padding-bottom:20px; /* Height of the footer */
|
||||
margin: 0px 0px 0px 160px;
|
||||
}
|
||||
|
||||
#footer{
|
||||
clear:both;
|
||||
position:absolute;
|
||||
bottom:0;
|
||||
width:100%;
|
||||
height:20px; /* Height of the footer */
|
||||
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.form-caption {
|
||||
--1overflow:hidden;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
}
|
||||
/*aaa*/
|
||||
.form-caption-content {
|
||||
float:left;
|
||||
}
|
||||
|
||||
/*
|
||||
a:link,a:visited {
|
||||
font-size: 12px;
|
||||
color: #0000A0;
|
||||
background-color: #FFFFFF;
|
||||
text-decoration: none;
|
||||
target-new: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
font-size: 12px;
|
||||
color: #0000A0;
|
||||
background-color: #a3d3f8;
|
||||
text-decoration: none;
|
||||
target-new: none;
|
||||
}*/
|
||||
@@ -6,7 +6,7 @@
|
||||
apply="org.zkoss.bind.BindComposer"
|
||||
viewModel="@id('vm') @init('info.bukova.isspst.ui.users.PasswdVM')">
|
||||
<caption src="/img/passwd.png" zclass="form-caption" label="Změnit heslo" />
|
||||
<style src="/app/form.css"/>
|
||||
|
||||
<grid>
|
||||
<columns>
|
||||
<column hflex="min"/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<html xmlns="native" xmlns:u="zul" xmlns:zk="zk">
|
||||
<u:style src="/app/page.css"/>
|
||||
<u:style src="/css/page.css"/>
|
||||
|
||||
<script type="text/javascript">
|
||||
zk.afterLoad("zk", function () {
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
<div id="container">
|
||||
<div id="header">
|
||||
hlavicka
|
||||
Objednávkový systém SPŠ Třebíč
|
||||
</div>
|
||||
|
||||
<div id="leftcolumn">
|
||||
|
||||
@@ -1,16 +1,48 @@
|
||||
<?page title="${labels.AgendaBuildings}" contentType="text/html;charset=UTF-8"?>
|
||||
<zk>
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<window title="${labels.AgendaBuildings}" border="normal" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('info.bukova.isspst.ui.BuildingList')">
|
||||
|
||||
<include src="/app/toolbar.zul"/>
|
||||
<window border="normal" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('info.bukova.isspst.ui.BuildingList')">
|
||||
<caption zclass="form-caption" label="${labels.AgendaBuildings}" />
|
||||
<include src="/app/toolbar.zul" />
|
||||
|
||||
<listbox model="@load(vm.dataList)" selectedItem="@bind(vm.dataBean)">
|
||||
<listhead>
|
||||
<listheader label="${labels.BuildingsGridColumnCode}" width="10%" />
|
||||
<listheader label="${labels.BuildingsGridColumnName}" width="30%" />
|
||||
<listheader label="${labels.BuildingsGridColumnDescription}" width="60%" />
|
||||
<listheader label="${labels.BuildingsGridColumnCode}" sort="auto(code)" onSort="@command('onSort', column='code')" width="10%" />
|
||||
<listheader label="${labels.BuildingsGridColumnName}" sort="auto(name)" onSort="@command('onSort', column='name')" width="30%" />
|
||||
<listheader label="${labels.BuildingsGridColumnDescription}" sort="auto(description)" onSort="@command('onSort', column='description')" width="60%" />
|
||||
</listhead>
|
||||
<auxhead sclass="category-center" visible="@load(vm.filter)">
|
||||
<auxheader>
|
||||
<div sclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<textbox value="@bind(vm.filterTemplate.code)" instant="true" onChange="@command('doFilter')" sclass="find-grid-textbox" />
|
||||
</div>
|
||||
<div sclass="find-grid-img">
|
||||
<image src="/img/funnel.png" />
|
||||
</div>
|
||||
</div>
|
||||
</auxheader>
|
||||
<auxheader>
|
||||
<div sclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<textbox value="@bind(vm.filterTemplate.name)" instant="true" onChange="@command('doFilter')" sclass="find-grid-textbox" />
|
||||
</div>
|
||||
<div sclass="find-grid-img">
|
||||
<image src="/img/funnel.png" />
|
||||
</div>
|
||||
</div>
|
||||
</auxheader>
|
||||
<auxheader>
|
||||
<div sclass="find-grid-cell">
|
||||
<div sclass="find-grid-divtextbox">
|
||||
<textbox value="@bind(vm.filterTemplate.description)" instant="true" onChange="@command('doFilter')" sclass="find-grid-textbox" />
|
||||
</div>
|
||||
<div sclass="find-grid-img">
|
||||
<image src="/img/funnel.png" />
|
||||
</div>
|
||||
</div>
|
||||
</auxheader>
|
||||
</auxhead>
|
||||
<template name="model">
|
||||
<listitem>
|
||||
<listcell label="@load(each.code)" />
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?page title="${labels.AgendaBuildings}" contentType="text/html;charset=UTF-8"?>
|
||||
<!--?link rel="stylesheet" type="text/css" href="/app/page.css"?-->
|
||||
<zk>
|
||||
<window id="editWin" closable="true" border="normal" position="center" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('info.bukova.isspst.ui.BuildingForm')">
|
||||
<caption src="/img/building.png" zclass="form-caption" label="${labels.FormBuilding}" />
|
||||
@@ -19,13 +18,13 @@
|
||||
<row>
|
||||
<cell sclass="row-title">${labels.BuildingsFormName} :</cell>
|
||||
<cell>
|
||||
<textbox width="200px" value="@bind(vm.dataBean.name)" />
|
||||
<textbox id="name" width="200px" value="@bind(vm.dataBean.name)" />
|
||||
</cell>
|
||||
</row>
|
||||
<row>
|
||||
<cell sclass="row-title">${labels.BuildingsFormDescription} :</cell>
|
||||
<cell>
|
||||
<textbox width="300px" value="@bind(vm.dataBean.description)" />
|
||||
<textbox id="description" width="300px" value="@bind(vm.dataBean.description)" />
|
||||
</cell>
|
||||
</row>
|
||||
</rows>
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
html {
|
||||
/*vertical scrollbar allways visible */
|
||||
overflow: -moz-scrollbars-vertical;
|
||||
overflow-y: scroll;
|
||||
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
#container {
|
||||
min-height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#header {
|
||||
width: auto;
|
||||
height: 40px;
|
||||
border: 1px solid #ccc;
|
||||
padding: 10px;
|
||||
background: url("/isspst/img/header-bg.png") 50% 0 repeat-x;
|
||||
|
||||
color: #ffffff;
|
||||
font-size: 35px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
text-shadow: 2px 2px 2px #000000;
|
||||
}
|
||||
|
||||
#leftcolumn {
|
||||
width: 140px;
|
||||
padding: 10px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#navbar {
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
#maincolumn {
|
||||
padding: 10px;
|
||||
padding-bottom: 20px; /* Height of the footer */
|
||||
margin: 0px 0px 0px 160px;
|
||||
}
|
||||
|
||||
#footer {
|
||||
clear: both;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 20px; /* Height of the footer */
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.form-caption {
|
||||
overflow: hidden;
|
||||
font-weight: bold;
|
||||
font-size: 20px;
|
||||
text-shadow: 2px 2px 2px #888888;
|
||||
padding-left: 5px;
|
||||
}
|
||||
/*aaa*/
|
||||
.form-caption-content {
|
||||
float: left;
|
||||
}
|
||||
|
||||
/*
|
||||
a:link,a:visited {
|
||||
font-size: 12px;
|
||||
color: #0000A0;
|
||||
background-color: #FFFFFF;
|
||||
text-decoration: none;
|
||||
target-new: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
font-size: 12px;
|
||||
color: #0000A0;
|
||||
background-color: #a3d3f8;
|
||||
text-decoration: none;
|
||||
target-new: none;
|
||||
}*/
|
||||
@@ -0,0 +1,18 @@
|
||||
.find-grid-cell {
|
||||
display: table;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.find-grid-img {
|
||||
display: table-cell;
|
||||
width: 20px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.find-grid-divtextbox {
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.find-grid-textbox {
|
||||
width: 100%;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 394 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
Reference in New Issue
Block a user