Files
grecia/app/views/dashboard/polls/_poll.html.erb
Juan Salvador Pérez García 4b8cc85c49 Fixes #234
View questions now is View results and redirects to results
in public view.

Fixed flaky spec that was making the tests fail.

Added missing specs for polls feature as well as poll model.
2018-07-19 17:15:05 +02:00

44 lines
1.5 KiB
Plaintext

<div class="column poll-card" id="<%= dom_id(poll) %>">
<div class="card">
<div class="card-section">
<p class="text-right">
<a href='#' class="button round hollow clipboard-btn" data-clipboard-text="<%= poll_url(poll) %>">
<i class="fi-clipboard-notes"></i>
</a>
</p>
<h4 class="text-center"><%= poll.title %></h4>
<p class="text-center">
<%= t('.published_on') %>
<%= l(poll.starts_at.to_date) %>
</p>
</div>
<div class="card-section text-center">
<strong><%= t('.responses', count: poll.questions.count) %></strong>
</div>
<div class="card-section text-center">
<% if poll.incoming? %>
<%= link_to t('.edit_poll'), edit_proposal_dashboard_poll_path(proposal, poll), class: 'button hollow' %>
<% else %>
<%= link_to t('.view_results'), results_poll_path(poll), class: 'button', target: '_blank' %>
<% end %>
</div>
<div class="card-section">
<p>
<%= best_in_place poll,
:results_enabled,
as: :checkbox,
url: proposal_dashboard_poll_url(proposal, poll),
collection: {
false: raw('<input type="checkbox">'),
true: raw('<input type="checkbox" checked>')
} %>
<strong><%= t('.show_results') %></strong>
</p>
<p class="help-text"><%= t('.show_results_help') %></p>
</div>
</div>
</div>