Mercurial > p > roundup > code
comparison roundup/cgi/templating.py @ 1028:16498e77e3ff
allow overiding of the index args roundup/cgi/templating.py
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 03 Sep 2002 07:33:01 +0000 |
| parents | d6c13142e7b9 |
| children | f5216dbced55 |
comparison
equal
deleted
inserted
replaced
| 1027:9990a635de03 | 1028:16498e77e3ff |
|---|---|
| 1094 return '\n'.join(l) | 1094 return '\n'.join(l) |
| 1095 | 1095 |
| 1096 def indexargs_href(self, url, args): | 1096 def indexargs_href(self, url, args): |
| 1097 ''' embed the current index args in a URL ''' | 1097 ''' embed the current index args in a URL ''' |
| 1098 l = ['%s=%s'%(k,v) for k,v in args.items()] | 1098 l = ['%s=%s'%(k,v) for k,v in args.items()] |
| 1099 if self.columns: | 1099 if self.columns and not args.has_key(':columns'): |
| 1100 l.append(':columns=%s'%(','.join(self.columns))) | 1100 l.append(':columns=%s'%(','.join(self.columns))) |
| 1101 if self.sort[1] is not None: | 1101 if self.sort[1] is not None and not args.has_key(':sort'): |
| 1102 if self.sort[0] == '-': | 1102 if self.sort[0] == '-': |
| 1103 val = '-'+self.sort[1] | 1103 val = '-'+self.sort[1] |
| 1104 else: | 1104 else: |
| 1105 val = self.sort[1] | 1105 val = self.sort[1] |
| 1106 l.append(':sort=%s'%val) | 1106 l.append(':sort=%s'%val) |
| 1107 if self.group[1] is not None: | 1107 if self.group[1] is not None and not args.has_key(':group'): |
| 1108 if self.group[0] == '-': | 1108 if self.group[0] == '-': |
| 1109 val = '-'+self.group[1] | 1109 val = '-'+self.group[1] |
| 1110 else: | 1110 else: |
| 1111 val = self.group[1] | 1111 val = self.group[1] |
| 1112 l.append(':group=%s'%val) | 1112 l.append(':group=%s'%val) |
| 1113 if self.filter: | 1113 if self.filter and not args.has_key(':columns'): |
| 1114 l.append(':filter=%s'%(','.join(self.filter))) | 1114 l.append(':filter=%s'%(','.join(self.filter))) |
| 1115 for k,v in self.filterspec.items(): | 1115 for k,v in self.filterspec.items(): |
| 1116 l.append('%s=%s'%(k, ','.join(v))) | 1116 if not args.has_key(k): |
| 1117 if self.search_text: | 1117 l.append('%s=%s'%(k, ','.join(v))) |
| 1118 if self.search_text and not args.has_key(':search_text'): | |
| 1118 l.append(':search_text=%s'%self.search_text) | 1119 l.append(':search_text=%s'%self.search_text) |
| 1119 l.append(':pagesize=%s'%self.pagesize) | 1120 if not args.has_key(':pagesize'): |
| 1120 l.append(':startwith=%s'%self.startwith) | 1121 l.append(':pagesize=%s'%self.pagesize) |
| 1122 if not args.has_key(':startwith'): | |
| 1123 l.append(':startwith=%s'%self.startwith) | |
| 1121 return '%s?%s'%(url, '&'.join(l)) | 1124 return '%s?%s'%(url, '&'.join(l)) |
| 1122 | 1125 |
| 1123 def base_javascript(self): | 1126 def base_javascript(self): |
| 1124 return ''' | 1127 return ''' |
| 1125 <script language="javascript"> | 1128 <script language="javascript"> |
