]> cat aescling's git repositories - mastodon.git/commitdiff
Note if the user is already following the target when authorizing follow (#6325)
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Sat, 24 Mar 2018 11:50:41 +0000 (20:50 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 24 Mar 2018 11:50:41 +0000 (12:50 +0100)
app/views/authorize_follows/_post_follow_actions.html.haml [new file with mode: 0644]
app/views/authorize_follows/show.html.haml
app/views/authorize_follows/success.html.haml
config/locales/en.yml
config/locales/ja.yml

diff --git a/app/views/authorize_follows/_post_follow_actions.html.haml b/app/views/authorize_follows/_post_follow_actions.html.haml
new file mode 100644 (file)
index 0000000..2a9c062
--- /dev/null
@@ -0,0 +1,4 @@
+.post-follow-actions
+  %div= link_to t('authorize_follow.post_follow.web'), web_url("accounts/#{@account.id}"), class: 'button button--block'
+  %div= link_to t('authorize_follow.post_follow.return'), TagManager.instance.url_for(@account), class: 'button button--block'
+  %div= t('authorize_follow.post_follow.close')
index f7a8f72d20d60f6e9931e7df54c165dda8fafe7e..a1fd01dd6b7b4dbfcdf30c466fb9c8fa83f611b3 100644 (file)
@@ -5,7 +5,13 @@
   .follow-prompt
     = render 'card', account: @account
 
-  - unless current_account.following?(@account)
+  - if current_account.following?(@account)
+    .flash-message
+      %strong
+        = t('authorize_follow.already_following')
+    = render 'post_follow_actions'
+
+  - else
     = form_tag authorize_follow_path, method: :post, class: 'simple_form' do
       = hidden_field_tag :acct, @account.acct
       = button_tag t('authorize_follow.follow'), type: :submit
index 63ff3bcf130751e850aa7cee5c3689e5a1e2ac08..fa59b24b8e038b79db452c7edcddd0be7592128c 100644 (file)
@@ -10,7 +10,4 @@
 
     = render 'card', account: @account
 
-  .post-follow-actions
-    %div= link_to t('authorize_follow.post_follow.web'), web_url("accounts/#{@account.id}"), class: 'button button--block'
-    %div= link_to t('authorize_follow.post_follow.return'), TagManager.instance.url_for(@account), class: 'button button--block'
-    %div= t('authorize_follow.post_follow.close')
+  = render 'post_follow_actions'
index 995cbdaa0105864c7b2798e30439e2a014b63f30..e3d76971b4941a8e9e16e5f20ca0155c6a487cbe 100644 (file)
@@ -382,6 +382,7 @@ en:
     security: Security
     set_new_password: Set new password
   authorize_follow:
+    already_following: You are already following this account
     error: Unfortunately, there was an error looking up the remote account
     follow: Follow
     follow_request: 'You have sent a follow request to:'
index 3b1990214eef226ffcf3a7c69eee98e6c9b8b541..1ff3097820ea3bb7e7892e45970ef2520eced6cf 100644 (file)
@@ -382,6 +382,7 @@ ja:
     security: セキュリティ
     set_new_password: 新しいパスワード
   authorize_follow:
+    already_following: あなたは既にこのアカウントをフォローしています
     error: 残念ながら、リモートアカウント情報の取得中にエラーが発生しました
     follow: フォロー
     follow_request: 'あなたは以下のアカウントにフォローリクエストを送信しました:'