<commit_before>.row
  #content.col-md-9
    %h1.page-header
      = @user.full_name
      %span.uid_heading
        (#{@user.uid})
      .menu-icon-container.hidden
        %span.glyphicon.glyphicon-tasks.menu-icon
    %h3 Your courses
    %table.table.table-hover.table-striped
      - if @courses.empty?
        %p You don't have any courses.
        - if current_user.is_admin_or_convenor?
          = link_to 'Create one', new_course_path
      - else
        %tr
          %th Course Code
          %th Name
          %th Convenors
          %th Groups
          %th Assignments
        - @courses.each do |c|
          %tr
            %td= link_to c.code, course_path(c)
            %td= link_to c.name, course_path(c)
            %td
              - c.convenors.each do |convenor|
                = link_to convenor.firstname + " " + convenor.surname, user_path(convenor)
                %br
            %td
              - c.groups.each do |g|
                - if g.users.include?(@user)
                  = link_to g.name, group_path(g)
                  %br
            %td
              - c.assignments.each do |a|
                = link_to a.name, assignment_path(a)
                %br
    %h3 Your groups
    %table.table.table-hover.table-striped
      - if !@courses.empty?
        %tr
          %th Course Code
          %th Group Name
        - for c in @user.courses
          - for group in c.groups
            - if group.users.include?(@user)
              %tr
                %td= link_to c.code, course_path(c)
                %td= link_to group.name, group_path(group)
      - elsif !@user.is_admin? && @user.groups.empty?
        %p You don't have any groups.

    %h3 Your Assignments
    %table.table.table-hover.table-striped
      - if @user.assignments.empty?
        %p You don't have any assignments.
      - else
        %tr
          %th Course Code
          %th Assignment
          %th Date Due
          %th Your Submissions
        - @user.assignments.uniq.each do |a|
          %tr
            %td= link_to a.course.code, course_path(a)
            %td= link_to a.name, assignment_path(a)
            %td= a.due_date.strftime('%d/%m/%Y %I:%M%p')
            %td{style: "line-height: 2em;"}
              - if @user.submissions_for(a).empty?
                %span.glyphicon.glyphicon-exclamation-sign.warn
                %span.warn No submission
                %br
                = link_to "Add submission", "/submissions/#{a.id}/new"
              - else
                - @user.submissions_for(a).each do |s|
                  - if s.finalised
                    %span.glyphicon.glyphicon-thumbs-up.good
                    = link_to s.created_at.strftime('%d/%m/%Y %I:%M%p'), submission_path(s), class: "good"
                  - else
                    %span.glyphicon.glyphicon-ok
                    = link_to s.created_at.strftime('%d/%m/%Y %I:%M%p'), submission_path(s)

                  - if is_late_with_extension(s, a)
                    %span.label.label-warning
                      Extension until #{a.latest_extension_for(s.user).due_date.strftime('%d/%m/%Y %I:%M%p')}
                  - elsif is_late(s, a) || is_late_without_extension(s, a)
                    %span.label.label-danger
                      Late
                  %br
                  
    %h3 Submissions to Review
    %table.table.table-hover.table-striped
      %tr
        %th Submission
        %th Assignment
        %th Date Submitted
        %th Review Status
      - if current_user
        - Assignment.all.each do |a|
          - for s in a.peer_review_submissions_for(@user)
            %tr
              %td
                = link_to submission_path(s) do
                  %i.glyphicon.glyphicon-share-alt
                  View
              %td= link_to s.assignment.name, assignment_path(s.assignment)
              %td= link_to s.created_at.strftime('%d/%m/%Y %I:%M%p'), submission_path(s)
              %td
                - if s.reviewed_by?(@user)
                  %span.label.label-success
                    Reviewed
                - else
                  %span.label.label-danger
                    Not Reviewed
                  
      - else
        - @user.assignments.each do |a|
          - for s in a.peer_review_submissions_for(@user)
            %tr<commit_msg>Show assignment course on user profile peer reviews<commit_after>.row
  #content.col-md-9
    %h1.page-header
      = @user.full_name
      %span.uid_heading
        (#{@user.uid})
      .menu-icon-container.hidden
        %span.glyphicon.glyphicon-tasks.menu-icon
    %h3 Your courses
    %table.table.table-hover.table-striped
      - if @courses.empty?
        %p You don't have any courses.
        - if current_user.is_admin_or_convenor?
          = link_to 'Create one', new_course_path
      - else
        %tr
          %th Course Code
          %th Name
          %th Convenors
          %th Groups
          %th Assignments
        - @courses.each do |c|
          %tr
            %td= link_to c.code, course_path(c)
            %td= link_to c.name, course_path(c)
            %td
              - c.convenors.each do |convenor|
                = link_to convenor.firstname + " " + convenor.surname, user_path(convenor)
                %br
            %td
              - c.groups.each do |g|
                - if g.users.include?(@user)
                  = link_to g.name, group_path(g)
                  %br
            %td
              - c.assignments.each do |a|
                = link_to a.name, assignment_path(a)
                %br
    %h3 Your groups
    %table.table.table-hover.table-striped
      - if !@courses.empty?
        %tr
          %th Course Code
          %th Group Name
        - for c in @user.courses
          - for group in c.groups
            - if group.users.include?(@user)
              %tr
                %td= link_to c.code, course_path(c)
                %td= link_to group.name, group_path(group)
      - elsif !@user.is_admin? && @user.groups.empty?
        %p You don't have any groups.

    %h3 Your Assignments
    %table.table.table-hover.table-striped
      - if @user.assignments.empty?
        %p You don't have any assignments.
      - else
        %tr
          %th Course Code
          %th Assignment
          %th Date Due
          %th Your Submissions
        - @user.assignments.uniq.each do |a|
          %tr
            %td= link_to a.course.code, course_path(a)
            %td= link_to a.name, assignment_path(a)
            %td= a.due_date.strftime('%d/%m/%Y %I:%M%p')
            %td{style: "line-height: 2em;"}
              - if @user.submissions_for(a).empty?
                %span.glyphicon.glyphicon-exclamation-sign.warn
                %span.warn No submission
                %br
                = link_to "Add submission", "/submissions/#{a.id}/new"
              - else
                - @user.submissions_for(a).each do |s|
                  - if s.finalised
                    %span.glyphicon.glyphicon-thumbs-up.good
                    = link_to s.created_at.strftime('%d/%m/%Y %I:%M%p'), submission_path(s), class: "good"
                  - else
                    %span.glyphicon.glyphicon-ok
                    = link_to s.created_at.strftime('%d/%m/%Y %I:%M%p'), submission_path(s)

                  - if is_late_with_extension(s, a)
                    %span.label.label-warning
                      Extension until #{a.latest_extension_for(s.user).due_date.strftime('%d/%m/%Y %I:%M%p')}
                  - elsif is_late(s, a) || is_late_without_extension(s, a)
                    %span.label.label-danger
                      Late
                  %br
                  
    %h3 Submissions to Review
    %table.table.table-hover.table-striped
      %tr
        %th Submission
        %th Course
        %th Assignment
        %th Date Submitted
        %th Review Status
      - if current_user
        - Assignment.all.each do |a|
          - for s in a.peer_review_submissions_for(@user)
            %tr
              %td
                = link_to submission_path(s) do
                  %i.glyphicon.glyphicon-share-alt
                  View
              %td= link_to a.course.code, course_path(a.course)
              %td= link_to a.name, assignment_path(s.assignment)
              %td= link_to s.created_at.strftime('%d/%m/%Y %I:%M%p'), submission_path(s)
              %td
                - if s.reviewed_by?(@user)
                  %span.label.label-success
                    Reviewed
                - else
                  %span.label.label-danger
                    Not Reviewed
                  
      - else
        - @user.assignments.each do |a|
          - for s in a.peer_review_submissions_for(@user)
            %tr
{'fraction_non_alphanumeric': 0.10938924339106655, 'fraction_numerical': 0.0015952597994530538, 'mean_word_length': 1.309736842105263, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '901500', 'n_tokens_mistral': 2806, 'n_tokens_neox': 2663, 'n_words': 546}