<commit_before># These overrides add Slack configuration to the settings panel
# See https://guides.spreecommerce.com/developer/view.html

# Grid menu integration
Deface::Override.new(
  :virtual_path  => "admin/settings",
  :insert_bottom => "[data-hook='admin_settings_grid']",
  :name          => "slack_grid_item",
  :text => "
    <%= settings_item('hash', 'slack', 'Enable Slack for your account') %>
    "
  )

# Left menu integration
Deface::Override.new(
  :virtual_path  => "admin/settings",
  :insert_bottom => "[data-hook='admin_settings_menu']",
  :name          => "slack_settings_menu",
  :text => "<%= settings_menu_item('hash', 'slack') %>"
  )

# Configuration Panel
Deface::Override.new(
  :virtual_path  => "admin/settings",
  :insert_before => "div.submit-section",
  :name          => "slack_panel",
  :text => "
    <div class='settings-section slack' data-hook='admin_settings_slack'>
      <%= f.text_field 'slack.post_url', value: AppSettings['slack.post_url'], label: 'Webhook URL' %>
      <%= f.text_field 'slack.default_channel', value: AppSettings['slack.default_channel'], label: 'Default Channel' %>
      <%= f.check_box 'slack.ping_private_topics', { checked: AppSettings['slack.ping_private_topics'] == '1', label: 'Post private topics to Slack' } %>
      <%= f.check_box 'slack.ping_public_topics', { checked: AppSettings['slack.ping_public_topics'] == '1', label: 'Post public topics to Slack' } %>
    </div>
    "
  )
<commit_msg>Use fa icon for slack!<commit_after># These overrides add Slack configuration to the settings panel
# See https://guides.spreecommerce.com/developer/view.html

# Grid menu integration
Deface::Override.new(
  :virtual_path  => "admin/settings",
  :insert_bottom => "[data-hook='admin_settings_grid']",
  :name          => "slack_grid_item",
  :text => "
    <%= settings_item('fa fa-slack', 'slack', 'Enable Slack for your account') %>
    "
  )

# Left menu integration
Deface::Override.new(
  :virtual_path  => "admin/settings",
  :insert_bottom => "[data-hook='admin_settings_menu']",
  :name          => "slack_settings_menu",
  :text => "<%= settings_menu_item('fa fa-slack', 'slack') %>"
  )

# Configuration Panel
Deface::Override.new(
  :virtual_path  => "admin/settings",
  :insert_before => "div.submit-section",
  :name          => "slack_panel",
  :text => "
    <div class='settings-section slack' data-hook='admin_settings_slack'>
      <%= f.text_field 'slack.post_url', value: AppSettings['slack.post_url'], label: 'Webhook URL' %>
      <%= f.text_field 'slack.default_channel', value: AppSettings['slack.default_channel'], label: 'Default Channel' %>
      <%= f.check_box 'slack.ping_private_topics', { checked: AppSettings['slack.ping_private_topics'] == '1', label: 'Post private topics to Slack' } %>
      <%= f.check_box 'slack.ping_public_topics', { checked: AppSettings['slack.ping_public_topics'] == '1', label: 'Post public topics to Slack' } %>
    </div>
    "
  )

{'fraction_non_alphanumeric': 0.16897133220910623, 'fraction_numerical': 0.0013490725126475548, 'mean_word_length': 4.3249551166965885, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 43, 'https://': 2, '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': '6854599', 'n_tokens_mistral': 1015, 'n_tokens_neox': 987, 'n_words': 194}