From e9ad4b49fbab77869c3595d96d23a82d307b8732 Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 7 Dec 2017 11:12:46 +0100 Subject: [PATCH] improves styles for follow button --- .../investments/_investment_show.html.erb | 3 +++ app/views/follows/_follow_button.html.erb | 17 ++++++----------- app/views/proposals/show.html.erb | 3 +++ config/locales/en/general.yml | 1 + config/locales/es/general.yml | 1 + 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/views/budgets/investments/_investment_show.html.erb b/app/views/budgets/investments/_investment_show.html.erb index 5704ac1a7..fc42e1a3a 100644 --- a/app/views/budgets/investments/_investment_show.html.erb +++ b/app/views/budgets/investments/_investment_show.html.erb @@ -131,6 +131,9 @@ } %> <% if current_user %> + + + <%= render 'follows/follow_button', follow: find_or_build_follow(current_user, investment) %> <% end %> diff --git a/app/views/follows/_follow_button.html.erb b/app/views/follows/_follow_button.html.erb index 547e880b9..1d32228ce 100644 --- a/app/views/follows/_follow_button.html.erb +++ b/app/views/follows/_follow_button.html.erb @@ -1,24 +1,19 @@ - +
- <% if follow.followable.followed_by?(current_user) %> - - <%= link_to t('shared.unfollow'), + <%= link_to t('shared.following'), follow_path(follow), method: :delete, remote: true, title: unfollow_text(follow.followable), - class: 'button hollow' %> + class: 'button expanded' %> <% else %> - - <%= link_to t('shared.follow'), + <%= link_to follow_text(follow.followable), follows_path(followable_id: follow.followable.id, followable_type: follow.followable.class.name), method: :post, remote: true, title: follow_text(follow.followable), - class: 'button hollow' %> - + class: 'button hollow expanded' %> <% end %> - - \ No newline at end of file +
diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb index 13da25cfc..aa8b0aee3 100644 --- a/app/views/proposals/show.html.erb +++ b/app/views/proposals/show.html.erb @@ -182,6 +182,9 @@ } %> <% if current_user %> + + + <%= render 'follows/follow_button', follow: find_or_build_follow(current_user, @proposal) %> <% end %> diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml index 5c18a27f5..a654f0a2a 100644 --- a/config/locales/en/general.yml +++ b/config/locales/en/general.yml @@ -569,6 +569,7 @@ en: collective: Collective flag: Flag as inappropriate follow: "Follow" + following: "Following" follow_entity: "Follow %{entity}" followable: budget_investment: diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml index 46fd2df53..201f13443 100644 --- a/config/locales/es/general.yml +++ b/config/locales/es/general.yml @@ -566,6 +566,7 @@ es: collective: Colectivo flag: Denunciar como inapropiado follow: "Seguir" + following: "Siguiendo" follow_entity: "Seguir %{entity}" followable: budget_investment: