cleans up show view

This commit is contained in:
Juanjo Bazán
2016-03-08 13:40:35 +01:00
parent 1cbd1f9324
commit 7231f72e01
2 changed files with 25 additions and 12 deletions

View File

@@ -11,4 +11,8 @@ module TextWithLinksHelper
Rinku.auto_link(html, :all, 'target="_blank" rel="nofollow"').html_safe
end
def simple_format_no_tags_no_sanitize(html)
simple_format(html, {}, sanitize: false)
end
end

View File

@@ -53,30 +53,39 @@
<h2><%= t("valuation.spending_proposals.show.dossier") %></h2>
<p><%= link_to t("valuation.spending_proposals.show.edit_dossier"), edit_valuation_spending_proposal_path(@spending_proposal) %></p>
<p id="price"><strong><%= t("valuation.spending_proposals.show.price") %> (<%= t("valuation.spending_proposals.show.currency") %>):</strong>
<%= @spending_proposal.price.present? ? @spending_proposal.price : t("valuation.spending_proposals.show.undefined") %>
<p>
<%= link_to t("valuation.spending_proposals.show.edit_dossier"), edit_valuation_spending_proposal_path(@spending_proposal) %>
</p>
<p id="price_first_year"><strong><%= t("valuation.spending_proposals.show.price_first_year") %> (<%= t("valuation.spending_proposals.show.currency") %>):</strong>
<%= @spending_proposal.price_first_year.present? ? @spending_proposal.price_first_year : t("valuation.spending_proposals.show.undefined") %>
<p id="price">
<strong><%= t("valuation.spending_proposals.show.price") %> (<%= t("valuation.spending_proposals.show.currency") %>):</strong>
<%= @spending_proposal.price.presence or t("valuation.spending_proposals.show.undefined") %>
</p>
<p id="price_first_year">
<strong><%= t("valuation.spending_proposals.show.price_first_year") %> (<%= t("valuation.spending_proposals.show.currency") %>):</strong>
<%= @spending_proposal.price_first_year.presence or t("valuation.spending_proposals.show.undefined") %>
</p>
<%= simple_format(safe_html_with_links(@spending_proposal.price_explanation.html_safe), {}, sanitize: false) if @spending_proposal.price_explanation.present? %>
<p id="time_scope"><strong><%= t("valuation.spending_proposals.show.time_scope") %>:</strong>
<%= @spending_proposal.time_scope.present? ? @spending_proposal.time_scope : t("valuation.spending_proposals.show.undefined") %>
<p id="time_scope">
<strong><%= t("valuation.spending_proposals.show.time_scope") %>:</strong>
<%= @spending_proposal.time_scope.presence or t("valuation.spending_proposals.show.undefined") %>
</p>
<p id="feasibility"><strong><%= t("valuation.spending_proposals.show.feasibility") %>:</strong>
<p id="feasibility">
<strong><%= t("valuation.spending_proposals.show.feasibility") %>:</strong>
<%= t("valuation.spending_proposals.show.#{@spending_proposal.feasibility}") %>
</p>
<%= simple_format(safe_html_with_links(@spending_proposal.feasible_explanation.html_safe), {}, sanitize: false) if @spending_proposal.feasible_explanation.present? %>
<%= simple_format_no_tags_no_sanitize(safe_html_with_links(@spending_proposal.feasible_explanation.html_safe)) if @spending_proposal.feasible_explanation.present? %>
<% if @spending_proposal.valuation_finished %>
<p><strong><%= t("valuation.spending_proposals.show.valuation_finished") %></strong>
<p>
<strong><%= t("valuation.spending_proposals.show.valuation_finished") %></strong>
</p>
<% end %>
<% if @spending_proposal.internal_comments.present? %>
<h2><%= t("valuation.spending_proposals.show.internal_comments") %></h2>
<%= simple_format(safe_html_with_links(@spending_proposal.internal_comments.html_safe), {}, sanitize: false) %>
<%= simple_format_no_tags_no_sanitize(safe_html_with_links(@spending_proposal.internal_comments.html_safe)) %>
<% end %>