Skip to content

Commit d4ebb32

Browse files
author
effe
committed
Initializing repository
1 parent c3e6e53 commit d4ebb32

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+9464
-0
lines changed

LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Zak (including all files included on the suite) is released
2+
with a pure GPL3 license. Please, read it inside this directory,
3+
file: LICENSE-GPL3.txt
4+
5+
The directory src/js/jquery contains jquery, jquery ui and
6+
some plugin: the license of these files has to be considered
7+
indpendently from ZaK (see file headers please).
8+
Tha same applies for src/css related jquery (and jquery plugins)
9+
files
10+
11+
Authors: WuBook Srl
12+
Site: http://wubook.net/
13+
Copyright: 2010 and next years

LICENSE-GPL3.txt

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

server/__init__.py

Whitespace-only changes.

server/pages.py

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
from nevow import rend, loaders, tags as T, inevow
2+
from twisted.web.util import ChildRedirector
3+
from twisted.web.static import File
4+
from twisted.web import resource
5+
import os
6+
JsDispenser= File('src/js', defaultType= 'application/x-javascript')
7+
CssDispenser= File('src/css', defaultType= 'text/css')
8+
ImgDispenser= File('src/imgs', defaultType= 'image/png')
9+
10+
class IZak:
11+
def __init__(self):
12+
self.zakDbVersion= self.dbInit()
13+
def dbInit(self):
14+
files= [f for f in os.listdir('src/db') if f.endswith('.sql')]
15+
files.sort()
16+
self.files= files
17+
return len(files)
18+
def getSchema(self, fromversion= 0):
19+
res= ''
20+
for f in self.files[fromversion:]:
21+
res+= open('src/db/%s' % f).read()
22+
return res
23+
24+
ZaK= IZak()
25+
26+
class AdminTemplate(rend.Page):
27+
addSlash= 0
28+
docFactory= loaders.xmlfile('src/html/template.xhtml')
29+
jsorigin= None
30+
cssorigin= None
31+
xmlfile= None
32+
def render_contents(self, ctx, data):
33+
return loaders.xmlfile(self.xmlfile)
34+
def render_js(self, ctx, data):
35+
return self.jsorigin
36+
def render_css(self, ctx, data):
37+
if self.cssorigin:
38+
if isinstance(self.cssorigin, str):
39+
return T.link(type= 'text/css', rel= 'stylesheet', href= self.cssorigin)
40+
else:
41+
return [T.link(type= 'text/css', rel= 'stylesheet', href= s) for s in self.cssorigin]
42+
return ''
43+
44+
class AdminProperties(AdminTemplate):
45+
jsorigin= '/js/cm/pgprops.js'
46+
xmlfile= 'src/html/properties.xhtml'
47+
cssorigin= '/css/props.css'
48+
class AdminTableau(AdminTemplate):
49+
jsorigin= '/js/cm/pgtab.js'
50+
xmlfile= 'src/html/tableau.xhtml'
51+
cssorigin= '/css/tab.css', '/css/ui-themes/blitzer/jquery-ui-1.8.2.custom.css'
52+
53+
class AdminPricing(AdminTemplate):
54+
jsorigin= '/js/cm/pgpricing.js'
55+
xmlfile= 'src/html/pricing.xhtml'
56+
cssorigin= '/css/pricing.css', '/css/ui-themes/blitzer/jquery-ui-1.8.2.custom.css'
57+
58+
class AdminReservation(AdminTemplate):
59+
jsorigin= '/js/cm/pgres.js'
60+
xmlfile= 'src/html/res.xhtml'
61+
cssorigin= '/css/tab.css', '/css/res.css'
62+
63+
class AdminSchema(resource.Resource):
64+
def render(self, rqst):
65+
rqst.setHeader('content-type', 'text/plain')
66+
try:
67+
fromversion= int(rqst.args['fromversion'][0])
68+
return ZaK.getSchema(fromversion)
69+
except Exception, ss:
70+
print 'Error parsing schema: %s' % str(ss)
71+
return ''
72+
73+
class AdminInit(rend.Page):
74+
docFactory= loaders.xmlfile('src/html/init.xhtml')
75+
def __init__(self):
76+
rend.Page.__init__(self)
77+
self.children= {
78+
'': self,
79+
'schema': AdminSchema(),
80+
}
81+
def locateChild(self, ctx, segs):
82+
if segs[0] != 'version':
83+
return rend.Page.locateChild(self, ctx, segs)
84+
rqst= inevow.IRequest(ctx)
85+
rqst.setHeader('content-type', 'text/plain')
86+
return str(ZaK.zakDbVersion), ()
87+
88+
89+
class ZakAdmin(rend.Page):
90+
def __init__(self):
91+
rend.Page.__init__(self)
92+
self.children= {
93+
'dashboard': AdminProperties(),
94+
'tableau': AdminTableau(),
95+
'book': AdminReservation(),
96+
'js': JsDispenser,
97+
'css': CssDispenser,
98+
'imgs': ImgDispenser,
99+
'': ChildRedirector('/init/'),
100+
'init': AdminInit(),
101+
'pricing': AdminPricing(),
102+
}

