index.html.haml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. - content_for :page_title do
  2. = t('doorkeeper.authorized_applications.index.title')
  3. %p= t('doorkeeper.authorized_applications.index.description_html')
  4. %hr.spacer/
  5. .applications-list
  6. - @applications.each do |application|
  7. .applications-list__item{ id: dom_id(application) }
  8. - if application.website.present?
  9. = link_to application.name, application.website, target: '_blank', rel: 'noopener noreferrer', class: 'announcements-list__item__title'
  10. - else
  11. %strong.announcements-list__item__title
  12. = application.name
  13. - if application.superapp?
  14. %span.information-badge.superapp= t('doorkeeper.authorized_applications.index.superapp')
  15. .announcements-list__item__action-bar
  16. .announcements-list__item__meta
  17. - if @last_used_at_by_app[application.id]
  18. = t('doorkeeper.authorized_applications.index.last_used_at', date: l(@last_used_at_by_app[application.id].to_date))
  19. - else
  20. = t('doorkeeper.authorized_applications.index.never_used')
  21. ·
  22. = t('doorkeeper.authorized_applications.index.authorized_at', date: l(application.created_at.to_date))
  23. - unless application.superapp? || current_account.unavailable?
  24. %div
  25. = table_link_to 'close', t('doorkeeper.authorized_applications.buttons.revoke'), oauth_authorized_application_path(application), method: :delete, data: { confirm: t('doorkeeper.authorized_applications.confirmations.revoke') }
  26. .announcements-list__item__permissions
  27. %ul.permissions-list
  28. - grouped_scopes(application.scopes).each do |scope|
  29. %li.permissions-list__item
  30. .permissions-list__item__icon
  31. = material_symbol('check')
  32. .permissions-list__item__text
  33. .permissions-list__item__text__title
  34. = t(scope.key, scope: [:doorkeeper, :grouped_scopes, :title])
  35. .permissions-list__item__text__type
  36. = t(scope.access, scope: [:doorkeeper, :grouped_scopes, :access])