<commit_before><%= form_for(@post, builder: blogit_conf.admin_form_builder_class.constantize,
  html: {class: "new_blog_post blogit_admin_form", id: "new_blog_post"}) do |f| %>

  <% if @post.errors.any? %>
    <div id="error_explanation">
      <h2><%=t :prohibited_this_post_from_being_saved, scope: 'blogit.admin.posts', count: @post.errors.count%></h2>

      <ul>
        <% @post.errors.full_messages.each do |msg| %>
          <li><%= msg %></li>
        <% end %>
      </ul>
    </div>
  <% end %>

  <%= f.field do %>
    <%= f.label :title, t(:post_title, scope: "blogit.admin.posts") %>
    <%= f.text_field :title, \
      placeholder: t(:give_your_post_a_title, scope: 'blogit.admin.posts') %>
  <% end %>
  
  <%= f.field do %>
    <%= f.label :description, t(:post_description, scope: "blogit.admin.posts") %>
    <%= f.text_area :description, \
      placeholder: t(:write_a_brief_overview_of_your_post, 
        scope: 'blogit.admin.posts') %>
  <% end %>
  
  <%= render "blogit/admin/posts/post_body_#{blogit_conf.admin_wysiwyg_editor}", 
    { f: f } %>

  <%= f.field id: "new_blog_post_tag_field" do %>
    <%= f.label :tag_list, t(:tags, scope: 'blogit.admin.posts') %>
    <%= f.text_field :tag_list, value: f.object.tags.join(", "),
      placeholder: t(:tag_placeholder, scope: 'blogit.admin.posts')  %>
  <% end %>

  <%= f.field id: "new_blog_post_state_field" do %>
    <%= f.label :state, t(:state, scope: 'blogit.admin.posts') %>
    <%= f.collection_select(:state, Blogit::Post::AVAILABLE_STATUS, :to_s, :to_s) %>
  <% end %>

  <%= actions do %>
    <%= f.submit %> <%=t :or, scope: 'blogit.admin.posts'%>
    
    <%= link_to(t(:cancel, scope: 'blogit.admin.posts'), 
      @post.new_record? ? blogit_admin.root_path : post_path(@post)) %>
      
  <% end %>

<% end %><commit_msg>Fix post form select for state to use existing states<commit_after><%= form_for(@post, builder: blogit_conf.admin_form_builder_class.constantize,
  html: {class: "new_blog_post blogit_admin_form", id: "new_blog_post"}) do |f| %>

  <% if @post.errors.any? %>
    <div id="error_explanation">
      <h2><%=t :prohibited_this_post_from_being_saved, scope: 'blogit.admin.posts', count: @post.errors.count%></h2>

      <ul>
        <% @post.errors.full_messages.each do |msg| %>
          <li><%= msg %></li>
        <% end %>
      </ul>
    </div>
  <% end %>

  <%= f.field do %>
    <%= f.label :title, t(:post_title, scope: "blogit.admin.posts") %>
    <%= f.text_field :title, \
      placeholder: t(:give_your_post_a_title, scope: 'blogit.admin.posts') %>
  <% end %>

  <%= f.field do %>
    <%= f.label :description, t(:post_description, scope: "blogit.admin.posts") %>
    <%= f.text_area :description, \
      placeholder: t(:write_a_brief_overview_of_your_post,
        scope: 'blogit.admin.posts') %>
  <% end %>

  <%= render "blogit/admin/posts/post_body_#{blogit_conf.admin_wysiwyg_editor}",
    { f: f } %>

  <%= f.field id: "new_blog_post_tag_field" do %>
    <%= f.label :tag_list, t(:tags, scope: 'blogit.admin.posts') %>
    <%= f.text_field :tag_list, value: f.object.tags.join(", "),
      placeholder: t(:tag_placeholder, scope: 'blogit.admin.posts')  %>
  <% end %>

  <%= f.field id: "new_blog_post_state_field" do %>
    <%= f.label :state, t(:state, scope: 'blogit.admin.posts') %>
    <%= f.collection_select(:state, (Blogit::Configuration::ACTIVE_STATES + Blogit::Configuration::HIDDEN_STATES), :to_s, :to_s) %>
  <% end %>

  <%= actions do %>
    <%= f.submit %> <%=t :or, scope: 'blogit.admin.posts'%>

    <%= link_to(t(:cancel, scope: 'blogit.admin.posts'),
      @post.new_record? ? blogit_admin.root_path : post_path(@post)) %>

  <% end %>

<% end %>
{'fraction_non_alphanumeric': 0.2028633171258779, 'fraction_numerical': 0.0010804970286331713, 'mean_word_length': 3.5103532277710108, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 79, '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': '6191155', 'n_tokens_mistral': 1526, 'n_tokens_neox': 1388, 'n_words': 234}