<commit_before>- title "Study Summary"

.properties
  %ul
    %li
      %dfn Title:
      %em=h @study.title
    %li
      %dfn Abstract:
      =format_text @study.abstract
  %hr
  %ul
    %li
      %dfn Attachments:
      - if @study.attachments.empty?
        &mdash;
      - else
        %ul= render @study.attachments
  %hr
  %ul
    %li
      %dfn Created by:
      =h @study.owner.name
    %li
      %dfn Access Mode:
      = cleanup access_text(@study)
    %li
      %dfn Status:
      =h @study.status
    %li
      %dfn ASSDA ID:
      = cleanup @study.permanent_identifier
    %li
      %dfn Archivist:
      = cleanup(@study.archivist && @study.archivist.name)

  %hr
  %ul
    %li
      %dfn Kind of data:
      - tmp = []
      - tmp << "qualitative" if @study.data_is_qualitative == '1'
      - tmp << "quantitative" if @study.data_is_quantitative == '1'
      - tmp = tmp.empty? ? [] : [tmp.join(" and ")]
      = cleanup((tmp + (@study.data_kind || [])).join(", ").humanize)
    %li
      %dfn Sample population:
      = cleanup @study.sample_population
    %li
      %dfn Time period:
      = [h(@study.period_start), h(@study.period_end)].join(" &mdash; ")
    %li
      %dfn Response rate:
      = cleanup @study.response_rate
    %li
      %dfn Sampling procedure:
      = cleanup((@study.sampling_procedure || []).join(", ").humanize)
    %li
      %dfn Collection method:
      = cleanup((@study.collection_method || []).join(", ").humanize)
    %li
      %dfn Collection period:
      = [h(@study.collection_start), h(@study.collection_end)].join(" &mdash; ")

  %hr
  %ul
    %li
      %dfn Depositor:
      - if @study.depositors
        = "#{cleanup @study.depositors["name"]},"
        = cleanup @study.depositors["affiliation"]
      - else
        &mdash;
    %li
      %dfn Principal Investigators:
      - if @study.principal_investigators.blank?
        &mdash;
      - else
        %ul
          - for item in @study.principal_investigators
            %li
              = "#{cleanup item["name"]},"
              = cleanup item["affiliation"]
    %li
      %dfn Data Producers:
      - if @study.data_producers.blank?
        &mdash;
      - else
        %ul
          - for item in @study.data_producers
            %li
              = "#{cleanup item["name"], "n.a."},"
              = cleanup item["affiliation"], "n.a."
    %li
      %dfn Funding:
      - if @study.funding_agency.blank?
        &mdash;
      - else
        %ul
          - for item in @study.funding_agency
            %li
              - data = []
              - data << item["agency"] unless item["agency"].blank?
              - unless item["grant_number"].blank?
                - data << "grant no. #{item["grant_number"]}"
              = cleanup data.join(", ")
    %li
      %dfn Acknowledgements:
      - if @study.other_acknowledgements.blank?
        &mdash;
      - else
        %ul
          - for item in @study.other_acknowledgements
            %li
              = "#{cleanup item["name"], "n.a."},"
              = cleanup item["affiliation"], "n.a."
              = "(#{cleanup item["role"], "n.a."})"
    %li
      %dfn References:
      - if @study.references.blank?
        &mdash;
      - else
        %ul
          - for item in @study.references
            %li
              = "#{item["author"]}: " unless item["author"].blank?
              %em= cleanup item["title"], "n.a."
              = " (#{item["details"]})" unless item["details"].blank?
%hr
%p.links>
  = link_to "Show DDI", study_path(@study, :format => :xml)
  - if @study.can_be_edited_by current_user
    |
    = link_to "Edit", edit_study_path(@study)
    |
    = link_to "Delete", @study, :confirm => 'Really delete this study?', |
                                :method => :delete |

- if @study.status == "submitted" and @study.can_be_approved_by current_user
  %hr
  %h3 Approve and assign to an archivist:
  - make_form_for @study, :url => approve_study_path(@study), |
                          :html => { :method => :post } do |f| |
    = f.select :archivist, :label => ""
    = f.result_buttons %w{Assign}
  %hr
  %h3 Return to depositor for further editing:
  - make_form_for @study, :url => reject_study_path(@study), |
                          :html => { :method => :post } do |f| |
    = f.result_buttons %w{Reject}<commit_msg>Nicer formatting for manager's choices on a submitted study.<commit_after>- title "Study Summary"

