Skip to content

Commit ac3df5d

Browse files
committed
issue2550831: Make the classic template query.edit page work.
More edits: 1) Admin was unable to restore a deleted query but could retire it. Add 'restore' security permission to admin in security.py. This seems like it should be a standard perm. 2) If a search you had in your "Your Queries" list was made private to somebody else, you lost the ability to drop it from your list. Modified the query.edit.html so that re-private and retired queries are listed at the bottom and you can uninstall them. Ideally a re-privated query should just dissapear from your listing. issue2550915 opened to track this.
1 parent 539cbe5 commit ac3df5d

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

roundup/security.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def __init__(self, db):
126126
self.addRole(name="Anonymous", description="An anonymous user")
127127

128128
# default permissions - Admin may do anything
129-
for p in 'create edit retire view'.split():
129+
for p in 'create edit restore retire view'.split():
130130
p = self.addPermission(name=p.title(),
131131
description="User may %s everything"%p)
132132
self.addPermissionToRole('Admin', p)

share/roundup/templates/classic/html/query.edit.html

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,23 +121,41 @@
121121
</tr>
122122

123123
<tr>
124-
<td colspan="5"><b i18n:translate="">Active retired queries</b></td>
124+
<td colspan="5"><b i18n:translate="">Active retired/private queries</b></td>
125125
</tr>
126-
<tr tal:repeat="query request/user/queries">
126+
<tal:block tal:repeat="query request/user/queries">
127+
<tr>
127128
<tal:block condition="python:path('query/is_retired')">
128129
<td><a tal:attributes="href string:${query/klass}?${query/url}"
129130
tal:content="query/name">query</a></td>
130131
<tal:block tal:condition="python: not query.creator == uid">
131132
<td metal:use-macro="template/macros/include"> </td>
132133
</tal:block>
133-
<td colspan="3" i18n:translate="">[query is retired]</td>
134+
<td colspan="2" tal:condition="python: not query.creator == uid" i18n:translate="">[query is retired]</td>
135+
<td colspan="3" tal:condition="python: query.creator == uid" i18n:translate="">[query is retired]</td>
134136
<td tal:condition="python:query.creator == uid">
135137
<input type="button" value="Restore" i18n:attributes="value"
136138
tal:attributes="onClick python:'''restore('%s')'''%query.id">
137139
</td>
140+
<td colspan="1" tal:condition="python:not query.creator == uid" tal:content="query/creator" i18n:translate="">put query owner here</td>
138141
</tal:block>
139142
</tr>
140-
143+
<tr>
144+
<tal:block condition="python:path('query/private_for') and (not query.creator == uid)">
145+
<td><a tal:attributes="href string:${query/klass}?${query/url}"
146+
tal:content="query/name">query</a></td>
147+
<tal:block tal:condition="python: not query.creator == uid">
148+
<td metal:use-macro="template/macros/include"> </td>
149+
</tal:block>
150+
<td colspan="2" i18n:translate="">[query is private]</td>
151+
<td tal:condition="python:query.creator == uid">
152+
<input type="button" value="Restore" i18n:attributes="value"
153+
tal:attributes="onClick python:'''restore('%s')'''%query.id">
154+
</td>
155+
<td colspan="1" tal:content="query/creator" i18n:translate="">put query owner here</td>
156+
</tal:block>
157+
</tr>
158+
</tal:block>
141159
<tr><td colspan="5">
142160
<input type="hidden" name="@action" value="edit">
143161
<input type="hidden" name="@template" value="edit">

0 commit comments

Comments
 (0)