Add section for protocol specific information on the admin page (#4910)

This PR adds section for protocol specific information, then always show
both of OStatus and ActivityPub. Specifically, this will help admins to
check PuSH subscription status and unsubscribe manually, even `protocol`
has been changed.

This also includes below changes:

* Add `overflow: hidden` to prevent float leaking
* Add missing fields for ActivityPub
lolsob-rspec
unarist 2017-09-13 06:06:10 +09:00 committed by Eugen Rochko
parent d4fd2a39e6
commit 94fdf7da70
3 changed files with 75 additions and 44 deletions

View File

@ -97,6 +97,14 @@
margin-bottom: 40px; margin-bottom: 40px;
} }
h3 {
color: $ui-secondary-color;
font-size: 20px;
line-height: 28px;
font-weight: 400;
margin-bottom: 30px;
}
h6 { h6 {
font-size: 16px; font-size: 16px;
color: $ui-secondary-color; color: $ui-secondary-color;

View File

@ -37,29 +37,6 @@
%th= t('admin.accounts.protocol') %th= t('admin.accounts.protocol')
%td= @account.protocol.humanize %td= @account.protocol.humanize
- if @account.ostatus?
%tr
%th= t('admin.accounts.feed_url')
%td= link_to @account.remote_url, @account.remote_url
%tr
%th= t('admin.accounts.push_subscription_expires')
%td
- if @account.subscribed?
%time.formatted{ datetime: @account.subscription_expires_at.iso8601, title: l(@account.subscription_expires_at) }
= l @account.subscription_expires_at
- else
= t('admin.accounts.not_subscribed')
%tr
%th= t('admin.accounts.salmon_url')
%td= link_to @account.salmon_url, @account.salmon_url
- elsif @account.activitypub?
%tr
%th= t('admin.accounts.inbox_url')
%td= link_to @account.inbox_url, @account.inbox_url
%tr
%th= t('admin.accounts.outbox_url')
%td= link_to @account.outbox_url, @account.outbox_url
%tr %tr
%th= t('admin.accounts.follows') %th= t('admin.accounts.follows')
%td= @account.following_count %td= @account.following_count
@ -82,29 +59,73 @@
%th= t('.targeted_reports') %th= t('.targeted_reports')
%td= link_to pluralize(@account.targeted_reports.count, t('.report')), admin_reports_path(target_account_id: @account.id) %td= link_to pluralize(@account.targeted_reports.count, t('.report')), admin_reports_path(target_account_id: @account.id)
%div{ style: 'float: right' } %div{ style: 'overflow: hidden' }
- if @account.local? %div{ style: 'float: right' }
= link_to t('admin.accounts.reset_password'), admin_account_reset_path(@account.id), method: :create, class: 'button' - if @account.local?
- if @account.user&.otp_required_for_login? = link_to t('admin.accounts.reset_password'), admin_account_reset_path(@account.id), method: :create, class: 'button'
= link_to t('admin.accounts.disable_two_factor_authentication'), admin_user_two_factor_authentication_path(@account.user.id), method: :delete, class: 'button' - if @account.user&.otp_required_for_login?
- else = link_to t('admin.accounts.disable_two_factor_authentication'), admin_user_two_factor_authentication_path(@account.user.id), method: :delete, class: 'button'
- if @account.ostatus? - else
= link_to t('admin.accounts.redownload'), redownload_admin_account_path(@account.id), method: :post, class: 'button'
%div{ style: 'float: left' }
- if @account.silenced?
= link_to t('admin.accounts.undo_silenced'), admin_account_silence_path(@account.id), method: :delete, class: 'button'
- else
= link_to t('admin.accounts.silence'), admin_account_silence_path(@account.id), method: :post, class: 'button'
- if @account.local?
- unless @account.user_confirmed?
= link_to t('admin.accounts.confirm'), admin_account_confirmation_path(@account.id), method: :post, class: 'button'
- if @account.suspended?
= link_to t('admin.accounts.undo_suspension'), admin_account_suspension_path(@account.id), method: :delete, class: 'button'
- else
= link_to t('admin.accounts.perform_full_suspension'), admin_account_suspension_path(@account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button'
- unless @account.local?
%hr
%h3 OStatus
.table-wrapper
%table.table
%tbody
%tr
%th= t('admin.accounts.feed_url')
%td= link_to @account.remote_url, @account.remote_url
%tr
%th= t('admin.accounts.push_subscription_expires')
%td
- if @account.subscribed?
%time.formatted{ datetime: @account.subscription_expires_at.iso8601, title: l(@account.subscription_expires_at) }
= l @account.subscription_expires_at
- else
= t('admin.accounts.not_subscribed')
%tr
%th= t('admin.accounts.salmon_url')
%td= link_to @account.salmon_url, @account.salmon_url
%div{ style: 'overflow: hidden' }
%div{ style: 'float: right' }
= link_to @account.subscribed? ? t('admin.accounts.resubscribe') : t('admin.accounts.subscribe'), subscribe_admin_account_path(@account.id), method: :post, class: 'button' = link_to @account.subscribed? ? t('admin.accounts.resubscribe') : t('admin.accounts.subscribe'), subscribe_admin_account_path(@account.id), method: :post, class: 'button'
- if @account.subscribed? - if @account.subscribed?
= link_to t('admin.accounts.unsubscribe'), unsubscribe_admin_account_path(@account.id), method: :post, class: 'button negative' = link_to t('admin.accounts.unsubscribe'), unsubscribe_admin_account_path(@account.id), method: :post, class: 'button negative'
= link_to t('admin.accounts.redownload'), redownload_admin_account_path(@account.id), method: :post, class: 'button'
%div{ style: 'float: left' } %hr
- if @account.silenced? %h3 ActivityPub
= link_to t('admin.accounts.undo_silenced'), admin_account_silence_path(@account.id), method: :delete, class: 'button'
- else
= link_to t('admin.accounts.silence'), admin_account_silence_path(@account.id), method: :post, class: 'button'
- if @account.local? .table-wrapper
- unless @account.user_confirmed? %table.table
= link_to t('admin.accounts.confirm'), admin_account_confirmation_path(@account.id), method: :post, class: 'button' %tbody
%tr
- if @account.suspended? %th= t('admin.accounts.inbox_url')
= link_to t('admin.accounts.undo_suspension'), admin_account_suspension_path(@account.id), method: :delete, class: 'button' %td= link_to @account.inbox_url, @account.inbox_url
- else %tr
= link_to t('admin.accounts.perform_full_suspension'), admin_account_suspension_path(@account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button' %th= t('admin.accounts.outbox_url')
%td= link_to @account.outbox_url, @account.outbox_url
%tr
%th= t('admin.accounts.shared_inbox_url')
%td= link_to @account.shared_inbox_url, @account.shared_inbox_url
%tr
%th= t('admin.accounts.followers_url')
%td= link_to @account.followers_url, @account.followers_url

View File

@ -60,6 +60,7 @@ en:
email: E-mail email: E-mail
feed_url: Feed URL feed_url: Feed URL
followers: Followers followers: Followers
followers_url: Followers URL
follows: Follows follows: Follows
inbox_url: Inbox URL inbox_url: Inbox URL
ip: IP ip: IP
@ -93,6 +94,7 @@ en:
resubscribe: Resubscribe resubscribe: Resubscribe
salmon_url: Salmon URL salmon_url: Salmon URL
search: Search search: Search
shared_inbox_url: Shared Inbox URL
show: show:
created_reports: Reports created by this account created_reports: Reports created by this account
report: report report: report