Mercurial > p > roundup > code
changeset 3913:00896a2acaa5
clean up query display of "Private to you" items
Previously the handling of queries in the edit menu was a little wonky. If
you change a query to not be private to you then you lose the ability to
ever change it back to being private.
Previously the queries were displayed in three chunks: First all retired
queries. Then all queries private to the current user (this batch has the
dropdown for toggling private state). Then all non-private queries.
Now: all queries we created that are retired, all queries that we created
that are not retired, then all non-private queries not created by the
current user.
this should fix [SF#1481394]
| author | Justus Pendleton <jpend@users.sourceforge.net> |
|---|---|
| date | Thu, 20 Sep 2007 23:44:58 +0000 |
| parents | 82f462d9ad16 |
| children | a1b3692f5b1e |
| files | roundup/cgi/actions.py templates/classic/html/query.edit.html |
| diffstat | 2 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/roundup/cgi/actions.py Thu Sep 20 19:42:48 2007 +0000 +++ b/roundup/cgi/actions.py Thu Sep 20 23:44:58 2007 +0000 @@ -1,4 +1,4 @@ -#$Id: actions.py,v 1.70 2007-05-15 16:23:39 schlatterbeck Exp $ +#$Id: actions.py,v 1.71 2007-09-20 23:44:58 jpend Exp $ import re, cgi, StringIO, urllib, Cookie, time, random, csv, codecs @@ -148,7 +148,7 @@ """ self.fakeFilterVars() queryname = self.getQueryName() - + # editing existing query name? old_queryname = self.getFromForm('old-queryname')
--- a/templates/classic/html/query.edit.html Thu Sep 20 19:42:48 2007 +0000 +++ b/templates/classic/html/query.edit.html Thu Sep 20 23:44:58 2007 +0000 @@ -57,8 +57,8 @@ </tal:block> </tr> -<tr tal:define="queries python:db.query.filter(filterspec={'private_for':uid})" - tal:repeat="query queries"> +<tr tal:repeat="query mine"> + <tal:block condition="not:query/is_retired"> <td><a tal:attributes="href string:${query/klass}?${query/url}" tal:content="query/name">query</a></td> @@ -79,10 +79,12 @@ <input type="button" value="Delete" i18n:attributes="value" tal:attributes="onClick python:'''retire('%s')'''%query.id"> </td> + </tal:block> </tr> <tr tal:define="queries python:db.query.filter(filterspec={'private_for':None})" tal:repeat="query queries"> + <tal:block condition="python: query.creator != uid"> <td><a tal:attributes="href string:${query/klass}?${query/url}" tal:content="query/name">query</a></td> @@ -93,7 +95,7 @@ </td> <td tal:condition="not:query/is_edit_ok" colspan="3" i18n:translate="">[not yours to edit]</td> - + </tal:block> </tr> <tr><td colspan="5">
