adds simple investment show view to admin
valuators info is missing
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
class Admin::BudgetInvestmentsController < Admin::BaseController
|
||||
|
||||
before_action :load_budget, only: [:index, :show]
|
||||
|
||||
has_filters %w{valuation_open without_admin managed valuating valuation_finished all}, only: :index
|
||||
|
||||
def index
|
||||
@budget = Budget.includes(:groups).find params[:budget_id]
|
||||
@investments = @budget.investments.scoped_filter(params, @current_filter).order(cached_votes_up: :desc, created_at: :desc).page(params[:page])
|
||||
@investments = Budget::Investment.scoped_filter(params, @current_filter).order(cached_votes_up: :desc, created_at: :desc).page(params[:page])
|
||||
end
|
||||
|
||||
def show
|
||||
@budget = Budget.includes(:groups).find params[:budget_id]
|
||||
@investment = @budget.investments.find params[:id]
|
||||
@investment = Budget::Investment.where(budget_id: @budget.id).find params[:id]
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def load_budget
|
||||
@budget = Budget.includes(:groups).find params[:budget_id]
|
||||
end
|
||||
|
||||
end
|
||||
@@ -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 %> <span class="icon-external small"></span></p>
|
||||
<% end %>
|
||||
|
||||
<%= safe_html_with_links @investment.description %>
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -114,6 +114,21 @@ en:
|
||||
feasible: "Feasible (%{price})"
|
||||
not_feasible: "Not feasible"
|
||||
undefined: "Undefined"
|
||||
show:
|
||||
assigned_admin: Assigned administrator
|
||||
assigned_valuators: Assigned valuators
|
||||
classification: Clasification
|
||||
info: "%{budget_name} - Group: %{group_name} - Investment project %{id}"
|
||||
edit: Edit
|
||||
edit_classification: Edit classification
|
||||
by: By
|
||||
sent: Sent
|
||||
group: Grupo
|
||||
heading: Partida
|
||||
dossier: Dossier
|
||||
edit_dossier: Edit dossier
|
||||
tags: Tags
|
||||
undefined: Undefined
|
||||
comments:
|
||||
index:
|
||||
filter: Filter
|
||||
|
||||
@@ -114,6 +114,21 @@ es:
|
||||
feasible: "Viable (%{price})"
|
||||
not_feasible: "Inviable"
|
||||
undefined: "Sin definir"
|
||||
show:
|
||||
assigned_admin: Administrador asignado
|
||||
assigned_valuators: Evaluadores asignados
|
||||
classification: Clasificación
|
||||
info: "%{budget_name} - Grupo: %{group_name} - Propuesta de inversión %{id}"
|
||||
edit: Editar
|
||||
edit_classification: Editar clasificación
|
||||
by: Autor
|
||||
sent: Fecha
|
||||
group: Grupo
|
||||
heading: Partida
|
||||
dossier: Informe
|
||||
edit_dossier: Editar informe
|
||||
tags: Etiquetas
|
||||
undefined: Sin definir
|
||||
comments:
|
||||
index:
|
||||
filter: Filtro
|
||||
|
||||
Reference in New Issue
Block a user