<commit_before><div>
  <div id="versions-panel" class="collapse post-action-panel">
    <div style="padding: 20px;">
      <div class="container-fluid">
        <div class="row">
          <div class="col-md-8 col-md-offset-2">
            <ul class="list-group" style="margin: 0;">
              <%= render partial: 'storytime/dashboard/versions/version.html.erb', collection: @post.versions.order(created_at: :desc), locals: { versionable: @post } %>
            </ul>
            <%= link_to "Done", '#', class: "btn btn-primary btn-outline pull-right", style: "margin-top: 10px; margin-right: 15px;", data: { toggle: 'collapse', target: '#versions-panel' } %>
          </div>
        </div>
      </div>
    </div>
  </div>

  <%= simple_form_for (@post.new_record? ? [:dashboard, @post.blog, @post] : [:dashboard, @post]), html: { class: "post-form #{@post.new_record? ? 'new-post-form' : 'edit-post-form'}", data: { :"autosave-url" => (url_for([:dashboard, @post, :autosaves]) unless @post.new_record?), :"post-type" => current_post_type.type_name.tableize.singularize } } do |f| %>

    <%= hidden_field_tag :type, @post.type_name %>
    <% if Pundit.policy(current_user, @post).publish? %>
      <%= f.input :published, as: :hidden, input_html: { id: "post_published" } %>
    <% end %>

    <div id="post-advanced-settings" class="collapse post-action-panel">
      <div style="padding: 20px;">
        <div class="container-fluid">
          <div class="row">
            <div class="col-md-8 col-md-offset-2">
              <% if lookup_context.template_exists?("storytime/dashboard/posts/_#{@post.type_name}_fields") %>
                <%= render("storytime/dashboard/posts/#{@post.type_name}_fields", f: f)  %>
              <% end %>
              
              <div class="post_field post_excerpt character-limit">
                <small>
                  <div class="pull-right character-limit-display" data-limit="<%= Storytime.post_excerpt_character_limit %>"></div>
                </small>
                <%= f.input :excerpt, required: false, input_html: { class: "character-limit-input" } %>
              </div>

              <div class="post_field post_tags">
                <%= f.association :tags, input_html: { name: "#{@post.class.name.split('::').last.tableize.singularize}[tag_list][]", class: 'chosen-select tags-input', multiple: true } %>
              </div>

              <div class="row">
                <div class="col-sm-6">
                  <%= f.input :slug, input_html: { value: (@post.persisted? ? @post.slug : nil) } %>
                </div>
                <div class="col-sm-6">
                  <%= f.input :published_at, as: :date_time_picker, label: "Publish Date/Time", input_html: { style: "display: inline;" } %>
                </div>
              </div>
              <div class="row">
              <%= f.input :featured, as: :boolean, label: "Hacer este post un destacado en header homepage?" %>
              </div>
      
              <hr>

              <div class="post_actions">
                <%= link_to "Cancel", '#', class: "btn btn-default", data: { toggle: 'collapse', target: '#post-advanced-settings' } %>

                <div class="pull-right">
                  <%= f.submit "Save Draft", id: "save-draft-submit", class: "btn btn-default save" unless @post.published? %>
                  <%= f.submit "Publish", class: "btn btn-primary btn-outline publish", publish: true unless @post.published? %>
                  <%= f.submit "Update", class: "btn btn-primary btn-outline save" if @post.published? %>
                </div>
                

                <div class="notify_subscribers_checkbox pull-right">
                  <%= f.input :notifications_enabled, as: :boolean, label: "Notify subscribers of new post" unless @post.published? %>
                </div>

              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    
    <% if Storytime.enable_file_upload %>
      <div class="collapse post-action-panel" id="featured-images-panel">
        <div style="padding: 20px;">
          <div class="container-fluid">
            <div class="row">
              <div class="col-md-8 col-md-offset-2">
                <div class="row">
                  <div class="col-sm-10 col-sm-offset-1">
                    <div class="row">
                      <div class="col-sm-6">
                        <div class="well text-center featured_image_block <%= 'has-image' if @post.featured_media %>">
                          <%= f.input :featured_media_id, as: :hidden, input_html: { id: "featured_media_id" } %>
                          <div id="featured_media_container" class="image_container">
                            <%= image_tag @post.featured_media.file_url(:thumb), id: "featured_media_image" if @post.featured_media %>
                          </div>
                          <button type="button" class="btn btn-danger btn-block remove_featured_image">
                            <%= t('dashboard.posts.remove_image') %>
                          </button>
                          <i class="icon-st-icons-images select_featured_image"></i>
                          <div class="select_featured_image">
                            <%= link_to "Select Featured Image", "#", class: "btn btn-primary btn-outline text-lighter", id: "featured_media_button" %>
                          </div>
                        </div>
                      </div>
                      <div class="col-sm-6">
                        <div class="well text-center featured_image_block <%= 'has-image' if @post.secondary_media %>">
                          <%= f.input :secondary_media_id, as: :hidden, input_html: { id: "secondary_media_id" } %>
                          <div id="secondary_media_container" class="image_container">
                            <%= image_tag @post.secondary_media.file_url(:thumb), id: "secondary_media_image" if @post.secondary_media %>
                          </div>
                          <button type="button" class="btn btn-danger btn-block remove_featured_image">
                            <%= t('dashboard.posts.remove_image') %>
                          </button>
                          <i class="icon-st-icons-images select_featured_image"></i>
                          <div class="select_featured_image">
                            <%= link_to "Select Secondary Image", "#", class: "btn btn-primary btn-outline text-lighter", id: "secondary_media_button" %><commit_msg>form saved with calls to show images and also setting a virtual attribute<commit_after><div>
  <div id="versions-panel" class="collapse post-action-panel">
    <div style="padding: 20px;">
      <div class="container-fluid">
        <div class="row">
          <div class="col-md-8 col-md-offset-2">
            <ul class="list-group" style="margin: 0;">
              <%= render partial: 'storytime/dashboard/versions/version.html.erb', collection: @post.versions.order(created_at: :desc), locals: { versionable: @post } %>
            </ul>
            <%= link_to "Done", '#', class: "btn btn-primary btn-outline pull-right", style: "margin-top: 10px; margin-right: 15px;", data: { toggle: 'collapse', target: '#versions-panel' } %>
          </div>
        </div>
      </div>
    </div>
  </div>

  <%= simple_form_for (@post.new_record? ? [:dashboard, @post.blog, @post] : [:dashboard, @post]), html: { class: "post-form #{@post.new_record? ? 'new-post-form' : 'edit-post-form'}", data: { :"autosave-url" => (url_for([:dashboard, @post, :autosaves]) unless @post.new_record?), :"post-type" => current_post_type.type_name.tableize.singularize } } do |f| %>

    <%= hidden_field_tag :type, @post.type_name %>
    <% if Pundit.policy(current_user, @post).publish? %>
      <%= f.input :published, as: :hidden, input_html: { id: "post_published" } %>
    <% end %>

    <div id="post-advanced-settings" class="collapse post-action-panel">
      <div style="padding: 20px;">
        <div class="container-fluid">
          <div class="row">
            <div class="col-md-8 col-md-offset-2">
              <% if lookup_context.template_exists?("storytime/dashboard/posts/_#{@post.type_name}_fields") %>
                <%= render("storytime/dashboard/posts/#{@post.type_name}_fields", f: f)  %>
              <% end %>
              
              <div class="post_field post_excerpt character-limit">
                <small>
                  <div class="pull-right character-limit-display" data-limit="<%= Storytime.post_excerpt_character_limit %>"></div>
                </small>
                <%= f.input :excerpt, required: false, input_html: { class: "character-limit-input" } %>
              </div>

              <div class="post_field post_tags">
                <%= f.association :tags, input_html: { name: "#{@post.class.name.split('::').last.tableize.singularize}[tag_list][]", class: 'chosen-select tags-input', multiple: true } %>
              </div>

              <div class="row">
                <div class="col-sm-12">
                  <%# byebug %>
                  <!-- @post.featured_media[:retina_dimensions][:file] -->
                  <%= image_tag "#{@post.featured_media.file.header_img.url}", style: "max-width:19%" %>
                  <%= image_tag "#{@post.featured_media.file.header_img_east.url}", style: "max-width:19%" %>
                  <%= image_tag "#{@post.featured_media.file.header_img_west.url}", style: "max-width:19%" %>
                  <%= image_tag "#{@post.featured_media.file.header_img_south_east.url}", style: "max-width:19%" %>
                  <%= image_tag "#{@post.featured_media.file.header_img_south_west.url}", style: "max-width:19%" %>
                  <% @headers = [:default, :derecha, :izquierda] %>
                  <%= f.input :the_header_img, collection: @headers, prompt: "Elige header" %>
                </div>
              </div>

              <div class="row">
                <div class="col-sm-6">
                  <%= f.input :slug, input_html: { value: (@post.persisted? ? @post.slug : nil) } %>
                </div>
                <div class="col-sm-6">
                  <%= f.input :published_at, as: :date_time_picker, label: "Publish Date/Time", input_html: { style: "display: inline;" } %>
                </div>
              </div>
              <div class="row">
              <%= f.input :featured, as: :boolean, label: "Hacer este post un destacado en header homepage?" %>
              </div>
      
              <hr>

              <div class="post_actions">
                <%= link_to "Cancel", '#', class: "btn btn-default", data: { toggle: 'collapse', target: '#post-advanced-settings' } %>

                <div class="pull-right">
                  <%= f.submit "Save Draft", id: "save-draft-submit", class: "btn btn-default save" unless @post.published? %>
                  <%= f.submit "Publish", class: "btn btn-primary btn-outline publish", publish: true unless @post.published? %>
                  <%= f.submit "Update", class: "btn btn-primary btn-outline save" if @post.published? %>
                </div>
                

                <div class="notify_subscribers_checkbox pull-right">
                  <%= f.input :notifications_enabled, as: :boolean, label: "Notify subscribers of new post" unless @post.published? %>
                </div>

              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    
    <% if Storytime.enable_file_upload %>
      <div class="collapse post-action-panel" id="featured-images-panel">
        <div style="padding: 20px;">
          <div class="container-fluid">
            <div class="row">
              <div class="col-md-8 col-md-offset-2">
                <div class="row">
                  <div class="col-sm-10 col-sm-offset-1">
                    <div class="row">
                      <div class="col-sm-12">
                        <div class="well text-center featured_image_block <%= 'has-image' if @post.featured_media %>">
                          <%= f.input :featured_media_id, as: :hidden, input_html: { id: "featured_media_id" } %>
                          <div id="featured_media_container" class="image_container">
                            <%= image_tag @post.featured_media.file_url(:thumb), id: "featured_media_image" if @post.featured_media %>
                          </div>
                          <button type="button" class="btn btn-danger btn-block remove_featured_image">
                            <%= t('dashboard.posts.remove_image') %>
                          </button>
                          <i class="icon-st-icons-images select_featured_image"></i>
                          <div class="select_featured_image">
                            <%= link_to "Elegir Imagen Para Titular", "#", class: "btn btn-primary btn-outline text-lighter", id: "featured_media_button" %>
{'fraction_non_alphanumeric': 0.1613548883756736, 'fraction_numerical': 0.004618937644341801, 'mean_word_length': 1.935819209039548, 'pattern_counts': {'":': 0, '<': 213, '<?xml version=': 0, '>': 217, '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': '1885459', 'n_tokens_mistral': 4050, 'n_tokens_neox': 3775, 'n_words': 761}