<commit_before>- imported_user = user.imported_user
%div{:id=>"action_menu_wrapper"}
  %div{ :id => dom_id_for(user, :item), :class => 'item' }
    %div.action_menu
      %div.action_menu_header_left
        =link_to name_for_component(user), user
        - if imported_user
          %span.tiny{:style=>"font-weight:normal"}
            (Imported)
        - if user.portal_teacher
          %span.badge= "Teacher"
        - if user.portal_student
          %span.badge= "Student"
      %div.action_menu_header_right
        %ul.menu
          - if user.portal_teacher && policy(user).teacher_page?
            %li.menu=link_to 'Teacher Page', portal_teacher_path(user.portal_teacher)
          - if user.portal_student && policy(user).student_page?
            %li.menu=link_to 'Student Page', portal_student_path(user.portal_student)
          - if policy(user).edit?
            %li.menu=link_to 'edit', edit_user_path(user)
          - else
            - if policy(user).limited_edit?
              %li.menu=link_to 'edit', limited_edit_user_path(user)
          - if policy(user).reset_password? && !user.is_oauth_user?
            %li.menu=link_to 'Reset Password', reset_password_user_path(user)
          - if user.state == 'pending' && policy(user).confirm?
            %li.menu=link_to 'Activate', confirm_user_path(user)
          - if(user != current_visitor) && policy(user).switch?
            - switch_user_form_id = "switch_user_id_#{user.id}"
            %li.menu=link_to 'Switch', 'javascript: void(0);',:onclick => "$('#{switch_user_form_id}').submit();"
            = form_for user, :url => switch_user_path(user), :html => { :method => :put,:class=> "hidden" ,:id=> switch_user_form_id}  do |form|
              = hidden_field_tag 'user[id]', user.id
              = hidden_field_tag 'commit', 'Switch'

    %div{:id => dom_id_for(user, :details), :class => 'tiny'}
      %ul.menu_h
        %li
          login:
          = user.login
        %li
          email:
          = user.email
        %li
          Roles:
          = user.roles.map{|r| r.title.capitalize}.join(', ')
        - if user.portal_teacher
          %li
            Cohorts:
          - user.portal_teacher.cohorts.each do |c|
            %li
              = c.fullname
          %li
            Schools:
            %li
              = "#{user.portal_teacher.school_names.join(', ')}"
      %li
        Status: #{user.state}
        - if imported_user
          = "(#{imported_user.is_verified ? "verified" : "not-verfied"})"<commit_msg>[#148097361] Indicate Portal Account Type<commit_after>- imported_user = user.imported_user
%div{:id=>"action_menu_wrapper"}
  %div{ :id => dom_id_for(user, :item), :class => 'item' }
    %div.action_menu
      %div.action_menu_header_left{:style=>"white-space: nowrap"}
        =link_to name_for_component(user), user
        - if imported_user
          %span.tiny{:style=>"font-weight:normal"}
            (Imported)
        - if user.portal_teacher
          %span.badge= "Teacher"
        - if user.portal_student
          %span.badge= "Student"
        - if user.is_oauth_user?
          %span.badge= "#{user.authentications[0].provider.titleize} user"
      %div.action_menu_header_right
        %ul.menu
          - if user.portal_teacher && policy(user).teacher_page?
            %li.menu=link_to 'Teacher Page', portal_teacher_path(user.portal_teacher)
          - if user.portal_student && policy(user).student_page?
            %li.menu=link_to 'Student Page', portal_student_path(user.portal_student)
          - if policy(user).edit?
            %li.menu=link_to 'edit', edit_user_path(user)
          - else
            - if policy(user).limited_edit?
              %li.menu=link_to 'edit', limited_edit_user_path(user)
          - if policy(user).reset_password? && !user.is_oauth_user?
            %li.menu=link_to 'Reset Password', reset_password_user_path(user)
          - if user.state == 'pending' && policy(user).confirm?
            %li.menu=link_to 'Activate', confirm_user_path(user)
          - if(user != current_visitor) && policy(user).switch?
            - switch_user_form_id = "switch_user_id_#{user.id}"
            %li.menu=link_to 'Switch', 'javascript: void(0);',:onclick => "$('#{switch_user_form_id}').submit();"
            = form_for user, :url => switch_user_path(user), :html => { :method => :put,:class=> "hidden" ,:id=> switch_user_form_id}  do |form|
              = hidden_field_tag 'user[id]', user.id
              = hidden_field_tag 'commit', 'Switch'

    %div{:id => dom_id_for(user, :details), :class => 'tiny'}
      %ul.menu_h
        %li
          login:
          = user.login
        %br
        %li
          email:
          = user.email
        %br
        %li
          Roles:
          = user.roles.map{|r| r.title.capitalize}.join(', ')
        %br
        - if user.portal_teacher
          %li
            Cohorts:
          - user.portal_teacher.cohorts.each do |c|
            %li
              = c.fullname
          %br
          %li
            Schools:
            %li
              = "#{user.portal_teacher.school_names.join(', ')}"
          %br
      %li
        Status: #{user.state}
        - if imported_user
          = "(#{imported_user.is_verified ? "verified" : "not-verfied"})"
{'fraction_non_alphanumeric': 0.1408051408051408, 'fraction_numerical': 0.002268002268002268, 'mean_word_length': 2.101992966002345, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 28, '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': '2862559', 'n_tokens_mistral': 1749, 'n_tokens_neox': 1747, 'n_words': 280}