<%= "data-ds-callback-with-values=\"#{ds_callback_with_values}\" " if ds_callback_with_values.present? %>class='dyna-span<%= ' ds-content-present' if (attr_object.try(attrib).present? || master_ds_object.try(attrib).present?) %>'>
<%= hidden_field_tag "last_dyna_span_val_#{unique_ref_id}", attr_object.try(attrib) || master_ds_object.try(attrib), id: "last_dyna_span_val_#{unique_ref_id}" %>
" style="display:none;">
<%= form_for(master_ds_object, **form_for_options.symbolize_keys) do |f| %>
<% if master_ds_object.nested_attributes_options.keys.any? {|i| i.to_s.=~(/#{attr_object.class.try(:model_name).try(:i18n_key).to_s}/) || i.to_s.=~(/#{attr_object.class.try(:table_name)}/) } and !attr_object.nil? %>
<%= f.fields_for master_ds_object.nested_attributes_options.keys.select {|i| i.to_s.=~(/#{attr_object.class.model_name.i18n_key.to_s}/) || i.to_s.=~(/#{attr_object.class.table_name}/) }.first, attr_object do |a|%>
<%= a.hidden_field(:id, value: attr_object.id) if attr_object.id.present? %>
<% hidden_fields.each do |hkey, hval| %>
<%= a.hidden_field hkey.to_sym, value: hval %>
<% end if hidden_fields %>
<%= a.text_area attrib, id: "dyna_span_field_val_#{unique_ref_id}", onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');", **html_options.symbolize_keys %>
<% end %>
<% else %>
<%= f.text_area attrib, id: "dyna_span_field_val_#{unique_ref_id}", onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');", **html_options.symbolize_keys %>
<% hidden_fields.each do |hkey, hval| %>
<%= f.hidden_field hkey.to_sym, value: hval %>
<% end if hidden_fields %>
<% end %>
<% end %>
<%= content_tag 'span', attr_object.try(attrib) || master_ds_object.try(attrib), id: "dyna_span_span#{unique_ref_id}", onclick: "$().dynaspan.upShow('#{unique_ref_id}');", class: 'dyna-span dyna-span-text', style: 'display:block;' %>
<%= content_tag('div', dyna_span_edit_text, class: 'dyna-span-edit-text pull-right', onclick: "$().dynaspan.upShow('#{unique_ref_id}');", style: 'cursor:pointer;') %>