<commit_before>ActiveAdmin.register Category do
  menu parent: 'configuration'
  includes :background, :translations, :slider, :optional_module

  permit_params :id,
                :name,
                :color,
                :show_in_menu,
                :show_in_footer,
                :optional,
                :optional_module_id,
                translations_attributes: [
                  :id, :locale, :title
                ],
                referencement_attributes: [
                  :id,
                  translations_attributes: [
                    :id, :locale, :title, :description, :keywords
                  ]
                ],
                background_attributes: [
                  :id, :image, :_destroy
                ]

  decorate_with CategoryDecorator
  config.clear_sidebar_sections!

  # Sortable
  sortable
  config.sort_order = 'position_asc'
  config.paginate   = false

  index do
    sortable_handle_column
    column :background
    column :title
    column :div_color
    column :slider if slider_module.enabled?
    column :in_menu
    column :in_footer
    column :module if current_user.super_administrator?

    translation_status
    actions
  end

  show do
    columns do
      column do
        attributes_table do
          row :background
          row :div_color
          row :slider if slider_module.enabled?
          row :in_menu
          row :in_footer
          row :module if current_user.super_administrator?
        end
      end

      column do
        render 'admin/shared/referencement/show', referencement: resource.referencement
      end
    end
  end

  form do |f|
    f.semantic_errors(*f.object.errors.keys)

    columns do
      column do
        f.inputs t('activerecord.models.category.one') do
          f.translated_inputs 'Translated fields', switch_locale: true do |t|
            t.input :title, hint: 'Titre du menu'
          end
        end

        f.inputs t('general') do
          columns do
            column do
              f.input :name,
                      collection: Category.models_name,
                      include_blank: false,
                      input_html: { class: 'chosen-select' }
            end

            column do
              f.input :show_in_menu
              f.input :show_in_footer
            end
          end

          f.input :custom_background_color,
                  as: :boolean,<commit_msg>Remove broken styles column in AA Category form<commit_after>ActiveAdmin.register Category do
  menu parent: 'configuration'
  includes :background, :translations, :slider, :optional_module

  permit_params :id,
                :name,
                :color,
                :show_in_menu,
                :show_in_footer,
                :optional,
                :optional_module_id,
                translations_attributes: [
                  :id, :locale, :title
                ],
                referencement_attributes: [
                  :id,
                  translations_attributes: [
                    :id, :locale, :title, :description, :keywords
                  ]
                ],
                background_attributes: [
                  :id, :image, :_destroy
                ]

  decorate_with CategoryDecorator
  config.clear_sidebar_sections!

  # Sortable
  sortable
  config.sort_order = 'position_asc'
  config.paginate   = false

  index do
    sortable_handle_column
    column :background
    column :title
    column :div_color
    column :slider if slider_module.enabled?
    column :in_menu
    column :in_footer
    column :module if current_user.super_administrator?

    translation_status
    actions
  end

  show do
    columns do
      column do
        attributes_table do
          row :background
          row :div_color
          row :slider if slider_module.enabled?
          row :in_menu
          row :in_footer
          row :module if current_user.super_administrator?
        end
      end

      column do
        render 'admin/shared/referencement/show', referencement: resource.referencement
      end
    end
  end

  form do |f|
    f.semantic_errors(*f.object.errors.keys)

    columns do
      column do
        f.inputs t('activerecord.models.category.one') do
          f.translated_inputs 'Translated fields', switch_locale: true do |t|
            t.input :title, hint: 'Titre du menu'
          end
        end

        f.inputs t('general') do
          f.input :name,
                  collection: Category.models_name,
                  include_blank: false,
                  input_html: { class: 'chosen-select' }

          f.input :show_in_menu
          f.input :show_in_footer

          f.input :custom_background_color,
                  as: :boolean,
{'fraction_non_alphanumeric': 0.06757607555089191, 'fraction_numerical': 0.0, 'mean_word_length': 1.5720453318942256, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3059673', 'n_tokens_mistral': 1315, 'n_tokens_neox': 1234, 'n_words': 313}