adds simple investment show view to admin

valuators info is missing
This commit is contained in:
Juanjo Bazán
2016-09-06 17:04:31 +02:00
parent 31ef3f4c98
commit 6542812647
5 changed files with 125 additions and 5 deletions

View File

@@ -0,0 +1,36 @@
<div class="callout primary float-right">
<%= t "admin.budget_investments.show.info", budget_name: @budget.name, group_name: @investment.group.name, id: @investment.id %>
</div>
<br>
<h1 class="inline-block"><%= @investment.title %></h1>
<div class="row small-collapse spending-proposal-info">
<div class="small-12 medium-4 column">
<p title="<%= t("admin.budget_investments.show.group") %>: <%= @investment.group.name %>">
<strong><%= t("admin.budget_investments.show.heading") %>:</strong>
<%= @investment.heading.name %>
</p>
</div>
<div class="small-12 medium-4 column">
<p>
<strong><%= t("admin.budget_investments.show.by") %>:</strong>
<%= link_to @investment.author.name, admin_user_path(@investment.author) %>
</p>
</div>
<div class="small-12 medium-4 column">
<p>
<strong><%= t("admin.budget_investments.show.sent") %>:</strong>
<%= l @investment.created_at, format: :datetime %>
</p>
</div>
</div>
<% if @investment.external_url.present? %>
<p><%= text_with_links @investment.external_url %>&nbsp;<span class="icon-external small"></span></p>
<% end %>
<%= safe_html_with_links @investment.description %>

View File

@@ -1 +1,49 @@
<%= @investment.title %>
<%= link_to admin_budget_budget_investments_path(Budget::Investment.filter_params(params)), data: {no_turbolink: true} do %>
<span class="icon-angle-left"></span> <%= t("shared.back") %>
<% end %>
<%= render 'written_by_author' %>
<%= link_to t("admin.budget_investments.show.edit"),
admin_budget_budget_investment_path(@budget, @investment,
Budget::Investment.filter_params(params)) %>
<hr>
<h2 id="classification"><%= t("admin.budget_investments.show.classification") %></h2>
<p><strong><%= t("admin.budget_investments.show.assigned_admin") %>:</strong>
<%= @investment.administrator.try(:name_and_email) || t("admin.budget_investments.show.undefined") %>
</p>
<p id="tags">
<strong><%= t("admin.budget_investments.show.tags") %>:</strong>
<%= @investment.tags.pluck(:name).join(', ') %>
</p>
<p id="assigned_valuators">
<strong><%= t("admin.budget_investments.show.assigned_valuators") %>:</strong>
<% if @investment.valuators.any? %>
<%= @investment.valuators.collect(&:name_and_email).join(', ') %>
<% else %>
<%= t("admin.budget_investments.show.undefined") %>
<% end %>
</p>
<p>
<%= link_to t("admin.budget_investments.show.edit_classification"),
edit_admin_spending_proposal_path(@investment,
{anchor: 'classification'}.merge(Budget::Investment.filter_params(params))) %>
</p>
<hr>
<h2><%= t("admin.budget_investments.show.dossier") %></h2>
<%# render 'valuation/budget_investments/written_by_valuators' %>
<p>
<%= link_to t("admin.budget_investments.show.edit_dossier"), edit_valuation_spending_proposal_path(@investment) %>
</p>