Change authorized applications page (#17656)
* Change authorized applications page * Hide revoke button for superapps and suspended accounts * Clean up db/schema.rb
This commit is contained in:
@ -12,8 +12,9 @@
|
||||
= fa_icon 'sign-out'
|
||||
|
||||
.container-alt= yield
|
||||
|
||||
.modal-layout__mastodon
|
||||
%div
|
||||
%img{alt:'', draggable:'false', src:"#{mascot_url}"}
|
||||
%img{alt: '', draggable: 'false', src: mascot_url }
|
||||
|
||||
= render template: 'layouts/application'
|
||||
|
@ -1,26 +1,38 @@
|
||||
- content_for :page_title do
|
||||
= t('doorkeeper.authorizations.new.title')
|
||||
|
||||
.form-container
|
||||
.form-container.simple_form
|
||||
.oauth-prompt
|
||||
%h2= t('doorkeeper.authorizations.new.prompt', client_name: @pre_auth.client.name)
|
||||
%h3= t('doorkeeper.authorizations.new.title')
|
||||
|
||||
%p
|
||||
= t('doorkeeper.authorizations.new.able_to')
|
||||
!= @pre_auth.scopes.map { |scope| t(scope, scope: [:doorkeeper, :scopes]) }.map { |s| "<strong>#{s}</strong>" }.to_sentence
|
||||
%p= t('doorkeeper.authorizations.new.prompt_html', client_name: content_tag(:strong, @pre_auth.client.name))
|
||||
|
||||
= form_tag oauth_authorization_path, method: :post, class: 'simple_form' do
|
||||
= hidden_field_tag :client_id, @pre_auth.client.uid
|
||||
= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri
|
||||
= hidden_field_tag :state, @pre_auth.state
|
||||
= hidden_field_tag :response_type, @pre_auth.response_type
|
||||
= hidden_field_tag :scope, @pre_auth.scope
|
||||
= button_tag t('doorkeeper.authorizations.buttons.authorize'), type: :submit
|
||||
%h3= t('doorkeeper.authorizations.new.review_permissions')
|
||||
|
||||
= form_tag oauth_authorization_path, method: :delete, class: 'simple_form' do
|
||||
= hidden_field_tag :client_id, @pre_auth.client.uid
|
||||
= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri
|
||||
= hidden_field_tag :state, @pre_auth.state
|
||||
= hidden_field_tag :response_type, @pre_auth.response_type
|
||||
= hidden_field_tag :scope, @pre_auth.scope
|
||||
= button_tag t('doorkeeper.authorizations.buttons.deny'), type: :submit, class: 'negative'
|
||||
%ul.permissions-list
|
||||
- grouped_scopes(@pre_auth.scopes).each do |scope|
|
||||
%li.permissions-list__item
|
||||
.permissions-list__item__icon
|
||||
= fa_icon('check')
|
||||
.permissions-list__item__text
|
||||
.permissions-list__item__text__title
|
||||
= t(scope.key, scope: [:doorkeeper, :grouped_scopes, :title])
|
||||
.permissions-list__item__text__type
|
||||
= t(scope.access, scope: [:doorkeeper, :grouped_scopes, :access])
|
||||
|
||||
.actions
|
||||
= form_tag oauth_authorization_path, method: :post do
|
||||
= hidden_field_tag :client_id, @pre_auth.client.uid
|
||||
= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri
|
||||
= hidden_field_tag :state, @pre_auth.state
|
||||
= hidden_field_tag :response_type, @pre_auth.response_type
|
||||
= hidden_field_tag :scope, @pre_auth.scope
|
||||
= button_tag t('doorkeeper.authorizations.buttons.authorize'), type: :submit
|
||||
|
||||
= form_tag oauth_authorization_path, method: :delete do
|
||||
= hidden_field_tag :client_id, @pre_auth.client.uid
|
||||
= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri
|
||||
= hidden_field_tag :state, @pre_auth.state
|
||||
= hidden_field_tag :response_type, @pre_auth.response_type
|
||||
= hidden_field_tag :scope, @pre_auth.scope
|
||||
= button_tag t('doorkeeper.authorizations.buttons.deny'), type: :submit, class: 'negative'
|
||||
|
@ -1,24 +1,44 @@
|
||||
- content_for :page_title do
|
||||
= t('doorkeeper.authorized_applications.index.title')
|
||||
|
||||
.table-wrapper
|
||||
%table.table
|
||||
%thead
|
||||
%tr
|
||||
%th= t('doorkeeper.authorized_applications.index.application')
|
||||
%th= t('doorkeeper.authorized_applications.index.scopes')
|
||||
%th= t('doorkeeper.authorized_applications.index.created_at')
|
||||
%th
|
||||
%tbody
|
||||
- @applications.each do |application|
|
||||
%tr
|
||||
%td
|
||||
- if application.website.blank?
|
||||
= application.name
|
||||
- else
|
||||
= link_to application.name, application.website, target: '_blank', rel: 'noopener noreferrer'
|
||||
%th!= application.scopes.map { |scope| t(scope, scope: [:doorkeeper, :scopes]) }.join(', ')
|
||||
%td= l application.created_at
|
||||
%td
|
||||
- unless application.superapp? || current_account.suspended?
|
||||
= table_link_to 'times', t('doorkeeper.authorized_applications.buttons.revoke'), oauth_authorized_application_path(application), method: :delete, data: { confirm: t('doorkeeper.authorized_applications.confirmations.revoke') }
|
||||
%p= t('doorkeeper.authorized_applications.index.description_html')
|
||||
|
||||
%hr.spacer/
|
||||
|
||||
.announcements-list
|
||||
- @applications.each do |application|
|
||||
.announcements-list__item
|
||||
- if application.website.present?
|
||||
= link_to application.name, application.website, target: '_blank', rel: 'noopener noreferrer', class: 'announcements-list__item__title'
|
||||
- else
|
||||
%strong.announcements-list__item__title
|
||||
= application.name
|
||||
- if application.superapp?
|
||||
%span.account-role.moderator= t('doorkeeper.authorized_applications.index.superapp')
|
||||
|
||||
.announcements-list__item__action-bar
|
||||
.announcements-list__item__meta
|
||||
- if application.most_recently_used_access_token
|
||||
= t('doorkeeper.authorized_applications.index.last_used_at', date: l(application.most_recently_used_access_token.last_used_at.to_date))
|
||||
- else
|
||||
= t('doorkeeper.authorized_applications.index.never_used')
|
||||
|
||||
•
|
||||
|
||||
= t('doorkeeper.authorized_applications.index.authorized_at', date: l(application.created_at.to_date))
|
||||
|
||||
- unless application.superapp? || current_account.suspended?
|
||||
%div
|
||||
= table_link_to 'times', t('doorkeeper.authorized_applications.buttons.revoke'), oauth_authorized_application_path(application), method: :delete, data: { confirm: t('doorkeeper.authorized_applications.confirmations.revoke') }
|
||||
|
||||
.announcements-list__item__permissions
|
||||
%ul.permissions-list
|
||||
- grouped_scopes(application.scopes).each do |scope|
|
||||
%li.permissions-list__item
|
||||
.permissions-list__item__icon
|
||||
= fa_icon('check')
|
||||
.permissions-list__item__text
|
||||
.permissions-list__item__text__title
|
||||
= t(scope.key, scope: [:doorkeeper, :grouped_scopes, :title])
|
||||
.permissions-list__item__text__type
|
||||
= t(scope.access, scope: [:doorkeeper, :grouped_scopes, :access])
|
||||
|
Reference in New Issue
Block a user