<commit_before>- @title = 'Datasets'

- content_for :body_class do
  brand-background

- content_for :header do
  .header-container
    .container
      %h1.page-heading
        .pull-right
          = link_to plus_or('Create Dataset'), new_dataset_path, class: 'btn btn-accent btn-shadow' if current_user && current_user.system_admin?
          = render 'layouts/per_page', per_page: 24, object_count: @datasets.total_count
        = @title

- filtered_params = params.permit(:ages, :data, :order)

%div{ style: 'margin-bottom: 20px;display: flex;' }
  %div{ style: 'margin: auto; flex: 1; text-align: center' }
    %div.center{ style: 'font-size: 10px;' } AGES
    .btn-group
      = link_to '#', class: 'btn btn-default dropdown-toggle', data: { toggle: 'dropdown' }, aria: { haspopup: 'true', expanded: 'false' } do
        %span.hidden-sm.hidden-md.hidden-lg.glyphicon.glyphicon-cog
        %span.hidden-xs
          - case params[:ages]
          - when '0-17'
            Children
          - when '18-90'
            Adults
          - when '', nil
            All Ages
          - else
            = params[:ages]
        %span.caret
      %ul.dropdown-menu
        %li= link_to 'All Ages', datasets_path(filtered_params.merge(ages: nil)), style: params[:ages].blank? ? 'font-weight: bold' : nil
        %li= link_to 'Children', datasets_path(filtered_params.merge(ages: '0-17')), style: params[:ages] == '0-17' ? 'font-weight: bold' : nil
        %li= link_to 'Adults', datasets_path(filtered_params.merge(ages: '18-90')), style: params[:ages] == '18-90' ? 'font-weight: bold' : nil
  %div{ style: 'margin: auto; flex: 1; text-align: center' }
    %div.center{ style: 'font-size: 10px;' } DATA
    .btn-group
      = link_to '#', class: 'btn btn-default dropdown-toggle', data: { toggle: 'dropdown' }, aria: { haspopup: 'true', expanded: 'false' } do
        %span.hidden-sm.hidden-md.hidden-lg.glyphicon.glyphicon-cog
        %span.hidden-xs
          - case params[:data]
          - when 'actigraphy'
            Actigraphy
          - when 'polysomnography'
            Polysomnography
          - else
            All Data

        %span.caret
      %ul.dropdown-menu
        %li= link_to 'All Data', datasets_path(filtered_params.merge(data: nil)), style: params[:data].blank? ? 'font-weight: bold' : nil
        %li= link_to 'Actigraphy', datasets_path(filtered_params.merge(data: 'actigraphy')), style: params[:data] == 'actigraphy' ? 'font-weight: bold' : nil
        %li= link_to 'Polysomnography', datasets_path(filtered_params.merge(data: 'polysomnography')), style: params[:data] == 'polysomnography' ? 'font-weight: bold' : nil
  %div{ style: 'margin: auto; flex: 1; text-align: center' }
    %div.center{ style: 'font-size: 10px;' } SORT
    .btn-group
      = link_to '#', class: 'btn btn-default dropdown-toggle', data: { toggle: 'dropdown' }, aria: { haspopup: 'true', expanded: 'false' } do
        %span.hidden-sm.hidden-md.hidden-lg.glyphicon.glyphicon-cog
        %span.hidden-xs
          - case params[:order]
          - when 'datasets.release_date desc'
            Newest
          - when 'datasets.rating desc'
            Popular
          - else
            Publish Date
        %span.caret
      %ul.dropdown-menu.dropdown-menu-right
        %li= link_to 'Publish Date', datasets_path(filtered_params.merge(order: nil)), style: params[:order].blank? ? 'font-weight: bold' : nil
        %li= link_to 'Newest', datasets_path(filtered_params.merge(order: 'datasets.release_date desc')), style: params[:order] == 'datasets.release_date desc' ? 'font-weight: bold' : nil
        %li= link_to 'Popular', datasets_path(filtered_params.merge(order: 'datasets.rating desc')), style: params[:order] == 'datasets.rating desc' ? 'font-weight: bold' : nil

- if @datasets.count.zero?
  .lead.center{ style: 'margin-top: 40px' }
    No datasets found matching search criteria.
    = link_to 'Back to index.', datasets_path
