decidim-proposals 0.14.4 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/app/assets/images/decidim/gamification/badges/accepted_proposals.svg +194 -104
- data/app/assets/images/decidim/gamification/badges/proposals.svg +192 -108
- data/app/assets/javascripts/decidim/proposals/admin/proposals.es6 +25 -20
- data/app/cells/decidim/proposals/proposal_activity_cell.rb +19 -0
- data/app/commands/decidim/proposals/admin/answer_proposal.rb +6 -2
- data/app/commands/decidim/proposals/admin/create_proposal.rb +4 -4
- data/app/commands/decidim/proposals/admin/import_participatory_text.rb +49 -0
- data/app/commands/decidim/proposals/admin/import_proposals.rb +7 -21
- data/app/commands/decidim/proposals/admin/merge_proposals.rb +68 -0
- data/app/commands/decidim/proposals/admin/publish_participatory_text.rb +65 -0
- data/app/commands/decidim/proposals/admin/split_proposals.rb +67 -0
- data/app/commands/decidim/proposals/admin/update_proposal.rb +67 -0
- data/app/commands/decidim/proposals/create_collaborative_draft.rb +19 -14
- data/app/commands/decidim/proposals/create_proposal.rb +4 -2
- data/app/commands/decidim/proposals/endorse_proposal.rb +5 -1
- data/app/commands/decidim/proposals/publish_proposal.rb +15 -3
- data/app/commands/decidim/proposals/unvote_proposal.rb +34 -3
- data/app/commands/decidim/proposals/vote_proposal.rb +32 -2
- data/app/controllers/decidim/proposals/admin/participatory_texts_controller.rb +62 -0
- data/app/controllers/decidim/proposals/admin/proposals_controller.rb +28 -1
- data/app/controllers/decidim/proposals/admin/proposals_merges_controller.rb +27 -0
- data/app/controllers/decidim/proposals/admin/proposals_splits_controller.rb +27 -0
- data/app/controllers/decidim/proposals/collaborative_drafts_controller.rb +0 -1
- data/app/controllers/decidim/proposals/proposal_endorsements_controller.rb +6 -2
- data/app/controllers/decidim/proposals/proposal_votes_controller.rb +15 -0
- data/app/controllers/decidim/proposals/proposals_controller.rb +1 -1
- data/app/forms/decidim/proposals/admin/import_participatory_text_form.rb +28 -0
- data/app/forms/decidim/proposals/admin/preview_participatory_text_form.rb +21 -0
- data/app/forms/decidim/proposals/admin/proposal_form.rb +4 -1
- data/app/forms/decidim/proposals/admin/proposals_fork_form.rb +57 -0
- data/app/forms/decidim/proposals/admin/proposals_merge_form.rb +13 -0
- data/app/forms/decidim/proposals/admin/proposals_split_form.rb +12 -0
- data/app/helpers/decidim/proposals/application_helper.rb +23 -0
- data/app/helpers/decidim/proposals/map_helper.rb +1 -1
- data/app/helpers/decidim/proposals/participatory_texts_helper.rb +18 -0
- data/app/helpers/decidim/proposals/proposal_endorsements_helper.rb +1 -1
- data/app/helpers/decidim/proposals/proposal_wizard_helper.rb +2 -1
- data/app/jobs/decidim/proposals/notify_proposals_mentioned_job.rb +3 -4
- data/app/models/decidim/proposals/participatory_text.rb +13 -0
- data/app/models/decidim/proposals/proposal.rb +31 -9
- data/app/models/decidim/proposals/proposal_vote.rb +21 -1
- data/app/permissions/decidim/proposals/admin/permissions.rb +30 -0
- data/app/presenters/decidim/proposals/admin_log/proposal_presenter.rb +5 -1
- data/app/presenters/decidim/proposals/log/resource_presenter.rb +18 -0
- data/app/presenters/decidim/proposals/official_author_presenter.rb +4 -0
- data/app/queries/decidim/proposals/metrics/accepted_proposals_metric_manage.rb +29 -0
- data/app/queries/decidim/proposals/metrics/proposals_metric_manage.rb +53 -0
- data/app/queries/decidim/proposals/metrics/votes_metric_manage.rb +57 -0
- data/app/services/decidim/proposals/proposal_builder.rb +72 -0
- data/app/services/decidim/proposals/proposal_search.rb +2 -2
- data/app/views/decidim/proposals/admin/participatory_texts/_article-preview.html.erb +13 -0
- data/app/views/decidim/proposals/admin/participatory_texts/_bulk-actions.html.erb +1 -0
- data/app/views/decidim/proposals/admin/participatory_texts/index.html.erb +43 -0
- data/app/views/decidim/proposals/admin/participatory_texts/new_import.html.erb +39 -0
- data/app/views/decidim/proposals/admin/proposals/_bulk-actions.html.erb +7 -2
- data/app/views/decidim/proposals/admin/proposals/_proposal-tr.html.erb +4 -0
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_dropdown.html.erb +36 -0
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_merge.html.erb +15 -0
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_recategorize.html.erb +15 -0
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_split.html.erb +15 -0
- data/app/views/decidim/proposals/admin/proposals/edit.html.erb +7 -0
- data/app/views/decidim/proposals/admin/proposals/index.html.erb +2 -2
- data/app/views/decidim/proposals/collaborative_drafts/compare.html.erb +2 -2
- data/app/views/decidim/proposals/collaborative_drafts/complete.html.erb +1 -1
- data/app/views/decidim/proposals/collaborative_drafts/show.html.erb +1 -1
- data/app/views/decidim/proposals/proposal_endorsements/_identity.html.erb +5 -1
- data/app/views/decidim/proposals/proposal_endorsements/update_buttons_and_counters.js.erb +1 -1
- data/app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb +13 -4
- data/app/views/decidim/proposals/proposals/_edit_form_fields.html.erb +2 -2
- data/app/views/decidim/proposals/proposals/_endorsement_identities_cabin.html.erb +1 -1
- data/app/views/decidim/proposals/proposals/_proposal_similar.html.erb +1 -1
- data/app/views/decidim/proposals/proposals/_voting_rules.html.erb +15 -4
- data/app/views/decidim/proposals/proposals/new.html.erb +1 -1
- data/config/locales/ca.yml +72 -4
- data/config/locales/de.yml +71 -3
- data/config/locales/en.yml +71 -3
- data/config/locales/es-PY.yml +71 -3
- data/config/locales/es.yml +73 -5
- data/config/locales/eu.yml +71 -3
- data/config/locales/fi.yml +81 -13
- data/config/locales/fr.yml +71 -3
- data/config/locales/gl.yml +71 -3
- data/config/locales/hu.yml +71 -3
- data/config/locales/it.yml +71 -3
- data/config/locales/nl.yml +71 -3
- data/config/locales/pl.yml +71 -3
- data/config/locales/pt-BR.yml +72 -4
- data/config/locales/pt.yml +71 -3
- data/config/locales/sv.yml +71 -3
- data/db/migrate/20180927111721_create_participatory_texts.rb +13 -0
- data/db/migrate/20180930125321_add_participatory_text_level_to_proposals.rb +7 -0
- data/db/migrate/20180930125321_add_position_to_proposals.rb +7 -0
- data/db/migrate/20181003074440_fix_user_groups_ids_in_proposals_endorsements.rb +16 -0
- data/db/migrate/20181010114622_add_temporary_votes.rb +9 -0
- data/db/migrate/20181016132225_add_organization_as_author.rb +13 -0
- data/db/migrate/20181017084221_make_author_polymorhpic_for_proposal_endorsements.rb +31 -0
- data/lib/decidim/content_parsers/proposal_parser.rb +9 -3
- data/lib/decidim/proposals.rb +3 -1
- data/lib/decidim/proposals/admin_engine.rb +12 -1
- data/lib/decidim/proposals/component.rb +60 -23
- data/lib/decidim/proposals/engine.rb +55 -12
- data/lib/decidim/proposals/markdown_to_proposals.rb +90 -0
- data/lib/decidim/proposals/participatory_text_section.rb +21 -0
- data/lib/decidim/proposals/test/factories.rb +35 -7
- data/lib/decidim/proposals/version.rb +1 -1
- metadata +86 -19
@@ -15,6 +15,10 @@ module Decidim
|
|
15
15
|
class ProposalPresenter < Decidim::Log::BasePresenter
|
16
16
|
private
|
17
17
|
|
18
|
+
def resource_presenter
|
19
|
+
@resource_presenter ||= Decidim::Proposals::Log::ResourcePresenter.new(action_log.resource, h, action_log.extra["resource"])
|
20
|
+
end
|
21
|
+
|
18
22
|
def diff_fields_mapping
|
19
23
|
{
|
20
24
|
title: "Decidim::Proposals::AdminLog::ValueTypes::ProposalTitleBodyPresenter",
|
@@ -27,7 +31,7 @@ module Decidim
|
|
27
31
|
|
28
32
|
def action_string
|
29
33
|
case action
|
30
|
-
when "answer", "create"
|
34
|
+
when "answer", "create", "update"
|
31
35
|
"decidim.proposals.admin_log.proposal.#{action}"
|
32
36
|
else
|
33
37
|
super
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Proposals
|
5
|
+
module Log
|
6
|
+
class ResourcePresenter < Decidim::Log::ResourcePresenter
|
7
|
+
private
|
8
|
+
|
9
|
+
# Private: Presents resource name.
|
10
|
+
#
|
11
|
+
# Returns an HTML-safe String.
|
12
|
+
def present_resource_name
|
13
|
+
Decidim::Proposals::ProposalPresenter.new(resource).title
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Proposals
|
5
|
+
module Metrics
|
6
|
+
class AcceptedProposalsMetricManage < Decidim::Proposals::Metrics::ProposalsMetricManage
|
7
|
+
def metric_name
|
8
|
+
"accepted_proposals"
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def query
|
14
|
+
return @query if @query
|
15
|
+
|
16
|
+
spaces = Decidim.participatory_space_manifests.flat_map do |manifest|
|
17
|
+
manifest.participatory_spaces.call(@organization).public_spaces
|
18
|
+
end
|
19
|
+
components = Decidim::Component.where(participatory_space: spaces).published
|
20
|
+
@query = Decidim::Proposals::Proposal.where(component: components).joins(:component)
|
21
|
+
.left_outer_joins(:category)
|
22
|
+
@query = @query.where("decidim_proposals_proposals.published_at <= ?", end_time).accepted
|
23
|
+
@query = @query.group("decidim_categorizations.id", :participatory_space_type, :participatory_space_id)
|
24
|
+
@query
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Proposals
|
5
|
+
module Metrics
|
6
|
+
class ProposalsMetricManage < Decidim::MetricManage
|
7
|
+
def metric_name
|
8
|
+
"proposals"
|
9
|
+
end
|
10
|
+
|
11
|
+
def save
|
12
|
+
return @registry if @registry
|
13
|
+
|
14
|
+
@registry = []
|
15
|
+
cumulative.each do |key, cumulative_value|
|
16
|
+
next if cumulative_value.zero?
|
17
|
+
quantity_value = quantity[key] || 0
|
18
|
+
category_id, space_type, space_id = key
|
19
|
+
record = Decidim::Metric.find_or_initialize_by(day: @day.to_s, metric_type: @metric_name,
|
20
|
+
organization: @organization, decidim_category_id: category_id,
|
21
|
+
participatory_space_type: space_type, participatory_space_id: space_id)
|
22
|
+
record.assign_attributes(cumulative: cumulative_value, quantity: quantity_value)
|
23
|
+
@registry << record
|
24
|
+
end
|
25
|
+
@registry.each(&:save!)
|
26
|
+
@registry
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def query
|
32
|
+
return @query if @query
|
33
|
+
|
34
|
+
spaces = Decidim.participatory_space_manifests.flat_map do |manifest|
|
35
|
+
manifest.participatory_spaces.call(@organization).public_spaces
|
36
|
+
end
|
37
|
+
components = Decidim::Component.where(participatory_space: spaces).published
|
38
|
+
@query = Decidim::Proposals::Proposal.where(component: components).joins(:component)
|
39
|
+
.left_outer_joins(:category)
|
40
|
+
@query = @query.where("decidim_proposals_proposals.published_at <= ?", end_time).except_withdrawn
|
41
|
+
@query = @query.group("decidim_categorizations.decidim_category_id",
|
42
|
+
:participatory_space_type,
|
43
|
+
:participatory_space_id)
|
44
|
+
@query
|
45
|
+
end
|
46
|
+
|
47
|
+
def quantity
|
48
|
+
@quantity ||= query.where("decidim_proposals_proposals.published_at >= ?", start_time).count
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Proposals
|
5
|
+
module Metrics
|
6
|
+
class VotesMetricManage < Decidim::MetricManage
|
7
|
+
def metric_name
|
8
|
+
"votes"
|
9
|
+
end
|
10
|
+
|
11
|
+
def save
|
12
|
+
return @registry if @registry
|
13
|
+
|
14
|
+
@registry = []
|
15
|
+
cumulative.each do |key, cumulative_value|
|
16
|
+
next if cumulative_value.zero?
|
17
|
+
quantity_value = quantity[key] || 0
|
18
|
+
category_id, space_type, space_id, proposal_id = key
|
19
|
+
record = Decidim::Metric.find_or_initialize_by(day: @day.to_s, metric_type: @metric_name,
|
20
|
+
organization: @organization, decidim_category_id: category_id,
|
21
|
+
participatory_space_type: space_type, participatory_space_id: space_id,
|
22
|
+
related_object_type: "Decidim::Proposals::Proposal", related_object_id: proposal_id)
|
23
|
+
record.assign_attributes(cumulative: cumulative_value, quantity: quantity_value)
|
24
|
+
@registry << record
|
25
|
+
end
|
26
|
+
@registry.each(&:save!)
|
27
|
+
@registry
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def query
|
33
|
+
return @query if @query
|
34
|
+
|
35
|
+
spaces = Decidim.participatory_space_manifests.flat_map do |manifest|
|
36
|
+
manifest.participatory_spaces.call(@organization).public_spaces
|
37
|
+
end
|
38
|
+
components = Decidim::Component.where(participatory_space: spaces).published
|
39
|
+
proposals = Decidim::Proposals::Proposal.where(component: components).except_withdrawn
|
40
|
+
@query = Decidim::Proposals::ProposalVote.joins(proposal: :component)
|
41
|
+
.left_outer_joins(proposal: :category)
|
42
|
+
.where(proposal: proposals)
|
43
|
+
@query = @query.where("decidim_proposals_proposal_votes.created_at <= ?", end_time)
|
44
|
+
@query = @query.group("decidim_categorizations.id",
|
45
|
+
:participatory_space_type,
|
46
|
+
:participatory_space_id,
|
47
|
+
:decidim_proposal_id)
|
48
|
+
@query
|
49
|
+
end
|
50
|
+
|
51
|
+
def quantity
|
52
|
+
@quantity ||= query.where("decidim_proposals_proposal_votes.created_at >= ?", start_time).count
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Proposals
|
5
|
+
# A factory class to ensure we always create Proposals the same way since it involves some logic.
|
6
|
+
module ProposalBuilder
|
7
|
+
# Public: Creates a new Proposal.
|
8
|
+
#
|
9
|
+
# attributes - The Hash of attributes to create the Proposal with.
|
10
|
+
# author - An Authorable the will be the first coauthor of the Proposal.
|
11
|
+
# user_group_author - A User Group to, optionally, set it as the author too.
|
12
|
+
# action_user - The User to be used as the user who is creating the proposal in the traceability logs.
|
13
|
+
#
|
14
|
+
# Returns a Proposal.
|
15
|
+
def create(attributes:, author:, action_user:, user_group_author: nil)
|
16
|
+
Decidim.traceability.perform_action!(:create, Proposal, action_user, visibility: "all") do
|
17
|
+
proposal = Proposal.new(attributes)
|
18
|
+
proposal.add_coauthor(author, user_group: user_group_author)
|
19
|
+
proposal.save!
|
20
|
+
proposal
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
module_function :create
|
25
|
+
|
26
|
+
# Public: Creates a new Proposal by copying the attributes from another one.
|
27
|
+
#
|
28
|
+
# original_proposal - The Proposal to be used as base to create the new one.
|
29
|
+
# author - An Authorable the will be the first coauthor of the Proposal.
|
30
|
+
# user_group_author - A User Group to, optionally, set it as the author too.
|
31
|
+
# action_user - The User to be used as the user who is creating the proposal in the traceability logs.
|
32
|
+
# extra_attributes - A Hash of attributes to create the new proposal, will overwrite the original ones.
|
33
|
+
# skip_link - Whether to skip linking the two proposals or not (default false).
|
34
|
+
#
|
35
|
+
# Returns a Proposal
|
36
|
+
#
|
37
|
+
# rubocop:disable Metrics/ParameterLists
|
38
|
+
def copy(original_proposal, author:, action_user:, user_group_author: nil, extra_attributes: {}, skip_link: false)
|
39
|
+
origin_attributes = original_proposal.attributes.except(
|
40
|
+
"id",
|
41
|
+
"created_at",
|
42
|
+
"updated_at",
|
43
|
+
"state",
|
44
|
+
"answer",
|
45
|
+
"answered_at",
|
46
|
+
"decidim_component_id",
|
47
|
+
"reference",
|
48
|
+
"proposal_votes_count",
|
49
|
+
"proposal_endorsements_count",
|
50
|
+
"proposal_notes_count"
|
51
|
+
).merge(
|
52
|
+
"category" => original_proposal.category
|
53
|
+
).merge(
|
54
|
+
extra_attributes
|
55
|
+
)
|
56
|
+
|
57
|
+
proposal = create(
|
58
|
+
attributes: origin_attributes,
|
59
|
+
author: author,
|
60
|
+
user_group_author: user_group_author,
|
61
|
+
action_user: action_user
|
62
|
+
)
|
63
|
+
|
64
|
+
proposal.link_resources(original_proposal, "copied_from_component") unless skip_link
|
65
|
+
proposal
|
66
|
+
end
|
67
|
+
# rubocop:enable Metrics/ParameterLists
|
68
|
+
|
69
|
+
module_function :copy
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -24,9 +24,9 @@ module Decidim
|
|
24
24
|
# The 'official' proposals doesn't have an author id
|
25
25
|
def search_origin
|
26
26
|
if origin == "official"
|
27
|
-
query.where(coauthorships_count: 0)
|
27
|
+
query.where.not(coauthorships_count: 0).joins(:coauthorships).where(decidim_coauthorships: { decidim_author_type: "Decidim::Organization" })
|
28
28
|
elsif origin == "citizens"
|
29
|
-
query.where.not(coauthorships_count: 0)
|
29
|
+
query.where.not(coauthorships_count: 0).joins(:coauthorships).where.not(decidim_coauthorships: { decidim_author_type: "Decidim::Organization" })
|
30
30
|
else # Assume 'all'
|
31
31
|
query
|
32
32
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div class="grid-x">
|
2
|
+
<div class="cell">
|
3
|
+
<%= form.hidden_field :position, class: "position" %>
|
4
|
+
<%= form.text_field :title, optional: false %>
|
5
|
+
</div>
|
6
|
+
</div>
|
7
|
+
<% if proposal.article? %>
|
8
|
+
<div class="grid-x">
|
9
|
+
<div class="cell">
|
10
|
+
<%= form.text_area :body, optional: true %>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= link_to t(".import_doc"), new_import_participatory_texts_path, id: "import-doc", class: "button tiny button--title" %>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<%= decidim_form_for(@preview_form, url: publish_participatory_texts_path, class: "form grid-container") do |form| %>
|
2
|
+
<div class="card">
|
3
|
+
<div class="card-divider">
|
4
|
+
<h2 class="card-title">
|
5
|
+
<%= t(".title") %>
|
6
|
+
<%= render partial: "bulk-actions" %>
|
7
|
+
</h2>
|
8
|
+
</div>
|
9
|
+
<div class="card-section">
|
10
|
+
<% if @drafts.any? %>
|
11
|
+
<p><%= t(".info_1") %></p>
|
12
|
+
<ul id="participatory-text" class="accordion js-sortable mb-m"
|
13
|
+
data-accordion
|
14
|
+
data-multi-expand="true"
|
15
|
+
data-allow-all-closed="true">
|
16
|
+
<%= form.fields_for(:proposals) do |prop_form| %>
|
17
|
+
<% proposal= @drafts[prop_form.index] %>
|
18
|
+
<li class="accordion-item" data-accordion-item>
|
19
|
+
<a href="#" class="accordion-title flex--sbc"><%= preview_participatory_text_section_title(proposal) %><span class="mr-m"><%= icon "menu", class: "icon--small" %></span></a>
|
20
|
+
<div class="accordion-content" data-tab-content>
|
21
|
+
<%= render "article-preview", { form: prop_form, proposal: proposal } %>
|
22
|
+
</div>
|
23
|
+
</li>
|
24
|
+
<% end %>
|
25
|
+
</ul>
|
26
|
+
<% end -%>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
<div class="grid-x align-center mt-sm">
|
30
|
+
<%= form.submit t(".publish_document") %>
|
31
|
+
</div>
|
32
|
+
<% end -%>
|
33
|
+
<script>
|
34
|
+
$(window).on("load", function() {
|
35
|
+
$( "#participatory-text" ).on( "sortupdate",
|
36
|
+
function( event, ui ) {
|
37
|
+
$('#participatory-text li').each(function(idx, li) {
|
38
|
+
input= $(li).find("input.position").val(idx+1)
|
39
|
+
})
|
40
|
+
}
|
41
|
+
)
|
42
|
+
})
|
43
|
+
</script>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<%= decidim_form_for(@import, url: import_participatory_texts_path, class: "form grid-container") do |form| %>
|
2
|
+
<div class="card">
|
3
|
+
<div class="card-divider">
|
4
|
+
<h2 class="card-title"><%= t(".title") %></h2>
|
5
|
+
</div>
|
6
|
+
<div class="card-section">
|
7
|
+
<div class="grid-x">
|
8
|
+
<div class="cell">
|
9
|
+
<div id="import-title" class="row column">
|
10
|
+
<%= form.translated :text_field, :title, autofocus: true %>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
<div class="grid-x">
|
15
|
+
<div class="cell">
|
16
|
+
<div id="import-desc" class="row column">
|
17
|
+
<%= form.translated :text_area, :description %>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
<div class="grid-x">
|
22
|
+
<div class="cell">
|
23
|
+
<fieldset>
|
24
|
+
<legend><%= t(".document_legend") %></legend>
|
25
|
+
<div class="row column">
|
26
|
+
<%= form.upload :document, optional: false %>
|
27
|
+
</div>
|
28
|
+
</fieldset>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
<div class="grid-x align-center mt-sm">
|
34
|
+
<%= form.submit t(".upload_document") %>
|
35
|
+
</div>
|
36
|
+
<div class="grid-x align-center">
|
37
|
+
<%= t(".bottom_hint") %>
|
38
|
+
</div>
|
39
|
+
<% end -%>
|
@@ -1,7 +1,10 @@
|
|
1
1
|
<div class="flex--cc flex-gap--1">
|
2
|
-
<%=
|
2
|
+
<%= render partial: "decidim/proposals/admin/proposals/bulk_actions/dropdown" %>
|
3
3
|
|
4
4
|
<div id="js-other-actions-wrapper">
|
5
|
+
<% if component_settings.participatory_texts_enabled? %>
|
6
|
+
<%= link_to t("actions.participatory_texts", scope: "decidim.proposals"), participatory_texts_path, id: "participatory_texts", class: "button tiny button--simple" %>
|
7
|
+
<% end %>
|
5
8
|
<%= link_to t("actions.import", scope: "decidim.proposals", name: t("models.proposal.name", scope: "decidim.proposals.admin")), new_proposals_import_path, class: "button tiny button--simple" if allowed_to? :import, :proposals %>
|
6
9
|
|
7
10
|
<% if allowed_to? :create, :proposal %>
|
@@ -11,5 +14,7 @@
|
|
11
14
|
<%= export_dropdown %>
|
12
15
|
</div>
|
13
16
|
|
14
|
-
<%=
|
17
|
+
<%= render partial: "decidim/proposals/admin/proposals/bulk_actions/recategorize" %>
|
18
|
+
<%= render partial: "decidim/proposals/admin/proposals/bulk_actions/merge" %>
|
19
|
+
<%= render partial: "decidim/proposals/admin/proposals/bulk_actions/split" %>
|
15
20
|
</div>
|
@@ -51,6 +51,10 @@
|
|
51
51
|
</td>
|
52
52
|
|
53
53
|
<td class="table-list__actions">
|
54
|
+
<% if allowed_to? :edit, :proposal, proposal: proposal %>
|
55
|
+
<%= icon_link_to "pencil", edit_proposal_path(proposal), t("actions.edit_proposal", scope: "decidim.proposals"), class: "action-icon--edit-proposal" %>
|
56
|
+
<% end %>
|
57
|
+
|
54
58
|
<% if allowed_to? :create, :proposal_note %>
|
55
59
|
<%= icon_link_to "chat", proposal_proposal_notes_path(proposal_id: proposal.id), t("actions.private_notes", scope: "decidim.proposals"), class: "action-icon--index-notes" %>
|
56
60
|
<% end %>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<div id="js-bulk-actions-wrapper">
|
2
|
+
<button
|
3
|
+
id="js-bulk-actions-button"
|
4
|
+
class="button button--nomargin tiny success light dropdown"
|
5
|
+
type="button"
|
6
|
+
data-toggle="js-bulk-actions-dropdown">
|
7
|
+
<%= t("decidim.proposals.admin.proposals.index.actions") %>
|
8
|
+
</button>
|
9
|
+
|
10
|
+
<div
|
11
|
+
id="js-bulk-actions-dropdown"
|
12
|
+
class="dropdown-pane"
|
13
|
+
data-position="bottom"
|
14
|
+
data-alignment="right"
|
15
|
+
data-dropdown="dropdown"
|
16
|
+
data-auto-focus="false"
|
17
|
+
data-events="resize">
|
18
|
+
<ul class="list-reset">
|
19
|
+
<li>
|
20
|
+
<button type="button" data-action="recategorize-proposals">
|
21
|
+
<%= t("decidim.proposals.admin.proposals.index.change_category") %>
|
22
|
+
</button>
|
23
|
+
</li>
|
24
|
+
<li>
|
25
|
+
<button type="button" data-action="merge-proposals">
|
26
|
+
<%= t("decidim.proposals.admin.proposals.index.merge") %>
|
27
|
+
</button>
|
28
|
+
</li>
|
29
|
+
<li>
|
30
|
+
<button type="button" data-action="split-proposals">
|
31
|
+
<%= t("decidim.proposals.admin.proposals.index.split") %>
|
32
|
+
</button>
|
33
|
+
</li>
|
34
|
+
</ul>
|
35
|
+
</div>
|
36
|
+
</div>
|