Skip to content

Commit e964acf

Browse files
author
Richard Jones
committed
changed template to remove duplicate display table...
...using built-in permission checks now fixed permissions settings for anonymous to make view work again for them
1 parent 9e40158 commit e964acf

File tree

2 files changed

+50
-83
lines changed

2 files changed

+50
-83
lines changed

templates/classic/dbinit.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: dbinit.py,v 1.2 2003-11-10 03:56:39 richard Exp $
18+
# $Id: dbinit.py,v 1.3 2004-01-19 23:57:47 richard Exp $
1919

2020
import os
2121

@@ -132,11 +132,11 @@ def open(name=None):
132132
# - Allow anonymous (new) users to register through the email gateway
133133
p = db.security.getPermission('Email Registration')
134134
db.security.addPermissionToRole('Anonymous', p)
135-
# - Allow anonymous users access to the "issue" class of data
136-
# Note: this also grants access to related information like files,
137-
# messages, statuses etc that are linked to issues
138-
p = db.security.getPermission('View', 'issue')
139-
db.security.addPermissionToRole('Anonymous', p)
135+
# - Allow anonymous users access to view issues (which implies being
136+
# able to view all linked information too
137+
for cl in 'issue', 'file', 'msg', 'keyword':
138+
p = db.security.getPermission('View', cl)
139+
db.security.addPermissionToRole('Anonymous', p)
140140
# - Allow anonymous users access to edit the "issue" class of data
141141
# Note: this also grants access to create related information like
142142
# files and messages etc that are linked to issues
@@ -202,3 +202,4 @@ def init(adminpw):
202202

203203
# vim: set filetype=python ts=4 sw=4 et si
204204

205+
#SHA: 92c54c05ba9f59453dc74fa9fdbbae34f7a9c077

templates/classic/html/issue.item.html

Lines changed: 43 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,17 @@
44
<span tal:replace="config/TRACKER_NAME" />:
55
<span tal:condition="context/id"
66
tal:replace="string:Issue ${context/id}: ${context/title}" />
7-
<tal:x tal:condition="not:context/id">New Issue</tal:x>
87
</title>
98
<span metal:fill-slot="body_title" tal:omit-tag="python:1">
9+
<tal:x tal:condition="not:context/id">New</tal:x>
1010
Issue<span tal:replace="context/id" />
1111
<tal:x tal:condition="context/is_edit_ok">Editing</tal:x>
1212
</span>
1313

1414
<td class="content" metal:fill-slot="content">
1515

16-
<span tal:condition="python:not (context.is_view_ok() or context.is_edit_ok())">
17-
You are not allowed to view this page.
18-
</span>
19-
2016
<form method="POST" name="itemSynopsis" onSubmit="return submit_once()"
21-
enctype="multipart/form-data" tal:condition="context/is_edit_ok"
22-
tal:attributes="action context/designator">
17+
enctype="multipart/form-data" tal:attributes="action context/designator">
2318

2419
<table class="form">
2520
<tr>
@@ -62,20 +57,20 @@
6257
</td>
6358
</tr>
6459

65-
<tr>
60+
<tr tal:condition="context/is_edit_ok">
6661
<th>Change Note</th>
6762
<td colspan=3>
6863
<textarea tal:content="request/form/@note/value | default"
6964
name="@note" wrap="hard" rows="5" cols="80"></textarea>
7065
</td>
7166
</tr>
7267

73-
<tr>
68+
<tr tal:condition="context/is_edit_ok">
7469
<th>File</th>
7570
<td colspan=3><input type="file" name="@file" size="40"></td>
7671
</tr>
7772

78-
<tr>
73+
<tr tal:condition="context/is_edit_ok">
7974
<td>
8075
&nbsp;
8176
<input type="hidden" name="@template" value="item">
@@ -85,7 +80,9 @@
8580
submit button will go here
8681
</td>
8782
</tr>
83+
8884
</table>
85+
8986
</form>
9087

9188
<table class="form" tal:condition="not:context/id">
@@ -96,79 +93,48 @@
9693
</tr>
9794
</table>
9895

