about summary refs log tree commit diff
path: root/app/views/accounts
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-06 21:27:58 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-06 21:27:58 +0200
commit3554d638b31aa5ace2aa524db0165932c15d9a71 (patch)
treed20d71469f6077daf83a6996f4143dd393924b68 /app/views/accounts
parent87ba52ad3f1e32b0608bb6c6ffb226c1988267a3 (diff)
Fix #72 - add follow/unfollow button to public profiles
Diffstat (limited to 'app/views/accounts')
-rw-r--r--app/views/accounts/_header.html.haml7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/views/accounts/_header.html.haml b/app/views/accounts/_header.html.haml
index 371bc62c3..fb9abd691 100644
--- a/app/views/accounts/_header.html.haml
+++ b/app/views/accounts/_header.html.haml
@@ -1,4 +1,11 @@
 .card{ style: "background-image: url(#{@account.header.url(:medium)})" }
+  - if user_signed_in? && current_account.id != @account.id
+    .controls
+      - if current_account.following?(@account)
+        = link_to 'Unfollow', unfollow_account_path(@account), data: { method: :post }, class: 'button'
+      - else
+        = link_to 'Follow', follow_account_path(@account), data: { method: :post }, class: 'button'
+
   .avatar= image_tag @account.avatar.url(:large)
   %h1.name
     = display_name(@account)