adds interface to disallow organizations votes

on debates
This commit is contained in:
Juanjo Bazán
2015-09-02 12:16:55 +02:00
parent 361ccb8624
commit 8915ce7ffd
5 changed files with 13 additions and 3 deletions

View File

@@ -3,9 +3,11 @@ App.Votes =
hoverize: (votes) -> hoverize: (votes) ->
$(votes).hover -> $(votes).hover ->
$("div.anonymous-votes", votes).show(); $("div.anonymous-votes", votes).show();
$("div.organizations-votes", votes).show();
$("div.not-logged", votes).show(); $("div.not-logged", votes).show();
, -> , ->
$("div.anonymous-votes", votes).hide(); $("div.anonymous-votes", votes).hide();
$("div.organizations-votes", votes).hide();
$("div.not-logged", votes).hide(); $("div.not-logged", votes).hide();
initialize: -> initialize: ->

View File

@@ -135,7 +135,7 @@
} }
} }
.anonymous-votes { .anonymous-votes, .organizations-votes {
background: $warning-bg; background: $warning-bg;
color: $warning-color; color: $warning-color;
height: 100%; height: 100%;
@@ -380,7 +380,7 @@
padding-top: rem-calc(36); padding-top: rem-calc(36);
} }
.anonymous-votes { .anonymous-votes, .organizations-votes {
padding-top: rem-calc(24); padding-top: rem-calc(24);
} }
} }

View File

@@ -21,7 +21,13 @@
<%= t("debates.debate.votes", count: debate.total_votes) %> <%= t("debates.debate.votes", count: debate.total_votes) %>
</span> </span>
<% if user_signed_in? && current_user.unverified? && !debate.votable_by?(current_user)%> <% if user_signed_in? && current_user.organization? %>
<div class="organizations-votes" style='display:none'>
<p>
<%= t("votes.organizations") %>
</p>
</div>
<% elsif user_signed_in? && current_user.unverified? && !debate.votable_by?(current_user)%>
<div class="anonymous-votes" style='display:none'> <div class="anonymous-votes" style='display:none'>
<p> <p>
<%= t("votes.anonymous", <%= t("votes.anonymous",

View File

@@ -146,6 +146,7 @@ en:
signup: sign up signup: sign up
anonymous: "This debate already has too much anonymous votes, %{verify_account} to vote." anonymous: "This debate already has too much anonymous votes, %{verify_account} to vote."
verify_account: verify your account verify_account: verify your account
organizations: Organizations can not vote
account: account:
show: show:
title: "My account" title: "My account"

View File

@@ -146,6 +146,7 @@ es:
signup: registrarte signup: registrarte
anonymous: "Este debate ya tiene demasiados votos anónimos, para poder votar %{verify_account}." anonymous: "Este debate ya tiene demasiados votos anónimos, para poder votar %{verify_account}."
verify_account: verifica tu cuenta verify_account: verifica tu cuenta
organizations: Las organizaciones no pueden votar
account: account:
show: show:
title: "Mi cuenta" title: "Mi cuenta"