<commit_before><% id = field.new_record? ? "NEW_FIELD_ID" : field.id %>

<div id="<%= id %>" class="custom-field-item">
<fieldset class="fieldbox">
  <legend><%= format_name(field.format) %></legend>
  <%= required labelled_form_field _('Name'), text_field_tag("custom_fields[#{id}][name]", field.name, :size => 30) %>
    <%= button_to_function :delete, _('Remove field'), "remove_content('##{id}');" %>

    <% if field.format != "list" %>
      <%= labelled_form_field  _('Default value'), text_field_tag("custom_fields[#{id}][default_value]", field.default_value, :size => 30) %>
    <% end %>
    <%= hidden_field_tag "custom_fields[#{id}][customized_type]", field.customized_type.to_s %>
    <%= hidden_field_tag "custom_fields[#{id}][format]", field.format %>

    <div>
      <%= labelled_check_box _('Active'), "custom_fields[#{id}][active]", 1, field.active, :id => "active_checkbox", :onclick  => "active_action('custom_fields[#{id}][active]','custom_fields[#{id}][required]', 'custom_fields[#{id}][signup]')" %>
      <%= labelled_check_box _('Required'), "custom_fields[#{id}][required]", 1, field.required, :id => "required_checkbox", :onclick  => "required_action('custom_fields[#{id}][active]','custom_fields[#{id}][required]', 'custom_fields[#{id}][signup]')" %>
      <%= labelled_check_box _('Display on creation?'), "custom_fields[#{id}][signup]", 1, field.signup, :id => "signup_checkbox",:onclick  => "signup_action('custom_fields[#{id}][active]','custom_fields[#{id}][required]', 'custom_fields[#{id}][signup]')" %>
      <%= labelled_check_box _('Display on moderation?'), "custom_fields[#{id}][moderation_task]", 1, field.moderation_task %>
    </div>

    <% if field.format == "list" %>
      <table>
        <thead>
          <tr>
            <th><%= _("Alternative") %></th>
            <th><%= _("Default") %></th>
            <th><%= _("Delete") %></th>
          </tr>
        </thead>
        <tfoot>
          <tr><td colspan=3><%= button(:add, _('Add option'), 'javascript: void()', :id => "btn_opt_#{id}", :onclick => "add_content('##{id} .custom-field-extras', $('#btn_opt_#{id}').attr('value'), 'EXTRAS_ID');", :value => "#{render_extras_field(id)}".html_safe) %></td></tr>
        </tfoot><commit_msg>Minor fix in custom fields creation checkboxes<commit_after><% id = field.new_record? ? "NEW_FIELD_ID" : field.id %>

<div id="<%= id %>" class="custom-field-item">
<fieldset class="fieldbox">
  <legend><%= format_name(field.format) %></legend>
  <%= required labelled_form_field _('Name'), text_field_tag("custom_fields[#{id}][name]", field.name, :size => 30) %>
    <%= button_to_function :delete, _('Remove field'), "remove_content('##{id}');" %>

    <% if field.format != "list" %>
      <%= labelled_form_field  _('Default value'), text_field_tag("custom_fields[#{id}][default_value]", field.default_value, :size => 30) %>
    <% end %>
    <%= hidden_field_tag "custom_fields[#{id}][customized_type]", field.customized_type.to_s %>
    <%= hidden_field_tag "custom_fields[#{id}][format]", field.format %>

    <div>
      <%= labelled_check_box _('Active'), "custom_fields[#{id}][active]", 1, field.active, :id => "active_checkbox_#{id}", :onclick  => "active_action('custom_fields[#{id}][active]','custom_fields[#{id}][required]', 'custom_fields[#{id}][signup]')" %>
      <%= labelled_check_box _('Required'), "custom_fields[#{id}][required]", 1, field.required, :id => "required_checkbox_#{id}", :onclick  => "required_action('custom_fields[#{id}][active]','custom_fields[#{id}][required]', 'custom_fields[#{id}][signup]')" %>
      <%= labelled_check_box _('Display on creation?'), "custom_fields[#{id}][signup]", 1, field.signup, :id => "signup_checkbox_#{id}",:onclick  => "signup_action('custom_fields[#{id}][active]','custom_fields[#{id}][required]', 'custom_fields[#{id}][signup]')" %>
      <%= labelled_check_box _('Display on moderation?'), "custom_fields[#{id}][moderation_task]", 1, field.moderation_task %>
    </div>

    <% if field.format == "list" %>
      <table>
        <thead>
          <tr>
            <th><%= _("Alternative") %></th>
            <th><%= _("Default") %></th>
            <th><%= _("Delete") %></th>
          </tr>
        </thead>
        <tfoot>
          <tr><td colspan=3><%= button(:add, _('Add option'), 'javascript: void()', :id => "btn_opt_#{id}", :onclick => "add_content('##{id} .custom-field-extras', $('#btn_opt_#{id}').attr('value'), 'EXTRAS_ID');", :value => "#{render_extras_field(id)}".html_safe) %></td></tr>
        </tfoot>
{'fraction_non_alphanumeric': 0.2447583314941514, 'fraction_numerical': 0.003972632972853675, 'mean_word_length': 5.083221476510067, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 109, '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': '126543', 'n_tokens_mistral': 1675, 'n_tokens_neox': 1601, 'n_words': 243}