/
main.zpt
149 lines (142 loc) · 5.49 KB
/
main.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
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
<tal:header replace="structure here/manage_page_header" />
<tal:tabs replace="structure here/manage_tabs" />
<!-- Add object widget -->
<form class="form-inline float-right mb-2"
method="get"
tal:condition="here/filtered_meta_types"
tal:attributes="action string:${request/URL1}/" >
<div class="form-group">
<label for="addItemSelect"
class="mr-2">Select type to add</label>
<select class="form-control mr-2"
name=":action"
id="addItemSelect"
tal:attributes="onchange string:location.href='${request/URL1}/'+this.options[this.selectedIndex].value">
<tal:option tal:repeat="mt here/filtered_meta_types">
<option tal:condition="mt/action"
tal:attributes="value mt/action"
tal:content="mt/name">Action</option>
</tal:option>
</select>
</div>
<input class="btn btn-outline-secondary" type="submit" name="submit" value="Add" />
</form>
<form name="objectItems"
method="post"
tal:define="
ids here/objectIds;
sm modules/AccessControl/SecurityManagement/getSecurityManager"
tal:attributes="action string:${request/URL1}/">
<tal:not-empty condition="ids">
<table class="table table-striped table-hover table-sm"
tal:condition="ids">
<thead class="thead-light">
<tr>
<th scope="col" class="text-right">
<input type="checkbox" id="checkAll"
onclick="(function() {
var checkboxes = document.getElementsByClassName('checkbox-list-item');
for (i = 0; i < checkboxes.length; i++){
checkboxes[i].checked = document.getElementById('checkAll').checked;
}})()">
</th>
<th scope="col">Type</th>
<th scope="col">Id</th>
<th scope="col">Title</th>
<th scope="col" class="text-right">Size</th>
</tr>
</thead>
<tbody>
<tr tal:repeat="id ids">
<tal:ob define="ob python:here.get(id)">
<td class="text-right">
<input type="checkbox"
class="checkbox-list-item"
name="ids:list"
tal:attributes="value id" />
</td>
<td>
<span tal:attributes="class ob/zmi_icon;
title ob/meta_type">
<span class="sr-only"
tal:content="ob/meta_type">meta_type</span>
</span>
</td>
<td>
<a tal:attributes="href string:${id}/manage_workspace"
tal:content="id">Id</a>
<span class="badge badge-warning"
tal:condition="ob/wl_isLocked | nothing">
Locked
</span>
</td>
<td>
<a tal:condition="ob/title"
tal:attributes="href string:${id}/manage_workspace"
tal:content="ob/title">Title</a>
</td>
<td class="text-right"
tal:content="python:here.computeSize(ob)">
</td>
</tal:ob>
</tr>
</tbody>
</table>
<div class="form-group"
tal:define="
delete_allowed python:sm.checkPermission('Delete objects', context)"
tal:condition="ids">
<tal:copy-paste condition="not:context/dontAllowCopyAndPaste|nothing">
<input class="btn btn-outline-secondary"
type="submit"
name="manage_renameForm:method"
value="Rename" />
<input class="btn btn-outline-danger"
type="submit"
name="manage_cutObjects:method"
value="Cut"
tal:condition="delete_allowed" />
<input class="btn btn-outline-secondary"
type="submit"
name="manage_copyObjects:method"
value="Copy" />
<input class="btn btn-outline-info"
type="submit"
name="manage_pasteObjects:method"
value="Paste"
tal:condition="here/cb_dataValid" />
</tal:copy-paste>
<input class="btn btn-outline-danger"
type="submit"
name="manage_delObjects:method"
value="Delete"
tal:condition="delete_allowed" />
<input class="btn btn-outline-secondary"
type="submit"
name="manage_importExportForm:method"
value="Import/Export"
tal:condition="python:sm.checkPermission('Import/Export objects', context)" />
</div>
</tal:not-empty>
<tal:empty condition="not:ids">
<div class="mb-2">
<span class="badge badge-pill badge-info">Info</span>
There are currently no items in <em tal:content="here/title_or_id"></em>.
</div>
<div class="form-group">
<tal:copy-paste condition="not:context/dontAllowCopyAndPaste|nothing">
<input class="btn btn-outline-secondary"
type="submit"
name="manage_pasteObjects:method"
value="Paste"
tal:condition="here/cb_dataValid" />
</tal:copy-paste>
<input class="btn btn-outline-secondary"
type="submit"
name="manage_importExportForm:method"
value="Import/Export"
tal:condition="python:sm.checkPermission('Import/Export objects', context)" />
</div>
</tal:empty>
</form>
<tal:footer replace="structure here/manage_page_footer" />