-
Notifications
You must be signed in to change notification settings - Fork 96
/
ptEdit.zpt
121 lines (102 loc) · 4.66 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
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
<h1 tal:replace="structure python:context.manage_page_header(management_page_charset='utf-8')"
>manage_page_header</h1>
<h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
tal:replace="structure context/manage_tabs">manage_tabs</h2>
<tal:block define="global body request/other/text | request/form/text | context/read" />
<main class="container-fluid">
<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-3 col-md-2">Title</label>
<div class="col-sm-9 col-md-10">
<input id="title" class="form-control" type="text" name="title"
tal:attributes="value request/title | context/title" />
</div>
</div>
<div class="form-group row">
<label for="contenttype" class="form-label col-sm-3 col-md-2">Content Type</label>
<div class="col-sm-3 col-md-2">
<input id="contenttype" class="form-control" type="text" name="content_type"
tal:attributes="value request/content_type | context/content_type" />
</div>
</div>
<div class="form-group row">
<label for="title" class="form-label col-sm-3 col-md-2">Last Modified</label>
<div class="col-sm-5 col-md-5">
<span tal:replace="python: here.last_modified(here)">2018-01-01 00:00</span>
</div>
<div class="col-sm-4 col-md-5 text-right">
<a class="btn btn-secondary" title="Browse HTML source"
target="_blank" href="source.html" tal:condition="context/html">
<i class="far fa-eye"></i>
</a>
<a class="btn btn-secondary" title="Browse XML source"
target="_blank" href="source.xml" tal:condition="not:context/html">
<i class="far fa-eye"></i>
</a>
</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"
tal:attributes="data-readonly python:context.wl_isLocked() and 'true' or 'false'">
Template Body</textarea>
<div class="form-group row">
<div class="col-6 zmi-controls">
<input tal:condition="not:context/wl_isLocked"
class="btn btn-primary" type="submit" name="pt_editAction:method"
value="Save Changes" />
<input tal:condition="context/wl_isLocked"
class="btn btn-primary disabled" type="submit"
value="Upload File" disabled="disabled" />
<span tal:condition="context/wl_isLocked"
class="badge badge-warning" title="Locked"><i class="fa fa-lock"></i></span>
</div>
<div class="col-6 text-right pt-4 mt-2">
<div class="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"
title="Caution: Any metal-macros that you use will be expanded in your template's source"
>Expand macros <span class="hidden-xs">when editing</span></label>
</div>
</div>
</div>
</form>
<form action="pt_upload" method="post" enctype="multipart/form-data" class="zmi-upload mt-4"
tal:condition="not:here/wl_isLocked | nothing">
<p class="form-help">
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>. For non-XML and non-HTML content please set the
Encoding attribute. To view or download the current text click
<a href="document_src" title="Document Source">here</a>.
</p>
<div class="input-group" title="Select Local File for Uploading">
<div class="custom-file">
<input type="file" name="file" class="custom-file-input" id="file-data" value=""
onchange="$('.custom-file label span').html($(this).val().replace(/^.*(\\|\/|\:)/, ''));" />
<label class="custom-file-label" for="file-data"><span>Choose file</span></label>
</div>
<div class="input-group-append">
<input id="encoding" type="text" title="Encoding"
class="form-control text-warning"
style="width:5rem;border-radius:0;text-align:center"
name="encoding" value="utf-8" placeholder="utf-8" />
</div>
<div class="input-group-append">
<input class="btn btn-outline-secondary" type="submit" value="Upload File" />
</div>
</div>
<small id="encodingHelp" class="form-text text-warning text-right">
Encoding only used for non-XML and non-HTML content
</small>
</form>
</main>
<h1 tal:replace="structure context/manage_page_footer">Footer</h1>