From 8915ce7ffd5d530bb709e3290d94ebb836420619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?= Date: Wed, 2 Sep 2015 12:16:55 +0200 Subject: [PATCH] adds interface to disallow organizations votes on debates --- app/assets/javascripts/votes.js.coffee | 2 ++ app/assets/stylesheets/debates.scss | 4 ++-- app/views/debates/_votes.html.erb | 8 +++++++- config/locales/en.yml | 1 + config/locales/es.yml | 1 + 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/votes.js.coffee b/app/assets/javascripts/votes.js.coffee index da3d55664..4ccfb2131 100644 --- a/app/assets/javascripts/votes.js.coffee +++ b/app/assets/javascripts/votes.js.coffee @@ -3,9 +3,11 @@ App.Votes = hoverize: (votes) -> $(votes).hover -> $("div.anonymous-votes", votes).show(); + $("div.organizations-votes", votes).show(); $("div.not-logged", votes).show(); , -> $("div.anonymous-votes", votes).hide(); + $("div.organizations-votes", votes).hide(); $("div.not-logged", votes).hide(); initialize: -> diff --git a/app/assets/stylesheets/debates.scss b/app/assets/stylesheets/debates.scss index a480f4870..2fe4a8383 100644 --- a/app/assets/stylesheets/debates.scss +++ b/app/assets/stylesheets/debates.scss @@ -135,7 +135,7 @@ } } - .anonymous-votes { + .anonymous-votes, .organizations-votes { background: $warning-bg; color: $warning-color; height: 100%; @@ -380,7 +380,7 @@ padding-top: rem-calc(36); } - .anonymous-votes { + .anonymous-votes, .organizations-votes { padding-top: rem-calc(24); } } diff --git a/app/views/debates/_votes.html.erb b/app/views/debates/_votes.html.erb index 89d9313a1..e8aaf7d26 100644 --- a/app/views/debates/_votes.html.erb +++ b/app/views/debates/_votes.html.erb @@ -21,7 +21,13 @@ <%= t("debates.debate.votes", count: debate.total_votes) %> - <% if user_signed_in? && current_user.unverified? && !debate.votable_by?(current_user)%> + <% if user_signed_in? && current_user.organization? %> + + <% elsif user_signed_in? && current_user.unverified? && !debate.votable_by?(current_user)%>