<%= link_to admin_spending_proposals_path(SpendingProposal.filter_params(params)), data: {no_turbolink: true} do %>
  <span class="icon-angle-left"></span> <%= t("admin.spending_proposals.show.back") %>
<% end %>

<%= render 'written_by_author' %>

<%= link_to t("admin.spending_proposals.show.edit"),
              edit_admin_spending_proposal_path(@spending_proposal,
                                                SpendingProposal.filter_params(params)) %>

<hr>

<h2 id="classification"><%= t("admin.spending_proposals.show.classification") %></h2>

<p><strong><%= t("admin.spending_proposals.show.assigned_admin") %>:</strong>
  <%= @spending_proposal.administrator.try(:name_and_email) || t("admin.spending_proposals.show.undefined") %>
</p>

<p id="tags">
  <strong><%= t("admin.spending_proposals.show.tags") %>:</strong>

  <%= @spending_proposal.tags.pluck(:name).join(', ') %>
</p>

<p id="assigned_valuators">
  <strong><%= t("admin.spending_proposals.show.assigned_valuators") %>:</strong>
  <% if @spending_proposal.valuators.any? %>
    <%= @spending_proposal.valuators.collect(&:name_and_email).join(', ') %>
  <% else %>
    <%= t("admin.spending_proposals.show.undefined") %>
  <% end %>
</p>

<p>
  <%= link_to t("admin.spending_proposals.show.edit_classification"),
                edit_admin_spending_proposal_path(@spending_proposal,
                                                  {anchor: 'classification'}.merge(SpendingProposal.filter_params(params))) %>
</p>

<hr>

<h2><%= t("admin.spending_proposals.show.dossier") %></h2>

<%= render 'valuation/spending_proposals/written_by_valuators' %>

<p>
  <%= link_to t("admin.spending_proposals.show.edit_dossier"), edit_valuation_spending_proposal_path(@spending_proposal) %>
</p>

