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