Added Legislation Proposals views

This commit is contained in:
María Checa
2017-09-14 12:52:03 +02:00
parent 0245605f19
commit 0ed6b0da6b
28 changed files with 960 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<% provide :title do %><%= @process.title %><% end %>
<%= render 'legislation/processes/header', process: @process, header: :full %>
<%= render 'key_dates', process: @process, phase: :proposals %>
<div class="row">
<div class="debate-chooser">
<div class="row">
<div class="small-12 medium-9 column">
<div class="debate-list">
<% if @process.proposals.empty? %>
<div class="callout primary">
<p><%= t('.empty_questions') %></p>
</div>
<% else %>
<%= render @process.proposals %>
<% end %>
</div>
</div>
<div class="small-12 medium-3 column">
<div class="callout success">
<p><%= t('.participate') %></p>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,10 @@
<% if can? :hide, proposal %>
<%= link_to t("admin.actions.hide").capitalize, hide_moderation_proposal_path(proposal),
method: :put, remote: true, data: { confirm: t('admin.actions.confirm') } %>
<% end %>
<% if can? :hide, proposal.author %>
&nbsp;|&nbsp;
<%= link_to t("admin.actions.hide_author").capitalize, hide_moderation_user_path(proposal.author_id),
method: :put, data: { confirm: t('admin.actions.confirm') } %>
<% end %>

View File

@@ -0,0 +1,12 @@
<div class="sidebar-divider"></div>
<h2 class="sidebar-title"><%= t("shared.tags_cloud.categories") %></h2>
<br>
<ul id="categories" class="no-bullet categories">
<% @categories.each do |category| %>
<li class="inline-block">
<% css_class = { class: 'active' } if params[:search] == category.name %>
<%= link_to category.name, proposals_path(search: category.name), css_class || {} %>
</li>
<% end %>
</ul>

View File

