Skip to content

Commit 1d4c353

Browse files
author
Alexander Smishlajev
committed
copied from classic templates: i18n markup,
show list of items when 'is_only_view_ok'
1 parent cb3c17d commit 1d4c353

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

templates/minimal/html/_generic.index.html

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,54 @@
55
tal:content="python:context._classname.capitalize()+' editing'"></title>
66
<span metal:fill-slot="body_title" tal:omit-tag="python:1"
77
tal:content="python:context._classname.capitalize()+' editing'"></span>
8-
98
<td class="content" metal:fill-slot="content">
109

11-
<span tal:condition="python:not (context.is_view_ok() or context.is_edit_ok())">
12-
You are not allowed to view this page.
13-
</span>
10+
<span tal:condition="python:not (context.is_view_ok() or context.is_edit_ok())"
11+
tal:omit-tag="python:1" i18n:translate=""
12+
>You are not allowed to view this page.</span>
1413

1514
<tal:block tal:condition="context/is_edit_ok">
15+
<tal:block i18n:translate="">
1616
<p class="form-help">
17-
You may edit the contents of the <span tal:replace="request/classname" />
17+
You may edit the contents of the
18+
<span tal:replace="request/classname" i18n:name="classname"/>
1819
class using this form. Commas, newlines and double quotes (") must be
1920
handled delicately. You may include commas and newlines by enclosing the
2021
values in double-quotes ("). Double quotes themselves must be quoted by
2122
doubling ("").
2223
</p>
2324

2425
<p class="form-help">
25-
Multilink properties have their multiple values colon (":") separated
26+
Multilink properties have their multiple values colon (":") separated
2627
(... ,"one:two:three", ...)
2728
</p>
2829

2930
<p class="form-help">
3031
Remove entries by deleting their line. Add new entries by appending
3132
them to the table - put an X in the id column.
3233
</p>
33-
34-
<form onSubmit="return submit_once()" method="POST">
34+
</tal:block>
35+
<form onSubmit="return submit_once()" method="POST"
36+
tal:attributes="action context/designator">
3537
<textarea rows="15" cols="60" name="rows" tal:content="context/csv"></textarea>
3638
<br>
3739
<input type="hidden" name="@action" value="editCSV">
3840
<input type="submit" value="Edit Items">
3941
</form>
4042
</tal:block>
4143

42-
<tal:block tal:condition="context/is_only_view_ok">
43-
view ok
44-
</tal:block>
44+
<table tal:condition="context/is_only_view_ok" width="100%" class="list">
45+
<tr>
46+
<th tal:repeat="property context/propnames" tal:content="property">&nbsp;</th>
47+
</tr>
48+
<tr tal:repeat="item context/list"
49+
tal:attributes="class python:['normal', 'alt'][repeat['item'].index%6/3]"
50+
>
51+
<td tal:repeat="property context/propnames"
52+
tal:content="python: item[property] or default"
53+
>&nbsp;</td>
54+
</tr>
55+
</table>
4556

4657
</td>
4758

0 commit comments

Comments
 (0)