Mercurial > p > roundup > code
comparison roundup/cgi/templating.py @ 3472:522b11d5ba8d
classhelp works with Link properties now [SF#1410290]
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 20 Jan 2006 02:09:11 +0000 |
| parents | fd32170475f5 |
| children | 86d6131847e8 |
comparison
equal
deleted
inserted
replaced
| 3471:f16eca38e4e5 | 3472:522b11d5ba8d |
|---|---|
| 623 if check('View', userid, self.classname, itemid=id)] | 623 if check('View', userid, self.classname, itemid=id)] |
| 624 return l | 624 return l |
| 625 | 625 |
| 626 def classhelp(self, properties=None, label=''"(list)", width='500', | 626 def classhelp(self, properties=None, label=''"(list)", width='500', |
| 627 height='400', property='', form='itemSynopsis', | 627 height='400', property='', form='itemSynopsis', |
| 628 pagesize=50, sort=None, filter=None): | 628 pagesize=50, inputtype="checkbox", sort=None, filter=None): |
| 629 '''Pop up a javascript window with class help | 629 '''Pop up a javascript window with class help |
| 630 | 630 |
| 631 This generates a link to a popup window which displays the | 631 This generates a link to a popup window which displays the |
| 632 properties indicated by "properties" of the class named by | 632 properties indicated by "properties" of the class named by |
| 633 "classname". The "properties" should be a comma-separated list | 633 "classname". The "properties" should be a comma-separated list |
| 646 | 646 |
| 647 The popup window will be resizable and scrollable. | 647 The popup window will be resizable and scrollable. |
| 648 | 648 |
| 649 If the "property" arg is given, it's passed through to the | 649 If the "property" arg is given, it's passed through to the |
| 650 javascript help_window function. | 650 javascript help_window function. |
| 651 | |
| 652 You can use inputtype="radio" to display a radio box instead | |
| 653 of the default checkbox (useful for entering Link-properties) | |
| 651 | 654 |
| 652 If the "form" arg is given, it's passed through to the | 655 If the "form" arg is given, it's passed through to the |
| 653 javascript help_window function. - it's the name of the form | 656 javascript help_window function. - it's the name of the form |
| 654 the "property" belongs to. | 657 the "property" belongs to. |
| 655 ''' | 658 ''' |
| 666 sort = '&@sort=' + sort | 669 sort = '&@sort=' + sort |
| 667 if property: | 670 if property: |
| 668 property = '&property=%s'%property | 671 property = '&property=%s'%property |
| 669 if form: | 672 if form: |
| 670 form = '&form=%s'%form | 673 form = '&form=%s'%form |
| 674 if inputtype: | |
| 675 type= '&type=%s'%inputtype | |
| 671 if filter: | 676 if filter: |
| 672 filterprops = filter.split(';') | 677 filterprops = filter.split(';') |
| 673 filtervalues = [] | 678 filtervalues = [] |
| 674 names = [] | 679 names = [] |
| 675 for x in filterprops: | 680 for x in filterprops: |
| 678 filtervalues.append('&%s=%s' % (name, urllib.quote(values))) | 683 filtervalues.append('&%s=%s' % (name, urllib.quote(values))) |
| 679 filter = '&@filter=%s%s' % (','.join(names), ''.join(filtervalues)) | 684 filter = '&@filter=%s%s' % (','.join(names), ''.join(filtervalues)) |
| 680 else: | 685 else: |
| 681 filter = '' | 686 filter = '' |
| 682 help_url = "%s?@startwith=0&@template=help&"\ | 687 help_url = "%s?@startwith=0&@template=help&"\ |
| 683 "properties=%s%s%s%s&@pagesize=%s%s" % \ | 688 "properties=%s%s%s%s%s&@pagesize=%s%s" % \ |
| 684 (self.classname, properties, property, form, sort, pagesize, filter) | 689 (self.classname, properties, property, form, type, sort, pagesize, filter) |
| 685 onclick = "javascript:help_window('%s', '%s', '%s');return false;" % \ | 690 onclick = "javascript:help_window('%s', '%s', '%s');return false;" % \ |
| 686 (help_url, width, height) | 691 (help_url, width, height) |
| 687 return '<a class="classhelp" href="%s" onclick="%s">%s</a>' % \ | 692 return '<a class="classhelp" href="%s" onclick="%s">%s</a>' % \ |
| 688 (help_url, onclick, self._(label)) | 693 (help_url, onclick, self._(label)) |
| 689 | 694 |
