Remove unused legislation proposals index action
The `legislation_proposals#index` action was never used because it used
the same URL as `legislation_processes#proposals`.
In commit 702bfec24 we removed the view, but we forgot to remove the
controller action, the route, and some partials which were rendered from
the index view.
This commit is contained in:
@@ -3,16 +3,15 @@ class Legislation::ProposalsController < Legislation::BaseController
|
|||||||
include FlagActions
|
include FlagActions
|
||||||
include ImageAttributes
|
include ImageAttributes
|
||||||
|
|
||||||
before_action :load_categories, only: [:index, :new, :create, :edit, :map, :summary]
|
before_action :load_categories, only: [:new, :create, :edit, :map, :summary]
|
||||||
before_action :load_geozones, only: [:edit, :map, :summary]
|
before_action :load_geozones, only: [:edit, :map, :summary]
|
||||||
|
|
||||||
before_action :authenticate_user!, except: [:index, :show, :map, :summary]
|
before_action :authenticate_user!, except: [:show, :map, :summary]
|
||||||
load_and_authorize_resource :process, class: "Legislation::Process"
|
load_and_authorize_resource :process, class: "Legislation::Process"
|
||||||
load_and_authorize_resource :proposal, class: "Legislation::Proposal", through: :process
|
load_and_authorize_resource :proposal, class: "Legislation::Proposal", through: :process
|
||||||
|
|
||||||
invisible_captcha only: [:create, :update], honeypot: :subtitle
|
invisible_captcha only: [:create, :update], honeypot: :subtitle
|
||||||
|
|
||||||
has_orders %w[confidence_score created_at], only: :index
|
|
||||||
has_orders %w[most_voted newest oldest], only: :show
|
has_orders %w[most_voted newest oldest], only: :show
|
||||||
|
|
||||||
helper_method :resource_model, :resource_name
|
helper_method :resource_model, :resource_name
|
||||||
@@ -38,11 +37,6 @@ class Legislation::ProposalsController < Legislation::BaseController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def index_customization
|
|
||||||
load_successful_proposals
|
|
||||||
load_featured unless @proposal_successful_exists
|
|
||||||
end
|
|
||||||
|
|
||||||
def vote
|
def vote
|
||||||
@proposal.register_vote(current_user, params[:value])
|
@proposal.register_vote(current_user, params[:value])
|
||||||
legislation_proposal_votes(@proposal)
|
legislation_proposal_votes(@proposal)
|
||||||
@@ -65,8 +59,4 @@ class Legislation::ProposalsController < Legislation::BaseController
|
|||||||
def resource_name
|
def resource_name
|
||||||
"proposal"
|
"proposal"
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_successful_proposals
|
|
||||||
@proposal_successful_exists = Legislation::Proposal.successful.exists?
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ module Abilities
|
|||||||
can :vote_featured, Proposal
|
can :vote_featured, Proposal
|
||||||
|
|
||||||
can :vote, Legislation::Proposal
|
can :vote, Legislation::Proposal
|
||||||
can :vote_featured, Legislation::Proposal
|
|
||||||
can :create, Legislation::Answer
|
can :create, Legislation::Answer
|
||||||
|
|
||||||
can :create, Budget::Investment, budget: { phase: "accepting" }
|
can :create, Budget::Investment, budget: { phase: "accepting" }
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
<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 %>
|
|
||||||
|
|
||||||
•
|
|
||||||
|
|
||||||
<% if proposal.author.display_official_position_badge? %>
|
|
||||||
<span class="label round level-<%= proposal.author.official_level %>">
|
|
||||||
<%= proposal.author.official_position %>
|
|
||||||
</span>
|
|
||||||
•
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<strong><%= t("proposals.proposal.votes", 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>
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
<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>
|
|
||||||
<%= sanitize(t("votes.verified_only", verify_account: link_to_verify_account)) %>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<% elsif !user_signed_in? %>
|
|
||||||
<%= render "shared/login_to_vote" %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if voted_for?(@featured_proposals_votes, proposal) %>
|
|
||||||
<% if setting["twitter_handle"] %>
|
|
||||||
<div class="share-supported">
|
|
||||||
<%= render "shared/social_share",
|
|
||||||
title: proposal.title,
|
|
||||||
url: proposal_url(proposal),
|
|
||||||
description: proposal.summary,
|
|
||||||
mobile: proposal.title %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<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(image_path_for("map.jpg", alt: t("shared.tags_cloud.districts_list"))) %>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<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>
|
|
||||||
@@ -376,7 +376,6 @@ en:
|
|||||||
select_order_long: "You are viewing proposals according to:"
|
select_order_long: "You are viewing proposals according to:"
|
||||||
start_proposal: Create a proposal
|
start_proposal: Create a proposal
|
||||||
title: Proposals
|
title: Proposals
|
||||||
top: Top weekly
|
|
||||||
top_link_proposals: The most supported proposals by category
|
top_link_proposals: The most supported proposals by category
|
||||||
section_header:
|
section_header:
|
||||||
icon_alt: Proposals icon
|
icon_alt: Proposals icon
|
||||||
|
|||||||
@@ -376,7 +376,6 @@ es:
|
|||||||
select_order_long: "Estas viendo las propuestas"
|
select_order_long: "Estas viendo las propuestas"
|
||||||
start_proposal: Crea una propuesta
|
start_proposal: Crea una propuesta
|
||||||
title: Propuestas ciudadanas
|
title: Propuestas ciudadanas
|
||||||
top: Top semanal
|
|
||||||
top_link_proposals: Propuestas más apoyadas por categoría
|
top_link_proposals: Propuestas más apoyadas por categoría
|
||||||
section_header:
|
section_header:
|
||||||
icon_alt: Icono de Propuestas
|
icon_alt: Icono de Propuestas
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace :legislation do
|
|||||||
resources :answers, only: [:create]
|
resources :answers, only: [:create]
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :proposals do
|
resources :proposals, except: [:index] do
|
||||||
member do
|
member do
|
||||||
post :vote
|
post :vote
|
||||||
put :flag
|
put :flag
|
||||||
|
|||||||
Reference in New Issue
Block a user