diff --git a/app/views/admin/budget_investments/_written_by_author.html.erb b/app/views/admin/budget_investments/_written_by_author.html.erb
index ec2582fdc..b2bc5b5b5 100644
--- a/app/views/admin/budget_investments/_written_by_author.html.erb
+++ b/app/views/admin/budget_investments/_written_by_author.html.erb
@@ -6,7 +6,6 @@
-
@@ -59,35 +58,3 @@
<%= text_with_links @investment.external_url %>
<% end %>
-
-<%= safe_html_with_links @investment.description %>
-
-
- <%= t("admin.budget_investments.show.image") %>:
-
- <% if @investment.image.present? %>
- <%= link_to t("admin.budget_investments.show.see_image"),
- namespaced_budget_investment_path(@investment, {anchor: "image"}),
- target: "blank" %>
- <% else %>
- <%= t("admin.budget_investments.show.no_image") %>
- <% end %>
-
-
-
- <%= t("admin.budget_investments.show.documents") %>:
-
- <% if @investment.documents.present? %>
- <%= link_to t("admin.budget_investments.show.see_documents",
- count: @investment.documents.count),
- namespaced_budget_investment_path(@investment, {anchor: "documents"}),
- target: "blank" %>
- <% else %>
- <%= t("admin.budget_investments.show.no_documents") %>
- <% end %>
-
-
-
- <%= t("admin.budget_investments.show.user_tags") %>:
- <%= @investment.tag_list.sort.join(", ") %>
-
diff --git a/app/views/admin/budget_investments/show.html.erb b/app/views/admin/budget_investments/show.html.erb
index d364118ca..b77b9216b 100644
--- a/app/views/admin/budget_investments/show.html.erb
+++ b/app/views/admin/budget_investments/show.html.erb
@@ -5,10 +5,19 @@
<%= render "written_by_author" %>
-<%= link_to t("admin.budget_investments.show.edit"),
- edit_admin_budget_budget_investment_path(@budget, @investment,
- Budget::Investment.filter_params(params).to_h) unless @budget.finished? %>
+
<%= t("admin.budget_investments.show.preview") %>
+
+ <%= link_to t("admin.budget_investments.show.edit"),
+ edit_admin_budget_budget_investment_path(
+ @budget,
+ @investment,
+ Budget::Investment.filter_params(params).to_h
+ ),
+ class: "button hollow" unless @budget.finished? %>
+
+
+<%= render partial: "/budgets/investments/investment_detail", locals: {investment: @investment, preview: true} %>
<%= t("admin.budget_investments.show.classification") %>
diff --git a/app/views/budgets/investments/_investment_detail.erb b/app/views/budgets/investments/_investment_detail.erb
index 15c0f3c75..6c49abe38 100644
--- a/app/views/budgets/investments/_investment_detail.erb
+++ b/app/views/budgets/investments/_investment_detail.erb
@@ -7,9 +7,11 @@
•
<%= investment.heading.name %>
•
-
- <%= render "budgets/investments/flag_actions", investment: investment %>
-
+ <% if local_assigns[:preview].nil? %>
+
+ <%= render "budgets/investments/flag_actions", investment: investment %>
+
+ <% end %>
@@ -66,8 +68,10 @@
<%= investment.price_explanation %>
<% end %>
-<%= render "relationable/related_content", relationable: investment %>
+<% if local_assigns[:preview].nil? %>
+ <%= render "relationable/related_content", relationable: investment %>
-
- <%= render "budgets/investments/actions", investment: investment %>
-
+
+ <%= render "budgets/investments/actions", investment: investment %>
+
+<% end %>
diff --git a/app/views/valuation/budget_investments/_dossier_detail.html.erb b/app/views/valuation/budget_investments/_dossier_detail.html.erb
new file mode 100644
index 000000000..04e1b34b0
--- /dev/null
+++ b/app/views/valuation/budget_investments/_dossier_detail.html.erb
@@ -0,0 +1,28 @@
+<% budget = investment.budget %>
+
+
<%= t("valuation.budget_investments.edit.valuation_finished") %>
+
+
+ <%= t("valuation.budget_investments.edit.feasibility") %>:
+ <%= t("admin.budget_investments.index.feasibility.#{investment.feasibility}") %>
+
+
+ <%= t("valuation.budget_investments.edit.feasible_explanation_html") %>:
+ <%= investment.unfeasibility_explanation.presence || "-" %>
+
+
+ <%= t("valuation.budget_investments.edit.price_html", currency: budget.currency_symbol) %>:
+ <%= investment.price.presence || "-" %>
+
+
+ <%= t("valuation.budget_investments.show.price_first_year", currency: budget.currency_symbol) %>:
+ <%= investment.price_first_year.presence || "-" %>
+
+
+ <%= t("valuation.budget_investments.edit.price_explanation_html") %>:
+ <%= investment.price_explanation.presence || "-" %>
+
+
+ <%= t("valuation.budget_investments.edit.duration_html") %>:
+ <%= investment.duration.presence || "-" %>
+
diff --git a/app/views/valuation/budget_investments/_dossier_form.html.erb b/app/views/valuation/budget_investments/_dossier_form.html.erb
new file mode 100644
index 000000000..776bb6e23
--- /dev/null
+++ b/app/views/valuation/budget_investments/_dossier_form.html.erb
@@ -0,0 +1,91 @@
+<% budget = investment.budget %>
+<%= form_for(investment, url: valuate_valuation_budget_budget_investment_path(budget, investment), html: {id: "valuation_budget_investment_edit_form"}) do |f| %>
+ <%= render "shared/errors", resource: investment %>
+
+
+
+
+
+
+
+
+
+
+ <%= f.label :unfeasibility_explanation, t("valuation.budget_investments.edit.feasible_explanation_html") %>
+ <%= f.text_area :unfeasibility_explanation, label: false, rows: 3 %>
+
+
+
+
+
+
+
+
+
+ <%= f.label :price, "#{t("valuation.budget_investments.edit.price_html", currency: budget.currency_symbol)}" %>
+ <%= f.number_field :price, label: false, max: 1000000000000000 %>
+
+
+
+ <%= f.label :price_first_year, "#{t("valuation.budget_investments.edit.price_first_year_html", currency: budget.currency_symbol)}" %>
+ <%= f.number_field :price_first_year, label: false, max: 1000000000000000 %>
+
+
+
+
+
+ <%= f.label :price_explanation, t("valuation.budget_investments.edit.price_explanation_html") %>
+ <%= f.text_area :price_explanation, label: false, rows: 3 %>
+
+
+
+
+
+ <%= f.label :duration, t("valuation.budget_investments.edit.duration_html") %>
+ <%= f.text_field :duration, label: false %>
+
+
+
+
+
+
+
+ <%= f.label :valuation_finished do %>
+ <%= f.check_box :valuation_finished,
+ title: t("valuation.budget_investments.edit.valuation_finished"),
+ label: false, id: "js-investment-report-alert",
+ "data-alert": t("valuation.budget_investments.edit.valuation_finished_alert"),
+ "data-not-feasible-alert": t("valuation.budget_investments.edit.not_feasible_alert") %>
+ <%= t("valuation.budget_investments.edit.valuation_finished") %>
+ <% end %>
+
+
+
+
+
+ <%= f.submit(class: "button expanded large", value: t("valuation.budget_investments.edit.save")) %>
+
+
+<% end %>
diff --git a/app/views/valuation/budget_investments/edit.html.erb b/app/views/valuation/budget_investments/edit.html.erb
index 1077fb43d..463987bce 100644
--- a/app/views/valuation/budget_investments/edit.html.erb
+++ b/app/views/valuation/budget_investments/edit.html.erb
@@ -5,145 +5,17 @@
<%= t("valuation.budget_investments.edit.dossier") %>
<% if can?(:valuate, @investment) %>
- <%= form_for(@investment, url: valuate_valuation_budget_budget_investment_path(@budget, @investment), html: {id: "valuation_budget_investment_edit_form"}) do |f| %>
- <%= render "shared/errors", resource: @investment %>
-
-
-
-
-
-
-
-
-
-
- <%= f.label :unfeasibility_explanation, t("valuation.budget_investments.edit.feasible_explanation_html") %>
- <%= f.text_area :unfeasibility_explanation, label: false, rows: 3 %>
-
-
-
-
-
-
-
-
-
- <%= f.label :price, "#{t("valuation.budget_investments.edit.price_html", currency: @budget.currency_symbol)}" %>
- <%= f.number_field :price, label: false, max: 1000000000000000 %>
-
-
-
- <%= f.label :price_first_year, "#{t("valuation.budget_investments.edit.price_first_year_html", currency: @budget.currency_symbol)}" %>
- <%= f.number_field :price_first_year, label: false, max: 1000000000000000 %>
-
-
-
-
-
- <%= f.label :price_explanation, t("valuation.budget_investments.edit.price_explanation_html") %>
- <%= f.text_area :price_explanation, label: false, rows: 3 %>
-
-
-
-
-
- <%= f.label :duration, t("valuation.budget_investments.edit.duration_html") %>
- <%= f.text_field :duration, label: false %>
-
-
-
-
-
-
-
- <%= f.label :valuation_finished do %>
- <%= f.check_box :valuation_finished,
- title: t("valuation.budget_investments.edit.valuation_finished"),
- label: false, id: "js-investment-report-alert",
- "data-alert": t("valuation.budget_investments.edit.valuation_finished_alert"),
- "data-not-feasible-alert": t("valuation.budget_investments.edit.not_feasible_alert") %>
- <%= t("valuation.budget_investments.edit.valuation_finished") %>
- <% end %>
-
-
-
-
-
- <%= f.submit(class: "button expanded large", value: t("valuation.budget_investments.edit.save")) %>
-
-
- <% end %>
+ <%= render partial: "/valuation/budget_investments/dossier_form", locals: {investment: @investment} %>
<% else %>
-
-
<%= t("valuation.budget_investments.edit.valuation_finished") %>
-
-
- <%= t("valuation.budget_investments.edit.feasibility") %>:
- <%= t("admin.budget_investments.index.feasibility.#{@investment.feasibility}") %>
-
-
- <%= t("valuation.budget_investments.edit.feasible_explanation_html") %>:
- <%= @investment.unfeasibility_explanation.presence || "-" %>
-
-
- <%= t("valuation.budget_investments.edit.price_html", currency: @budget.currency_symbol) %>:
- <%= @investment.price.presence || "-" %>
-
-
- <%= t("valuation.budget_investments.show.price_first_year", currency: @budget.currency_symbol) %>:
- <%= @investment.price_first_year.presence || "-" %>
-
-
- <%= t("valuation.budget_investments.edit.price_explanation_html") %>:
- <%= @investment.price_explanation.presence || "-"%>
-
-
- <%= t("valuation.budget_investments.edit.duration_html") %>:
- <%= @investment.duration.presence || "-" %>
-
+ <%= render partial: "/valuation/budget_investments/dossier_detail", locals: {investment: @investment} %>
<% end %>
<%= render "valuation/budget_investments/valuation_comments" %>
-
<%= @investment.title %>
-
-<%= safe_html_with_links @investment.description %>
-
-
<%= t("valuation.budget_investments.show.info") %>
-
-
<%= t("valuation.budget_investments.show.by") %>:
- <%= link_to @investment.author.name, user_path(@investment.author) %>
-
-
-
<%= t("valuation.budget_investments.show.heading") %>:
- <%= @investment.heading.name %>
-
-
-
<%= t("valuation.budget_investments.show.sent") %>:
- <%= l @investment.created_at, format: :datetime %>
-
+
<%= t("valuation.budget_investments.show.preview") %>
+
+<%= render partial: "/budgets/investments/investment_detail", locals: {investment: @investment, preview: true} %>
+
<%= t("valuation.budget_investments.show.responsibles") %>
diff --git a/app/views/valuation/budget_investments/show.html.erb b/app/views/valuation/budget_investments/show.html.erb
index 3cbcb382b..5e5519a9b 100644
--- a/app/views/valuation/budget_investments/show.html.erb
+++ b/app/views/valuation/budget_investments/show.html.erb
@@ -1,27 +1,27 @@
<%= back_link_to valuation_budget_budget_investments_path %>
-
<%= t("valuation.budget_investments.show.title") %> <%= @investment.id %>
-
<%= @investment.title %>
+
-<%= safe_html_with_links @investment.description %>
+
<%= t("admin.budget_investments.show.preview") %>
+
+ <%= link_to t("admin.budget_investments.show.edit"),
+ edit_valuation_budget_budget_investment_path(
+ @budget,
+ @investment,
+ Budget::Investment.filter_params(params)
+ ),
+ class: "button hollow" unless @budget.finished? %>
+
+
+
+<%= render partial: "/budgets/investments/investment_detail", locals: {investment: @investment, preview: true} %>
+
<% if @investment.external_url.present? %>
<%= text_with_links @investment.external_url %>
<% end %>
-
<%= t("valuation.budget_investments.show.info") %>
-
-
<%= t("valuation.budget_investments.show.by") %>:
- <%= link_to @investment.author.name, user_path(@investment.author) %>
-
-
-
<%= t("valuation.budget_investments.show.heading") %>:
- <%= @investment.heading.name %>
-
-
-
<%= t("valuation.budget_investments.show.sent") %>:
- <%= l @investment.created_at, format: :datetime %>
-
+
<%= t("valuation.budget_investments.show.responsibles") %>
@@ -46,10 +46,14 @@
+
<%= link_to t("valuation.budget_investments.show.edit_dossier"), edit_valuation_budget_budget_investment_path(@budget, @investment) %>
<%= render "dossier" %>
+