<commit_before>- @title = @subject.name
- @menu_title = "#{@project.name} #{@title}"

- content_for :container_class, "container-fluid"
- content_for :sidebar, render("subjects/sidebar")

- content_for :header do
  - if @subject.editable_by?(current_user)
    .float-right
      .dropdown
        = link_to "#", class: "btn btn-light dropdown-toggle", data: { toggle: "dropdown" } do
          .d-inline-block.d-sm-none
            %i.fa.fa-cog
          .d-none.d-sm-inline-block Actions

        .dropdown-menu.dropdown-menu-right
          - if @project.randomizations_enabled? && @project.unblinded?(current_user)
            - scheme_count = @project.randomization_schemes.published.count
            - @project.randomization_schemes.published.where.not(id: @subject.randomizations.select(:randomization_scheme_id)).each do |scheme|
              = link_to randomize_subject_to_list_project_randomization_scheme_path(@project, scheme, subject_code: @subject.subject_code), class: "dropdown-item" do
                %i.fa.fa-random
                Randomize
                - if scheme_count > 1
                  to
                  = scheme.name

          - if @project.events.where(archived: false).count > 0
            = link_to choose_event_project_subject_path(@project, @subject), class: "dropdown-item" do
              %i.fa.fa-files-o
              New Event
          = link_to data_entry_project_subject_path(@project, @subject), class: "dropdown-item" do
            %i.fa.fa-file-o
            New Sheet
          = link_to edit_project_subject_path(@subject.project, @subject), class: "dropdown-item" do
            %i.fa.fa-pencil
            Edit Subject
          .dropdown-divider
          = link_to [@subject.project, @subject], method: :delete, data: { confirm: "Delete subject?" }, class: "dropdown-item text-danger" do
            %i.fa.fa-trash
            Delete Subject

  = @title

- if @project.events.where(archived: false).count > 0
  - if @subject.subject_events.count == 0 && @subject.editable_by?(current_user)
    = render "subjects/choose_event"
  - else
    #subject-sheets= render "subjects/sheets"
- else
  - if @subject.sheets.count == 0 && @subject.editable_by?(current_user)
    = render "subjects/data_entry"
  - else
    #subject-sheets= render "subjects/sheets"

.dashboard-container{ style: "margin-top: 40px" }
  %table.table.table-borderless.table-striped
    %col.d-none.d-sm-table-column{ width: "30%" }
    %col.d-table-column.d-sm-none{ width: "50%" }
    - viewable_sites = current_user.all_viewable_sites.where(project_id: @project.id)
    - if viewable_sites.count > 1
      %tr
        %th Site
        %td= link_to @subject.site.name, [@subject.site.project, @subject.site] if @subject.site

    %tr
      %th=@project.subject_code_name_full
      %td=@subject.subject_code<commit_msg>Removed subject code and site from subject show page<commit_after>- @title = @subject.name
- @menu_title = "#{@project.name} #{@title}"

- content_for :container_class, "container-fluid"
- content_for :sidebar, render("subjects/sidebar")

- content_for :header do
  - if @subject.editable_by?(current_user)
    .float-right
      .dropdown
        = link_to "#", class: "btn btn-light dropdown-toggle", data: { toggle: "dropdown" } do
          .d-inline-block.d-sm-none
            %i.fa.fa-cog
          .d-none.d-sm-inline-block Actions

        .dropdown-menu.dropdown-menu-right
          - if @project.randomizations_enabled? && @project.unblinded?(current_user)
            - scheme_count = @project.randomization_schemes.published.count
            - @project.randomization_schemes.published.where.not(id: @subject.randomizations.select(:randomization_scheme_id)).each do |scheme|
              = link_to randomize_subject_to_list_project_randomization_scheme_path(@project, scheme, subject_code: @subject.subject_code), class: "dropdown-item" do
                %i.fa.fa-random
                Randomize
                - if scheme_count > 1
                  to
                  = scheme.name

          - if @project.events.where(archived: false).count > 0
            = link_to choose_event_project_subject_path(@project, @subject), class: "dropdown-item" do
              %i.fa.fa-files-o
              New Event
          = link_to data_entry_project_subject_path(@project, @subject), class: "dropdown-item" do
            %i.fa.fa-file-o
            New Sheet
          = link_to edit_project_subject_path(@subject.project, @subject), class: "dropdown-item" do
            %i.fa.fa-pencil
            Edit Subject
          .dropdown-divider
          = link_to [@subject.project, @subject], method: :delete, data: { confirm: "Delete subject?" }, class: "dropdown-item text-danger" do
            %i.fa.fa-trash
            Delete Subject

  = @title

- if @project.events.where(archived: false).count > 0
  - if @subject.subject_events.count == 0 && @subject.editable_by?(current_user)
    = render "subjects/choose_event"
  - else
    #subject-sheets= render "subjects/sheets"
- else
  - if @subject.sheets.count == 0 && @subject.editable_by?(current_user)
    = render "subjects/data_entry"
  - else
    #subject-sheets= render "subjects/sheets"
{'fraction_non_alphanumeric': 0.1262229042777671, 'fraction_numerical': 0.003261078074045655, 'mean_word_length': 2.5566166439290585, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '4917468', 'n_tokens_mistral': 1661, 'n_tokens_neox': 1613, 'n_words': 299}