-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnotes.php
More file actions
73 lines (70 loc) · 2.3 KB
/
notes.php
File metadata and controls
73 lines (70 loc) · 2.3 KB
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
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Notes' clonable='1' routable='1'>
<cms:editable
name='content'
type='textarea'
label='Content'
/>
<cms:editable
name='note_owner'
type='relation'
has='one'
masterpage='users/index.php'
label='Owner'
required='1'
no_guix='1'
/>
<cms:editable
name='note_pad'
type='relation'
has='one'
masterpage='pads.php'
label='Pad'
required='1'
no_guix='1'
/>
<!-- define routes -->
<cms:route name='list_view' path='' filters='authenticated'/>
<cms:route
name='page_view'
path='{:id}'
filters='authenticated | note_exists | owns_note'
>
<cms:route_validators
id='non_zero_integer'
/>
</cms:route>
<cms:route name='create_view' path='create' filters='authenticated' />
<cms:route
name='create_with_pad_view'
path='{:id}/create'
filters='authenticated | pad_exists | owns_pad'
>
<cms:route_validators
id='non_zero_integer'
/>
</cms:route>
<cms:route
name='edit_view'
path='{:id}/edit'
filters='authenticated | note_exists | owns_note'
>
<cms:route_validators
id='non_zero_integer'
/>
</cms:route>
<cms:route
name='delete_view'
path='{:id}/delete'
filters='authenticated | note_exists | owns_note'
>
<cms:route_validators
id='non_zero_integer'
/>
</cms:route>
</cms:template>
<!-- find the matched route (view). Respond with 404 if no route matches. -->
<cms:match_route debug='0' is_404='1' />
<!-- and invoke snippet corresponding to the selected view -->
<cms:embed "views/notes/<cms:show k_matched_route />.html" />
<?php COUCH::invoke( K_IGNORE_CONTEXT ); ?>