<%- title t('scripts.libraries_title') %>
<%- description 'List of user-submitted libraries available on Greasy Fork' %>

<div class="sidebarred">
  <div class="sidebarred-main-content">
    <div class="open-sidebar sidebar-collapsed">
      ☰
    </div>

    <div class="library-list-header">
      <h2><%= t('scripts.libraries_title') %></h2>
    </div>

    <p class="script-list-description"><%= it('scripts.libraries_description_html', policy_link: help_code_rules_path(anchor: 'require'), site_name: site_name) %></p>

    <% if @scripts.empty? %>
      <p><%= t('scripts.listing_no_scripts') %></p>
    <% else %>
      <ol id="browse-script-list" class="script-list">
        <%= render partial: 'script', collection: @scripts, cached: overriding_locale? ? false : ->(script) { ['libraries', script, I18n.locale] } %>
      </ol>
    <% end %>

    <%= render_pagination %>

    <p><%= t('scripts.write_your_own_html', post_a_script_link: link_to(t('scripts.post_a_script_link_text'), new_script_version_path), learn_to_write_scripts_link: link_to(t('scripts.learn_to_write_scripts_link_text'), help_writing_user_scripts_path)) %></p>
  </div>

  <div class="sidebar collapsed">
    <div class="close-sidebar">
      <div class="sidebar-title"><%= t('common.listing_options_title') %></div>
      <div>☰</div>
    </div>
    <%= render partial: 'list_options', locals: {scripts: @scripts, include_script_sets: false, include_search: true, libraries: true, sort_options: params[:q].present? ? %w[relevance created updated name] : %w[created updated name]} %>
  </div>
</div>
