mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-01-20 22:47:59 +01:00
48 lines
1.6 KiB
Text
48 lines
1.6 KiB
Text
<div class="block__header block__header--js-tabbed">
|
|
<%= link("Voting", to: "#", class: "selected", data: [click_tab: "voting"]) %>
|
|
<%= if can?(@conn, :hide, @topic) do %>
|
|
<%= link("Voters", to: "#", data: [click_tab: "voters", load_tab: ~p"/forums/#{@forum}/topics/#{@topic}/poll/votes"]) %>
|
|
<%= link("Administrate", to: "#", data: [click_tab: "administration"]) %>
|
|
<% end %>
|
|
</div>
|
|
<div class="block__tab" data-tab="voting">
|
|
<%= cond do %>
|
|
<% @poll.hidden_from_users -> %>
|
|
<div class="walloftext"></div>
|
|
<div class="block block--fixed block--warning">
|
|
<h1>
|
|
This poll has been deleted
|
|
</h1>
|
|
<p>
|
|
Reason:
|
|
<strong>
|
|
<%= @poll.deletion_reason || "Unknown (likely deleted in error). Please contact a moderator." %>
|
|
</strong>
|
|
</p>
|
|
</div>
|
|
<% @poll_active and not @voted and not is_nil(@conn.assigns.current_user) -> %>
|
|
<div class="poll">
|
|
<div class="poll-area">
|
|
<%= render(PhilomenaWeb.Topic.PollView, "_vote_form.html", assigns) %>
|
|
</div>
|
|
</div>
|
|
<% true -> %>
|
|
<div class="poll">
|
|
<div class="poll-area">
|
|
<%= render(PhilomenaWeb.Topic.PollView, "_results.html", assigns) %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<%= if can?(@conn, :hide, @topic) do %>
|
|
<div class="block__tab hidden" data-tab="voters">
|
|
<p>
|
|
Loading…
|
|
</p>
|
|
</div>
|
|
<div class="block__tab hidden" data-tab="administration">
|
|
<a class="button button--state-warning js-staff-action" href={~p"/forums/#{@forum}/topics/#{@topic}/poll/edit"}>
|
|
<i class="fa fa-edit"></i> Edit
|
|
</a>
|
|
</div>
|
|
<% end %>
|