/
ptEdit.zpt
88 lines (73 loc) · 3.71 KB
/
ptEdit.zpt
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
<h1 tal:replace="structure python:context.manage_page_header(management_page_charset='utf-8')">Header</h1>
<h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
tal:replace="structure context/manage_tabs">Tabs</h2>
<main>
<tal:block define="global body request/other/text | request/form/text
| context/read" />
<form action="" method="post" tal:attributes="action request/URL1" class="zmi-zpt zmi-edit">
<input type="hidden" name="encoding" value="utf-8" />
<div class="form-group row">
<label for="title" class="form-label col-sm-1">Title</label>
<input id="title" class="form-control col-sm-4" type="text" name="title"
tal:attributes="value request/title | context/title" />
<label for="contenttype" class="form-label col-sm-3 offset-sm-1">Content Type</label>
<input id="contenttype" class="form-control col-sm-3" type="text" name="content_type"
tal:attributes="value request/content_type | context/content_type" />
</div>
<div class="row ">
<div class="col-sm-6 offset-sm-6">
<a href="source.html" tal:condition="context/html">Browse HTML source</a>
<a href="source.xml" tal:condition="not:context/html">Browse XML source</a>
</div>
<div class="col-sm-6 offset-sm-6">
<div class="form-group form-check">
<input type="hidden" name="expand:int:default" value="0" />
<input id="expand" class="form-check-input" type="checkbox" value="1" name="expand:int"
tal:attributes="checked request/expand | context/expand" />
<label for="expand" class="form-check-label">Expand macros when editing</label>
</div>
</div>
</div>
<div tal:define="errors context/pt_errors" tal:condition="errors"
class="alert alert-danger" role="alert">
<pre tal:content="python:'\n'.join(errors)">errors</pre>
</div>
<textarea id="content" class="form-control zmi-zpt zmi-code col-sm-12" name="text:text" wrap="off" style="width: 100%;" rows="20"
tal:content="body">Template Body</textarea>
<div class="controls mt-2">
<em tal:condition="context/wl_isLocked">Locked</em>
<input tal:condition="not:context/wl_isLocked"
class="btn btn-primary" type="submit"
name="pt_editAction:method" value="Save Changes"/>
</div>
</form>
<p class="form-help mt-5">You can upload the text for
<span tal:replace="context/title_and_id" /> using the following form.
Choose an existing HTML or XML file from your local computer by
clicking <em>browse</em>. You can also <a href="document_src">click
context</a> to view or download the current text.</p>
<form action="pt_upload" method="post" enctype="multipart/form-data" class="zmi-upload">
<div class="form-group row">
<label for="file-data" class="col-sm-3 col-md-2" class="form-label">
File
</label>
<div class="col-sm-9 col-md-6">
<input id="file-data" class="form-control-file" type="file" name="file" size="40" value="" />
</div>
</div>
<div class="form-group row">
<label for="encoding" class="form-label col-sm-2">Encoding</label>
<div class="col-sm-9 col-md-6">
<input id="encoding" class="form-control" name="encoding" value="utf-8" />
<small id="encodingHelp" class="form-text text-muted">only used for non-XML and non-HTML content</small>
</div>
</div>
<div class="controls">
<em tal:condition="context/wl_isLocked">Locked</em>
<input tal:condition="not:context/wl_isLocked"
class="btn btn-primary" type="submit" value="Upload File" />
</div>
</form>
</main>
<h1 tal:replace="structure context/manage_page_footer">Footer</h1>