about summary refs log tree commit diff
diff options
context:
space:
mode:
authorunarist <m.unarist@gmail.com>2017-08-14 21:09:00 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-08-14 14:09:00 +0200
commit5b9ae7981e2458a322f9e2fbeac9b334a15936bc (patch)
treee0801ec94c8776fd5d9813685458acc46aa6f445
parent5f22c0189d52383f0226622997d8282e9f387f3b (diff)
Update /admin/accounts/:id view for ActivityPub (#4600)
* Add protocol field
* Switch protocol specific information according to active protocol
* Hide PuSH subscription related buttons if ActivityPub is active
-rw-r--r--app/views/admin/accounts/show.html.haml43
-rw-r--r--config/locales/en.yml3
2 files changed, 31 insertions, 15 deletions
diff --git a/app/views/admin/accounts/show.html.haml b/app/views/admin/accounts/show.html.haml
index 5ad1fd6ee..5c781e817 100644
--- a/app/views/admin/accounts/show.html.haml
+++ b/app/views/admin/accounts/show.html.haml
@@ -32,18 +32,30 @@
         %th= t('admin.accounts.profile_url')
         %td= link_to @account.url, @account.url
       %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?
-            = 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
+        %th= t('admin.accounts.protocol')
+        %td= @account.protocol
+
+      - 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?
+              = 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
       %th= t('admin.accounts.follows')
@@ -74,9 +86,10 @@
     - if @account.user&.otp_required_for_login?
       = link_to t('admin.accounts.disable_two_factor_authentication'), admin_user_two_factor_authentication_path(@account.user.id), method: :delete, class: 'button'
   - else
-    = 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?
-      = link_to t('admin.accounts.unsubscribe'), unsubscribe_admin_account_path(@account.id), method: :post, class: 'button negative'
+    - if @account.ostatus?
+      = 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?
+        = 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' }
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 1fa0de90b..210bfc5b4 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -57,6 +57,7 @@ en:
       feed_url: Feed URL
       followers: Followers
       follows: Follows
+      inbox_url: Inbox URL
       ip: IP
       location:
         all: All
@@ -76,8 +77,10 @@ en:
         alphabetic: Alphabetic
         most_recent: Most recent
         title: Order
+      outbox_url: Outbox URL
       perform_full_suspension: Perform full suspension
       profile_url: Profile URL
+      protocol: Protocol
       public: Public
       push_subscription_expires: PuSH subscription expires
       redownload: Refresh avatar