Skip to content

Commit 94851e8

Browse files
author
Richard Jones
committed
classhelp works with Link properties now [SF#1410290]
1 parent 2de9276 commit 94851e8

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Feature:
1616
- enable registration confirmation by web only (sf bug 1381675)
1717
- allow preselection of values in templating menu()s (sf patch 1396085)
1818
- display the query name in the header (sf feature 1298535 / patch 1349387)
19+
- classhelp works with Link properties now (sf bug 1410290)
1920

2021
Fixed:
2122
- MySQL now creates String columns using the TEXT column type

roundup/cgi/templating.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ def filter(self, request=None, filterspec={}, sort=(None,None),
625625

626626
def classhelp(self, properties=None, label=''"(list)", width='500',
627627
height='400', property='', form='itemSynopsis',
628-
pagesize=50, sort=None, filter=None):
628+
pagesize=50, inputtype="checkbox", sort=None, filter=None):
629629
'''Pop up a javascript window with class help
630630
631631
This generates a link to a popup window which displays the
@@ -648,6 +648,9 @@ def classhelp(self, properties=None, label=''"(list)", width='500',
648648
649649
If the "property" arg is given, it's passed through to the
650650
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)
651654
652655
If the "form" arg is given, it's passed through to the
653656
javascript help_window function. - it's the name of the form
@@ -668,6 +671,8 @@ def classhelp(self, properties=None, label=''"(list)", width='500',
668671
property = '&property=%s'%property
669672
if form:
670673
form = '&form=%s'%form
674+
if inputtype:
675+
type= '&type=%s'%inputtype
671676
if filter:
672677
filterprops = filter.split(';')
673678
filtervalues = []
@@ -680,8 +685,8 @@ def classhelp(self, properties=None, label=''"(list)", width='500',
680685
else:
681686
filter = ''
682687
help_url = "%s?@startwith=0&@template=help&"\
683-
"properties=%s%s%s%s&@pagesize=%s%s" % \
684-
(self.classname, properties, property, form, sort, pagesize, filter)
688+
"properties=%s%s%s%s%s&@pagesize=%s%s" % \
689+
(self.classname, properties, property, form, type, sort, pagesize, filter)
685690
onclick = "javascript:help_window('%s', '%s', '%s');return false;" % \
686691
(help_url, width, height)
687692
return '<a class="classhelp" href="%s" onclick="%s">%s</a>' % \

templates/classic/html/_generic.help.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@
7171
<th tal:repeat="prop props" tal:content="prop" i18n:translate=""></th>
7272
</tr>
7373
<tr tal:repeat="item batch">
74-
<tal:block tal:define="attr python:item[props[0]]">
75-
<td>
76-
<input type="checkbox" name="check"
74+
<tal:block tal:define="attr python:item[props[0]]" >
75+
<td>
76+
<input name="check"
7777
onclick="updatePreview();"
78-
tal:attributes="value attr; id string:id_$attr" />
78+
tal:attributes="type python:request.form['type'].value;
79+
value attr; id string:id_$attr" />
7980
</td>
8081
<td tal:repeat="prop props">
8182
<label class="classhelp-label"

templates/minimal/html/_generic.help.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@
7171
<th tal:repeat="prop props" tal:content="prop" i18n:translate=""></th>
7272
</tr>
7373
<tr tal:repeat="item batch">
74-
<tal:block tal:define="attr python:item[props[0]]">
75-
<td>
76-
<input type="checkbox" name="check"
74+
<tal:block tal:define="attr python:item[props[0]]" >
75+
<td>
76+
<input name="check"
7777
onclick="updatePreview();"
78-
tal:attributes="value attr; id string:id_$attr" />
78+
tal:attributes="type python:request.form['type'].value;
79+
value attr; id string:id_$attr" />
7980
</td>
8081
<td tal:repeat="prop props">
8182
<label class="classhelp-label"

0 commit comments

Comments
 (0)