Add: フレンドサーバー (#61)
* Fix mastodon version * テーブル作成 * Wip: フレンドサーバーフォローの承認を受信 * Wip: フレンド申請拒否を受信 * Wip: フォローリクエストを受理 * Wip: 相手からのフォロー・アンフォローを受理 * 普通のフォローとフレンドサーバーのフォローを区別するテストを追加 * ドメインブロックによるフォロー拒否 * ドメインブロックしたあと、申請中のフォロリクを取り下げる処理 * スタブに条件を追加 * Wip: 相手からのDelete信号に対応 * DB定義が消えていたので修正 * Wip: ローカル公開投稿をフレンドに送信する処理など * Wip: 未収載+誰でもの投稿をフレンドに送る設定 * Wip: ローカル公開をそのまま送信する設定を考慮 * Fix test * Wip: 他サーバーからのローカル公開投稿の受け入れ * Wip: Web画面作成 * Fix test * Wip: ローカル公開を連合TLに流す * Wip: フレンドサーバーの削除ボタン * Wip: メール通知や設定のテストなど * Wip: 翻訳を作成 * Fix: 却下されたあとフォローボタンが表示されない問題 * Wip: 編集できない問題 * 有効にしていないフレンドサーバーをリストで無効表示
This commit is contained in:
parent
acb29e5b11
commit
87e858a202
66 changed files with 1638 additions and 51 deletions
|
@ -47,6 +47,9 @@
|
|||
.fields-group
|
||||
= f.input :reject_new_follow, as: :boolean, wrapper: :with_label, label: I18n.t('admin.domain_blocks.reject_new_follow'), hint: I18n.t('admin.domain_blocks.reject_new_follow_hint')
|
||||
|
||||
.fields-group
|
||||
= f.input :reject_friend, as: :boolean, wrapper: :with_label, label: I18n.t('admin.domain_blocks.reject_friend'), hint: I18n.t('admin.domain_blocks.reject_friend_hint')
|
||||
|
||||
.fields-group
|
||||
= f.input :detect_invalid_subscription, as: :boolean, wrapper: :with_label, label: I18n.t('admin.domain_blocks.detect_invalid_subscription'), hint: I18n.t('admin.domain_blocks.detect_invalid_subscription_hint')
|
||||
|
||||
|
|
|
@ -47,6 +47,9 @@
|
|||
.fields-group
|
||||
= f.input :reject_new_follow, as: :boolean, wrapper: :with_label, label: I18n.t('admin.domain_blocks.reject_new_follow'), hint: I18n.t('admin.domain_blocks.reject_new_follow_hint')
|
||||
|
||||
.fields-group
|
||||
= f.input :reject_friend, as: :boolean, wrapper: :with_label, label: I18n.t('admin.domain_blocks.reject_friend'), hint: I18n.t('admin.domain_blocks.reject_friend_hint')
|
||||
|
||||
.fields-group
|
||||
= f.input :detect_invalid_subscription, as: :boolean, wrapper: :with_label, label: I18n.t('admin.domain_blocks.detect_invalid_subscription'), hint: I18n.t('admin.domain_blocks.detect_invalid_subscription_hint')
|
||||
|
||||
|
|
41
app/views/admin/friend_servers/_friend_domain.html.haml
Normal file
41
app/views/admin/friend_servers/_friend_domain.html.haml
Normal file
|
@ -0,0 +1,41 @@
|
|||
%tr
|
||||
%td
|
||||
- unless friend.available
|
||||
%span.negative-hint
|
||||
= fa_icon('times')
|
||||
= ' '
|
||||
= t 'admin.friend_servers.disabled'
|
||||
%samp= friend.domain
|
||||
%td
|
||||
- if friend.i_am_accepted?
|
||||
%span.positive-hint
|
||||
= fa_icon('check')
|
||||
= ' '
|
||||
= t 'admin.friend_servers.enabled'
|
||||
- elsif friend.i_am_pending?
|
||||
= fa_icon('hourglass')
|
||||
= ' '
|
||||
= t 'admin.friend_servers.pending'
|
||||
- else
|
||||
%span.negative-hint
|
||||
= fa_icon('times')
|
||||
= ' '
|
||||
= t 'admin.friend_servers.disabled'
|
||||
%td
|
||||
- if friend.they_are_accepted?
|
||||
%span.positive-hint
|
||||
= fa_icon('check')
|
||||
= ' '
|
||||
= t 'admin.friend_servers.enabled'
|
||||
- elsif friend.they_are_pending?
|
||||
= fa_icon('hourglass')
|
||||
= ' '
|
||||
= t 'admin.friend_servers.pending'
|
||||
- else
|
||||
%span.negative-hint
|
||||
= fa_icon('times')
|
||||
= ' '
|
||||
= t 'admin.friend_servers.disabled'
|
||||
%td
|
||||
= table_link_to 'pencil', t('admin.friend_servers.edit_friend'), edit_admin_friend_server_path(friend)
|
||||
= table_link_to 'times', t('admin.friend_servers.delete'), admin_friend_server_path(friend), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') }
|
20
app/views/admin/friend_servers/_friend_fields.html.haml
Normal file
20
app/views/admin/friend_servers/_friend_fields.html.haml
Normal file
|
@ -0,0 +1,20 @@
|
|||
%p= t 'admin.friend_servers.edit.description'
|
||||
%hr.spacer/
|
||||
|
||||
.fields-group
|
||||
= f.input :domain, as: :string, wrapper: :with_label, required: true, disabled: !friend.id.nil?, label: t('admin.friend_servers.edit.domain')
|
||||
|
||||
.fields-group
|
||||
= f.input :inbox_url, as: :string, wrapper: :with_label, label: t('admin.friend_servers.edit.inbox_url'), hint: t('admin.friend_servers.edit.inbox_url_hint')
|
||||
|
||||
.fields-group
|
||||
= f.input :available, as: :boolean, wrapper: :with_label, label: t('admin.friend_servers.edit.available')
|
||||
|
||||
.fields-group
|
||||
= f.input :pseudo_relay, as: :boolean, wrapper: :with_label, label: t('admin.friend_servers.edit.pseudo_relay')
|
||||
|
||||
.fields-group
|
||||
= f.input :unlocked, as: :boolean, wrapper: :with_label, label: t('admin.friend_servers.edit.unlocked')
|
||||
|
||||
.fields-group
|
||||
= f.input :allow_all_posts, as: :boolean, wrapper: :with_label, label: t('admin.friend_servers.edit.allow_all_posts')
|
52
app/views/admin/friend_servers/edit.html.haml
Normal file
52
app/views/admin/friend_servers/edit.html.haml
Normal file
|
@ -0,0 +1,52 @@
|
|||
- content_for :page_title do
|
||||
= t('admin.friend_servers.edit_friend')
|
||||
|
||||
= simple_form_for @friend, url: admin_friend_server_path(@friend), method: :put do |f|
|
||||
= render 'shared/error_messages', object: @friend
|
||||
= render 'friend_fields', f: f, friend: @friend
|
||||
|
||||
.fields-group
|
||||
%h4= t('admin.friend_servers.active_status')
|
||||
.fields-group
|
||||
- if @friend.i_am_accepted?
|
||||
%span.positive-hint
|
||||
= fa_icon('check')
|
||||
= ' '
|
||||
= t 'admin.friend_servers.enabled'
|
||||
- elsif @friend.i_am_pending?
|
||||
= fa_icon('hourglass')
|
||||
= ' '
|
||||
= t 'admin.friend_servers.pending'
|
||||
- else
|
||||
%span.negative-hint
|
||||
= fa_icon('times')
|
||||
= ' '
|
||||
= t 'admin.friend_servers.disabled'
|
||||
.action-buttons
|
||||
%div
|
||||
= link_to t('admin.friend_servers.follow'), follow_admin_friend_server_path(@friend), class: 'button', method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if @friend.i_am_idle? || @friend.i_am_rejected?
|
||||
= link_to t('admin.friend_servers.unfollow'), unfollow_admin_friend_server_path(@friend), class: 'button', method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if @friend.i_am_pending? || @friend.i_am_accepted?
|
||||
|
||||
%h4= t('admin.friend_servers.passive_status')
|
||||
.fields-gtoup
|
||||
- if @friend.they_are_accepted?
|
||||
%span.positive-hint
|
||||
= fa_icon('check')
|
||||
= ' '
|
||||
= t 'admin.friend_servers.enabled'
|
||||
- elsif @friend.they_are_pending?
|
||||
= fa_icon('hourglass')
|
||||
= ' '
|
||||
= t 'admin.friend_servers.pending'
|
||||
- else
|
||||
%span.negative-hint
|
||||
= fa_icon('times')
|
||||
= ' '
|
||||
= t 'admin.friend_servers.disabled'
|
||||
.action-buttons
|
||||
%div
|
||||
= link_to t('admin.friend_servers.accept'), accept_admin_friend_server_path(@friend), class: 'button', method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if @friend.they_are_pending?
|
||||
= link_to t('admin.friend_servers.reject'), reject_admin_friend_server_path(@friend), class: 'button', method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if @friend.they_are_pending?
|
||||
|
||||
.actions
|
||||
= f.button :button, t('generic.save_changes'), type: :submit
|
21
app/views/admin/friend_servers/index.html.haml
Normal file
21
app/views/admin/friend_servers/index.html.haml
Normal file
|
@ -0,0 +1,21 @@
|
|||
- content_for :page_title do
|
||||
= t('admin.friend_servers.title')
|
||||
|
||||
.simple_form
|
||||
%p.hint= t('admin.friend_servers.description_html')
|
||||
= link_to @friends.empty? ? t('admin.friend_servers.setup') : t('admin.friend_servers.add_new'), new_admin_friend_server_path, class: 'block-button'
|
||||
|
||||
- unless @friends.empty?
|
||||
%hr.spacer
|
||||
|
||||
.table-wrapper
|
||||
%table.table
|
||||
%thead
|
||||
%tr
|
||||
%th= t('admin.friend_servers.domain')
|
||||
%th= t('admin.friend_servers.active_status')
|
||||
%th= t('admin.friend_servers.passive_status')
|
||||
%th
|
||||
%tbody
|
||||
- @friends.each do |friend|
|
||||
= render 'friend_domain', friend: friend
|
9
app/views/admin/friend_servers/new.html.haml
Normal file
9
app/views/admin/friend_servers/new.html.haml
Normal file
|
@ -0,0 +1,9 @@
|
|||
- content_for :page_title do
|
||||
= t('admin.friend_servers.add_new')
|
||||
|
||||
= simple_form_for @friend, url: admin_friend_servers_path do |f|
|
||||
= render 'shared/error_messages', object: @friend
|
||||
= render 'friend_fields', f: f, friend: @friend
|
||||
|
||||
.actions
|
||||
= f.button :button, t('admin.friend_servers.save_and_enable'), type: :submit
|
|
@ -45,6 +45,11 @@
|
|||
.fields-group
|
||||
= f.input :enable_public_unlisted_visibility, as: :boolean, wrapper: :with_label, kmyblue: true, hint: false
|
||||
|
||||
%h4= t('admin.settings.discovery.friend_servers')
|
||||
|
||||
.fields-group
|
||||
= f.input :unlocked_friend, as: :boolean, wrapper: :with_label, kmyblue: true, hint: false
|
||||
|
||||
%h4= t('admin.settings.discovery.publish_statistics')
|
||||
|
||||
.fields-group
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<%= raw t('application_mailer.salutation', name: display_name(@me)) %>
|
||||
|
||||
<%= raw t('admin_mailer.new_pending_friend_server.body', domain: @friend.domain) %>
|
||||
|
||||
<%= raw t('application_mailer.view')%> <%= admin_friend_servers_url %>
|
|
@ -22,13 +22,14 @@
|
|||
.fields-group
|
||||
= ff.input :always_send_emails, wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_always_send_emails'), hint: I18n.t('simple_form.hints.defaults.setting_always_send_emails')
|
||||
|
||||
- if current_user.can?(:manage_reports, :manage_appeals, :manage_users, :manage_taxonomies) || (SoftwareUpdate.check_enabled? && current_user.can?(:view_devops))
|
||||
- if current_user.can?(:manage_reports, :manage_appeals, :manage_users, :manage_taxonomies, :manage_federation) || (SoftwareUpdate.check_enabled? && current_user.can?(:view_devops))
|
||||
%h4= t 'notifications.administration_emails'
|
||||
|
||||
.fields-group
|
||||
= ff.input :'notification_emails.report', wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.report') if current_user.can?(:manage_reports)
|
||||
= ff.input :'notification_emails.appeal', as: :boolean, wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.appeal') if current_user.can?(:manage_appeals)
|
||||
= ff.input :'notification_emails.pending_account', wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.pending_account') if current_user.can?(:manage_users)
|
||||
= ff.input :'notification_emails.pending_friend_server', as: :boolean, wrapper: :with_label, kmyblue: true, label: I18n.t('simple_form.labels.notification_emails.pending_friend_server') if current_user.can?(:manage_federation)
|
||||
= ff.input :'notification_emails.trends', wrapper: :with_label, label: I18n.t('simple_form.labels.notification_emails.trending_tag') if current_user.can?(:manage_taxonomies)
|
||||
|
||||
- if SoftwareUpdate.check_enabled? && current_user.can?(:view_devops)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue