<%= link_to resource_locator(election).path do %>
<%= content_tag :h3,
present(election).title,
class: "h5 text-secondary hover:underline",
title: t("polling_station.election", scope: "decidim.votings.polling_officer_zone.polling_officers.index") %>
<%= content_tag :span,
present(polling_officer.voting).title,
class: "text-sm text-gray-2",
title: t("polling_station.voting", scope: "decidim.votings.polling_officer_zone.polling_officers.index") %>
<%= content_tag :span,
t(polling_officer.role, scope: "decidim.votings.polling_officers.roles"),
title: t("polling_station.role", scope: "decidim.votings.polling_officer_zone.polling_officers.index"),
class: "ml-auto label#{" success" if polling_officer.role == :president}" %>
<% end %>
<% if polling_officer.polling_station %>
<%= content_tag :span,
present(polling_officer.polling_station).title,
class: "font-semibold",
title: t("polling_station.name", scope: "decidim.votings.polling_officer_zone.polling_officers.index") %>
<%= content_tag :span,
present(polling_officer.polling_station).address,
class: "text-sm text-gray-2",
title: t("polling_station.address", scope: "decidim.votings.polling_officer_zone.polling_officers.index") %>
<%= link_to t("polling_station.identify_person", scope: "decidim.votings.polling_officer_zone.polling_officers.index"),
new_polling_officer_election_in_person_vote_path(polling_officer, election),
class: "button button__sm button__transparent-secondary" %>
<% closure = polling_officer.polling_station.closures.find_by(election:) %>
<% if closure %>
<% if closure.results_phase? %>
<%= link_to t("polling_station.count_votes", scope: "decidim.votings.polling_officer_zone.polling_officers.index"),
edit_polling_officer_election_closure_path(polling_officer, election),
class: "button button__sm button__transparent-secondary" %>
<% else %>
<%= link_to t("polling_station.show_closure", scope: "decidim.votings.polling_officer_zone.polling_officers.index"),
polling_officer_election_closure_path(polling_officer, election),
class: "button button__sm button__secondary" %>
<% end %>
<% else %>
<%= link_to t("polling_station.count_votes", scope: "decidim.votings.polling_officer_zone.polling_officers.index"),
new_polling_officer_election_closure_path(polling_officer, election),
class: "button button__sm button__secondary" %>
<% end %>
<% end %>