- if @study.status == "submitted" and @study.can_be_approved_by current_user
  .box
    Approve and assign to an archivist
    %p
      - make_form_for @study, :url => approve_study_path(@study), |
                              :html => { :method => :post } do |f| |
        = f.select :archivist, :label => "", :inline => true
        = f.result_buttons %w{Assign}
    or reopen so that depositor can add further information:
    %p
      - make_form_for @study, :url => reject_study_path(@study), |
                              :html => { :method => :post } do |f| |
        = f.result_buttons %w{Reopen}
  .clear
  %hr

.properties
  %ul
    %li
      %dfn Title:
      %em=h @study.title
    %li
      %dfn Abstract:
      =format_text @study.abstract
  %hr
  %ul
    %li
      %dfn Attachments:
      - if @study.attachments.empty?
        &mdash;
      - else
        %ul= render @study.attachments
  %hr
  %ul
    %li
      %dfn Created by:
      =h @study.owner.name
    %li
      %dfn Access Mode:
      = cleanup access_text(@study)
    %li
      %dfn Status:
      =h @study.status
    %li
      %dfn ASSDA ID:
      = cleanup @study.permanent_identifier
    %li
      %dfn Archivist:
      = cleanup(@study.archivist && @study.archivist.name)

  %hr
  %ul
    %li
      %dfn Kind of data:
      - tmp = []
      - tmp << "qualitative" if @study.data_is_qualitative == '1'
      - tmp << "quantitative" if @study.data_is_quantitative == '1'
      - tmp = tmp.empty? ? [] : [tmp.join(" and ")]
      = cleanup((tmp + (@study.data_kind || [])).join(", ").humanize)
    %li
      %dfn Sample population:
      = cleanup @study.sample_population
    %li
      %dfn Time period:
      = [h(@study.period_start), h(@study.period_end)].join(" &mdash; ")
    %li
      %dfn Response rate:
      = cleanup @study.response_rate
    %li
      %dfn Sampling procedure:
      = cleanup((@study.sampling_procedure || []).join(", ").humanize)
    %li
      %dfn Collection method:
      = cleanup((@study.collection_method || []).join(", ").humanize)
    %li
      %dfn Collection period:
      = [h(@study.collection_start), h(@study.collection_end)].join(" &mdash; ")

  %hr
  %ul
    %li
      %dfn Depositor:
      - if @study.depositors
        = "#{cleanup @study.depositors["name"]},"
        = cleanup @study.depositors["affiliation"]
      - else
        &mdash;
    %li
      %dfn Principal Investigators:
      - if @study.principal_investigators.blank?
        &mdash;
      - else
        %ul
          - for item in @study.principal_investigators
            %li
              = "#{cleanup item["name"]},"
              = cleanup item["affiliation"]
    %li
      %dfn Data Producers:
      - if @study.data_producers.blank?
        &mdash;
      - else
        %ul
          - for item in @study.data_producers
            %li
              = "#{cleanup item["name"], "n.a."},"
              = cleanup item["affiliation"], "n.a."
    %li
      %dfn Funding:
      - if @study.funding_agency.blank?
        &mdash;
      - else
        %ul
          - for item in @study.funding_agency
            %li
              - data = []
              - data << item["agency"] unless item["agency"].blank?
              - unless item["grant_number"].blank?
                - data << "grant no. #{item["grant_number"]}"
              = cleanup data.join(", ")
    %li
      %dfn Acknowledgements:
      - if @study.other_acknowledgements.blank?
        &mdash;
      - else
        %ul
          - for item in @study.other_acknowledgements
            %li
              = "#{cleanup item["name"], "n.a."},"
              = cleanup item["affiliation"], "n.a."
              = "(#{cleanup item["role"], "n.a."})"
    %li
      %dfn References:
      - if @study.references.blank?
        &mdash;
      - else
        %ul
          - for item in @study.references
            %li
              = "#{item["author"]}: " unless item["author"].blank?
              %em= cleanup item["title"], "n.a."
              = " (#{item["details"]})" unless item["details"].blank?
%hr
%p.links>
  = link_to "Show DDI", study_path(@study, :format => :xml)
  - if @study.can_be_edited_by current_user
    |
    = link_to "Edit", edit_study_path(@study)
    |
    = link_to "Delete", @study, :confirm => 'Really delete this study?', |
                                :method => :delete |
{'fraction_non_alphanumeric': 0.1499488810632739, 'fraction_numerical': 0.0006815858230148812, 'mean_word_length': 1.8263242375601927, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6865363', 'n_tokens_mistral': 3024, 'n_tokens_neox': 2847, 'n_words': 647}