114 lines
4.2 KiB
Plaintext
114 lines
4.2 KiB
Plaintext
<section class="budget-investment-show" id="<%= dom_id(investment) %>">
|
|
|
|
<div class="row">
|
|
<div class="small-12 medium-9 column">
|
|
<%= back_link_to budget_investments_path(investment.budget) %>
|
|
|
|
<h1><%= investment.title %></h1>
|
|
|
|
<div class="budget-investment-info">
|
|
<%= render '/shared/author_info', resource: investment %>
|
|
|
|
<span class="bullet"> • </span>
|
|
<%= l investment.created_at.to_date %>
|
|
<span class="bullet"> • </span>
|
|
<%= investment.heading.name %>
|
|
</div>
|
|
|
|
<br>
|
|
<p id="investment_code">
|
|
<%= t("budgets.investments.show.code_html", code: investment.id) %>
|
|
</p>
|
|
|
|
<% if investment.location.present? %>
|
|
<p>
|
|
<%= t("budgets.investments.show.location_html", location: investment.location) %>
|
|
</p>
|
|
<% end %>
|
|
|
|
<% if investment.organization_name.present? %>
|
|
<p>
|
|
<%= t("budgets.investments.show.organization_name_html", name: investment.organization_name) %>
|
|
</p>
|
|
<% end %>
|
|
|
|
<%= render 'shared/tags', taggable: investment %>
|
|
|
|
<%= safe_html_with_links investment.description.html_safe %>
|
|
|
|
<% if investment.external_url.present? %>
|
|
<div class="document-link">
|
|
<%= text_with_links investment.external_url %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% if investment.unfeasible? && investment.unfeasibility_explanation.present? %>
|
|
<h2><%= t('budgets.investments.show.unfeasibility_explanation') %></h2>
|
|
<p><%= investment.unfeasibility_explanation %></p>
|
|
<% end %>
|
|
|
|
<% if investment.feasible? && investment.price_explanation.present? %>
|
|
<h2><%= t('budgets.investments.show.price_explanation') %></h2>
|
|
<p><%= investment.price_explanation %></p>
|
|
<% end %>
|
|
</div>
|
|
|
|
<aside class="small-12 medium-3 column">
|
|
<% if investment.should_show_aside? %>
|
|
<% if investment.should_show_votes? %>
|
|
<div class="sidebar-divider"></div>
|
|
<h2><%= t("budgets.investments.show.supports") %></h2>
|
|
<div class="text-center">
|
|
<div id="<%= dom_id(investment) %>_votes">
|
|
<%= render partial: '/budgets/investments/votes', locals: {
|
|
investment: investment,
|
|
investment_votes: investment_votes,
|
|
vote_url: vote_budget_investment_path(investment.budget, investment, value: 'yes')
|
|
} %>
|
|
</div>
|
|
</div>
|
|
<% elsif investment.should_show_vote_count? %>
|
|
<div class="sidebar-divider"></div>
|
|
<h2><%= t("budgets.investments.show.supports") %></h2>
|
|
<div class="text-center">
|
|
<span class="total-supports">
|
|
<%= t("budgets.investments.investment.supports",
|
|
count: investment.total_votes) %>
|
|
</span>
|
|
</div>
|
|
<% elsif investment.should_show_ballots? %>
|
|
<div class="sidebar-divider"></div>
|
|
<h2><%= t("budgets.investments.show.votes") %></h2>
|
|
<div class="text-center">
|
|
<div id="<%= dom_id(investment) %>_ballot">
|
|
<%= render partial: 'ballot', locals: {
|
|
investment: investment,
|
|
investment_ids: investment_ids,
|
|
ballot: ballot,
|
|
} %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% else %>
|
|
<div class="float-right">
|
|
<span class="label-budget-investment float-left">
|
|
<%= t("budgets.investments.show.title") %>
|
|
</span>
|
|
<span class="icon-budget"></span>
|
|
</div>
|
|
<br>
|
|
<% end %>
|
|
<div id="social-share" class="sidebar-divider"></div>
|
|
<h2><%= t("budgets.investments.show.share") %></h2>
|
|
<div class="social-share-full">
|
|
<%= social_share_button_tag("#{investment.title} #{setting['twitter_hashtag']}") %>
|
|
<% if browser.device.mobile? %>
|
|
<a href="whatsapp://send?text=<%= investment.title %> <%= budget_investment_url(budget_id: investment.budget_id, id: investment.id) %>" data-action="share/whatsapp/share">
|
|
<span class="icon-whatsapp whatsapp"></span>
|
|
</a>
|
|
<% end %>
|
|
</div>
|
|
</aside>
|
|
</div>
|
|
</section>
|