Sha256: b015bd24c3ea81e985a2f6365ec02b1fa45858f33f0f565d2a61f383a158f47a

Contents?: true

Size: 1.49 KB

Versions: 1

Compression:

Stored size: 1.49 KB

Contents

<% locals = { :form => form, :untranslated_value => untranslated_value, :attribute_key => attribute_key } %>

<% if translatable_field_a_text_area?(form, attribute_key) %>

  <td colspan="3" class="translatable_label_and_field" valign="top" style="padding: 5px;">
    <%= form.label attribute_key, localized_label_for(attribute_key) %><br />
    <%= render 'translation_field_input', locals %>
  </td>

<% else %>

  <td class="translatable_label" valign="top" style="width: 10%; padding: 5px;">
    <%= form.label attribute_key, localized_label_for(attribute_key) %>
  </td>
  <td class="translatable_value" valign="top" style="padding: 5px;">
    <%= render 'translation_field_input', locals %>
  </td>
  <td class="translatable_auto_translate" valign="top" style='font-size:0.8em;'>
    <% if MongoTranslatableConfiguration.provide_autotranslate -%>

    <span class="translate_link_span"></span>
    <% translate_link = link_to('[auto translate]', '#', :title => 'Auto Translate Using Google', :class => 'translate_link') %>
    <%= javascript_tag("
    $$('.translate_link_span').last().update(#{::ActiveSupport::JSON.encode(translate_link)});
    $$('.translate_link').last().observe('click', function(event) {
      getGoogleTranslation(this.up('tr').down('.translatable_value').down('input').id,
                           '#{escape_javascript(h(untranslated_value[:value]))}',
                           '#{I18n.locale}', '#{h(@translation.locale)}');
      event.stop();
    });") %>
     <% end -%>
  </td>

<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongo_translatable-0.1.0 app/views/translations/_translation_field.html.erb