annotate MoinMoin/themes/basic/templates/modify.html @ 2504:96f95afaf6f8

POC for ACL validation
author sharky93 <rishabhr123@gmail.com>
date Sun, 22 Sep 2013 13:34:06 +0530
parents b0e5881e515e
children b0cce905e94d
rev   line source
2346
eb3c2da11ba1 separate item views as the itemviews template (basic theme)
sharky93 <rishabhr123@gmail.com>
parents: 2345
diff changeset
1 {% extends theme("layout.html") %}
eb3c2da11ba1 separate item views as the itemviews template (basic theme)
sharky93 <rishabhr123@gmail.com>
parents: 2345
diff changeset
2 {% import "forms.html" as forms %}
eb3c2da11ba1 separate item views as the itemviews template (basic theme)
sharky93 <rishabhr123@gmail.com>
parents: 2345
diff changeset
3 {% import "utils.html" as utils %}
2336
f844f7307aa6 tabbable grouping of meta in editor
sharky93 <rishabhr123@gmail.com>
parents: 2335
diff changeset
4 {% from theme("modify_meta.html") import basic_meta_editor %}
2346
eb3c2da11ba1 separate item views as the itemviews template (basic theme)
sharky93 <rishabhr123@gmail.com>
parents: 2345
diff changeset
5 {% import theme("itemviews.html") as itemviews with context %}
2481
76098dbcb43c adds support for editing non-wiki binary items
sharky93 <rishabhr123@gmail.com>
parents: 2440
diff changeset
6 {% import theme(form['content_form'].template) as content_template %}
76098dbcb43c adds support for editing non-wiki binary items
sharky93 <rishabhr123@gmail.com>
parents: 2440
diff changeset
7 {% set basic_data_editor = content_template.basic_data_editor %}
2346
eb3c2da11ba1 separate item views as the itemviews template (basic theme)
sharky93 <rishabhr123@gmail.com>
parents: 2345
diff changeset
8
eb3c2da11ba1 separate item views as the itemviews template (basic theme)
sharky93 <rishabhr123@gmail.com>
parents: 2345
diff changeset
9 {% set title = _("Modifying '%(item_name)s'", item_name=item_name) %}
eb3c2da11ba1 separate item views as the itemviews template (basic theme)
sharky93 <rishabhr123@gmail.com>
parents: 2345
diff changeset
10
eb3c2da11ba1 separate item views as the itemviews template (basic theme)
sharky93 <rishabhr123@gmail.com>
parents: 2345
diff changeset
11 {% block views %}
eb3c2da11ba1 separate item views as the itemviews template (basic theme)
sharky93 <rishabhr123@gmail.com>
parents: 2345
diff changeset
12 {{ itemviews }}
eb3c2da11ba1 separate item views as the itemviews template (basic theme)
sharky93 <rishabhr123@gmail.com>
parents: 2345
diff changeset
13 {% endblock %}
2335
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
14
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
15 {% block content %}
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
16 <h2>{{ title }}</h2>
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
17 <div id="moin-modify" class="moin-form">
2440
3000fd5b0e29 adds div to modify view to check if modify view, instead of checking the URL
sharky93 <rishabhr123@gmail.com>
parents: 2371
diff changeset
18 <div id="checkmodifyview"> </div>
2335
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
19 {{ gen.form.open(form, method='post', enctype='multipart/form-data') }}
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
20 {{ forms.render_errors(form) }}
2504
96f95afaf6f8 POC for ACL validation
sharky93 <rishabhr123@gmail.com>
parents: 2495
diff changeset
21 {{ forms.render_errors(form['meta_form']['acl']) }}
2335
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
22 {#
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
23 Workaround:
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
24 For *Draw content, hide submit button and form['comment'], since *Draw
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
25 POSTs originate from their respective applets.
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
26 #}
2371
1422a4849787 Fixing outline for tabs in modify view
sharky93 <rishabhr123@gmail.com>
parents: 2366
diff changeset
27 <ul class="moin-nav nav-tabs moin-shadow">
2366
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
28 <li class="active"><a href="#editor" data-toggle="tab">Edit Content</a></li>
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
29 <li><a href="#meta" data-toggle="tab">Edit Meta</a></li>
2495
b0e5881e515e adds basic ui for acl setting
sharky93 <rishabhr123@gmail.com>
parents: 2481
diff changeset
30 <li><a href="#acl" data-toggle="tab">Edit ACL</a></li>
2366
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
31 <li><a href="#help" data-toggle="tab">Help</a></li>
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
32 </ul>
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
33 <div class="tab-content">
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
34 <div class="tab-pane active" id="editor">
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
35 {{ basic_data_editor(form['content_form'], item_name, class='form-control') }}
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
36 </div>
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
37 <div class="tab-pane active" id="meta">
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
38 <div class="row">
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
39 <div class="col-lg-6">
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
40 {{ basic_meta_editor(form['meta_form']) }}
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
41 </div>
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
42 {% set field = form['extra_meta_text'] %}
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
43 <div class="col-lg-6">
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
44 <div class="form-group">
2356
92fb82ba5906 Basic meta forms and the extra metadata(JSON) now sidebyside, all textareas
sharky93 <rishabhr123@gmail.com>
parents: 2352
diff changeset
45 {{ gen.label(field) }}
2366
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
46 {{ gen.textarea(field, rows=field.properties.rows|string, cols=field.properties.cols|string, class='form-control') }}
2356
92fb82ba5906 Basic meta forms and the extra metadata(JSON) now sidebyside, all textareas
sharky93 <rishabhr123@gmail.com>
parents: 2352
diff changeset
47 </div>
92fb82ba5906 Basic meta forms and the extra metadata(JSON) now sidebyside, all textareas
sharky93 <rishabhr123@gmail.com>
parents: 2352
diff changeset
48 </div>
2336
f844f7307aa6 tabbable grouping of meta in editor
sharky93 <rishabhr123@gmail.com>
parents: 2335
diff changeset
49 </div>
f844f7307aa6 tabbable grouping of meta in editor
sharky93 <rishabhr123@gmail.com>
parents: 2335
diff changeset
50 </div>
2495
b0e5881e515e adds basic ui for acl setting
sharky93 <rishabhr123@gmail.com>
parents: 2481
diff changeset
51 <div class="tab-pane active" id="acl">
b0e5881e515e adds basic ui for acl setting
sharky93 <rishabhr123@gmail.com>
parents: 2481
diff changeset
52 <div class="row">
b0e5881e515e adds basic ui for acl setting
sharky93 <rishabhr123@gmail.com>
parents: 2481
diff changeset
53 {% set field = form['meta_form']['acl'] %}
b0e5881e515e adds basic ui for acl setting
sharky93 <rishabhr123@gmail.com>
parents: 2481
diff changeset
54 <div class="col-lg-6">
b0e5881e515e adds basic ui for acl setting
sharky93 <rishabhr123@gmail.com>
parents: 2481
diff changeset
55 <div class="form-group">
b0e5881e515e adds basic ui for acl setting
sharky93 <rishabhr123@gmail.com>
parents: 2481
diff changeset
56 {{ gen.label(field) }}
b0e5881e515e adds basic ui for acl setting
sharky93 <rishabhr123@gmail.com>
parents: 2481
diff changeset
57 {{ gen.textarea(field, rows='1', class='form-control') }}
b0e5881e515e adds basic ui for acl setting
sharky93 <rishabhr123@gmail.com>
parents: 2481
diff changeset
58 </div>
b0e5881e515e adds basic ui for acl setting
sharky93 <rishabhr123@gmail.com>
parents: 2481
diff changeset
59 </div>
b0e5881e515e adds basic ui for acl setting
sharky93 <rishabhr123@gmail.com>
parents: 2481
diff changeset
60 </div>
b0e5881e515e adds basic ui for acl setting
sharky93 <rishabhr123@gmail.com>
parents: 2481
diff changeset
61 </div>
2366
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
62 <div class="tab-pane active" id="help">
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
63 {% if form['content_form'].help %}
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
64 <pre id="moin-editor-help">{{ form['content_form'].help }}</pre>
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
65 {% endif %}
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
66 </div>
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
67 </div>
2335
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
68 {#
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
69 {{ gen.textarea(form['meta_text'], lang='en', dir='ltr', rows=rows_meta, cols=cols) }}
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
70 <br />
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
71 {{ forms.render_errors(form['meta_text']) }}
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
72 #}
2345
7dd810dc82e1 combines basic and extra meta into one tabbable, submit button below editor and renamed 'Save'
sharky93 <rishabhr123@gmail.com>
parents: 2344
diff changeset
73 {% if not form['content_form'].is_draw %}
2366
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
74 <div class="form-group">
2345
7dd810dc82e1 combines basic and extra meta into one tabbable, submit button below editor and renamed 'Save'
sharky93 <rishabhr123@gmail.com>
parents: 2344
diff changeset
75 {{ forms.render_textcha(gen, form) }}
2366
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
76 {{ gen.input(form['comment'], type="text", class="form-control") }}
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
77 </div>
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
78 <div class="form-group">
2345
7dd810dc82e1 combines basic and extra meta into one tabbable, submit button below editor and renamed 'Save'
sharky93 <rishabhr123@gmail.com>
parents: 2344
diff changeset
79 {{ forms.render_submit(form, value='Save', class='btn btn-primary', id='moin-save-text-button') }}
2366
15501d0c9254 Fixes modify view for boostrap v3
sharky93 <rishabhr123@gmail.com>
parents: 2356
diff changeset
80 </div>
2345
7dd810dc82e1 combines basic and extra meta into one tabbable, submit button below editor and renamed 'Save'
sharky93 <rishabhr123@gmail.com>
parents: 2344
diff changeset
81 {% endif %}
7dd810dc82e1 combines basic and extra meta into one tabbable, submit button below editor and renamed 'Save'
sharky93 <rishabhr123@gmail.com>
parents: 2344
diff changeset
82
2335
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
83 {{ gen.form.close() }}
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
84 </div>
acddea75972b basic modify view
sharky93 <rishabhr123@gmail.com>
parents:
diff changeset
85 {% endblock %}