99-
<table class="form" tal:condition="context/is_only_view_ok">
100-
<tr>
101-
<th>Title</th><td colspan=3 tal:content="context/title">title</td>
102-
</tr>
103-
104-
<tr>
105-
<th>Priority</th><td tal:content="context/priority">priority</td>
106-
<th>Status</th><td tal:content="context/status">status</td>
107-
</tr>
108-
109-
<tr>
110-
<th>Superseder</th>
111-
<td>
112-
<span tal:condition="context/superseder" tal:repeat="sup context/superseder">
113-
<br>View: <a tal:attributes="href string:issue${sup/id}"
114-
tal:content="sup/id"></a>
115-
</span>
116-
</td>
117-
<th>Nosy List</th><td><span tal:replace="context/nosy" /></td>
118-
</tr>
119-
120-
<tr>
121-
<th>Assigned To</th><td tal:content="context/assignedto"></td>
122-
<th>Topics</th><td tal:content="structure context/topic"></td>
123-
</tr>
124-
</table>
125-
126-
<tal:block tal:condition="python:context.id and context.is_view_ok()">
127-
128-
<p tal:content="structure string:Created on
96+
<p tal:condition="context/id" tal:content="structure string:Created on
12997
<b>${context/creation}</b> by <b>${context/creator}</b>, last
13098
changed <b>${context/activity}</b>.">activity info
131-
</p>
132-
133-
<table class="messages" tal:condition="context/messages">
134-
<tr><th colspan="4" class="header">Messages</th></tr>
135-
<tal:block tal:repeat="msg context/messages/reverse">
136-
<tr>
137-
<th><a tal:attributes="href string:msg${msg/id}"
138-
tal:content="string:msg${msg/id}"></a></th>
139-
<th tal:content="string:Author: ${msg/author}">author</th>
140-
<th tal:content="string:Date: ${msg/date}">date</th>
141-
<th>
142-
<a tal:condition="context/is_edit_ok"
143-
tal:attributes="href string:issue${context/id}?@remove@messages=${msg/id}&@action=edit">remove</a>
144-
</th>
145-
</tr>
146-
<tr>
147-
<td colspan="4" class="content">
148-
<pre tal:content="structure msg/content/hyperlinked">content</pre>
149-
</td>
150-
</tr>
151-
</tal:block>
152-
</table>
153-
154-
<table class="files" tal:condition="context/files">
155-
<tr><th colspan="2" class="header">Files</th></tr>
156-
<tr><th>File name</th><th>Uploaded</th></tr>
157-
<tr tal:repeat="file context/files">
158-
<td>
159-
<a tal:attributes="href string:file${file/id}/${file/name}"
160-
tal:content="file/name">dld link</a>
161-
</td>
162-
<td>
163-
<span tal:content="file/creator">creator's name</span>,
164-
<span tal:content="file/creation">creation date</span>
99+
</p>
100+
101+
<table class="messages" tal:condition="context/messages">
102+
<tr><th colspan="4" class="header">Messages</th></tr>
103+
<tal:block tal:repeat="msg context/messages/reverse">
104+
<tr>
105+
<th><a tal:attributes="href string:msg${msg/id}"
106+
tal:content="string:msg${msg/id}"></a></th>
107+
<th tal:content="string:Author: ${msg/author}">author</th>
108+
<th tal:content="string:Date: ${msg/date}">date</th>
109+
<th>
110+
<a tal:condition="context/is_edit_ok"
111+
tal:attributes="href string:issue${context/id}?@remove@messages=${msg/id}&@action=edit">remove</a>
112+
</th>
113+
</tr>
114+
<tr>
115+
<td colspan="4" class="content">
116+
<pre tal:content="structure msg/content/hyperlinked">content</pre>
165117
</td>
166118
</tr>
167-
</table>
119+
</tal:block>
120+
</table>
168121

169-
<tal:block tal:replace="structure context/history" />
122+
<table class="files" tal:condition="context/files">
123+
<tr><th colspan="2" class="header">Files</th></tr>
124+
<tr><th>File name</th><th>Uploaded</th></tr>
125+
<tr tal:repeat="file context/files">
126+
<td>
127+
<a tal:attributes="href string:file${file/id}/${file/name}"
128+
tal:content="file/name">dld link</a>
129+
</td>
130+
<td>
131+
<span tal:content="file/creator">creator's name</span>,
132+
<span tal:content="file/creation">creation date</span>
133+
</td>
134+
</tr>
135+
</table>
170136

171-
</tal:block>
137+
<tal:block tal:condition="context/id" tal:replace="structure context/history" />
172138

173139
</td>
174140

0 commit comments

Comments
 (0)