diff --git a/app/views/proposals/_preview.html.erb b/app/views/proposals/_preview.html.erb deleted file mode 100644 index b1b0c45e1..000000000 --- a/app/views/proposals/_preview.html.erb +++ /dev/null @@ -1,206 +0,0 @@ -<% provide :title do %><%= @proposal.title %><% end %> -<% content_for :meta_description do %><%= @proposal.summary %><% 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, - twitter_image_url: (@proposal.image.present? ? @proposal.image_url(:thumb) : nil), - og_image_url: (@proposal.image.present? ? @proposal.image_url(:thumb) : nil) %> -<% 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), @proposal_votes] do %> -
-
-
- <%= back_link_to proposals_path unless preview %> - -

<%= @proposal.title %>

- <% if @proposal.retired? %> -
- - <%= t("proposals.show.retired_warning") %>
- <%= link_to t("proposals.show.retired_warning_link_to_explanation"), "#retired_explanation" %> -
-
- <% elsif @proposal.conflictive? %> -
- <%= t("proposals.show.flag") %> -
- <% end %> - -
- <%= render '/shared/author_info', resource: @proposal %> - -  •  - <%= l @proposal.created_at.to_date %> -  •  -   - <%= link_to t("proposals.show.comments", count: @proposal.comments_count), "#comments" %> - - <% if current_user %> -  •  - - <%= render 'proposals/flag_actions', proposal: @proposal %> - - <% end %> - -
- - <%= render_image(@proposal.image, :large, true) if @proposal.image.present? %> - -
-

- <%= t("proposals.show.code") %> - <%= @proposal.code %> -

- -
<%= @proposal.summary %>
- - <% if @proposal.video_url.present? %> -
-
-
-
-
- <% end %> - - <%= safe_html_with_links @proposal.description %> - - <% if feature?(:map) && map_location_available?(@proposal.map_location) %> -
- <%= render_map(@proposal.map_location, "proposal", false, nil) %> -
- <% end %> - - <% if @proposal.external_url.present? %> - - <% end %> - - <% if @proposal.video_url.present? %> - - - <% end %> - -

<%= @proposal.question %>

- - <% if @proposal.retired? %> -
-

<%= t('proposals.show.retired') %>: <%= t("proposals.retire_options.#{@proposal.retired_reason}") unless @proposal.retired_reason == 'other' %>

- <%= simple_format text_with_links(@proposal.retired_explanation), {}, sanitize: false %> -
- <% end %> - - <% if feature?(:allow_attached_documents) %> - <%= render 'documents/documents', - documents: @proposal.documents, - max_documents_allowed: Proposal.max_documents_allowed %> - <% end %> - - <%= render 'shared/tags', taggable: @proposal %> - - <%= render 'shared/geozone', geozonable: @proposal %> - - <%= render 'relationable/related_content', relationable: @proposal %> - -
- <%= render 'proposals/actions', proposal: @proposal %> -
-
- - <% unless preview %> - - <% end %> -
-
-<% end %> - -<% unless preview %> -
-
- <%= render "proposals/filter_subnav" %> -
-
- -
- - - <%= render "proposals/notifications" %> -
-<% end %> diff --git a/app/views/proposals/created.html.erb b/app/views/proposals/created.html.erb index bd9cdfd3d..eaccb7d41 100644 --- a/app/views/proposals/created.html.erb +++ b/app/views/proposals/created.html.erb @@ -17,4 +17,4 @@ -<%= render 'preview', preview: true %> +<%= render file: 'proposals/show.html.erb', locals: { preview: true } %> diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb index 82a9fd624..f22e2ca9f 100644 --- a/app/views/proposals/show.html.erb +++ b/app/views/proposals/show.html.erb @@ -1,9 +1,108 @@ +<% preview = false unless local_assigns.has_key? :preview %> +<% provide :title do %><%= @proposal.title %><% end %> +<% content_for :meta_description do %><%= @proposal.summary %><% 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, + twitter_image_url: (@proposal.image.present? ? @proposal.image_url(:thumb) : nil), + og_image_url: (@proposal.image.present? ? @proposal.image_url(:thumb) : nil) %> +<% 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), @proposal_votes] do %> +
+
+
+ <%= back_link_to proposals_path unless preview %> + +

<%= @proposal.title %>

+ <% if @proposal.retired? %> +
+ + <%= t("proposals.show.retired_warning") %>
+ <%= link_to t("proposals.show.retired_warning_link_to_explanation"), "#retired_explanation" %> +
+
+ <% elsif @proposal.conflictive? %> +
+ <%= t("proposals.show.flag") %> +
+ <% end %> + +
+ <%= render '/shared/author_info', resource: @proposal %> + +  •  + <%= l @proposal.created_at.to_date %> +  •  +   + <%= link_to t("proposals.show.comments", count: @proposal.comments_count), "#comments" %> + + <% if current_user %> +  •  + + <%= render 'proposals/flag_actions', proposal: @proposal %> + + <% end %> + +
+ + <%= render_image(@proposal.image, :large, true) if @proposal.image.present? %> + +
+

+ <%= t("proposals.show.code") %> + <%= @proposal.code %> +

+ +
<%= @proposal.summary %>
+ + <% if @proposal.video_url.present? %> +
+
+
+
+
+ <% end %> + + <%= safe_html_with_links @proposal.description %> + + <% if feature?(:map) && map_location_available?(@proposal.map_location) %> +
+ <%= render_map(@proposal.map_location, "proposal", false, nil) %> +
+ <% end %> + + <% if @proposal.external_url.present? %> + + <% end %> + + <% if @proposal.video_url.present? %> + + + <% end %> + +

<%= @proposal.question %>

+ <% if @proposal.retired? %>
-

- <%= t("proposals.show.retired") %>: - <%= t("proposals.retire_options.#{@proposal.retired_reason}") unless @proposal.retired_reason == 'other' %> -

+

<%= t('proposals.show.retired') %>: <%= t("proposals.retire_options.#{@proposal.retired_reason}") unless @proposal.retired_reason == 'other' %>

<%= simple_format text_with_links(@proposal.retired_explanation), {}, sanitize: false %>
<% end %> @@ -25,105 +124,84 @@
- + <% end %>
<% end %> -
-
-
-
- <%= render "proposals/filter_subnav" %> -
+<% unless preview %> +
+
+ <%= render "proposals/filter_subnav" %>
-
-
-
- <%= render "proposals/comments" %> +
+ + + <%= render "proposals/notifications" %>
- - <%= render "proposals/notifications" %> -
+<% end %>