-
Notifications
You must be signed in to change notification settings - Fork 16
/
Node-test.zafu
297 lines (245 loc) · 9.26 KB
/
Node-test.zafu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<r:include template='Node'>
<r:with part='head'>
<title do='title_for_layout' do='show' attr='v_title' name='page_title'>page title</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<r:void name='stylesheets'>
<r:stylesheets media='all' list='reset,zena,code,calendar'/>
</r:void>
<link href="style.css" rel="Stylesheet" type="text/css"/>
<r:javascripts list='prototype,effects,zena,dragdrop'/>
<r:uses_calendar/>
</r:with>
<r:with part='context'/>
<r:with part='content' class='project'>
<div id='related'>
<ul do='pages'>
<li do='each'><p><b do='show' attr='v_title' edit='true' publish='true'/> <r:edit/></p>
<r:zazen attr='v_summary' edit='true' publish='true'/>
</li>
</ul>
This filter updates the "distant filter block test"
<r:filter live='true' update='upfi'/>
</div>
<h3>publish = true</h3>
<r:zazen attr='d_some_attr' edit='true' publish='true'/>
<h3>publish = force</h3>
<r:zazen attr='d_some_attr' edit='true' publish='force'/>
<h3>pagination test</h3>
(no ajax)
<r:nodes in='site' order='zip' limit='8' paginate='p'>
<p><b do='[p_nodes]'/> nodes</p>
<p>
<r:link mode='test' page='previous' do='t'>previous</r:link>
<r:show var='p'/>/<r:show var='p_count'/>
|| <r:link page='list' mode='test'/> ||
<r:link mode='test' page='next' do='t'>next</r:link>
</p>
<ul>
<li do='each'><r:show attr='zip'/> <r:link/></li>
</ul>
</r:nodes>
(ajax)
<div id='pagir' do='block' do='nodes' in='site' order='zip' limit='8' paginate='p'>
<p><b do='[p_nodes]'/> nodes</p>
<p>
<r:link mode='test' update='pagir' page='previous' do='t'>previous</r:link>
<r:show var='p'/>/<r:show var='p_count'/>
|| <r:link page='list' update='pagir'/> ||
<r:link mode='test' update='pagir' page='next' do='t'>next</r:link>
</p>
<ul>
<li do='each'><r:show attr='zip'/> <r:link/></li>
</ul>
</div>
<hr/>
<h3>calendar test</h3>
<div do='calendar' find='notes in site'/>
<h3>week calendar</h3>
<div do='calendar' find='notes in site' type='week'/>
<h3>tiny calendar</h3>
<div do='calendar' find='notes in site' size='tiny'/>
<h3>assign calendar</h3>
<p>Assigns the main node to 'zena' project with given date</p>
<r:root>
<div do='calendar' select='added_notes' date='l_date'>
<span do='[current_date]' format='%d'/>
initial notes here
<div class='orange' do='block' green_if='link_id'>
<span do='swap' role='added_note' publish='true' />
</div>
<r:else>
<span do='[current_date]' format='%d'/>
no notes yet
<div class='orange' do='block' green_if='link_id'>
<span do='swap' role='added_note' publish='true' />
</div>
</r:else>
</div>
</r:root>
<div id='edit' do='block'>
<h3>edit block test</h3>
<r:text/>
<r:edit publish='true'><r:if test='1 eq 2'>blue<r:else>edit in else</r:else></r:if></r:edit>
</div>
<hr/>
<h2>update target test</h2>
<div id='bozo' do='block'><h3 do='title' actions='all'/><r:img mode='pv'/>
<r:summary/>
</div>
<ul do='images in site'><r:each join=', ' do='link' update='bozo'/></ul>
<hr/>
<div id='upfi' do='block'>
<h2>distant filter block test</h2>
<ol do='pages where name like "[param:f]%" limit 5'><li do='each' do='[name]'/></ol>
</div>
<hr/>
<div id='filter'>
<h2>filter block test</h2>
<r:filter live='true'/>
<r:block do='pages where name like "[param:f]%" limit 5'>
<ol><li do='each' do='[name]'/></ol>
</r:block>
</div>
<hr/>
<h2>data test</h2>
<ol do='data'>
<li do='each'><r:edit/> <b do='[text]'/> <r:show attr='value_a'/> <r:show attr='value_b'/><r:unlink/></li>
<li do='form'><r:cancel/> <input name='text'/> <input name='value_a'/> <input name='value_b'/> <input type='submit'/></li>
<li do='add' done='focus'/>
<r:set var='hours' do='stat' find='sum' from='value_a'/> <r:set var='exp' do='stat' find='sum' of='value_b'/>
<li><b><r:show var='hours'/> * 150.00 = <r:show eval='hours * 150'/> + <r:show var='exp'/> = <r:show eval='( hours * 150 ) + exp'/></b></li>
</ol>
<hr/>
<h2>data group block test</h2>
<ol id='bdata' do='block' do='data'>
<r:group by='value_a'>
<li>value: <b do='[value_a]'/></li>
<li do='each'><r:edit/> <b do='[text]'/> <r:show attr='value_a'/> <r:show attr='value_b'/><r:unlink/></li>
</r:group>
<li do='form'><r:cancel/> <input name='text'/> <input name='value_a'/> <input name='value_b'/> <input type='submit'/></li>
<li do='add' done='focus'/>
<r:set var='hours' do='stat' find='sum' from='value_a'/> <r:set var='exp' do='stat' find='sum' of='value_b'/>
<li><b><r:show var='hours'/> * 150.00 = <r:show eval='hours * 150'/> + <r:show var='exp'/> = <r:show eval='( hours * 150 ) + exp'/></b></li>
</ol>
<hr/>
<h2>data block test</h2>
<ol id='bdata' do='block' do='data'>
<li do='each'><r:edit/> <b do='[text]'/> <r:show attr='value_a'/> <r:show attr='value_b'/><r:unlink/></li>
<li do='form'><r:cancel/> <input name='text'/> <input name='value_a'/> <input name='value_b'/> <input type='submit'/></li>
<li do='add' done='focus'/>
<r:set var='hours' do='stat' find='sum' from='value_a'/> <r:set var='exp' do='stat' find='sum' of='value_b'/>
<li><b><r:show var='hours'/> * 150.00 = <r:show eval='hours * 150'/> + <r:show var='exp'/> = <r:show eval='( hours * 150 ) + exp'/></b></li>
</ol>
<hr/>
<h2>swap</h2>
<style>
.orange { background:orange;}
.green { background:green;}
</style>
<div id='swap' class='orange' do='block' green_if='custom_a eq 100'>
<span do='swap' states=',100' attr='custom_a' publish='true'><r:if test='custom_a eq 100'><r:t>done</r:t><r:else do='t'>open</r:else></r:if></span> custom_a: <b do='[custom_a]'/>
</div>
<h2>drag & drop</h2>
<r:images in='site' do='each' draggable='true' do='img' mode='tiny'/>
<h3>drop set relation</h3>
<ul do='tags in site'>
<li style='border:1px solid #400; min_width:100px; min_height:100px;' do='each' do='drop' set='set_tag'>
<b do='[v_title]'/>
<ul do='tagged'><li do='each' do='unlink' do='img' mode='tiny'/></ul>
</li>
</ul>
<h3>drop set attributes</h3>
<ul do='projects in site'>
<li style='border:1px solid #400; min_width:100px; min_height:100px;' do='each'><r:drop d_foo='I am an icon for [v_title]' icon_for_id='[id]'><b do='title' actions='all'/><r:icon where='1'><r:unlink do='img' mode='pv'/> <r:show attr='d_foo'/> </r:icon></r:drop>
</li>
</ul>
<h3>drop reload with param (comment on receiving)</h3>
<div style='border:1px solid #400; min_width:100px; min_height:100px;' do='drop' change='params' d='[id]' do='if' test='param:d'>
<r:node where='id eq param:d' in='site'>
Change icon to <r:img mode='tiny'/> ?
<r:main store='icon' do='form'>
<r:input type='hidden' name='icon_id' set_value='[icon.id]'/>
<r:input type='hidden' name='m_title' set_value='icon changed to [icon.name]'/>
<r:textarea name='m_text'/>
<input type='submit'/>
</r:main>
</r:node>
<r:else>
<r:icon do='img' mode='pv'/>
please drop a node to change the icon
<ul do='comments'>
<li do='each'><b do='[title]'/> <b do='[author_name]'/>
<div do='{text}'/>
</li>
</ul></r:else>
</div>
<hr/>
<h3>drop reload with param (comment on dropped)</h3>
<r:images in='site' do='each' draggable='true' do='img' mode='tiny'/>
<div style='border:1px solid #400; min_width:100px; min_height:100px;' do='drop' change='params' d='[id]' do='if' test='param:d'>
<r:node where='id eq param:d' in='site'>
Change icon to <r:img mode='tiny'/> ?
<r:form t_id='[main.id]'>
<r:input type='hidden' name='icon_for_id' set_value='[main.id]'/>
<r:input type='hidden' name='m_title' set_value='icon for [main.name]'/>
<r:textarea name='m_text'/>
<input type='submit'/>
</r:form>
</r:node>
<r:else>
please drop a node to change the icon
<r:icon><r:img mode='pv'/>
<ul do='comments'>
<li do='each'><b do='[title]'/> <b do='[author_name]'/>
<div do='{text}'/>
</li>
</ul></r:icon></r:else>
</div>
<hr/>
<h2>add in updated DOM</h2>
<div id='add_and_update' do='block'>
<h3 do='title'/>
<ul do='pages'>
<li do='each' do='[v_title]'/>
<li do='add' klass='Page' update='add_and_update'/>
</ul>
</div>
<r:projects in='site' do='each' join=', ' do='link' update='add_and_update'/>
<hr/>
<h2>notes & comments</h2>
<div id='notes' do='notes' in='project' limit='10' order='log_at DESC'>
<ul class='note_list'>
<li do='add' after='self'/>
<li class='inline_form' do='form'>
<form>
<p class='node_v_title'><input type='text' name='v_title' size='25'/></p>
<p class='node_klass'> <r:select name='klass' root_class='Note' selected='Post'/></p>
<p class='node_log_at'> <input type='date_box' name='log_at'/> </p>
<p class='validate'> <input type="submit" value='validate' do='void' tset_value='validate'/></p>
</form>
</li>
<li class='note' do='each'>
<div class='header'>
<p class='log_at' do='show' date='log_at' tformat='full_date'>04.10</p>
<h2 class='title' do='title' actions='all'/>
<div class='summary' do ='summary'/>
</div>
<r:text/>
<ul do='comments'>
<li do='each'><b do='[title]'/> <b do='[author_name]'/>
<div do='{text}'/>
</li>
<li do='add'/>
<li do='form'>
<p><input name='title'/></p>
<p><textarea name='text'/></p>
<p><input type='submit'/></p>
</li>
</ul>
<div class='clear'></div>
</li>
</ul>
</div>
<hr/>
</r:with>
</r:include>