From 81c4f14a62fa9709aa83edb9774546a58465d861 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sun, 30 Nov 2014 15:28:58 +0100 Subject: [PATCH] added user/actions partial --- app/views/user/_actions.html.haml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 app/views/user/_actions.html.haml diff --git a/app/views/user/_actions.html.haml b/app/views/user/_actions.html.haml new file mode 100644 index 00000000..584a1de1 --- /dev/null +++ b/app/views/user/_actions.html.haml @@ -0,0 +1,10 @@ +- if user_signed_in? + - if @user == current_user + %a.btn.btn-default.btn-block{href: edit_user_profile_path} Edit profile + - else + - if current_user.following? @user + %button#editprofile.btn.btn-default.btn-block{type: :button, name: 'user-action', 'data-action' => :unfollow, 'data-target' => @user.screen_name} + Unfollow + - else + %button#editprofile.btn.btn-primary.btn-block{type: :button, name: 'user-action', 'data-action' => :follow, 'data-target' => @user.screen_name} + Follow \ No newline at end of file