<commit_before><%= jquery do %>
  $('.mod-webmail-account .imap-test').click(function() {
    var dl = $(this).closest('.mod-webmail-account');
    var imap_host = dl.find('.imap_host').val();
    var imap_auth_type = dl.find('.imap_auth_type').val();
    var imap_account = dl.find('.imap_account').val();
    var in_imap_password = dl.find('.in_imap_password').val();

    $.ajax({
      url: '<%= url_for action: :test_connection %>',
      method: 'POST',
      data: {
        item: {
          imap_host: imap_host,
          imap_auth_type: imap_auth_type,
          imap_account: imap_account,
          in_imap_password: <PASSWORD>,
        }
      },
      beforeSend: function(data) {
        dl.find('.imap-test-resp').html('Connecting ...');
      },
      success: function(data) {
        dl.find('.imap-test-resp').html(data);
      },
      error: function(data) {
        dl.find('.imap-test-resp').html('Error');
      },
    });
  });
<% end %>

<dl class="see mod-webmail-account">
  <dt><%= @model.t :imap_setting_name %><%= @model.tt :imap_setting_name %></dt>
  <dd><%= text_field_tag "item[imap_settings][][name]", setting.name, class: :name, required: true %></dd>

  <dt><%= @model.t :address %><%= @model.tt :address %></dt>
  <dd><%= text_field_tag "item[imap_settings][][address]", setting.address, placeholder: @defaults[:address], class: :address %></dd>

  <dt><%= @model.t :imap_host %><%= @model.tt :imap_host %></dt>
  <dd><%= text_field_tag "item[imap_settings][][imap_host]", setting.imap_host, placeholder: @defaults[:host], class: :imap_host %></dd>

  <dt><%= @model.t :imap_auth_type %><%= @model.tt :imap_auth_type %></dt>
  <dd><%= select_tag "item[imap_settings][][imap_auth_type]", options_for_select(@item.imap_auth_type_options, setting.imap_auth_type), include_blank: @defaults[:auth_type], class: :auth_type %></dd>

  <dt><%= @model.t :imap_account %><%= @model.tt :imap_account %></dt>
  <dd><%= text_field_tag "item[imap_settings][][imap_account]", setting.imap_account, placeholder: @defaults[:account], class: :imap_account %></dd>

  <dt><%= @model.t :in_imap_password %><%= @model.tt :in_imap_password %></dt>
  <dd><%= password_field_tag "item[imap_settings][][in_imap_password]", setting.decrypt_imap_password, placeholder: @defaults[:password], class: :in_imap_password %></dd><commit_msg>[fix] webmail : imap_auth_type class attribute<commit_after><%= jquery do %>
  $('.mod-webmail-account .imap-test').click(function() {
    var dl = $(this).closest('.mod-webmail-account');
    var imap_host = dl.find('.imap_host').val();
    var imap_auth_type = dl.find('.imap_auth_type').val();
    var imap_account = dl.find('.imap_account').val();
    var in_imap_password = dl.find('.in_imap_password').val();

    $.ajax({
      url: '<%= url_for action: :test_connection %>',
      method: 'POST',
      data: {
        item: {
          imap_host: imap_host,
          imap_auth_type: imap_auth_type,
          imap_account: imap_account,
          in_imap_password: <PASSWORD>,
        }
      },
      beforeSend: function(data) {
        dl.find('.imap-test-resp').html('Connecting ...');
      },
      success: function(data) {
        dl.find('.imap-test-resp').html(data);
      },
      error: function(data) {
        dl.find('.imap-test-resp').html('Error');
      },
    });
  });
<% end %>

<dl class="see mod-webmail-account">
  <dt><%= @model.t :imap_setting_name %><%= @model.tt :imap_setting_name %></dt>
  <dd><%= text_field_tag "item[imap_settings][][name]", setting.name, class: :name, required: true %></dd>

  <dt><%= @model.t :address %><%= @model.tt :address %></dt>
  <dd><%= text_field_tag "item[imap_settings][][address]", setting.address, placeholder: @defaults[:address], class: :address %></dd>

  <dt><%= @model.t :imap_host %><%= @model.tt :imap_host %></dt>
  <dd><%= text_field_tag "item[imap_settings][][imap_host]", setting.imap_host, placeholder: @defaults[:host], class: :imap_host %></dd>

  <dt><%= @model.t :imap_auth_type %><%= @model.tt :imap_auth_type %></dt>
  <dd><%= select_tag "item[imap_settings][][imap_auth_type]", options_for_select(@item.imap_auth_type_options, setting.imap_auth_type), include_blank: @defaults[:auth_type], class: :imap_auth_type %></dd>

  <dt><%= @model.t :imap_account %><%= @model.tt :imap_account %></dt>
  <dd><%= text_field_tag "item[imap_settings][][imap_account]", setting.imap_account, placeholder: @defaults[:account], class: :imap_account %></dd>

  <dt><%= @model.t :in_imap_password %><%= @model.tt :in_imap_password %></dt>
  <dd><%= password_field_tag "item[imap_settings][][in_imap_password]", setting.decrypt_imap_password, placeholder: @defaults[:password], class: :in_imap_password %></dd>
{'fraction_non_alphanumeric': 0.20967060810810811, 'fraction_numerical': 0.0, 'mean_word_length': 4.263333333333334, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 97, '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': '972086', 'n_tokens_mistral': 1782, 'n_tokens_neox': 1720, 'n_words': 285}