Files
nairobi/app/views/budgets/investments/_investment_detail.html.erb
Javi Martín a2e4b056ee Move documents partials to components
This way it'll be easier to change them.

Note that there were two `.document-link` elements which aren't part of
a `.documents` element. We're renaming the HTML class of the link in
investments because it didn't contain links to download documents and
are slightly duplicating the CSS in the poll answer documents in order
to keep the `word-wrap` property.
2023-10-23 18:10:24 +02:00

78 lines
2.4 KiB
Plaintext

<h1><%= investment.title %></h1>
<div class="budget-investment-info">
<%= render "/shared/author_info", resource: investment %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= l investment.created_at.to_date %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= render Shared::CommentsCountComponent.new(investment.comments_count, url: "#comments") %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= investment.heading.name %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<% if local_assigns[:preview].nil? %>
<span class="js-flag-actions">
<%= render "shared/flag_actions", flaggable: investment %>
</span>
<% end %>
</div>
<br>
<%= render_image(investment.image, :large, true) if investment.image.present? %>
<p id="investment_code">
<%= sanitize(t("budgets.investments.show.code", code: investment.id)) %>
</p>
<%= auto_link_already_sanitized_html wysiwyg(investment.description) %>
<% if feature?(:map) && map_location_available?(@investment.map_location) %>
<div class="margin">
<%= render_map(investment.map_location) %>
</div>
<% end %>
<% if investment.location.present? %>
<p>
<%= sanitize(t("budgets.investments.show.location", location: investment.location)) %>
</p>
<% end %>
<% if investment.organization_name.present? %>
<p>
<%= sanitize(t("budgets.investments.show.organization_name", name: investment.organization_name)) %>
</p>
<% end %>
<% if feature?(:allow_attached_documents) %>
<%= render Documents::DocumentsComponent.new(investment.documents) %>
<% end %>
<%= render "shared/tags", taggable: investment %>
<% if investment.external_url.present? %>
<div class="investment-external-link">
<%= sanitize_and_auto_link investment.external_url %>
</div>
<% end %>
<% if investment.should_show_unfeasibility_explanation? %>
<h2><%= t("budgets.investments.show.unfeasibility_explanation") %></h2>
<p><%= investment.unfeasibility_explanation %></p>
<% end %>
<% if investment.should_show_price_explanation? %>
<h2 id="price_explanation" data-magellan-target="price_explanation">
<%= t("budgets.investments.show.price_explanation") %>
</h2>
<p><%= investment.price_explanation %></p>
<% end %>
<% if local_assigns[:preview].nil? %>
<%= render "relationable/related_content", relationable: investment %>
<div class="js-moderator-investment-actions margin">
<%= render "budgets/investments/actions", investment: investment %>
</div>
<% end %>