<commit_before>= content_for :page_actions do
  = button_link_to Spree.t('blog.back'), admin_blogs_path, class: 'btn btn-success'
  = button_link_to Spree.t('blog_entry.new'), new_admin_blog_blog_entry_path(@blog), class: 'btn btn-success'
= content_for :page_title do
  = Spree.t('blog.entries')
- if @blog_entries.any?
  - content_for :table_filter_title do
    = Spree.t(:search)
  - content_for :table_filter do
    %div
      = search_form_for @search, url: 'blog_entries' do |f|
        %div(data-hook="admin_blog_entries_index_search")
          .clearfix
            .col-md-6
              .field
                = f.label :title_cont, Spree.t('blog_entry.title')
                = f.text_field :title_cont, class: 'form-control'
              .field.checkbox
                %label
                = f.check_box :visible_true, include_hidden: false
                = Spree.t('blog_entry.visible')
          %div.form-buttons.actions.filter-actions.text-center(data-hook="admin_blog_entries_index_search_buttons")
            = button Spree.t(:search), 'icon-search'
  %table.index.table.center#listing_blogs
    %colgroup
      %col(style='width: 10%;')
      %col(style='width: 50%;')
      %col(style='width: 10%;')
      %col(style='width: 10%;')
      %col(style='width: 20%;')
    %thead
      %tr
        %th.i= sort_link @search,:published_at, Spree.t('blog_entry.published_at'), { default_order: 'desc' }, { title: 'admin_blog_entries_listing_published_at_title' }
        %th= sort_link @search,:name, Spree.t('blog_entry.title'), {}, { title: 'admin_blog_entries_listing_title_title' }
        %th= Spree.t(:view)
        %th= sort_link @search, :visible, Spree.t('blog_entry.visible'), {}, {title: 'admin_blog_entries_listing_visible_title' }
        %th.actions(data-hook='admin_blogs_index_header_actions')= Spree.t(:action_items)
    %tbody
      - @blog_entries.each do |blog_entry|
        - permalink_arr = blog_entry.permalink.split('/')
        %tr(id="#{spree_dom_id blog_entry}" data-hook='admin_blog_entries_index_rows' class="#{cycle('odd', 'even')}")
          %td= blog_entry.published_at.strftime('%Y-%m-%d')
          %td= blog_entry.title
          %td= link_to Spree.t('blog_entry.view'), blog_entry_permalink_path(slug: permalink_arr[0], year: permalink_arr[1], month: permalink_arr[2], permalink: permalink_arr[3]), { target: "_blank" }
          %td
            = form_for [:admin, blog_entry.blog, blog_entry], method: :put, remote: true, class: 'toggle_blog_entry_visible' do |form|
              = form.check_box :visible, class: 'blog_entry_visible'
          %td.actions(data-hook='admin_blogs_index_row_actions')
            = button_link_to 'Edit', edit_admin_blog_blog_entry_path(@blog, blog_entry), class: 'btn btn-success'
  = paginate @blog_entries
- else
  %p= Spree.t('blog_entry.none')
:javascript
  jQuery(function() {
    $('.blog_entry_visible').change(function(){
     return $(this).parent('form').submit();
    });
  });<commit_msg>fixing 'View on Web' for admin listings<commit_after>= content_for :page_actions do
  = button_link_to Spree.t('blog.back'), admin_blogs_path, class: 'btn btn-success'
  = button_link_to Spree.t('blog_entry.new'), new_admin_blog_blog_entry_path(@blog), class: 'btn btn-success'
= content_for :page_title do
  = Spree.t('blog.entries')
- if @blog_entries.any?
  - content_for :table_filter_title do
    = Spree.t(:search)
  - content_for :table_filter do
    %div
      = search_form_for @search, url: 'blog_entries' do |f|
        %div(data-hook="admin_blog_entries_index_search")
          .clearfix
            .col-md-6
              .field
                = f.label :title_cont, Spree.t('blog_entry.title')
                = f.text_field :title_cont, class: 'form-control'
              .field.checkbox
                %label
                = f.check_box :visible_true, include_hidden: false
                = Spree.t('blog_entry.visible')
          %div.form-buttons.actions.filter-actions.text-center(data-hook="admin_blog_entries_index_search_buttons")
            = button Spree.t(:search), 'icon-search'
  %table.index.table.center#listing_blogs
    %colgroup
      %col(style='width: 10%;')
      %col(style='width: 50%;')
      %col(style='width: 10%;')
      %col(style='width: 10%;')
      %col(style='width: 20%;')
    %thead
      %tr
        %th.i= sort_link @search,:published_at, Spree.t('blog_entry.published_at'), { default_order: 'desc' }, { title: 'admin_blog_entries_listing_published_at_title' }
        %th= sort_link @search,:name, Spree.t('blog_entry.title'), {}, { title: 'admin_blog_entries_listing_title_title' }
        %th= Spree.t(:view)
        %th= sort_link @search, :visible, Spree.t('blog_entry.visible'), {}, {title: 'admin_blog_entries_listing_visible_title' }
        %th.actions(data-hook='admin_blogs_index_header_actions')= Spree.t(:action_items)
    %tbody
      - @blog_entries.each do |blog_entry|
        - permalink_arr = blog_entry.permalink.split('/')
        - storefront_blog_post_url = Rails.env.production? ? Spree::Store.current.url : '/'
        - storefront_blog_post_url += blog_entry.permalink
        %tr(id="#{spree_dom_id blog_entry}" data-hook='admin_blog_entries_index_rows' class="#{cycle('odd', 'even')}")
          %td= blog_entry.published_at.strftime('%Y-%m-%d')
          %td= blog_entry.title
          %td= link_to Spree.t('blog_entry.view'), storefront_blog_post_url, { target: "_blank" }
          %td
            = form_for [:admin, blog_entry.blog, blog_entry], method: :put, remote: true, class: 'toggle_blog_entry_visible' do |form|
              = form.check_box :visible, class: 'blog_entry_visible'
          %td.actions(data-hook='admin_blogs_index_row_actions')
            = button_link_to 'Edit', edit_admin_blog_blog_entry_path(@blog, blog_entry), class: 'btn btn-success'
  = paginate @blog_entries
- else
  %p= Spree.t('blog_entry.none')
:javascript
  jQuery(function() {
    $('.blog_entry_visible').change(function(){
     return $(this).parent('form').submit();
    });
  });
{'fraction_non_alphanumeric': 0.14995051138238205, 'fraction_numerical': 0.004289013526888816, 'mean_word_length': 3.3493543758967, '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': '2553235', 'n_tokens_mistral': 2098, 'n_tokens_neox': 2048, 'n_words': 324}