- else
  - @datasets.each do |dataset|
    .dataset-card{ id: "dataset-card-#{dataset.id}" }
      .dataset-card-header
        .dataset-card-header-ratings
          .pull-right
            %span{ style: 'color: #ccc;' }
              = link_to number_with_delimiter(dataset.dataset_reviews.count), dataset_dataset_reviews_path(dataset)
              %span.hidden-xs
                = "Review#{'s' if dataset.dataset_reviews.count != 1}"
              %i.fa.fa-comments.hidden-sm.hidden-md.hidden-lg
            = render 'datasets/rating', rating: dataset.rating
          = link_to dataset.name, dataset
          - if dataset.description.present?
            %br.hidden-sm.hidden-md.hidden-lg
            = link_to '#', data: { object: 'flip-card', target: "#dataset-card-#{dataset.id}" }, style: 'font-size: 10px;' do
              details
              %span.glyphicon.glyphicon-menu-down.text-muted

      .dataset-card-body
        .not-flipped
          .dataset-card-logo
            - if dataset.logo.size > 0
              = link_to image_tag(logo_dataset_path(dataset)), dataset
          = render 'datasets/card_content', dataset: dataset
        .already-flipped
          = simple_markdown(dataset.description)
      .dataset-card-footer
        .pull-right.hidden-xs= render 'datasets/card_footer_request', dataset: dataset
        .dataset-card-footer-links
          %span.hidden-xs{ style: 'color: #ccc;' } View
          .dataset-card-footer-entry
            = link_to dataset, class: 'no-underline' do
              %small Docs
          - unless dataset.dataset_files.where(is_file: true).count.zero?
            .dataset-card-footer-spacer|
            .dataset-card-footer-entry
              = link_to files_dataset_path(dataset), class: 'no-underline' do
                %small.hidden-sm.hidden-md.hidden-lg Files
                %small.hidden-xs
                  = pluralize number_with_delimiter(dataset.dataset_files.where(is_file: true).count), 'File'
                  &middot;
                  = number_to_human_size dataset.dataset_files.where(is_file: true).sum(:file_size)
          - unless dataset.current_variables.count.zero?
            .dataset-card-footer-spacer|
            .dataset-card-footer-entry
              = link_to dataset_variables_path(dataset), class: 'no-underline' do
                %small.hidden-sm.hidden-md.hidden-lg Variables
                %small.hidden-xs
                  = pluralize number_with_delimiter(dataset.current_variables.count), 'Variable'
      .dataset-card-footer.dataset-card-footer-request.hidden-sm.hidden-md.hidden-lg
        .center= render 'datasets/card_footer_request', dataset: dataset


  .center= paginate @datasets, theme: 'bootstrap'

  - content_for :call_to_action do
    .call-to-action
      .call-to-action-header
        Would you like to contribute a dataset?
      .call-to-action-body
        We can help you host your dataset on the NSRR, start by
        = link_to 'filling out a short form', dataset_hosting_start_path
        to learn more about the process.
<commit_msg>Shortened copy for hosting datasets<commit_after>- @title = 'Datasets'

- content_for :body_class do
  brand-background

- content_for :header do
  .header-container
    .container
      %h1.page-heading
        .pull-right
          = link_to plus_or('Create Dataset'), new_dataset_path, class: 'btn btn-accent btn-shadow' if current_user && current_user.system_admin?
          = render 'layouts/per_page', per_page: 24, object_count: @datasets.total_count
        = @title

- filtered_params = params.permit(:ages, :data, :order)

%div{ style: 'margin-bottom: 20px;display: flex;' }
  %div{ style: 'margin: auto; flex: 1; text-align: center' }
    %div.center{ style: 'font-size: 10px;' } AGES
    .btn-group
      = link_to '#', class: 'btn btn-default dropdown-toggle', data: { toggle: 'dropdown' }, aria: { haspopup: 'true', expanded: 'false' } do
        %span.hidden-sm.hidden-md.hidden-lg.glyphicon.glyphicon-cog
        %span.hidden-xs
          - case params[:ages]
          - when '0-17'
            Children
          - when '18-90'
            Adults
          - when '', nil
            All Ages
          - else
            = params[:ages]
        %span.caret
      %ul.dropdown-menu
        %li= link_to 'All Ages', datasets_path(filtered_params.merge(ages: nil)), style: params[:ages].blank? ? 'font-weight: bold' : nil
        %li= link_to 'Children', datasets_path(filtered_params.merge(ages: '0-17')), style: params[:ages] == '0-17' ? 'font-weight: bold' : nil
        %li= link_to 'Adults', datasets_path(filtered_params.merge(ages: '18-90')), style: params[:ages] == '18-90' ? 'font-weight: bold' : nil
  %div{ style: 'margin: auto; flex: 1; text-align: center' }
    %div.center{ style: 'font-size: 10px;' } DATA
    .btn-group
      = link_to '#', class: 'btn btn-default dropdown-toggle', data: { toggle: 'dropdown' }, aria: { haspopup: 'true', expanded: 'false' } do
        %span.hidden-sm.hidden-md.hidden-lg.glyphicon.glyphicon-cog
        %span.hidden-xs
          - case params[:data]
          - when 'actigraphy'
            Actigraphy
          - when 'polysomnography'
            Polysomnography
          - else
            All Data

        %span.caret
      %ul.dropdown-menu
        %li= link_to 'All Data', datasets_path(filtered_params.merge(data: nil)), style: params[:data].blank? ? 'font-weight: bold' : nil
        %li= link_to 'Actigraphy', datasets_path(filtered_params.merge(data: 'actigraphy')), style: params[:data] == 'actigraphy' ? 'font-weight: bold' : nil
        %li= link_to 'Polysomnography', datasets_path(filtered_params.merge(data: 'polysomnography')), style: params[:data] == 'polysomnography' ? 'font-weight: bold' : nil
  %div{ style: 'margin: auto; flex: 1; text-align: center' }
    %div.center{ style: 'font-size: 10px;' } SORT
    .btn-group
      = link_to '#', class: 'btn btn-default dropdown-toggle', data: { toggle: 'dropdown' }, aria: { haspopup: 'true', expanded: 'false' } do
        %span.hidden-sm.hidden-md.hidden-lg.glyphicon.glyphicon-cog
        %span.hidden-xs
          - case params[:order]
          - when 'datasets.release_date desc'
            Newest
          - when 'datasets.rating desc'
            Popular
          - else
            Publish Date
        %span.caret
      %ul.dropdown-menu.dropdown-menu-right
        %li= link_to 'Publish Date', datasets_path(filtered_params.merge(order: nil)), style: params[:order].blank? ? 'font-weight: bold' : nil
        %li= link_to 'Newest', datasets_path(filtered_params.merge(order: 'datasets.release_date desc')), style: params[:order] == 'datasets.release_date desc' ? 'font-weight: bold' : nil
        %li= link_to 'Popular', datasets_path(filtered_params.merge(order: 'datasets.rating desc')), style: params[:order] == 'datasets.rating desc' ? 'font-weight: bold' : nil

