[hg] galaxy 3411: Fix CheckboxField.is_checked(), which was brok...
details: http://www.bx.psu.edu/hg/galaxy/rev/0c07212afc00 changeset: 3411:0c07212afc00 user: Greg Von Kuster <greg@bx.psu.edu> date: Thu Feb 18 09:47:21 2010 -0500 description: Fix CheckboxField.is_checked(), which was broken if change set 3373. diffstat: lib/galaxy/web/form_builder.py | 2 -- templates/library/common/select_template.mako | 9 ++++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diffs (39 lines): diff -r 4a416d872806 -r 0c07212afc00 lib/galaxy/web/form_builder.py --- a/lib/galaxy/web/form_builder.py Wed Feb 17 16:37:02 2010 -0500 +++ b/lib/galaxy/web/form_builder.py Thu Feb 18 09:47:21 2010 -0500 @@ -102,8 +102,6 @@ def is_checked( value ): if value == True: return True - if isinstance( value, basestring ) and value.lower() in ( "yes", "true", "on" ): - return True # This may look strange upon initial inspection, but see the comments in the get_html() method # above for clarification. Basically, if value is not True, then it will always be a list with # 2 input fields ( a checkbox and a hidden field ) if the checkbox is checked. If it is not diff -r 4a416d872806 -r 0c07212afc00 templates/library/common/select_template.mako --- a/templates/library/common/select_template.mako Wed Feb 17 16:37:02 2010 -0500 +++ b/templates/library/common/select_template.mako Thu Feb 18 09:47:21 2010 -0500 @@ -1,6 +1,10 @@ <%inherit file="/base.mako"/> <%namespace file="/message.mako" import="render_msg" /> +<% + from galaxy.web.form_builder import CheckboxField + inheritable_check_box = CheckboxField( 'inheritable' ) +%> <script type="text/javascript"> $( function() { $( "select[refresh_on_change='true']").change( function() { @@ -50,10 +54,9 @@ <div class="form-row"> <label>Inherit template to contained folders and datasets?</label> %if inheritable_checked: - <input type="checkbox" name="inheritable" value="yes" checked/>Yes - %else: - <input type="checkbox" name="inheritable" value="yes"/>Yes + <% inheritable_check_box.checked = True %> %endif + ${inheritable_check_box.get_html()} <div class="toolParamHelp" style="clear: both;"> Check if you want this template to be used by other folders and datasets contained within this ${item_desc} </div>
participants (1)
-
Greg Von Kuster