details: http://www.bx.psu.edu/hg/galaxy/rev/4a2a488e4fa0 changeset: 3317:4a2a488e4fa0 user: Greg Von Kuster <greg@bx.psu.edu> date: Wed Feb 03 09:32:37 2010 -0500 description: Improvements to text rendering in TextArea fields in libraries. Eliminate the Optional / Required words in forms if no help text. diffstat: lib/galaxy/model/__init__.py | 6 +++++- templates/library/common/common.mako | 15 +-------------- templates/library/common/ldda_info.mako | 2 +- 3 files changed, 7 insertions(+), 16 deletions(-) diffs (57 lines): diff -r 4686a93802c0 -r 4a2a488e4fa0 lib/galaxy/model/__init__.py --- a/lib/galaxy/model/__init__.py Tue Feb 02 16:49:00 2010 -0500 +++ b/lib/galaxy/model/__init__.py Wed Feb 03 09:32:37 2010 -0500 @@ -1273,9 +1273,13 @@ req = 'Required' else: req = 'Optional' + if field[ 'helptext' ]: + helptext='%s (%s)' % ( field[ 'helptext' ], req ) + else: + helptext = '' widgets.append( dict( label=field[ 'label' ], widget=field_widget, - helptext='%s (%s)' % ( field[ 'helptext' ], req ) ) ) + helptext=helptext ) ) return widgets class FormDefinitionCurrent( object ): diff -r 4686a93802c0 -r 4a2a488e4fa0 templates/library/common/common.mako --- a/templates/library/common/common.mako Tue Feb 02 16:49:00 2010 -0500 +++ b/templates/library/common/common.mako Wed Feb 03 09:32:37 2010 -0500 @@ -36,22 +36,9 @@ %else: %for i, field in enumerate( widgets ): %if field[ 'widget' ].value: - <% - val = field[ 'widget' ].value - # Change new line chars to html - if val.find( '\r\n' ) >= 0: - val = val.replace( '\r\n', '<br/>' ) - if val.find( '\r' ) >= 0: - val = val.replace( '\r', '<br/>' ) - if val.find( '\n' ) >= 0: - val = val.replace( '\n', '<br/>' ) - # Convert to unicode to display non-ascii characters. - if type( val ) is not unicode: - val = unicode( val, 'utf-8' ) - %> <div class="form-row"> <label>${field[ 'label' ]}</label> - ${val} + <pre>${field[ 'widget' ].value}</pre> <div class="toolParamHelp" style="clear: both;"> ${field[ 'helptext' ]} </div> diff -r 4686a93802c0 -r 4a2a488e4fa0 templates/library/common/ldda_info.mako --- a/templates/library/common/ldda_info.mako Tue Feb 02 16:49:00 2010 -0500 +++ b/templates/library/common/ldda_info.mako Wed Feb 03 09:32:37 2010 -0500 @@ -63,7 +63,7 @@ <div class="toolFormBody"> <div class="form-row"> <label>Message:</label> - ${ldda.message} + <pre>${ldda.message}</pre> <div style="clear: both"></div> </div> <div class="form-row">