<%= back_link_to valuation_budget_budget_investments_path %>

<h2><%= t("valuation.budget_investments.show.title") %> <%= @investment.id %> </h2>
<h1><%= @investment.title %></h1>

<%= safe_html_with_links @investment.description %>

<% if @investment.external_url.present? %>
  <p><%= text_with_links @investment.external_url %></p>
<% end %>

<h2><%= t("valuation.budget_investments.show.info") %></h2>

<p><strong><%= t("valuation.budget_investments.show.by") %>:</strong>
  <%= link_to @investment.author.name, user_path(@investment.author) %>
</p>

<p><strong><%= t("valuation.budget_investments.show.heading") %>:</strong>
  <%= @investment.heading.name %>
</p>

<p><strong><%= t("valuation.budget_investments.show.sent") %>:</strong>
  <%= l @investment.created_at, format: :datetime %>
</p>

<h2><%= t("valuation.budget_investments.show.responsibles") %></h2>

<p><strong><%= t("valuation.budget_investments.show.assigned_admin") %>:</strong>
  <% if @investment.administrator.present? %>
    <%= @investment.administrator.name_and_email %>
  <% else %>
    <%= t("valuation.budget_investments.show.undefined") %>
  <% end %>
</p>

<p><strong><%= t("valuation.budget_investments.show.assigned_valuators") %>:</strong></p>
<div id="assigned_valuators">
  <ul>
    <% @investment.valuators.each do |valuator| %>
      <li><%= valuator.name_and_email %></li>
    <% end %>

    <% if @investment.valuators.empty? %>
      <li><%= t("valuation.budget_investments.show.undefined") %></li>
    <% end %>
  </ul>
</div>

<h2><%= t("valuation.budget_investments.show.dossier") %></h2>
<p>
  <%= link_to t("valuation.budget_investments.show.edit_dossier"), edit_valuation_budget_budget_investment_path(@budget, @investment) %>
</p>
<%= render 'dossier' %>

<%= render 'valuation/budget_investments/valuation_comments' %>
