adds icon if already answer poll

This commit is contained in:
Alberto Garcia Cabeza
2017-02-03 17:43:44 +01:00
parent 54472852ca
commit 46d9961c36
4 changed files with 29 additions and 9 deletions

View File

@@ -1382,6 +1382,7 @@ ul.ballot-list {
&.can-answer:after,
&.cant-answer:after,
&.not-logged-in:after,
&.already-answer:after,
&.unverified:after {
font-family: "icons" !important;
left: 34px;
@@ -1390,20 +1391,20 @@ ul.ballot-list {
}
&.can-answer {
border-right: 60px solid $success-bg;
border-right: 60px solid $info-bg;
&:after {
color: $color-success;
content: "\59";
color: $color-info;
content: "\6c";
}
}
&.cant-answer {
border-right: 60px solid $warning-bg;
border-right: 60px solid $alert-bg;
&:after {
color: $color-warning;
content: "\76";
color: $color-alert;
content: "\74";
}
}
@@ -1424,6 +1425,15 @@ ul.ballot-list {
content: "\6f";
}
}
&.already-answer {
border-right: 60px solid $success-bg;
&:after {
color: $color-success;
content: "\59";
}
}
}
.dates {

View File

@@ -1,9 +1,13 @@
<% poll_group.each do |poll| %>
<div class="poll">
<% if poll.answerable_by?(current_user) && poll.votable_by?(current_user) %>
<div class="icon-poll-answer can-answer" title="<%= t("polls.index.can_answer") %>">
<span class="sr-only"><%= t("polls.index.can_answer") %></span>
</div>
<%= link_to poll,
class: "icon-poll-answer can-answer",
title: t("polls.index.can_answer") do %>
<span class="sr-only">
<%= t("polls.index.can_answer") %>
</span>
<% end %>
<% elsif current_user.nil? %>
<%= link_to new_user_session_path,
class: "icon-poll-answer not-logged-in",
@@ -20,6 +24,10 @@
<%= t("polls.index.cant_answer_verify") %>
</span>
<% end %>
<% elsif !poll.votable_by?(current_user) %>
<div class="icon-poll-answer already-answer" title="<%= t("polls.index.already_answer") %>">
<span class="sr-only"><%= t("polls.index.already_answer") %></span>
</div>
<% else %>
<div class="icon-poll-answer cant-answer" title="<%= t("polls.index.cant_answer") %>">
<span class="sr-only"><%= t("polls.index.cant_answer") %></span>

View File

@@ -410,6 +410,7 @@ en:
cant_answer: "This poll is not available on your geozone"
cant_answer_not_logged_in: "You must sign in or sign up to participate"
cant_answer_verify: "You must verify your account in order to answer"
already_answer: "You already have participated in this poll"
show:
dates_title: "Participation dates"
cant_answer_not_logged_in: "You must %{signin} or %{signup} to participate."

View File

@@ -410,6 +410,7 @@ es:
cant_answer: "Esta votación no está disponible en tu zona"
cant_answer_not_logged_in: "Necesitas iniciar sesión o registrarte para participar"
cant_answer_verify: "Por favor verifica tu cuenta para poder responder"
already_answer: "Ya has participado en esta votación"
show:
dates_title: "Fechas de participación"
cant_answer_not_logged_in: "Necesitas %{signin} o %{signup} para participar."