Added check in poll card that allows setting the value of results_enabled flag. Access to stats/results now is controlled with abilities. Polls related to proposals will be accessible to the proposal author like they were administrators.
46 lines
1.5 KiB
Plaintext
46 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 'Editar encuesta', edit_proposal_dashboard_poll_path(proposal, poll), class: 'button hollow' %>
|
|
<% else %>
|
|
<a href='#' class="button">
|
|
<%= t('.view_responses') %>
|
|
</a>
|
|
<% 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>
|
|
|