mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-30 18:13:23 +08:00
Render disabled html fields instead of value strings when rendering un-editable data library template field information.
This commit is contained in:
@@ -7,21 +7,21 @@
|
||||
if isinstance( field[ 'widget' ], TextArea ) and field[ 'widget' ].value:
|
||||
has_contents = True
|
||||
label = field[ 'label' ]
|
||||
value = '<pre>%s</pre>' % field[ 'widget' ].value
|
||||
widget = field[ 'widget' ]
|
||||
elif isinstance( field[ 'widget' ], TextField ) and field[ 'widget' ].value:
|
||||
has_contents = True
|
||||
label = field[ 'label' ]
|
||||
value = field[ 'widget' ].value
|
||||
widget = field[ 'widget' ]
|
||||
elif isinstance( field[ 'widget' ], SelectField ) and field[ 'widget' ].options:
|
||||
for option_label, option_value, selected in field['widget'].options:
|
||||
if selected:
|
||||
has_contents = True
|
||||
label = field[ 'label' ]
|
||||
value = option_value
|
||||
widget = field[ 'widget' ]
|
||||
elif isinstance( field[ 'widget' ], CheckboxField ) and field[ 'widget' ].checked:
|
||||
has_contents = True
|
||||
label = field[ 'label' ]
|
||||
value = 'checked'
|
||||
widget = field[ 'widget' ]
|
||||
elif isinstance( field[ 'widget' ], WorkflowField ) and str( field[ 'widget' ].value ).lower() not in [ 'none' ]:
|
||||
has_contents = True
|
||||
label = field[ 'label' ]
|
||||
@@ -40,12 +40,11 @@
|
||||
widget = field[ 'widget' ]
|
||||
address = trans.sa_session.query( trans.model.UserAddress ).get( int( widget.value ) )
|
||||
label = address.desc
|
||||
value = address.get_html()
|
||||
%>
|
||||
%if has_contents:
|
||||
<div class="form-row">
|
||||
<label>${label}</label>
|
||||
${value}
|
||||
${widget.get_html( disabled=True )}
|
||||
<div class="toolParamHelp" style="clear: both;">
|
||||
${field[ 'helptext' ]}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user