comparison templates/classic/html/query.edit.html @ 2136:ee3cf6a44f29

queries on a per-user basis, and public queries [SF#891798] :) EditAction was confused about who "self" was Edit collision detection was broken for index-page edits
author Richard Jones <richard@users.sourceforge.net>
date Fri, 26 Mar 2004 04:50:51 +0000
parents
children 3b92a1b7a056
comparison
equal deleted inserted replaced
2135:89f42bddeaee 2136:ee3cf6a44f29
1 <!-- dollarId: user.item,v 1.7 2002/08/16 04:29:04 richard Exp dollar-->
2 <tal:block metal:use-macro="templates/page/macros/icing">
3 <title metal:fill-slot="head_title">
4 <span tal:replace="config/TRACKER_NAME" />: "Your Queries" Editing
5 </title>
6 <span metal:fill-slot="body_title" tal:omit-tag="python:1">
7 "Your Queries" Editing
8 </span>
9
10 <td class="content" metal:fill-slot="content">
11
12 <span tal:condition="not:context/is_edit_ok">
13 You are not allowed to edit queries.
14 </span>
15
16 <script language="javascript">
17 // This exists solely because I can't figure how to get the & into an
18 // attributes TALES expression, and so it keeps getting quoted.
19 function retire(qid) {
20 window.location = 'query'+qid+'?@action=retire&@template=edit';
21 }
22 </script>
23
24 <form method="POST" onSubmit="return submit_once()" action="query"
25 enctype="multipart/form-data" tal:condition="context/is_edit_ok">
26
27 <table class="list" width="100%"
28 tal:define="uid request/user/id; mine request/user/queries">
29
30 <tr><th>Query</th>
31 <th>Include in "Your Queries"</th>
32 <th>Edit</th>
33 <th>Private to you?</th>
34 <th>&nbsp;</th>
35 </tr>
36
37 <tr tal:repeat="query mine">
38 <tal:block condition="query/is_retired">
39
40 <td><a tal:attributes="href string:${query/klass}?${query/url}"
41 tal:content="query/name">query</a></td>
42
43 <td metal:define-macro="include">
44 <select tal:condition="python:query.id not in mine"
45 tal:attributes="name string:user${uid}@add@queries">
46 <option value="">leave out</option>
47 <option tal:attributes="value query/id">include</option>
48 </select>
49 <select tal:condition="python:query.id in mine"
50 tal:attributes="name string:user${uid}@remove@queries">
51 <option value="">leave in</option>
52 <option tal:attributes="value query/id">remove</option>
53 </select>
54 </td>
55
56 <td colspan="3">[query is retired]</td>
57
58 <!-- <td> maybe offer "restore" some day </td> -->
59 </tal:block>
60 </tr>
61
62 <tr tal:define="queries python:db.query.filter(filterspec={'private_for':uid})"
63 tal:repeat="query queries">
64 <td><a tal:attributes="href string:${query/klass}?${query/url}"
65 tal:content="query/name">query</a></td>
66
67 <td metal:use-macro="template/macros/include" />
68
69 <td><a tal:attributes="href string:query${query/id}">edit</a></td>
70
71 <td>
72 <select tal:attributes="name string:query${query/id}@private_for">
73 <option tal:attributes="selected python:query.private_for == uid;
74 value uid">yes</option>
75 <option tal:attributes="selected python:query.private_for == None"
76 value="-1">no</option>
77 </select>
78 </td>
79
80 <td>
81 <input type="button" value="Delete"
82 tal:attributes="onClick python:'''retire('%s')'''%query.id">
83 </td>
84 </tr>
85
86 <tr tal:define="queries python:db.query.filter(filterspec={'private_for':None})"
87 tal:repeat="query queries">
88 <td><a tal:attributes="href string:${query/klass}?${query/url}"
89 tal:content="query/name">query</a></td>
90
91 <td metal:use-macro="template/macros/include" />
92 <td colspan="3">[not yours to edit]</td>
93 </tr>
94
95 <tr><td colspan="5">
96 <input type="hidden" name="@action" value="edit">
97 <input type="hidden" name="@template" value="edit">
98 <input type="submit" value="Save Selection">
99 </td></tr>
100
101 </table>
102
103 </form>
104 </td>
105 </tal:block>

Roundup Issue Tracker: http://roundup-tracker.org/