@@ -0,0 +1,24 @@
<% cache [locale_and_user_status, @current_order, commentable_cache_key(@proposal), @comment_tree.comments, @comment_tree.comment_authors, @proposal.comments_count, @comment_flags] do %>
<div class="row comments">
<div id="comments" class="small-12 column">
<%= render 'shared/wide_order_selector', i18n_namespace: "comments" %>
<% if user_signed_in? %>
<%= render 'comments/form', {commentable: @proposal, parent_id: nil, toggeable: false} %>
<% else %>
<br>
<div data-alert class="callout primary">
<%= t("proposals.show.login_to_comment",
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
</div>
<% end %>
<% @comment_tree.root_comments.each do |comment| %>
<%= render 'comments/comment', comment: comment %>
<% end %>
<%= paginate @comment_tree.root_comments %>
</div>
</div>
<% end %>

View File

@@ -0,0 +1,27 @@
<div id="<%= dom_id(proposal) %>" class="proposal-featured clear">
<div class="small-12 medium-9 column">
<h3><%= link_to proposal.title, proposal %></h3>
<div class="info">
<% if proposal.author.hidden? || proposal.author.erased? %>
<%= t("proposals.show.author_deleted") %>
<% else %>
<%= proposal.author.name %>
<% end %>
&nbsp;&bull;&nbsp;
<% if proposal.author.display_official_position_badge? %>
<span class="label round level-<%= proposal.author.official_level %>">
<%= proposal.author.official_position %>
</span>
&nbsp;&bull;&nbsp;
<% end %>
<strong><%= t("proposals.proposal.supports", count: proposal.total_votes) %></strong>
</div>
</div>
<div id="<%= dom_id(proposal) %>_votes" class="small-12 medium-3 column">
<%= render 'featured_votes', proposal: proposal %>
</div>
</div>

View File

@@ -0,0 +1,44 @@
<div class="supports text-center">
<div class="in-favor">
<% if voted_for?(@featured_proposals_votes, proposal) %>
<div class="supported">
<%= t("proposals.proposal.already_supported") %>
</div>
<% else %>
<%= link_to vote_featured_proposal_path(proposal, value: 'yes'),
class: "button button-support small expanded",
title: t('proposals.proposal.support_title'), method: "post", remote: true do %>
<%= t("proposals.proposal.support") %>
<% end %>
<% end %>
</div>
<% if user_signed_in? && current_user.organization? %>
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
<p>
<%= t("votes.organizations") %>
</p>
</div>
<% elsif user_signed_in? && !proposal.votable_by?(current_user)%>
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
<p>
<%= t("votes.verified_only",
verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %>
</p>
</div>
<% elsif !user_signed_in? %>
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
<%= t("votes.unauthenticated",
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
</div>
<% end %>
<% if voted_for?(@featured_proposals_votes, proposal) %>
<% if setting['twitter_handle'] %>
<div class="share-supported">
<%= social_share_button_tag("#{proposal.title} #{setting['twitter_hashtag']}", url: proposal_url(proposal), via: setting['twitter_handle']) %>
</div>
<% end %>
<% end %>
</div>

View File

@@ -0,0 +1,30 @@
<div class="row">
<div class="small-12 column">
<ul class="tabs" data-tabs id="proposals-tabs">
<li class="tabs-title is-active">
<%= link_to "#tab-comments" do %>
<h3>
<%= t("proposals.show.comments_tab") %>
<span class="js-comments-count">(<%= @proposal.comments_count %>)</span>
</h3>
<% end %>
</li>
<li class="tabs-title">
<%= link_to "#tab-notifications" do %>
<h3>
<%= t("proposals.show.notifications_tab") %>
(<%= @notifications.count %>)
</h3>
<% end %>
</li>
<li class="tabs-title">
<%= link_to "#tab-documents" do %>
<h3>
<%= t("documents.tab") %>
(<%= @proposal.documents.count %>)
</h3>
<% end %>
</li>
</ul>
</div>
</div>

View File

@@ -0,0 +1,21 @@
<span class="js-flag-actions">
<span class="flag-content">
<% if show_flag_action? proposal %>
<a id="flag-expand-proposal-<%= proposal.id %>" data-toggle="flag-drop-proposal-<%= proposal.id %>" title="<%= t('shared.flag') %>">
<span class="icon-flag flag-disable"></span>
</a>
<span class="dropdown-pane" id="flag-drop-proposal-<%= proposal.id %>" data-dropdown data-auto-focus="true">
<%= link_to t('shared.flag'), flag_proposal_path(proposal), method: :put, remote: true, id: "flag-proposal-#{ proposal.id }" %>
</span>
<% end %>
<% if show_unflag_action? proposal %>
<a id="unflag-expand-proposal-<%= proposal.id %>" data-toggle="unflag-drop-proposal-<%= proposal.id %>" title="<%= t('shared.unflag') %>">
<span class="icon-flag flag-active"></span>
</a>
<span class="dropdown-pane" id="unflag-drop-proposal-<%= proposal.id %>" data-dropdown data-auto-focus="true">
<%= link_to t('shared.unflag'), unflag_proposal_path(proposal), method: :put, remote: true, id: "unflag-proposal-#{ proposal.id }" %>
</span>
<% end %>
</span>
</span>

View File

@@ -0,0 +1,103 @@
<%= form_for(@proposal, url: form_url) do |f| %>
<%= render 'shared/errors', resource: @proposal %>
<div class="row">
<div class="small-12 column">
<%= f.label :title, t("proposals.form.proposal_title") %>
<%= f.text_field :title, maxlength: Proposal.title_max_length, placeholder: t("proposals.form.proposal_title"), label: false, data: {js_suggest_result: "js_suggest_result", js_suggest: "#js-suggest", js_url: suggest_proposals_path}%>
</div>
<div id="js-suggest"></div>
<%= f.invisible_captcha :subtitle %>
<div class="small-12 column">
<%= f.label :question, t("proposals.form.proposal_question") %>
<p class="help-text" id="question-help-text">
<%= t("proposals.form.proposal_question_example_html") %>
</p>
<%= f.text_field :question, maxlength: Proposal.question_max_length,
placeholder: t("proposals.form.proposal_question"),
label: false,
aria: {describedby: "question-help-text"} %>
</div>
<div class="small-12 column">
<%= f.label :summary, t("proposals.form.proposal_summary") %>
<p class="help-text" id="summary-help-text"><%= t("proposals.form.proposal_summary_note") %></p>
<%= f.text_area :summary, rows: 4, maxlength: 200, label: false,
placeholder: t('proposals.form.proposal_summary'),
aria: {describedby: "summary-help-text"} %>
</div>
<div class="ckeditor small-12 column">
<%= f.label :description, t("proposals.form.proposal_text") %>
<%= f.cktext_area :description, maxlength: Proposal.description_max_length, ckeditor: { language: I18n.locale }, label: false %>
</div>
<div class="small-12 column">
<%= f.label :video_url, t("proposals.form.proposal_video_url") %>
<p class="help-text" id="video-url-help-text"><%= t("proposals.form.proposal_video_url_note") %></p>
<%= f.text_field :video_url, placeholder: t("proposals.form.proposal_video_url"), label: false,
aria: {describedby: "video-url-help-text"} %>
</div>
<div class="small-12 column">
<%= f.label :external_url, t("proposals.form.proposal_external_url") %>
<%= f.text_field :external_url, placeholder: t("proposals.form.proposal_external_url"), label: false %>
</div>
<div class="documents small-12 column" data-max-documents="<%= Proposal.max_documents_allowed %>">
<%= render 'documents/nested_documents', documentable: @proposal %>
</div>
<div class="small-12 medium-6 column">
<%= f.label :geozone_id, t("proposals.form.geozone") %>
<%= f.select :geozone_id, geozone_select_options, {include_blank: t("geozones.none"), label: false} %>
</div>
<div class="small-12 column">
<%= f.label :tag_list, t("proposals.form.tags_label") %>
<p class="help-text" id="tag-list-help-text"><%= t("proposals.form.tags_instructions") %></p>
<div id="category_tags" class="tags">
<%= f.label :category_tag_list, t("proposals.form.tag_category_label") %>
<% @categories.each do |tag| %>
<a class="js-add-tag-link"><%= tag.name %></a>
<% end %>
</div>
<br>
<%= f.text_field :tag_list, value: @proposal.tag_list.to_s,
label: false,
placeholder: t("proposals.form.tags_placeholder"),
class: 'js-tag-list',
aria: {describedby: "tag-list-help-text"} %>
</div>
<% if current_user.unverified? %>
<div class="small-12 column">
<%= f.label :responsible_name, t("proposals.form.proposal_responsible_name") %>
<p class="help-text" id="responsible-name-help-text"><%= t("proposals.form.proposal_responsible_name_note") %></p>
<%= f.text_field :responsible_name, placeholder: t("proposals.form.proposal_responsible_name"), label: false,
aria: {describedby: "responsible-name-help-text"} %>
</div>
<% end %>
<div class="small-12 column">
<% if @proposal.new_record? %>
<%= f.label :terms_of_service do %>
<%= f.check_box :terms_of_service, title: t('form.accept_terms_title'), label: false %>
<span class="checkbox">
<%= t("form.accept_terms",
policy: link_to(t("form.policy"), "/privacy", target: "blank"),
conditions: link_to(t("form.conditions"), "/conditions", target: "blank")).html_safe %>
</span>
<% end %>
<% end %>
</div>
<div class="actions small-12 column">
<%= f.submit(class: "button", value: t("proposals.#{action_name}.form.submit_button")) %>
</div>
</div>
<% end %>

View File

@@ -0,0 +1,6 @@
<div class="sidebar-divider"></div>
<h2 class="sidebar-title"><%= t("shared.tags_cloud.districts") %></h2>
<br>
<%= link_to map_proposals_path, id: 'map', title: t("shared.tags_cloud.districts_list") do %>
<%= image_tag("map.jpg", alt: t("shared.tags_cloud.districts_list")) %>
<% end %>

View File

@@ -0,0 +1,17 @@
<div class="tabs-panel" id="tab-notifications">
<div class="row">
<div class="small-12 column">
<% if @notifications.blank? %>
<div class="callout primary text-center">
<%= t('proposals.show.no_notifications') %>
</div>
<% end %>
<% @notifications.each do |notification| %>
<h3><%= notification.title %></h3>
<p class="more-info"><%= notification.created_at.to_date %></p>
<p><%= notification.body %></p>
<% end %>
</div>
</div>
</div>

View File

@@ -0,0 +1,6 @@
<div class="sidebar-divider"></div>
<h2 class="sidebar-title"><%= t("proposals.index.top") %></h2>
<p>
<%= link_to t("proposals.index.top_link_proposals"), summary_proposals_path, class: "small" %><br>
</p>

View File

@@ -0,0 +1,81 @@
<div id="<%= dom_id(proposal) %>"
class="proposal clear <%= ("successful" if proposal.total_votes > Proposal.votes_needed_for_success) %>"
data-type="proposal">
<div class="panel">
<div class="icon-successful"></div>
<div class="row">
<div class="small-12 medium-9 column">
<div class="proposal-content">
<% cache [locale_and_user_status(proposal), 'index', proposal, proposal.author] do %>
<h3><%= link_to proposal.title, namespaced_proposal_path(proposal) %></h3>
<p class="proposal-info">
<span class="icon-comments"></span>&nbsp;
<%= link_to t("proposals.proposal.comments", count: proposal.comments_count), namespaced_proposal_path(proposal, anchor: "comments") %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= l proposal.created_at.to_date %>
<% if proposal.author.hidden? || proposal.author.erased? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="author">
<%= t("proposals.show.author_deleted") %>
</span>
<% else %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="author">
<%= proposal.author.name %>
</span>
<% if proposal.author.display_official_position_badge? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="label round level-<%= proposal.author.official_level %>">
<%= proposal.author.official_position %>
</span>
<% end %>
<% end %>
<% if proposal.author.verified_organization? %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="label round is-association">
<%= t("shared.collective") %>
</span>
<% end %>
</p>
<div class="proposal-description">
<p><%= proposal.summary %></p>
<div class="truncate"></div>
</div>
<%= render "shared/tags", taggable: proposal, limit: 5 %>
<% end %>
</div>
</div>
<div id="<%= dom_id(proposal) %>_votes" class="small-12 medium-3 column supports-container">
<% if proposal.successful? %>
<div class="padding text-center">
<p>
<%= t("proposals.proposal.successful",
voting: link_to(t("proposals.proposal.voting"), polls_path)).html_safe %>
</p>
</div>
<% if can? :create, Poll::Question %>
<p class="text-center">
<%= link_to t('poll_questions.create_question'),
new_admin_question_path(proposal_id: proposal.id),
class: "button hollow" %>
</p>
<% end %>
<% elsif proposal.archived? %>
<div class="padding text-center">
<strong><%= t("proposals.proposal.supports", count: proposal.total_votes) %></strong>
<p><%= t("proposals.proposal.archived") %></p>
</div>
<% else %>
<%= render 'votes',
{ proposal: proposal, vote_url: vote_proposal_path(proposal, value: 'yes') } %>
<% end %>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1 @@
$("#<%= dom_id(@proposal) %> .js-flag-actions").html('<%= j render("proposals/flag_actions", proposal: @proposal) %>');

View File

@@ -0,0 +1,13 @@
<div class="sidebar-divider"></div>
<h2 class="sidebar-title"><%= t("proposals.index.retired_proposals") %></h2>
<% if params[:retired].blank? %>
<p><%= link_to t("proposals.index.retired_proposals_link"), proposals_path(retired: 'all'), class: "small" %></p>
<% else %>
<div class="sidebar-links">
<%= link_to t("proposals.index.retired_links.all"), proposals_path(retired: 'all') %>
<% Proposal::RETIRE_OPTIONS.each do |option| %>
<%= link_to t("proposals.index.retired_links.#{option}"), proposals_path(retired: option) %>
<% end %>
</div>
<% end %>

View File

@@ -0,0 +1,66 @@
<div class="supports text-center">
<div class="progress small-12 round">
<span class="meter" style="width: <%= progress_bar_percentage(proposal) %>%;"></span>
<span class="percentage">
<%= supports_percentage(proposal) %>&nbsp;/&nbsp;<%= t("proposals.proposal.total_percent") %>
</span>
</div>
<span class="total-supports">
<%= t("proposals.proposal.supports", count: proposal.total_votes) %>&nbsp;
<span>
<abbr title="<%= t("proposals.proposal.reason_for_supports_necessary") %>">
<%= t("proposals.proposal.supports_necessary", number: number_with_delimiter(Proposal.votes_needed_for_success)) %>
</abbr>
</span>
</span>
<div class="in-favor">
<% if voted_for?(@proposal_votes, proposal) %>
<div class="supported callout success">
<%= t("proposals.proposal.already_supported") %>
</div>
<% elsif user_signed_in? && proposal.votable_by?(current_user) %>
<%= link_to vote_url,
class: "button button-support small expanded",
title: t('proposals.proposal.support_title'), method: "post", remote: true do %>
<%= t("proposals.proposal.support") %>
<% end %>
<% else %>
<div class="button button-support small expanded">
<%= t("proposals.proposal.support") %>
</div>
<% end %>
</div>
<% if user_signed_in? && current_user.organization? %>
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
<p>
<%= t("votes.organizations") %>
</p>
</div>
<% elsif user_signed_in? && !proposal.votable_by?(current_user) %>
<div tabindex="0">
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
<p>
<%= t("votes.verified_only",
verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %>
</p>
</div>
</div>
<% elsif !user_signed_in? %>
<div tabindex="0">
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
<%= t("votes.unauthenticated",
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
</div>
</div>
<% end %>
<% if voted_for?(@proposal_votes, proposal) && setting['twitter_handle'] %>
<div class="share-supported">
<%= social_share_button_tag("#{proposal.title} #{setting['twitter_hashtag']}", url: proposal_url(proposal), via: setting['twitter_handle']) %>
</div>
<% end %>
</div>

View File

@@ -0,0 +1,14 @@
<div class="proposal-edit row">
<div class="small-12 column">
<%= back_link_to %>
<div class="float-right">
<%= link_to t("proposals.edit.show_link"), @proposal %>
</div>
<h1><%= t("proposals.edit.editing") %></h1>
<%= render "form", form_url: proposal_url(@proposal) %>
</div>
</div>

View File

@@ -0,0 +1,102 @@
<% provide :title do %><%= t('proposals.index.title') %><% end %>
<% content_for :header_addon do %>
<%= render "shared/search_form",
search_path: proposals_path(page: 1),
i18n_namespace: "proposals.index.search_form" %>
<% end %>
<% content_for :canonical do %>
<%= render "shared/canonical", href: proposals_url %>
<% end %>
<main>
<% if @search_terms || @advanced_search_terms || @tag_filter || params[:retired].present? %>
<div class="highlight no-margin-top padding margin-bottom">
<div class="row">
<div class="small-12 column">
<% if @search_terms || @advanced_search_terms %>
<h2><%= t("shared.search_results") %></h2>
<p>
<%= page_entries_info @proposals %>
<% if !@advanced_search_terms %>
<%= t("proposals.index.search_results_html", count: @proposals.size, search_term: @search_terms) %>
<% end %>
<p>
<% elsif @tag_filter %>
<h2><%= t("shared.search_results") %></h2>
<p>
<%= page_entries_info @proposals %>
<%= t("proposals.index.filter_topic", count: @proposals.size, topic: @tag_filter) %>
</p>
<% elsif params[:retired].present? %>
<h2><%= t("proposals.index.retired_proposals") %></h2>
<% end %>
</div>
</div>
</div>
<% else %>
<%= render "shared/section_header", i18n_namespace: "proposals.index.section_header", image: "proposals" %>
<% end %>
<div class="row">
<div id="proposals" class="proposals-list small-12 medium-9 column">
<% if has_banners? %>
<%= render "shared/banner" %>
<% end %>
<% if @featured_proposals.present? %>
<div id="featured-proposals" class="row featured-proposals">
<div class="small-12 column">
<h2>
<%= t("proposals.index.featured_proposals") %>
</h2>
</div>
<% @featured_proposals.each do |featured_proposal| %>
<%= render "featured_proposal", proposal: featured_proposal %>
<% end %>
</div>
<% end %>
<%= render("shared/advanced_search", search_path: proposals_path(page: 1)) unless params[:retired].present? %>
<%= render 'shared/order_links', i18n_namespace: "proposals.index" %>
<% if @proposals.any? %>
<div class="show-for-small-only">
<%= link_to t("proposals.index.start_proposal"), new_proposal_path, class: 'button expanded' %>
</div>
<% end %>
<div id="proposals-list">
<%= render partial: 'proposals/proposal', collection: @proposals %>
<%= paginate @proposals %>
<% unless @search_terms || @advanced_search_terms || @tag_filter %>
<div id="section_help" class="margin" data-magellan-target="section_help">
<p class="lead">
<strong><%= t("proposals.index.section_footer.title") %></strong>
</p>
<p><%= t("proposals.index.section_footer.help_text_1") %></p>
<p><%= t("proposals.index.section_footer.help_text_2",
org: link_to(setting['org_name'], new_user_registration_path)).html_safe %></p>
<p><%= t("proposals.index.section_footer.help_text_3") %></p>
</div>
<% end %>
</div>
</div>
<div class="small-12 medium-3 column">
<aside class="margin-bottom">
<%= link_to t("proposals.index.start_proposal"), new_proposal_path, class: 'button expanded' %>
<% if params[:retired].blank? %>
<%= render 'categories' %>
<%= render "shared/tag_cloud", taggable: 'proposal' %>
<%= render 'geozones' %>
<%= render 'popular' %>
<% end %>
<%= render 'retired' %>
</aside>
</div>
</div>
</main>

View File

@@ -0,0 +1 @@
<%= render 'shared/map', new_url_path: new_proposal_path %>

View File

@@ -0,0 +1,24 @@
<div class="proposal-form row">
<div class="small-12 medium-9 column">
<%= back_link_to %>
<h1><%= t("proposals.new.start_new") %></h1>
<div data-alert class="callout primary">
<%= link_to more_info_path(anchor: "proposals") ,title: t('shared.target_blank_html'), target: "_blank" do %>
<%= t("proposals.new.more_info")%>
<% end %>
</div>
<%= render "proposals/form", form_url: proposals_url %>
</div>
<div class="small-12 medium-3 column">
<span class="icon-proposals float-right"></span>
<h2><%= t("proposals.new.recommendations_title") %></h2>
<ul class="recommendations">
<li><%= t("proposals.new.recommendation_one") %></li>
<li><%= t("proposals.new.recommendation_two") %></li>
<li><%= t("proposals.new.recommendation_three") %></li>
</ul>
</div>
</div>

View File

@@ -0,0 +1,38 @@
<div class="proposal-edit row">
<div class="small-12 column">
<h1 class="inline-block"><%= t("proposals.retire_form.title") %></h1>
<h3><%= link_to @proposal.title, @proposal %></h3>
<div data-alert class="callout warning">
<%= t("proposals.retire_form.warning") %>
</div>
<%= form_for(@proposal, url: retire_proposal_path(@proposal)) do |f| %>
<%= render 'shared/errors', resource: @proposal %>
<div class="row">
<div class="small-12 medium-6 large-4 column">
<%= f.label :retired_reason, t("proposals.retire_form.retired_reason_label") %>
<%= f.select :retired_reason, retire_proposals_options, {include_blank: t("proposals.retire_form.retired_reason_blank"), label: false} %>
</div>
</div>
<div class="row">
<div class="small-12 medium-9 column">
<%= f.label :retired_explanation, t("proposals.retire_form.retired_explanation_label") %>
<%= f.text_area :retired_explanation, rows: 4, maxlength: 500, label: false,
placeholder: t('proposals.retire_form.retired_explanation_placeholder') %>
</div>
</div>
<div class="row">
<div class="actions small-12 medium-3 column">
<%= f.submit(class: "button expanded", value: t("proposals.retire_form.submit_button")) %>
</div>
</div>
<% end %>
</div>
</div>

View File

@@ -0,0 +1,51 @@
<% 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), @proposal_votes] do %>
<div class="proposal-show">
<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 partial: 'shared/social_share', locals: {
title: @proposal.title,
url: proposal_url(@proposal)
} %>
<% if @proposal_improvement_path.present? %>
<div class="callout highlight margin-top text-center">
<p class="lead"><strong><%= t("proposals.proposal.improve_info") %></strong></p>
<%= link_to t("proposals.proposal.improve_info_link"), @proposal_improvement_path, class: "button" %>
</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>
</div>
<% end %>

View File

@@ -0,0 +1,183 @@
<% 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 %>
<% 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 %>
<div class="proposal-show">
<div id="<%= dom_id(@proposal) %>" class="row">
<div class="small-12 medium-9 column">
<%= back_link_to %>
<% if can?(:create, @document) && @proposal.documents.size < Proposal.max_documents_allowed %>
<%= link_to t("documents.upload_document"),
new_document_path(documentable_id: @proposal, documentable_type: @proposal.class.name, from: request.url),
class: 'button hollow float-right' %>
<% end %>
<% if author_of?(@proposal, current_user) %>
<%= link_to t("proposals.show.send_notification"),
new_proposal_notification_path(proposal_id: @proposal.id),
class: 'button hollow float-right' %>
<% end %>
<% if current_user && @proposal.editable_by?(current_user) %>
<%= link_to edit_proposal_path(@proposal), class: 'edit-proposal button hollow float-right' do %>
<%= t("proposals.show.edit_proposal_link") %>
<% end %>
<% end %>
<h1><%= @proposal.title %></h1>
<% if @proposal.retired? %>
<div data-alert class="callout alert margin-top proposal-retired">
<strong>
<%= t("proposals.show.retired_warning") %><br>
<%= link_to t("proposals.show.retired_warning_link_to_explanation"), "#retired_explanation" %>
</strong>
</div>
<% elsif @proposal.conflictive? %>
<div data-alert class="callout alert margin-top">
<strong><%= t("proposals.show.flag") %></strong>
</div>
<% end %>
<div class="proposal-info">
<%= render '/shared/author_info', resource: @proposal %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= l @proposal.created_at.to_date %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<span class="icon-comments"></span>&nbsp;
<%= link_to t("proposals.show.comments", count: @proposal.comments_count), "#comments" %>
<% if current_user %>
<span class="bullet">&nbsp;&bull;&nbsp;</span>
<%= render 'proposals/flag_actions', proposal: @proposal %>
<% end %>
</div>
<br>
<p>
<%= t("proposals.show.code") %>
<strong><%= @proposal.code %></strong>
</p>
<blockquote><%= @proposal.summary %></blockquote>
<% if @proposal.video_url.present? %>
<div class="small-12 medium-7 small-centered">
<div class="flex-video">
<div id="js-embedded-video" data-video-code="<%= embedded_video_code %>"></div>
</div>
</div>
<% end %>
<%= safe_html_with_links @proposal.description %>
<% if @proposal.external_url.present? %>
<div class="document-link">
<p>
<span class="icon-document"></span>&nbsp;
<strong><%= t('proposals.show.title_external_url') %></strong>
</p>
<%= text_with_links @proposal.external_url %>
</div>
<% end %>
<% if @proposal.video_url.present? %>
<div class="video-link">
<p>
<span class="icon-video"></span>&nbsp;
<strong><%= t('proposals.show.title_video_url') %></strong>
</p>
<%= text_with_links @proposal.video_url %>
</div>
<% end %>
<h4><%= @proposal.question %></h4>
<% if @proposal.retired? %>
<div id="retired_explanation" class="callout">
<h2><%= t('proposals.show.retired') %>: <%= t("proposals.retire_options.#{@proposal.retired_reason}") unless @proposal.retired_reason == 'other' %></h2>
<%= simple_format text_with_links(@proposal.retired_explanation), {}, sanitize: false %>
</div>
<% end %>
<%= render 'shared/tags', taggable: @proposal %>
<%= render 'shared/geozone', geozonable: @proposal %>
<div class="js-moderator-proposal-actions margin">
<%= render 'proposals/actions', proposal: @proposal %>
</div>
</div>
<aside class="small-12 medium-3 column">
<div class="sidebar-divider"></div>
<h2><%= t("votes.supports") %></h2>
<div id="<%= dom_id(@proposal) %>_votes">
<% if @proposal.successful? %>
<p>
<%= t("proposals.proposal.successful",
voting: link_to(t("proposals.proposal.voting"), polls_path)).html_safe %>
</p>
<% if can? :create, Poll::Question %>
<p class="text-center">
<%= link_to t('poll_questions.create_question'),
new_admin_question_path(proposal_id: @proposal.id),
class: "button hollow expanded" %>
</p>
<% end %>
<% elsif @proposal.archived? %>
<div class="padding text-center">
<p>
<strong><%= t("proposals.proposal.supports", count: @proposal.total_votes) %></strong>
</p>
<p><%= t("proposals.proposal.archived") %></p>
</div>
<% else %>
<%= render 'votes',
{ proposal: @proposal, vote_url: vote_proposal_path(@proposal, value: 'yes') } %>
<% end %>
</div>
<%= render partial: 'shared/social_share', locals: {
share_title: t("proposals.show.share"),
title: @proposal.title,
url: proposal_url(@proposal)
} %>
<% if current_user %>
<%= render 'follows/follow_button', follow: find_or_build_follow(current_user, @proposal) %>
<% end %>
<%= render 'communities/access_button', community: @proposal.community %>
</aside>
</div>
</div>
<% end %>
<div class="tabs-content" data-tabs-content="proposals-tabs" role="tablist">
<%= render "proposals/filter_subnav" %>
<%= render "proposals/notifications" %>
<div class="tabs-panel is-active" id="tab-comments">
<%= render "proposals/comments" %>
</div>
<div class="tabs-panel" id="tab-documents">
<%= render 'documents/documents',
documents: @proposal.documents,
max_documents_allowed: Proposal.max_documents_allowed %>
</div>
</div>

View File

@@ -0,0 +1 @@
<%= render "shared/suggest" %>

View File

@@ -0,0 +1,53 @@
<main>
<div class="row proposals-summary">
<div id="proposals" class="proposals-list small-12 medium-9 column">
<%= back_link_to %>
<% @proposals.each do |group_name, proposals| %>
<div id="<%= group_name.parameterize %>">
<h2 class="margin-top"><%= group_name %></h2>
<% proposals[0..2].each do |proposal| %>
<div class="proposal clear">
<div class="panel">
<div class="row">
<div class="small-12 medium-9 column">
<div class="proposal-contenta">
<h3><%= link_to proposal.title, namespaced_proposal_path(proposal) %></h3>
<p class="proposal-info">
<% if proposal.author.hidden? || proposal.author.erased? %>
<span class="author"><%= t("proposals.show.author_deleted") %></span>
<% else %>
<span class="author"><%= proposal.author.name %></span>
<% if proposal.author.display_official_position_badge? %>
<span class="label round level-<%= proposal.author.official_level %>">
<%= proposal.author.official_position %>
</span>
<% end %>
<% end %>
</p>
<div class="proposal-description">
<p><%= proposal.summary %></p>
</div>
</div>
</div>
</div>
</div>
</div>
<% end %>
</div>
<% end %>
</div>
<div class="small-12 medium-3 column">
<aside class="sidebar">
<%= link_to t("proposals.index.start_proposal"), new_proposal_path, class: 'button radius expand' %>
<%= render "shared/tag_cloud", taggable: 'proposal' %>
<%= render 'categories' %>
<%= render 'geozones' %>
</aside>
</div>
</div>
</main>

View File

@@ -0,0 +1 @@
$("#<%= dom_id(@proposal) %>_votes").html('<%= j render("proposals/votes", proposal: @proposal) %>');

View File

@@ -0,0 +1 @@
$("#<%= dom_id(@proposal) %>_votes").html('<%= j render("proposals/featured_votes", proposal: @proposal) %>');

View File

@@ -86,6 +86,7 @@ es:
draft_publication_date: Publicación borrador
allegations_dates: Alegaciones
result_publication_date: Publicación resultados
proposals_dates: Propuestas
questions:
comments:
comment_button: Publicar respuesta