Files
nairobi/app/views/proposals/share.html.erb
Javi Martín b98244afd9 Remove votes query optimizations
Just like we did in commit 0214184b2d for investments, we're removing
some possible optimizations (we don't have any benchmarks proving they
affect performance at all) in order to simplify the code.

The investement votes component `delegate` code was accidentally left
but isn't used since commit 0214184b2, so we're removing it now that
we're removing the `voted_for?` helper method.
2022-02-21 18:47:13 +01:00

60 lines
1.9 KiB
Plaintext

<% provide :title do %><%= @proposal.title %><% end %>
<% provide :social_media_meta_tags do %>
<%= render "shared/social_media_meta_tags",
social_url: proposal_url(@proposal),
social_title: @proposal.title,
social_description: @proposal.summary %>
<% end %>
<% content_for :canonical do %>
<%= render "shared/canonical", href: proposal_url(@proposal) %>
<% end %>
<% cache [locale_and_user_status(@proposal),
@proposal,
@proposal.author,
Flag.flagged?(current_user, @proposal),
current_user&.voted_for?(@proposal)] do %>
<div id="<%= dom_id(@proposal) %>" class="row">
<div class="small-12 medium-8 column">
<h1><%= t("proposals.proposal.created") %></h1>
<p>
<span class="lead"><%= t("proposals.proposal.share.guide") %></span><br>
<%= t("proposals.proposal.share.edit") %>
</p>
<%= render "shared/social_share",
title: @proposal.title,
url: proposal_url(@proposal),
description: @proposal.summary,
mobile: @proposal.title %>
<% if can?(:dashboard, @proposal) %>
<div class="callout light margin">
<p class="text-center">
<strong><%= t("proposals.share.improve_it") %></strong>
</p>
<div class="small-12 medium-6 large-4 column small-centered">
<%= link_to t("proposals.share.dashboard"),
progress_proposal_dashboard_path(@proposal), class: "button expanded" %>
</div>
</div>
<% end %>
<div class="small margin-bottom">
<%= link_to t("proposals.proposal.share.view_proposal"), proposal_path(@proposal) %>
</div>
</div>
<div class="small-12 medium-4 column">
<div class="callout light">
<p>
<strong><%= @proposal.title %></strong><br>
<%= t("proposals.show.code") %> <%= @proposal.code %>
</p>
</div>
</div>
</div>
<% end %>