diff --git a/app/helpers/valuation_helper.rb b/app/helpers/valuation_helper.rb index cd70a6732..9e3a054c1 100644 --- a/app/helpers/valuation_helper.rb +++ b/app/helpers/valuation_helper.rb @@ -23,4 +23,8 @@ module ValuationHelper end end + def explanation_field(field) + simple_format_no_tags_no_sanitize(safe_html_with_links(field.html_safe)) if field.present? + end + end \ No newline at end of file diff --git a/app/views/valuation/spending_proposals/show.html.erb b/app/views/valuation/spending_proposals/show.html.erb index e98968fee..16f83dbe4 100644 --- a/app/views/valuation/spending_proposals/show.html.erb +++ b/app/views/valuation/spending_proposals/show.html.erb @@ -65,7 +65,8 @@ <%= t("valuation.spending_proposals.show.price_first_year") %> (<%= t("valuation.spending_proposals.show.currency") %>): <%= @spending_proposal.price_first_year.presence or t("valuation.spending_proposals.show.undefined") %>
-<%= simple_format(safe_html_with_links(@spending_proposal.price_explanation.html_safe), {}, sanitize: false) if @spending_proposal.price_explanation.present? %> + +<%= explanation_field @spending_proposal.price_explanation %><%= t("valuation.spending_proposals.show.time_scope") %>: @@ -77,7 +78,7 @@ <%= t("valuation.spending_proposals.show.#{@spending_proposal.feasibility}") %>
-<%= simple_format_no_tags_no_sanitize(safe_html_with_links(@spending_proposal.feasible_explanation.html_safe)) if @spending_proposal.feasible_explanation.present? %> +<%= explanation_field @spending_proposal.feasible_explanation %> <% if @spending_proposal.valuation_finished %>