-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/fix/proposals-performance-issues…
…-2' into feat/capistrano_deploy
- Loading branch information
Showing
11 changed files
with
149 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<span class="author" data-author> | ||
<%= content_tag :span, class: "author__container#{" is-compact" if layout == :compact}" do %> | ||
<% if layout == :compact %> | ||
<%= render :avatar %> | ||
|
||
<span> | ||
<%= render :name %> | ||
|
||
<% context_actions.each do |action| %> | ||
<%= render action %> | ||
<% end %> | ||
</span> | ||
<% elsif layout == :avatar %> | ||
<%= render :avatar %> | ||
<% else %> | ||
<%= render :avatar %> | ||
<%= render :name %> | ||
<% end %> | ||
<% end %> | ||
|
||
<% if layout == :default %> | ||
<% context_actions.each do |action| %> | ||
<%= render action %> | ||
<% end %> | ||
<% end %> | ||
</span> |
8 changes: 8 additions & 0 deletions
8
app/cells/decidim/participatory_space_dropdown_metadata/show.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div id="breadcrumb-secondary-dropdown-<%= id %>" class="menu-bar__secondary-dropdown"> | ||
<div class="menu-bar__secondary-dropdown__left"> | ||
<%= render :metadata %> | ||
</div> | ||
<ul class="menu-bar__secondary-dropdown__menu"> | ||
<%= render :links %> | ||
</ul> | ||
</div> |
44 changes: 44 additions & 0 deletions
44
app/controllers/concerns/decidim/proposals/proposals_controller_override.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# frozen_string_literal: true | ||
|
||
module Decidim | ||
module Proposals | ||
module ProposalsControllerOverride | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
def index | ||
if component_settings.participatory_texts_enabled? | ||
@proposals = Decidim::Proposals::Proposal | ||
.where(component: current_component) | ||
.published | ||
.not_hidden | ||
.only_amendables | ||
.includes(:category, :scope, :attachments, :coauthorships) | ||
.order(position: :asc) | ||
render "decidim/proposals/proposals/participatory_texts/participatory_text" | ||
else | ||
@proposals = search | ||
.result | ||
.published | ||
.not_hidden | ||
|
||
@all_geocoded_proposals = @proposals.geocoded | ||
|
||
@proposals = reorder(@proposals) | ||
@proposals = paginate(@proposals) | ||
@proposals = @proposals.includes(:component, :coauthorships, :attachments) | ||
|
||
@voted_proposals = if current_user | ||
ProposalVote.where( | ||
author: current_user, | ||
proposal: @proposals.pluck(:id) | ||
).pluck(:decidim_proposal_id) | ||
else | ||
[] | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<% add_decidim_page_title(t("name", scope: "decidim.components.proposals")) %> | ||
|
||
<% append_stylesheet_pack_tag "decidim_proposals", media: "all" %> | ||
<% append_javascript_pack_tag "decidim_proposals" %> | ||
|
||
<% content_for :aside do %> | ||
<h1 id="proposals-count" class="title-decorator"><%= component_name %></h1> | ||
|
||
<div class="proposal-list__aside__button-container"> | ||
<% if current_settings.creation_enabled && current_component.participatory_space.can_participate?(current_user) %> | ||
<%= action_authorized_link_to :create, new_proposal_path, class: "button button__xl button__secondary w-full", data: { "redirect_url" => new_proposal_path } do %> | ||
<span><%= t("new_proposal", scope: "decidim.proposals.proposals.index") %></span> | ||
<%= icon "add-line" %> | ||
<% end %> | ||
<% end %> | ||
|
||
<% if component_settings.collaborative_drafts_enabled? %> | ||
<%= link_to collaborative_drafts_path, class: "button button__sm button__transparent-secondary" do %> | ||
<span><%= t("collaborative_drafts_list", scope: "decidim.proposals.proposals.index") %></span> | ||
<%= icon "edit-2-line" %> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
|
||
<%= render layout: "decidim/shared/filters", locals: { filter_sections: , search_variable: :search_text_cont, skip_to_id: "proposals" } do %> | ||
<%= hidden_field_tag :order, order, id: nil, class: "order_filter" %> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= render layout: "layouts/decidim/shared/layout_two_col" do %> | ||
|
||
<%= render partial: "decidim/shared/component_announcement" %> | ||
|
||
<% if show_voting_rules? %> | ||
<section class="layout-main__section"> | ||
<%= render partial: "voting_rules" %> | ||
</section> | ||
<% end %> | ||
|
||
<section id="proposals" class="layout-main__section layout-main__heading"> | ||
<%= render partial: "proposals" %> | ||
</section> | ||
|
||
<% end %> |
13 changes: 13 additions & 0 deletions
13
app/views/layouts/decidim/header/_menu_breadcrumb_main_dropdown.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div id="<%= id %>" class="menu-bar__main-dropdown"> | ||
<div class="menu-bar__main-dropdown__top"> | ||
<div class="menu-bar__main-dropdown__top-left"> | ||
<%= render partial: "layouts/decidim/header/menu_breadcrumb_main_dropdown_top_left" %> | ||
</div> | ||
<%= breadcrumb_root_menu.render %> | ||
</div> | ||
<div class="menu-bar__main-dropdown__bottom"> | ||
<div class="menu-bar__main-dropdown__bottom-left"> | ||
<%= cell("decidim/highlighted_participatory_process", menu_highlighted_participatory_process) %> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters