<commit_before><%= form_for @category, url: submit_path, method: :post do |f| %>
  <div class="form-group">
    <%= f.label :name, class: 'form-element' %>
    <span class="form-caption">This will be public, so make it something simple and recognisable.</span>
    <%= f.text_field :name, class: 'form-element' %>
  </div>

  <div class="form-group">
    <%= f.label :short_wiki, class: 'form-element' %>
    <span class="form-caption">A short description of what this category is for. Markdown supported.</span>
    <%= f.text_area :short_wiki, class: 'form-element is-small' %>
  </div>

  <div class="form-group">
    <%= f.label :display_post_types, 'Listed post types', class: 'form-element' %>
    <span class="form-caption">
      These post types will be displayed on the category's homepage. For a Q&A category, you might only want to show questions.
    </span>
    <%= f.select :display_post_types, options_for_select(PostType.mapping.to_a, selected: @category.display_post_types),
                 { include_blank: true }, multiple: true, class: 'form-element' %>
  </div>

  <div class="form-group">
    <%= f.label :post_type_ids, 'Allowed post types', class: 'form-element' %>
    <span class="form-caption">Only these post types will be allowed in this category.</span>
    <%= f.select :post_type_ids, options_for_select(PostType.mapping.to_a, selected: @category.post_type_ids),
                 { include_blank: true }, multiple: true, class: 'form-element' %>
  </div>

  <div class="form-group">
    <%= f.label :tag_set_id, 'Tag set', class: 'form-element' %>
    <span class="form-caption">Which tag set may posts in this category draw from?</span>
    <%= f.select :tag_set_id, options_for_select(TagSet.all.map { |ts|  [ts.name, ts.id] }, selected: @category.tag_set_id),
                 { include_blank: true }, class: 'form-element' %>
  </div>

  <div class="form-group">
    <%= f.label :min_trust_level, 'Minimum trust level', class: 'form-element' %>
    <span class="form-caption">
      Users must have at least this trust level to post in this category. Leave blank to allow
      anyone to post.
    </span>
    <%= f.number_field :min_trust_level, class: 'form-element', min: 0, max: 10, step: 1 %>
  </div>

  <div class="form-group">
    <%= f.label :button_text, 'Post button text', class: 'form-element' %>
    <span class="form-caption">Customise the text on the "Create Post" button. Leave blank for default.</span>
    <%= f.text_field :button_text, class: 'form-element' %>
  </div>

  <div class="form-group">
    <%= f.check_box :is_homepage, class: 'form-checkbox-element' %>
    <%= f.label :is_homepage, 'Set as homepage?' %>
    <span class="form-caption">Tick this box to set this category as the site homepage.</span>
  </div>

  <div class="form-group">
    <%= f.label :color_code, 'Header color', class: 'form-element' %>
    <span class="form-caption">Select a color to be used for the header within this category. Leave empty for site-wide default.</span>
    <%= f.select :color_code, options_for_select(['turqoise', 'green', 'blue', 'purple', 'gray', 'yellow', 'orange', 'pink', 'red'], selected: @category.color_code),
                 { include_blank: true }, class: 'form-element' %>
  </div>

  <%= f.submit 'Save', class: 'button is-filled' %>
<% end %><commit_msg>Update _form.html.erb<commit_after><%= form_for @category, url: submit_path, method: :post do |f| %>
  <div class="form-group">
    <%= f.label :name, class: 'form-element' %>
    <span class="form-caption">This will be public, so make it something simple and recognisable.</span>
    <%= f.text_field :name, class: 'form-element' %>
  </div>

  <div class="form-group">
    <%= f.label :short_wiki, class: 'form-element' %>
    <span class="form-caption">A short description of what this category is for. Markdown supported.</span>
    <%= f.text_area :short_wiki, class: 'form-element is-small' %>
  </div>

  <div class="form-group">
    <%= f.label :display_post_types, 'Listed post types', class: 'form-element' %>
    <span class="form-caption">
      These post types will be displayed on the category's homepage. For a Q&A category, you might only want to show questions.
    </span>
    <%= f.select :display_post_types, options_for_select(PostType.mapping.to_a, selected: @category.display_post_types),
                 { include_blank: true }, multiple: true, class: 'form-element' %>
  </div>

  <div class="form-group">
    <%= f.label :post_type_ids, 'Allowed post types', class: 'form-element' %>
    <span class="form-caption">Only these post types will be allowed in this category.</span>
    <%= f.select :post_type_ids, options_for_select(PostType.mapping.to_a, selected: @category.post_type_ids),
                 { include_blank: true }, multiple: true, class: 'form-element' %>
  </div>

  <div class="form-group">
    <%= f.label :tag_set_id, 'Tag set', class: 'form-element' %>
    <span class="form-caption">Which tag set may posts in this category draw from?</span>
    <%= f.select :tag_set_id, options_for_select(TagSet.all.map { |ts|  [ts.name, ts.id] }, selected: @category.tag_set_id),
                 { include_blank: true }, class: 'form-element' %>
  </div>

  <div class="form-group">
    <%= f.label :min_trust_level, 'Minimum trust level', class: 'form-element' %>
    <span class="form-caption">
      Users must have at least this trust level to post in this category. Leave blank to allow
      anyone to post.
    </span>
    <%= f.number_field :min_trust_level, class: 'form-element', min: 0, max: 10, step: 1 %>
  </div>

  <div class="form-group">
    <%= f.label :button_text, 'Post button text', class: 'form-element' %>
    <span class="form-caption">Customise the text on the "Create Post" button. Leave blank for default.</span>
    <%= f.text_field :button_text, class: 'form-element' %>
  </div>

  <div class="form-group">
    <%= f.check_box :is_homepage, class: 'form-checkbox-element' %>
    <%= f.label :is_homepage, 'Set as homepage?' %>
    <span class="form-caption">Tick this box to set this category as the site homepage.</span>
  </div>

  <div class="form-group">
    <%= f.label :color_code, 'Header color', class: 'form-element' %>
    <span class="form-caption">Select a color to be used for the header within this category. Leave empty for site-wide default.</span>
    <%= f.select :color_code, options_for_select(['turquoise', 'green', 'blue', 'darkblue', 'purple', 'gray', 'bluegray', 'yellow', 'orange', 'pink', 'red'], selected: @category.color_code),
                 { include_blank: true }, class: 'form-element' %>
  </div>

  <%= f.submit 'Save', class: 'button is-filled' %>
<% end %>
{'fraction_non_alphanumeric': 0.16494845360824742, 'fraction_numerical': 0.0011952786493351262, 'mean_word_length': 3.694249649368864, 'pattern_counts': {'":': 0, '<': 117, '<?xml version=': 0, '>': 117, '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': '4992906', 'n_tokens_mistral': 2275, 'n_tokens_neox': 2147, 'n_words': 621}