Skip to content

Self-hosted project management for devs and their clients: tickets, time tracking, docs and meetings, with an AI assistant that cites its sources. AGPL-3.0.

905 B
Raw Blame
<%# The scope the token was MADE with (configuration), not the live reach: a link to an
    organisation the owner has since left still shows here. %>
<% if token.all_organisations? %>
  <%= t('views.users.personal_access_tokens.index.scope_all_organisations') %>
<% else %>
<% scope_lines = token.personal_access_token_organisations.includes(:organisation).map do |link|
     project_count = token.personal_access_token_projects.count { |p| p.project&.organisation_id == link.organisation_id }
     org_label = link.organisation&.name || t('views.users.personal_access_tokens.index.scope_unknown_org')
     if link.all_projects?
       "#{org_label} (#{t('views.users.personal_access_tokens.index.scope_all_projects')})"
     else
       "#{org_label} (#{t('views.users.personal_access_tokens.index.scope_n_projects', count: project_count)})"
     end
   end %>
<%= scope_lines.join(' · ') %>
<% end %>