<commit_before>#home
  .search
    = @library.video_count public_only?
    videos
    .form
      - form_for Search.new, :url => videos_path, :html => { :method => :get, :id => nil } do |form|
        %span.input
          = form.criterion :text, :size => 40, :id => nil
          = image_submit_tag "mag.png"
        = form.submit "Search"
  .divider
    .graphic
  .main
    .left
      .content
        .column_title
          Browse
        .category
          = render :partial => "shared/axes"

    .center
      .content
        - first = true
        - featured_videos.each do |video|
          .video
            %div{:class =>(first ? "first" : "other")}
              - first = false
              .image
                %a{:href => video_path( video.id )}
                  -if poster_path = video.poster_path
                    %img{:src=>poster_path,:alt => "video #{video.id}"}
              .details
                .title{:class=>video_vis_class(video)}
                  = link_to h(video.title), video_path( video )
                - if !(d = video_created( video )).blank?
                  .duration= int_to_duration( video.duration )
                  %span.between
                    |
                  .created
                    &= video_created( video ).to_s(:long)
                - if !video.sentence.blank?
                  .description&= video.sentence
              .clear  

    .right
      .content
        .column_title
          .size
            = link_to "All", collections_collections_path
            == [#{public_collections_count}]
          Collections
        #featured_collections
          - featured_collections.each do |collection|
            %div{ :class => 'collection', :id => "collection_#{collection.id}" }
              .title
                = link_to h(collection.title), collection_path( collection )
              .videos
                = collection.size(public_only?)
                videos
              .description
                &= collection.description
              .handle
                .handle_image
        %input{ :type => "submit", :class => "save_new_order", :value => "Save new order" }
        .all_collections
          = link_to "View all collections &raquo;", collections_collections_path
    - if current_user and current_user.has_role?( "admin" )
      :javascript
        var original_order;
        var handle_obj;
        function send_new_order() {
          var order = $("#featured_collections").sortable( 'serialize') ;
          alert(" new order is " +  order );<commit_msg>added AJAX call to new order saving interface<commit_after>#home
  .search
    = @library.video_count public_only?
    videos
    .form
      - form_for Search.new, :url => videos_path, :html => { :method => :get, :id => nil } do |form|
        %span.input
          = form.criterion :text, :size => 40, :id => nil
          = image_submit_tag "mag.png"
        = form.submit "Search"
  .divider
    .graphic
  .main
    .left
      .content
        .column_title
          Browse
        .category
          = render :partial => "shared/axes"

    .center
      .content
        - first = true
        - featured_videos.each do |video|
          .video{ :id => "video_#{video.id}" }
            %div{:class =>(first ? "first" : "other")}
              - first = false
              .image
                %a{:href => video_path( video.id )}
                  -if poster_path = video.poster_path
                    %img{:src=>poster_path,:alt => "video #{video.id}"}
              .details
                .title{:class=>video_vis_class(video)}
                  = link_to h(video.title), video_path( video )
                - if !(d = video_created( video )).blank?
                  .duration= int_to_duration( video.duration )
                  %span.between
                    |
                  .created
                    &= video_created( video ).to_s(:long)
                - if !video.sentence.blank?
                  .description&= video.sentence
              .clear  

    .right
      .content
        .column_title
          .size
            = link_to "All", collections_collections_path
            == [#{public_collections_count}]
          Collections
        #featured_collections
          - featured_collections.each do |collection|
            .collection{ :id => "collection_#{collection.id}" }
              .title
                = link_to h(collection.title), collection_path( collection )
              .videos
                = collection.size(public_only?)
                videos
              .description
                &= collection.description
              .handle
                .handle_image
        %input{ :type => "submit", :class => "save_new_order", :value => "Save new order" }
        .all_collections
          = link_to "View all collections &raquo;", collections_collections_path
    - if current_user and current_user.has_role?( "admin" )
      :javascript
        var original_order;
        var handle_obj;
        function send_new_order() {
          var order = $("#featured_collections").sortable( 'serialize') ;
          order = "order=" + order.replace( /(&)?collection\[\]=/g, " ");
          alert(" new order is " +  order );
          jQuery.post("http://localhost:3000/collections/featured/order", order, new_order_saved );
        }
        function new_order_saved( data, textStatus ) {
          alert( "data is " + data + " \n status is " + textStatus );
          // TODO new_order = 
          $(".save_new_order").fadeOut(500);
{'fraction_non_alphanumeric': 0.11697165410836025, 'fraction_numerical': 0.001973448152134912, 'mean_word_length': 1.535243292405639, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 37, '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': '99258', 'n_tokens_mistral': 1576, 'n_tokens_neox': 1523, 'n_words': 337}