summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 893fbd3)
raw | patch | inline | side by side (parent: 893fbd3)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 30 Jul 2002 02:41:04 +0000 (02:41 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 30 Jul 2002 02:41:04 +0000 (02:41 +0000) |
now only sort on one column. Nice and simple and obvious.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@929 57a73879-2fb5-44c3-a270-3262357dd7e2
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@929 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/htmltemplate.py | patch | blob | history |
index 56074fa14c3849e7c903139d92b77aadc38eb696..2c85c7e5d3edc8ef5a71c9659d3387df4460303a 100644 (file)
--- a/roundup/htmltemplate.py
+++ b/roundup/htmltemplate.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: htmltemplate.py,v 1.105 2002-07-26 08:26:59 richard Exp $
+# $Id: htmltemplate.py,v 1.106 2002-07-30 02:41:04 richard Exp $
__doc__ = """
Template engine.
w(' </tr>\n')
w('</table>\n')
- def sortby(self, sort_name, filterspec, columns, filter, group, sort, pagesize, startwith):
+ def sortby(self, sort_name, filterspec, columns, filter, group, sort,
+ pagesize, startwith):
+ ''' Figure the link for a column heading so we can sort by that
+ column
+ '''
l = []
w = l.append
for k, v in filterspec.items():
w(':group=%s'%','.join(map(urllib.quote, group)))
w(':pagesize=%s' % pagesize)
w(':startwith=%s' % startwith)
- m = []
- s_dir = ''
- for name in sort:
+
+ # handle the sorting - if we're already sorting by this column,
+ # then reverse the sorting, otherwise set the sorting to be this
+ # column only
+ sorting = None
+ if len(sort) == 1:
+ name = sort[0]
dir = name[0]
- if dir == '-':
- name = name[1:]
- else:
- dir = ''
- if sort_name == name:
- if dir == '-':
- s_dir = ''
- else:
- s_dir = '-'
- else:
- m.append(dir+urllib.quote(name))
- m.insert(0, s_dir+urllib.quote(sort_name))
- # so things don't get completely out of hand, limit the sort to
- # two columns
- w(':sort=%s'%','.join(m[:2]))
+ if dir == '-' and name[1:] == sort_name:
+ sorting = ':sort=%s'%sort_name
+ elif name == sort_name:
+ sorting = ':sort=-%s'%sort_name
+ if sorting is None:
+ sorting = ':sort=%s'%sort_name
+ w(sorting)
+
return '&'.join(l)
class ItemTemplate(TemplateFunctions):
#
# $Log: not supported by cvs2svn $
+# Revision 1.105 2002/07/26 08:26:59 richard
+# Very close now. The cgi and mailgw now use the new security API. The two
+# templates have been migrated to that setup. Lots of unit tests. Still some
+# issue in the web form for editing Roles assigned to users.
+#
# Revision 1.104 2002/07/25 07:14:05 richard
# Bugger it. Here's the current shape of the new security implementation.
# Still to do: