77 lines
2.8 KiB
Plaintext
77 lines
2.8 KiB
Plaintext
<% poll_group.each do |poll| %>
|
|
<div class="poll with-image">
|
|
<% if user_signed_in? && !current_user.unverified? && !poll.votable_by?(current_user) %>
|
|
<div class="icon-poll-answer already-answer" title="<%= t("polls.index.already_answer") %>">
|
|
<span class="show-for-sr"><%= t("polls.index.already_answer") %></span>
|
|
</div>
|
|
<% end %>
|
|
<div class="row" data-equalizer data-equalize-on="medium">
|
|
<div class="small-12 medium-3 column">
|
|
<div class="image-container" data-equalizer-watch>
|
|
<% if poll.image.present? %>
|
|
<%= image_tag poll.image_url(:large), alt: poll.image.title %>
|
|
<% else %>
|
|
<div class="no-image"></div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<div class="small-12 medium-6 column" data-equalizer-watch>
|
|
<div class="dates"></div>
|
|
<% if poll.questions.count == 1 %>
|
|
<% poll.questions.each do |question| %>
|
|
<h4>
|
|
<% if poll.results_enabled? %>
|
|
<%= link_to question.title, results_poll_path(poll) %>
|
|
<% elsif poll.stats_enabled? %>
|
|
<%= link_to question.title, stats_poll_path(poll) %>
|
|
<% else %>
|
|
<%= link_to question.title, poll %>
|
|
<% end %>
|
|
</h4>
|
|
<%= poll_dates(poll) %>
|
|
<% end %>
|
|
<% else %>
|
|
<h4>
|
|
<% if poll.results_enabled? %>
|
|
<%= link_to poll.name, results_poll_path(poll) %>
|
|
<% elsif poll.stats_enabled? %>
|
|
<%= link_to poll.name, stats_poll_path(poll) %>
|
|
<% else %>
|
|
<%= link_to poll.name, poll %>
|
|
<% end %>
|
|
</h4>
|
|
<%= poll_dates(poll) %>
|
|
<ul class="margin-top">
|
|
<% poll.questions.each do |question| %>
|
|
<li><%= question.title %></li>
|
|
<% end %>
|
|
</ul>
|
|
<% end %>
|
|
<% if poll.geozones.any? %>
|
|
<p>
|
|
<small><%= t("polls.index.geozone_info") %></small>
|
|
</p>
|
|
<% end %>
|
|
<ul class="no-bullet inline-block tags">
|
|
<% poll.geozones.each do |g| %>
|
|
<li class="inline-block"><span><%= g.name %></span></li>
|
|
<% end %>
|
|
</ul>
|
|
</div>
|
|
<div class="small-12 medium-3 column table" data-equalizer-watch>
|
|
<div class="table-cell aling-middle">
|
|
<%= link_to poll, class: "button hollow expanded" do %>
|
|
<% if poll.expired? %>
|
|
<%= t("polls.index.participate_button_expired") %>
|
|
<% elsif poll.incoming? %>
|
|
<%= t("polls.index.participate_button_incoming") %>
|
|
<% else %>
|
|
<%= t("polls.index.participate_button") %>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|