<commit_before>$('.cs-main-area .list-group').append("<%= escape_javascript render partial: 'package_list', locals: { packages: @packages, page: params[:page] } %>");

var newPagination;
<% if @packages.count > WillPaginate.per_page * ( params[:page] || '1' ).to_i %>
  newPagination = "<%= escape_javascript will_paginate @packages, class: 'pagination cs-full-width cs-no-margin cs-center' %>";
<% else %>
  newPagination = "<div class='pagination cs-full-width cs-no-margin cs-center'>";
  newPagination += "<%= escape_javascript link_to 'View all Packages', root_path(sort: params[:sort]) %>";
  newPagination += "</div>";
<% end %>

$('.pagination').replaceWith(newPagination);<commit_msg>Add "Scroll to Top" button to bottom of unsearched <commit_after>$('.cs-main-area .list-group').append("<%= escape_javascript render partial: 'package_list', locals: { packages: @packages, page: params[:page] } %>");

var newPagination;
<% if @packages.count > WillPaginate.per_page * ( params[:page] || '1' ).to_i %>
  newPagination = "<%= escape_javascript will_paginate @packages, class: 'pagination cs-full-width cs-no-margin cs-center' %>";
<% else %>
  newPagination = "<div class='pagination cs-full-width cs-no-margin cs-center'>";
  <% if params[:search].present? %>
    newPagination += "<%= escape_javascript link_to 'View all Packages', root_path(sort: params[:sort]) %>";
  <% else %>
    newPagination += "<a href='#top'>Scroll to Top</a>";
  <% end %>
  newPagination += "</div>";
<% end %>

$('.pagination').replaceWith(newPagination);

$("a[href='#top']").click(function() {
  $("html, body").animate({ scrollTop: 0 }, "slow");
  return false;
});
{'fraction_non_alphanumeric': 0.20579360289680146, 'fraction_numerical': 0.0018105009052504525, 'mean_word_length': 5.4765625, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 26, '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': '101568', 'n_tokens_mistral': 559, 'n_tokens_neox': 541, 'n_words': 119}