X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e146ad301ac42da3bf5b2d1f0f64ec2b1cd1a5c7..c51a3888a01543d0835119574960a02fd7d35994:/apps/workbench/app/helpers/application_helper.rb diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb index 2d1aca645e..14b1c34d11 100644 --- a/apps/workbench/app/helpers/application_helper.rb +++ b/apps/workbench/app/helpers/application_helper.rb @@ -222,7 +222,10 @@ module ApplicationHelper return_value end - def render_editable_attribute(object, attr, attrvalue=nil, htmloptions={}) + # Render an editable attribute with the attrvalue of the attr. + # The htmloptions are added to the editable element's list of attributes. + # The nonhtml_options are only used to customize the display of the element. + def render_editable_attribute(object, attr, attrvalue=nil, htmloptions={}, nonhtml_options={}) attrvalue = object.send(attr) if attrvalue.nil? if not object.attribute_editable?(attr) if attrvalue && attrvalue.length > 0 @@ -278,11 +281,11 @@ module ApplicationHelper edit_tiptitle = 'edit' edit_tiptitle = 'Warning: do not use hyphens in the repository name as they will be stripped' if (object.class.to_s == 'Repository' and attr == 'name') - edit_button = raw('' + (htmloptions[:btntext] || '') + '') + edit_button = raw('' + (nonhtml_options[:btntext] || '') + '') - if htmloptions[:btnplacement] == :left + if nonhtml_options[:btnplacement] == :left edit_button + ' ' + span_tag - elsif htmloptions[:btnplacement] == :top + elsif nonhtml_options[:btnplacement] == :top edit_button + raw('
') + span_tag else span_tag + ' ' + edit_button