<commit_before>%h1= t(".header")

%p
  = t(".different_users_different_roles")

  %br
  %b
    = t(".you_have_roles")
    #{current_user.roles.map{|role| role.name.humanize}.join(", ")}
  %br

%p= t(".role_allows_access")

- if policy(@config).setup_competition?
  - directors_name = t("layouts.competition_setup.manage_directors")
  %div= t(".directors_permissions_html", link: link_to(directors_name, directors_path))

%p= t(".you_may_need_to_grant_yourself_roles")

%b= t("example")
%ul
  %li= t(".event_planned_example")
  %li= t(".payment_admin_example")

%p= t(".roles_listed")

%p
  %b= t("note)")
  = t(".other_roles_not_permitted_html")

%h3= t(".users_with_permissions")
%table.sortable
  %thead
    %tr
      %th= User.model_name.human
      - @available_roles.each do |role|
        %th= role.to_s.humanize
  %tbody
    - User.this_tenant.with_any_role(*@available_roles).each do |user|
      %tr
        %th= user
        - @available_roles.each do |role|
          %td
            = user.has_role?(role)
            - if user.has_role?(role)
              = link_to "X", set_role_permissions_path(role_name: role, user_id: user.id), method: :put, data: { confirm: t("are_you_sure") }

.l--2up
  .l--column<commit_msg>Add email address to displayed users<commit_after>%h1= t(".header")

%p
  = t(".different_users_different_roles")

  %br
  %b
    = t(".you_have_roles")
    #{current_user.roles.map{|role| role.name.humanize}.join(", ")}
  %br

%p= t(".role_allows_access")

- if policy(@config).setup_competition?
  - directors_name = t("layouts.competition_setup.manage_directors")
  %div= t(".directors_permissions_html", link: link_to(directors_name, directors_path))

%p= t(".you_may_need_to_grant_yourself_roles")

%b= t("example")
%ul
  %li= t(".event_planned_example")
  %li= t(".payment_admin_example")

%p= t(".roles_listed")

%p
  %b= t("note)")
  = t(".other_roles_not_permitted_html")

%h3= t(".users_with_permissions")
%table.sortable
  %thead
    %tr
      %th= User.model_name.human
      - @available_roles.each do |role|
        %th= role.to_s.humanize
  %tbody
    - User.this_tenant.with_any_role(*@available_roles).each do |user|
      %tr
        %th= user.to_s_with_email
        - @available_roles.each do |role|
          %td
            = user.has_role?(role)
            - if user.has_role?(role)
              = link_to "X", set_role_permissions_path(role_name: role, user_id: user.id), method: :put, data: { confirm: t("are_you_sure") }

.l--2up
  .l--column
{'fraction_non_alphanumeric': 0.16593362654938024, 'fraction_numerical': 0.0023990403838464614, 'mean_word_length': 3.4919210053859966, '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': '2224029', 'n_tokens_mistral': 986, 'n_tokens_neox': 979, 'n_words': 154}