src/css/jquery.contextMenu.css

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/* Generic context menu styles */
2+
.contextMenu {
3+
position: absolute;
4+
width: 120px;
5+
z-index: 99999;
6+
border: solid 1px #CCC;
7+
background: #EEE;
8+
padding: 0px;
9+
margin: 0px;
10+
display: none;
11+
}
12+
13+
.contextMenu LI {
14+
list-style: none;
15+
padding: 0px;
16+
margin: 0px;
17+
}
18+
19+
.contextMenu A {
20+
color: #333;
21+
text-decoration: none;
22+
display: block;
23+
line-height: 20px;
24+
height: 20px;
25+
background-position: 6px center;
26+
background-repeat: no-repeat;
27+
outline: none;
28+
padding: 1px 5px;
29+
padding-left: 28px;
30+
}
31+
32+
.contextMenu LI.hover A {
33+
color: #FFF;
34+
background-color: #3399FF;
35+
}
36+
37+
.contextMenu LI.disabled A {
38+
color: #AAA;
39+
cursor: default;
40+
}
41+
42+
.contextMenu LI.hover.disabled A {
43+
background-color: transparent;
44+
}
45+
46+
.contextMenu LI.separator {
47+
border-top: solid 1px #CCC;
48+
}

src/css/pricing.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
div.immenu {background-color:#f0f0f0;padding:5px;border-radius:3px}
2+
table.roomsmanagement td {text-align: center}
3+
table.defprices td {text-align: right}
4+
table.defprices b {font-size: 14px;color:black}

src/css/props.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
div.immenu {background-color:#f0f0f0;padding:5px;border-radius:3px}
2+
table.roomsmanagement td {text-align: center}

src/css/res.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
div.bookright {
2+
float: right;
3+
border-radius: 5px;
4+
background-color: #cccccc;
5+
width: 320px;
6+
min-height: 100px;
7+
padding: 10px;
8+
border: 3px solid #888888;
9+
margin-left: 5px;
10+
}
11+
h1.secacc {
12+
border-radius: 5px;
13+
background-color: #eeeeee;
14+
padding: 5px;
15+
}
16+
17+
h1.secacc a {
18+
color: black;
19+
}

src/css/tab.css

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
#tabtable img, #tabtable,#tabtable tr,#tabtable td, #tabtable th{
2+
margin: 0;
3+
padding: 0;
4+
}
5+
#tabtable, tabtable *{
6+
}
7+
#tabtable{
8+
margin: 0 auto;
9+
font: 80%/1 Verdana, Arial, DejaVu Sans, Helvetica, sans-serif;
10+
border-collapse: separate;
11+
border-spacing: 0;
12+
width : auto;
13+
empty-cells: show;
14+
}
15+
#tabtable td, #tabtableheader th {
16+
position : relative;
17+
width: 28px;
18+
max-width: 28px;
19+
min-width: 28px;
20+
height: 32px;
21+
min-height: 32px;
22+
max-height: 32px;
23+
text-align: center;
24+
border: 1px solid #c0c0c0;
25+
}
26+
27+
/*#tabtable td img {*/
28+
/*cursor: move;*/
29+
/*}*/
30+
31+
#tabtable td.bc {
32+
border-right: none;
33+
background : url("/imgs/tbl/bc.png") 0 0 no-repeat;
34+
}
35+
#tabtable td.bi {
36+
border-right: none;
37+
background : url("/imgs/tbl/bi.png") 0 0 no-repeat;
38+
}
39+
#tabtable td.bn {
40+
border-right: none;
41+
background : url("/imgs/tbl/bn.png") 0 0 no-repeat;
42+
}
43+
#tabtable td.bp {
44+
border-right: none;
45+
background : url("/imgs/tbl/bp.png") 0 0 no-repeat;
46+
}
47+
48+
#tabtable td.ec {
49+
border-left: none;
50+
background : url("/imgs/tbl/ec.png") 0 0 no-repeat;
51+
}
52+
#tabtable td.ei {
53+
border-left: none;
54+
background : url("/imgs/tbl/ei.png") 0 0 no-repeat;
55+
}
56+
#tabtable td.en {
57+
border-left: none;
58+
background : url("/imgs/tbl/en.png") 0 0 no-repeat;
59+
}
60+
#tabtable td.ep {
61+
border-left: none;
62+
background : url("/imgs/tbl/ep.png") 0 0 no-repeat;
63+
}
64+
65+
#tabtable td.rc {
66+
border-left: none;
67+
border-right: none;
68+
background : url("/imgs/tbl/rc.png") 0 0 no-repeat;
69+
background-repeat: repeat-x;
70+
}
71+
#tabtable td.ri {
72+
border-left: none;
73+
border-right: none;
74+
background : url("/imgs/tbl/ri.png") 0 0 no-repeat;
75+
background-repeat: repeat-x;
76+
}
77+
#tabtable td.rn {
78+
border-left: none;
79+
border-right: none;
80+
background : url("/imgs/tbl/rn.png") 0 0 no-repeat;
81+
background-repeat: repeat-x;
82+
}
83+
#tabtable td.rp {
84+
border-left: none;
85+
border-right: none;
86+
background : url("/imgs/tbl/rp.png") 0 0 no-repeat;
87+
background-repeat: repeat-x;
88+
}
89+
90+
#tabtable td.zc {
91+
border-left: none;
92+
border-right: none;
93+
background : url("/imgs/tbl/zc.png") 0 0 no-repeat;
94+
}
95+
#tabtable td.zci {
96+
border-left: none;
97+
border-right: none;
98+
background : url("/imgs/tbl/zci.png") 0 0 no-repeat;
99+
}
100+
#tabtable td.zcn {
101+
border-left: none;
102+
border-right: none;
103+
background : url("/imgs/tbl/zcn.png") 0 0 no-repeat;
104+
}
105+
#tabtable td.zcp {
106+
border-left: none;
107+
border-right: none;
108+
background : url("/imgs/tbl/zcp.png") 0 0 no-repeat;
109+
}
110+
111+
#tabtable td.zi {
112+
border-left: none;
113+
border-right: none;
114+
background : url("/imgs/tbl/zi.png") 0 0 no-repeat;
115+
}
116+
#tabtable td.zic {
117+
border-left: none;
118+
border-right: none;
119+
background : url("/imgs/tbl/zic.png") 0 0 no-repeat;
120+
}
121+
#tabtable td.zin {
122+
border-left: none;
123+
border-right: none;
124+
background : url("/imgs/tbl/zin.png") 0 0 no-repeat;
125+
}
126+
#tabtable td.zip {
127+
border-left: none;
128+
border-right: none;
129+
background : url("/imgs/tbl/zip.png") 0 0 no-repeat;
130+
}
131+
132+
#tabtable td.zn {
133+
border-left: none;
134+
border-right: none;
135+
background : url("/imgs/tbl/zn.png") 0 0 no-repeat;
136+
}
137+
#tabtable td.znc {
138+
border-left: none;
139+
border-right: none;
140+
background : url("/imgs/tbl/znc.png") 0 0 no-repeat;
141+
}
142+
#tabtable td.zni {
143+
border-left: none;
144+
border-right: none;
145+
background : url("/imgs/tbl/zni.png") 0 0 no-repeat;
146+
}
147+
#tabtable td.znp {
148+
border-left: none;
149+
border-right: none;
150+
background : url("/imgs/tbl/znp.png") 0 0 no-repeat;
151+
}
152+
153+
#tabtable td.zp {
154+
border-left: none;
155+
border-right: none;
156+
background : url("/imgs/tbl/zp.png") 0 0 no-repeat;
157+
}
158+
#tabtable td.zpc {
159+
border-left: none;
160+
border-right: none;
161+
background : url("/imgs/tbl/zpc.png") 0 0 no-repeat;
162+
}
163+
#tabtable td.zpi {
164+
border-left: none;
165+
border-right: none;
166+
background : url("/imgs/tbl/zpi.png") 0 0 no-repeat;
167+
}
168+
#tabtable td.zpn {
169+
border-left: none;
170+
border-right: none;
171+
background : url("/imgs/tbl/zpn.png") 0 0 no-repeat;
172+
}

0 commit comments

Comments
 (0)