- if @datasets.count.zero?
  .lead.center{ style: 'margin-top: 40px' }
    No datasets found matching search criteria.
    = link_to 'Back to index.', datasets_path
- else
  - @datasets.each do |dataset|
    .dataset-card{ id: "dataset-card-#{dataset.id}" }
      .dataset-card-header
        .dataset-card-header-ratings
          .pull-right
            %span{ style: 'color: #ccc;' }
              = link_to number_with_delimiter(dataset.dataset_reviews.count), dataset_dataset_reviews_path(dataset)
              %span.hidden-xs
                = "Review#{'s' if dataset.dataset_reviews.count != 1}"
              %i.fa.fa-comments.hidden-sm.hidden-md.hidden-lg
            = render 'datasets/rating', rating: dataset.rating
          = link_to dataset.name, dataset
          - if dataset.description.present?
            %br.hidden-sm.hidden-md.hidden-lg
            = link_to '#', data: { object: 'flip-card', target: "#dataset-card-#{dataset.id}" }, style: 'font-size: 10px;' do
              details
              %span.glyphicon.glyphicon-menu-down.text-muted

      .dataset-card-body
        .not-flipped
          .dataset-card-logo
            - if dataset.logo.size > 0
              = link_to image_tag(logo_dataset_path(dataset)), dataset
          = render 'datasets/card_content', dataset: dataset
        .already-flipped
          = simple_markdown(dataset.description)
      .dataset-card-footer
        .pull-right.hidden-xs= render 'datasets/card_footer_request', dataset: dataset
        .dataset-card-footer-links
          %span.hidden-xs{ style: 'color: #ccc;' } View
          .dataset-card-footer-entry
            = link_to dataset, class: 'no-underline' do
              %small Docs
          - unless dataset.dataset_files.where(is_file: true).count.zero?
            .dataset-card-footer-spacer|
            .dataset-card-footer-entry
              = link_to files_dataset_path(dataset), class: 'no-underline' do
                %small.hidden-sm.hidden-md.hidden-lg Files
                %small.hidden-xs
                  = pluralize number_with_delimiter(dataset.dataset_files.where(is_file: true).count), 'File'
                  &middot;
                  = number_to_human_size dataset.dataset_files.where(is_file: true).sum(:file_size)
          - unless dataset.current_variables.count.zero?
            .dataset-card-footer-spacer|
            .dataset-card-footer-entry
              = link_to dataset_variables_path(dataset), class: 'no-underline' do
                %small.hidden-sm.hidden-md.hidden-lg Variables
                %small.hidden-xs
                  = pluralize number_with_delimiter(dataset.current_variables.count), 'Variable'
      .dataset-card-footer.dataset-card-footer-request.hidden-sm.hidden-md.hidden-lg
        .center= render 'datasets/card_footer_request', dataset: dataset

  .center= paginate @datasets, theme: 'bootstrap'

  - content_for :call_to_action do
    .call-to-action
      .call-to-action-body
        %strong Would you like to contribute a dataset?
      .call-to-action-body
        The NSRR can host your dataset,
        = link_to 'let us know about your dataset', dataset_hosting_start_path
        to start the process.

{'fraction_non_alphanumeric': 0.1337457337883959, 'fraction_numerical': 0.005830489192263936, 'mean_word_length': 2.462580009847366, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5609258', 'n_tokens_mistral': 4485, 'n_tokens_neox': 4334, 'n_words': 918}