<% provide :title, @proposal.title %>
<% 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 %>
