<commit_before>- klass = "#{field.abstract_model.model_name.parameterize}-#{field.name}"

.controls
  = form.hidden_field field.name, { id: "#{klass}" }
  .json-translate-errors
    = form.errors_for(field)
  %ul.nav.nav-tabs{ :style => 'margin-top:5px' }
    - field.locales.each do |locale|
      - locale_klass = "json-translate-pane-#{field.name}-#{locale}-#{form.object.id}"
      %li{ class: ( 'active' if locale == field.current_locale ) }
        %a{ href: '#', data: { toggle: 'tab',  target: ".#{locale_klass}:first"} }= "#{EmojiFlag.new(locale)} #{t(locale, scope: :languages)}"
  .tab-content{ class: "#{field.name}-inputs" }
    - field.locales.each do |locale|
      - locale_klass = "json-translate-pane-#{field.name}-#{locale}-#{form.object.id}"
      .fields.tab-pane{ class: "#{locale_klass} #{'active' if locale == field.current_locale}" }
        = form.text_area "#{field.name}_#{locale}", field.html_attributes.reverse_merge(data: { locale: "#{locale}", richtext: false, options: {}.to_json }).reverse_merge({ value: field.value_for_locale(locale), class: "form-control json-translate-input", required: field.required })

      :javascript
        (function() {
          var input = $("##{klass}");
          var form = $(input.get(0).form);

          form.on('submit', function(e) {
            var value = input.value || {};

            $('.#{field.name}-inputs .json-translate-input').each(function(index, element) {
              value[$(element).data('locale')] = element.value;
            });

            input.val(JSON.stringify(value));
          });
        })();<commit_msg>Fix tab margin<commit_after>- klass = "#{field.abstract_model.model_name.parameterize}-#{field.name}"

.controls
  = form.hidden_field field.name, { id: "#{klass}" }
  .json-translate-errors
    = form.errors_for(field)
  %ul.nav.nav-tabs{ style: 'margin-top: 0' }
    - field.locales.each do |locale|
      - locale_klass = "json-translate-pane-#{field.name}-#{locale}-#{form.object.id}"
      %li{ class: ( 'active' if locale == field.current_locale ) }
        %a{ href: '#', data: { toggle: 'tab',  target: ".#{locale_klass}:first"} }= "#{EmojiFlag.new(locale)} #{t(locale, scope: :languages)}"
  .tab-content{ class: "#{field.name}-inputs" }
    - field.locales.each do |locale|
      - locale_klass = "json-translate-pane-#{field.name}-#{locale}-#{form.object.id}"
      .fields.tab-pane{ class: "#{locale_klass} #{'active' if locale == field.current_locale}" }
        = form.text_area "#{field.name}_#{locale}", field.html_attributes.reverse_merge(data: { locale: "#{locale}", richtext: false, options: {}.to_json }).reverse_merge({ value: field.value_for_locale(locale), class: "form-control json-translate-input", required: field.required })

      :javascript
        (function() {
          var input = $("##{klass}");
          var form = $(input.get(0).form);

          form.on('submit', function(e) {
            var value = input.value || {};

            $('.#{field.name}-inputs .json-translate-input').each(function(index, element) {
              value[$(element).data('locale')] = element.value;
            });

            input.val(JSON.stringify(value));
          });
        })();
{'fraction_non_alphanumeric': 0.20254737496116806, 'fraction_numerical': 0.0012426219322771047, 'mean_word_length': 3.1019108280254777, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1459406', 'n_tokens_mistral': 1038, 'n_tokens_neox': 1062, 'n_words': 175}