<commit_before>%h1= "#{@project.name} - Permissions"

%p
  Project is owned by
  = link_to @project.owner.user_name, user_account_path(@project.owner)

= simple_form_for :permission, url: update_permissions_project_path(@project) do |p|
  %table.table.table-striped
    %thead
      %tr
        %th User
        %th No Access
        %th Read
        %th Read & Write
    %tbody
    - User.users.each do |user|
      - unless @project.owner == user
        %tr{user_id: user.id}
          %td= link_to user.user_name, user_account_path(user)
          %td
            %input{id: "user_#{user.id}_permissions_level_none",
                      type: 'radio',
                      name: "[user_ids][#{user.id}][permissions][level]",
                      value: '',
                      checked: !user.has_permission?(@project)}
          %td
            %input{id: "user_#{user.id}_permissions_level_reader",
                      type: 'radio',
                      name: "[user_ids][#{user.id}][permissions][level]",
                      value: 'reader',
                      checked: user.can_read?(@project)}

          %td
            %input{id: "user_#{user.id}_permissions_level_writer",
                      type: 'radio',
                      name: "[user_ids][#{user.id}][permissions][level]",
                      value: 'writer',
                      checked: user.can_write?(@project)}
  .form-actions
    = p.submit 'Update Permissions', class: 'btn'

-#- content_for :left_sidebar do
-#  = render layout: '/shared/left_sidebar', locals: {title: 'Projects'} do
-#    %li= link_to 'Project', project_path(@project),  title: "Back to project view", data: {toggle: 'tooltip',  placement: 'right'}

<commit_msg>Sort permission list by user name.<commit_after>%h1= "#{@project.name} - Permissions"

%p
  Project is owned by
  = link_to @project.owner.user_name, user_account_path(@project.owner)

= simple_form_for :permission, url: update_permissions_project_path(@project) do |p|
  %table.table.table-striped
    %thead
      %tr
        %th User
        %th No Access
        %th Read
        %th Read & Write
    %tbody
    - User.users.order('lower(user_name) ASC').each do |user|
      - unless @project.owner == user
        %tr{user_id: user.id}
          %td= link_to user.user_name, user_account_path(user)
          %td
            %input{id: "user_#{user.id}_permissions_level_none",
                      type: 'radio',
                      name: "[user_ids][#{user.id}][permissions][level]",
                      value: '',
                      checked: !user.has_permission?(@project)}
          %td
            %input{id: "user_#{user.id}_permissions_level_reader",
                      type: 'radio',
                      name: "[user_ids][#{user.id}][permissions][level]",
                      value: 'reader',
                      checked: user.can_read?(@project)}

          %td
            %input{id: "user_#{user.id}_permissions_level_writer",
                      type: 'radio',
                      name: "[user_ids][#{user.id}][permissions][level]",
                      value: 'writer',
                      checked: user.can_write?(@project)}
  .form-actions
    = p.submit 'Update Permissions', class: 'btn'

-#- content_for :left_sidebar do
-#  = render layout: '/shared/left_sidebar', locals: {title: 'Projects'} do
-#    %li= link_to 'Project', project_path(@project),  title: "Back to project view", data: {toggle: 'tooltip',  placement: 'right'}


{'fraction_non_alphanumeric': 0.14249073810202337, 'fraction_numerical': 0.0005699629524080935, 'mean_word_length': 2.0128755364806867, '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': '6943801', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1048, 'n_words': 216}