decidim-proposals 0.29.2 → 0.30.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/proposals/highlighted_proposals_for_component/show.erb +1 -1
- data/app/cells/decidim/proposals/highlighted_proposals_for_component_cell.rb +1 -1
- data/app/cells/decidim/proposals/participatory_text_proposal_cell.rb +1 -1
- data/app/cells/decidim/proposals/proposal_g/show.erb +13 -0
- data/app/cells/decidim/proposals/proposal_g_cell.rb +13 -0
- data/app/cells/decidim/proposals/proposal_history_cell.rb +107 -0
- data/app/cells/decidim/proposals/proposal_l/show.erb +37 -0
- data/app/cells/decidim/proposals/proposal_l_cell.rb +9 -0
- data/app/cells/decidim/proposals/proposal_metadata_cell.rb +2 -2
- data/app/cells/decidim/proposals/proposal_vote/show.erb +75 -0
- data/app/cells/decidim/proposals/proposal_vote_cell.rb +43 -0
- data/app/commands/decidim/proposals/accept_coauthorship.rb +62 -0
- data/app/commands/decidim/proposals/admin/assign_proposals_to_valuator.rb +14 -0
- data/app/commands/decidim/proposals/admin/create_proposal.rb +6 -14
- data/app/commands/decidim/proposals/admin/create_proposal_note.rb +20 -11
- data/app/commands/decidim/proposals/admin/import_proposals.rb +0 -5
- data/app/commands/decidim/proposals/admin/merge_proposals.rb +2 -2
- data/app/commands/decidim/proposals/admin/proposal_notes_methods.rb +48 -0
- data/app/commands/decidim/proposals/admin/reply_proposal_note.rb +92 -0
- data/app/commands/decidim/proposals/admin/split_proposals.rb +2 -2
- data/app/commands/decidim/proposals/admin/update_proposal.rb +10 -16
- data/app/commands/decidim/proposals/admin/update_proposal_taxonomies.rb +34 -0
- data/app/commands/decidim/proposals/cancel_coauthorship.rb +32 -0
- data/app/commands/decidim/proposals/create_collaborative_draft.rb +1 -2
- data/app/commands/decidim/proposals/create_proposal.rb +1 -2
- data/app/commands/decidim/proposals/invite_coauthor.rb +45 -0
- data/app/commands/decidim/proposals/publish_collaborative_draft.rb +1 -2
- data/app/commands/decidim/proposals/reject_coauthorship.rb +54 -0
- data/app/commands/decidim/proposals/update_collaborative_draft.rb +1 -2
- data/app/commands/decidim/proposals/update_proposal.rb +1 -2
- data/app/controllers/concerns/decidim/proposals/admin/filterable.rb +5 -1
- data/app/controllers/concerns/decidim/proposals/admin/needs_interpolations.rb +40 -0
- data/app/controllers/decidim/proposals/admin/proposal_answers_controller.rb +50 -2
- data/app/controllers/decidim/proposals/admin/proposal_notes_controller.rb +18 -0
- data/app/controllers/decidim/proposals/admin/proposals_controller.rb +41 -85
- data/app/controllers/decidim/proposals/collaborative_drafts_controller.rb +2 -4
- data/app/controllers/decidim/proposals/invite_coauthors_controller.rb +87 -0
- data/app/controllers/decidim/proposals/proposals_controller.rb +7 -32
- data/app/events/decidim/proposals/accepted_coauthorship_event.rb +8 -0
- data/app/events/decidim/proposals/admin/proposal_assigned_to_valuator_event.rb +27 -0
- data/app/events/decidim/proposals/admin/proposal_note_created_event.rb +5 -0
- data/app/events/decidim/proposals/coauthor_accepted_invite_event.rb +49 -0
- data/app/events/decidim/proposals/coauthor_invited_event.rb +45 -0
- data/app/events/decidim/proposals/coauthor_rejected_invite_event.rb +8 -0
- data/app/events/decidim/proposals/rejected_coauthorship_event.rb +8 -0
- data/app/events/decidim/proposals/update_proposal_taxonomies_event.rb +9 -0
- data/app/forms/decidim/proposals/admin/proposal_answer_form.rb +1 -0
- data/app/forms/decidim/proposals/admin/proposal_base_form.rb +3 -31
- data/app/forms/decidim/proposals/admin/proposal_form.rb +11 -6
- data/app/forms/decidim/proposals/admin/proposals_import_form.rb +0 -5
- data/app/forms/decidim/proposals/collaborative_draft_form.rb +0 -8
- data/app/forms/decidim/proposals/proposal_form.rb +5 -32
- data/app/helpers/decidim/proposals/admin/proposal_bulk_actions_helper.rb +25 -0
- data/app/helpers/decidim/proposals/admin/proposals_helper.rb +0 -1
- data/app/helpers/decidim/proposals/application_helper.rb +23 -14
- data/app/helpers/decidim/proposals/collaborative_draft_helper.rb +7 -7
- data/app/helpers/decidim/proposals/map_helper.rb +0 -18
- data/app/helpers/decidim/proposals/proposal_votes_helper.rb +15 -2
- data/app/jobs/decidim/proposals/admin/proposal_answer_job.rb +20 -0
- data/app/models/decidim/proposals/collaborative_draft.rb +10 -1
- data/app/models/decidim/proposals/proposal.rb +66 -5
- data/app/models/decidim/proposals/proposal_note.rb +11 -0
- data/app/models/decidim/proposals/proposal_state.rb +1 -1
- data/app/packs/entrypoints/decidim_proposals.js +1 -0
- data/app/packs/entrypoints/decidim_proposals_geocoding.js +2 -0
- data/app/packs/src/decidim/proposals/admin/proposals.js +16 -1
- data/app/packs/src/decidim/proposals/exit_handler.js +73 -0
- data/app/packs/stylesheets/decidim/proposals/proposals.scss +248 -3
- data/app/permissions/decidim/proposals/admin/permissions.rb +2 -5
- data/app/permissions/decidim/proposals/permissions.rb +42 -0
- data/app/presenters/decidim/proposals/admin_log/proposal_presenter.rb +1 -1
- data/app/presenters/decidim/proposals/proposal_presenter.rb +1 -1
- data/app/queries/decidim/proposals/filtered_proposals.rb +2 -2
- data/app/queries/decidim/proposals/metrics/accepted_proposals_metric_manage.rb +2 -2
- data/app/queries/decidim/proposals/metrics/endorsements_metric_manage.rb +10 -10
- data/app/queries/decidim/proposals/metrics/proposal_followers_metric_measure.rb +4 -4
- data/app/queries/decidim/proposals/metrics/proposal_participants_metric_measure.rb +6 -6
- data/app/queries/decidim/proposals/metrics/proposals_metric_manage.rb +6 -6
- data/app/queries/decidim/proposals/metrics/votes_metric_manage.rb +6 -6
- data/app/services/decidim/proposals/proposal_builder.rb +1 -1
- data/app/views/decidim/proposals/admin/proposal_notes/_form.html.erb +3 -3
- data/app/views/decidim/proposals/admin/proposal_notes/_proposal_note.html.erb +28 -0
- data/app/views/decidim/proposals/admin/proposal_notes/_proposal_note_reply.html.erb +9 -0
- data/app/views/decidim/proposals/admin/proposal_notes/_proposal_notes.html.erb +4 -28
- data/app/views/decidim/proposals/admin/proposal_states/_form.html.erb +1 -1
- data/app/views/decidim/proposals/admin/proposals/_actions.html.erb +21 -0
- data/app/views/decidim/proposals/admin/proposals/_bulk-actions.html.erb +3 -2
- data/app/views/decidim/proposals/admin/proposals/_form.html.erb +16 -23
- data/app/views/decidim/proposals/admin/proposals/_proposal-tr.html.erb +12 -28
- data/app/views/decidim/proposals/admin/proposals/_proposals-thead.html.erb +45 -0
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_apply_answer_template.html.erb +22 -0
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_dropdown.html.erb +15 -11
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_taxonomy_change.html.erb +23 -0
- data/app/views/decidim/proposals/admin/proposals/index.html.erb +17 -48
- data/app/views/decidim/proposals/admin/proposals/manage_trash.html.erb +18 -0
- data/app/views/decidim/proposals/admin/proposals/publish_answers.js.erb +1 -1
- data/app/views/decidim/proposals/admin/proposals/show.html.erb +10 -22
- data/app/views/decidim/proposals/admin/proposals/update_attribute.js.erb +1 -1
- data/app/views/decidim/proposals/admin/proposals_imports/new.html.erb +0 -3
- data/app/views/decidim/proposals/collaborative_drafts/_collaborative_actions.html.erb +9 -0
- data/app/views/decidim/proposals/collaborative_drafts/_collaborative_draft_aside.html.erb +0 -15
- data/app/views/decidim/proposals/collaborative_drafts/_edit_form_fields.html.erb +4 -6
- data/app/views/decidim/proposals/collaborative_drafts/index.html.erb +6 -2
- data/app/views/decidim/proposals/collaborative_drafts/show.html.erb +27 -11
- data/app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb +29 -9
- data/app/views/decidim/proposals/proposals/_actions.html.erb +4 -7
- data/app/views/decidim/proposals/proposals/_edit_form_fields.html.erb +17 -22
- data/app/views/decidim/proposals/proposals/_exit_modal.html.erb +17 -0
- data/app/views/decidim/proposals/proposals/_notification_alert_box.html.erb +1 -0
- data/app/views/decidim/proposals/proposals/_proposal_actions.html.erb +19 -0
- data/app/views/decidim/proposals/proposals/_proposal_aside.html.erb +9 -32
- data/app/views/decidim/proposals/proposals/_proposal_voting_rules.html.erb +33 -0
- data/app/views/decidim/proposals/proposals/_remaining_votes_count.html.erb +2 -2
- data/app/views/decidim/proposals/proposals/_remaining_votes_notification.html.erb +12 -0
- data/app/views/decidim/proposals/proposals/_update_proposal_voting_rules.html.erb +6 -0
- data/app/views/decidim/proposals/proposals/_vote_button.html.erb +12 -8
- data/app/views/decidim/proposals/proposals/_votes_count.html.erb +2 -1
- data/app/views/decidim/proposals/proposals/_voting_rules.html.erb +1 -7
- data/app/views/decidim/proposals/proposals/index.html.erb +10 -18
- data/app/views/decidim/proposals/proposals/index.js.erb +1 -1
- data/app/views/decidim/proposals/proposals/participatory_texts/_proposal_vote_button.html.erb +3 -1
- data/app/views/decidim/proposals/proposals/show.html.erb +35 -15
- data/config/locales/ar.yml +18 -72
- data/config/locales/bg.yml +7 -89
- data/config/locales/bs-BA.yml +0 -13
- data/config/locales/ca.yml +212 -72
- data/config/locales/cs.yml +213 -73
- data/config/locales/de.yml +214 -75
- data/config/locales/el.yml +8 -82
- data/config/locales/en.yml +209 -69
- data/config/locales/es-MX.yml +213 -73
- data/config/locales/es-PY.yml +213 -73
- data/config/locales/es.yml +215 -75
- data/config/locales/eu.yml +217 -78
- data/config/locales/fi-plain.yml +216 -75
- data/config/locales/fi.yml +216 -75
- data/config/locales/fr-CA.yml +118 -87
- data/config/locales/fr.yml +118 -87
- data/config/locales/ga-IE.yml +0 -19
- data/config/locales/gl.yml +8 -43
- data/config/locales/hu.yml +6 -66
- data/config/locales/id-ID.yml +8 -40
- data/config/locales/is-IS.yml +0 -14
- data/config/locales/it.yml +8 -53
- data/config/locales/ja.yml +162 -87
- data/config/locales/lt.yml +8 -83
- data/config/locales/lv.yml +8 -50
- data/config/locales/nl.yml +6 -55
- data/config/locales/no.yml +8 -42
- data/config/locales/pl.yml +6 -88
- data/config/locales/pt-BR.yml +6 -74
- data/config/locales/pt.yml +8 -54
- data/config/locales/ro-RO.yml +10 -54
- data/config/locales/ru.yml +0 -18
- data/config/locales/sk.yml +8 -50
- data/config/locales/sr-CS.yml +0 -14
- data/config/locales/sv.yml +128 -85
- data/config/locales/tr-TR.yml +8 -51
- data/config/locales/uk.yml +0 -18
- data/config/locales/zh-CN.yml +8 -51
- data/config/locales/zh-TW.yml +8 -84
- data/db/migrate/20171220084719_add_published_at_to_proposals.rb +1 -1
- data/db/migrate/20181016132225_add_organization_as_author.rb +1 -1
- data/db/migrate/20200120215928_move_proposal_endorsements_to_core_endorsements.rb +1 -1
- data/db/migrate/20200827154156_add_commentable_counter_cache_to_proposals.rb +3 -3
- data/db/migrate/20210310102839_add_followable_counter_cache_to_proposals.rb +1 -1
- data/db/migrate/20240110203504_create_default_proposal_states.rb +1 -1
- data/db/migrate/20240404202756_add_valuation_assignments_count_to_decidim_proposals_proposals.rb +1 -1
- data/db/migrate/20240617091140_add_email_on_assigned_proposals_to_users.rb +7 -0
- data/db/migrate/20240617170052_add_parent_relation_to_decidim_proposal_notes.rb +7 -0
- data/db/migrate/20240828103755_add_deleted_at_to_decidim_proposals_proposals.rb +8 -0
- data/decidim-proposals.gemspec +1 -1
- data/lib/decidim/api/functions/proposal_finder_helper.rb +12 -0
- data/lib/decidim/api/functions/proposal_list_helper.rb +12 -0
- data/lib/decidim/api/proposal_type.rb +17 -25
- data/lib/decidim/api/proposals_type.rb +4 -19
- data/lib/decidim/proposals/admin_engine.rb +12 -3
- data/lib/decidim/proposals/admin_filter.rb +3 -6
- data/lib/decidim/proposals/component.rb +4 -5
- data/lib/decidim/proposals/download_your_data_proposal_serializer.rb +15 -0
- data/lib/decidim/proposals/engine.rb +5 -0
- data/lib/decidim/proposals/import/proposal_creator.rb +4 -4
- data/lib/decidim/proposals/proposal_serializer.rb +12 -29
- data/lib/decidim/proposals/seeds.rb +21 -17
- data/lib/decidim/proposals/test/factories.rb +2 -1
- data/lib/decidim/proposals/version.rb +1 -1
- data/lib/decidim/proposals.rb +4 -0
- metadata +65 -29
- data/app/commands/decidim/proposals/admin/update_proposal_category.rb +0 -70
- data/app/commands/decidim/proposals/admin/update_proposal_scope.rb +0 -75
- data/app/events/decidim/proposals/admin/update_proposal_category_event.rb +0 -11
- data/app/events/decidim/proposals/admin/update_proposal_scope_event.rb +0 -11
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_recategorize.html.erb +0 -15
- data/app/views/decidim/proposals/admin/proposals/bulk_actions/_scope-change.html.erb +0 -21
- data/app/views/decidim/proposals/collaborative_drafts/_actions.html.erb +0 -7
@@ -16,27 +16,47 @@
|
|
16
16
|
|
17
17
|
<% if vote_limit_enabled? %>
|
18
18
|
(function() {
|
19
|
-
var $remainingVotesCount = $('
|
20
|
-
var $notVotedButtons = $('
|
19
|
+
var $remainingVotesCount = $('div[data-remaining-votes-count="true"]');
|
20
|
+
var $notVotedButtons = $('*[data-proposal-vote-button="true"]').not('[id^=vote_button-]');
|
21
21
|
|
22
|
-
if(
|
23
|
-
|
24
|
-
|
22
|
+
if($remainingVotesCount[0]) {
|
23
|
+
morphdom($remainingVotesCount[0], '<%= j(render partial: "decidim/proposals/proposals/remaining_votes_count").strip.html_safe %>');
|
24
|
+
}
|
25
25
|
|
26
26
|
<% if remaining_votes_count_for(current_user) == 0 %>
|
27
27
|
$notVotedButtons.attr('disabled', true);
|
28
|
-
$notVotedButtons.
|
28
|
+
$notVotedButtons.text('<%= t("decidim.proposals.proposals.vote_button.no_votes_remaining") %>');
|
29
29
|
<% else %>
|
30
30
|
$notVotedButtons.attr('disabled', false);
|
31
|
-
$notVotedButtons.
|
31
|
+
$notVotedButtons.text('<%= t("decidim.proposals.proposals.vote_button.vote") %>');
|
32
32
|
<% end %>
|
33
33
|
}());
|
34
34
|
<% end %>
|
35
35
|
|
36
36
|
<% if show_voting_rules? %>
|
37
37
|
(function() {
|
38
|
+
var $remainingVotesNotification = $('#remaining-votes-notification');
|
39
|
+
var $exitProposalModal = $('#exit-proposal-notification');
|
38
40
|
var $votingRules = $('.voting-rules');
|
39
|
-
|
40
|
-
|
41
|
+
var $votingRulesNode = $('.item_voting_rules')
|
42
|
+
|
43
|
+
if($votingRules[0]) {
|
44
|
+
morphdom($votingRules[0], '<%= j(render partial: "decidim/proposals/proposals/voting_rules").strip.html_safe %>');
|
45
|
+
}
|
46
|
+
|
47
|
+
<% if remaining_minimum_votes_count_for(current_user).zero? %>
|
48
|
+
$votingRulesNode.prepend(`<%= j(render partial: "decidim/proposals/proposals/notification_alert_box").strip.html_safe %>`)
|
49
|
+
|
50
|
+
<% end %>
|
51
|
+
if ($exitProposalModal[0]) {
|
52
|
+
morphdom($exitProposalModal[0], '<%= j(render partial: "decidim/proposals/proposals/exit_modal").strip.html_safe %>')
|
53
|
+
if(window.Decidim.currentDialogs["exit-proposal-notification"] && window.Decidim.currentDialogs["exit-proposal-notification"].dialog) {
|
54
|
+
window.Decidim.currentDialogs["exit-proposal-notification"].dialog.innerHTML = $exitProposalModal[0].innerHTML;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
if ($remainingVotesNotification[0]) {
|
59
|
+
morphdom($remainingVotesNotification[0], '<%= j(render partial: "decidim/proposals/proposals/remaining_votes_notification").strip.html_safe %>')
|
60
|
+
}
|
41
61
|
}());
|
42
62
|
<% end %>
|
@@ -1,13 +1,10 @@
|
|
1
1
|
<section class="layout-main__section layout-main__buttons" data-buttons>
|
2
|
-
|
3
|
-
<%= endorsement_buttons_cell(@proposal) %>
|
4
|
-
<% end %>
|
5
|
-
|
2
|
+
<%= cell("decidim/endorsement_block", @proposal) %>
|
6
3
|
<%= cell "decidim/comments_button", nil %>
|
7
4
|
|
8
|
-
<div class="ml-auto">
|
9
|
-
<%= cell "decidim/
|
5
|
+
<div class="ml-auto lg:ml-0">
|
6
|
+
<%= cell "decidim/share_widget", @proposal %>
|
10
7
|
</div>
|
11
8
|
</section>
|
12
9
|
|
13
|
-
<%= cell "decidim/endorsers_list", @proposal
|
10
|
+
<%= cell "decidim/endorsers_list", @proposal %>
|
@@ -20,36 +20,31 @@
|
|
20
20
|
<% end %>
|
21
21
|
|
22
22
|
<% if @form.geocoding_enabled? %>
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
<%= t("instructions", scope: "decidim.proposals.proposals.dynamic_map_instructions") %> <%= t("description", scope: "decidim.proposals.proposals.dynamic_map_instructions") %>
|
34
|
-
</p>
|
35
|
-
<%= dynamic_map_for proposal_preview_data_for_map(@proposal) unless new_proposal %>
|
23
|
+
<div id="address_input">
|
24
|
+
<div class="address-fill">
|
25
|
+
<%= form.geocoding_field :address, placeholder: t("decidim.proposals.proposals.placeholder.address"), data: { screen_reader_announcement: t("decidim.proposals.proposals.edit_form_fields.marker_added") } %>
|
26
|
+
</div>
|
27
|
+
<div id="address_map" class="proposal__container">
|
28
|
+
<p class="help-text">
|
29
|
+
<%= t("instructions", scope: "decidim.proposals.proposals.dynamic_map_instructions") %> <%= t("description", scope: "decidim.proposals.proposals.dynamic_map_instructions") %>
|
30
|
+
</p>
|
31
|
+
<%= dynamic_map_for proposal_preview_data_for_map(@form.to_h) %>
|
32
|
+
</div>
|
36
33
|
</div>
|
37
34
|
<% end %>
|
38
35
|
|
39
|
-
<% if @form.
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
<% if current_component.has_subscopes? %>
|
44
|
-
<%= scopes_select_field form, :scope_id, root: current_component.scope %>
|
36
|
+
<% if @form.taxonomy_filters&.any? %>
|
37
|
+
<% @form.taxonomy_filters.each do |filter| %>
|
38
|
+
<%= filter_taxonomy_items_select_field form, :taxonomies, filter %>
|
39
|
+
<% end %>
|
45
40
|
<% end %>
|
46
41
|
|
47
42
|
<% if component_settings.attachments_allowed? && (new_proposal || @proposal) %>
|
48
43
|
<%= form.attachment :documents,
|
49
44
|
multiple: true,
|
50
|
-
label: t("decidim.proposals.proposals.edit.
|
51
|
-
button_label: t("decidim.proposals.proposals.edit.
|
52
|
-
button_edit_label: t("decidim.proposals.proposals.edit.
|
45
|
+
label: t("decidim.proposals.proposals.edit.add_attachments"),
|
46
|
+
button_label: t("decidim.proposals.proposals.edit.add_attachments"),
|
47
|
+
button_edit_label: t("decidim.proposals.proposals.edit.edit_attachments"),
|
53
48
|
button_class: "button button__lg button__transparent-secondary w-full",
|
54
49
|
help_i18n_scope: "decidim.forms.file_help.file",
|
55
50
|
help_text: t("attachment_legend", scope: "decidim.proposals.proposals.edit") %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%= decidim_modal id: "exit-proposal-notification" do %>
|
2
|
+
<div data-dialog-container data-minimum-votes-reached="<%= remaining_minimum_votes_count_for(current_user).zero? %>" data-minimum-votes-count="<%= minimum_votes_per_user - remaining_minimum_votes_count_for(current_user) %>">
|
3
|
+
<%= icon "information-line" %>
|
4
|
+
<h3 class="h3 text-base" id="dialog-title-exit-proposal-notification" tabindex="-1" data-dialog-title>
|
5
|
+
<%= t("title", scope: "decidim.proposals.exit_modal", number: remaining_minimum_votes_count_for(current_user)) %>
|
6
|
+
</h3>
|
7
|
+
<p id="dialog-desc-budget-modal">
|
8
|
+
<%= t("message", scope: "decidim.proposals.exit_modal", number: remaining_minimum_votes_count_for(current_user)) %>
|
9
|
+
</p>
|
10
|
+
</div>
|
11
|
+
<div data-dialog-actions>
|
12
|
+
<button data-dialog-close="exit-proposal-notification" class="button button__sm md:button__lg button__secondary">
|
13
|
+
<%= t("cancel", scope: "decidim.proposals.exit_modal") %>
|
14
|
+
</button>
|
15
|
+
<%= link_to t("exit", scope: "decidim.proposals.exit_modal"), proposals_path, id: "exit-proposal-notification-link", class: "button button__sm md:button__lg button__secondary" %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= alert_box(t("success", scope: "decidim.proposals.proposals.voting_rules"), :success, true, { id: "success-proposal-vote" }) %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<% if @proposal.amendable? && allowed_to?(:edit, :proposal, proposal: @proposal) %>
|
2
|
+
<li role="menuitem">
|
3
|
+
<%= link_to edit_proposal_path(@proposal), class: "button button__sm button__text button__text-secondary" do %>
|
4
|
+
<span><%= t("edit_proposal", scope: "decidim.proposals.proposals.show") %></span>
|
5
|
+
<%= icon "pencil-line" %>
|
6
|
+
<% end %>
|
7
|
+
</li>
|
8
|
+
<% else %>
|
9
|
+
<%= cell("decidim/amendable/amend_button_card", @proposal) %>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<% if @proposal.withdrawable_by?(current_user) %>
|
13
|
+
<li role="menuitem">
|
14
|
+
<%= action_authorized_link_to :withdraw, withdraw_proposal_path(@proposal), resource: @proposal, method: :put, class: "button button__sm button__text button__text-secondary", title: t("withdraw_btn_hint", scope: "decidim.proposals.proposals.show" ), data: { confirm: t("withdraw_confirmation_html", scope: "decidim.proposals.proposals.show" ) } do %>
|
15
|
+
<span><%= t("withdraw_proposal", scope: "decidim.proposals.proposals.show") %></span>
|
16
|
+
<%= icon "arrow-go-back-line" %>
|
17
|
+
<% end %>
|
18
|
+
</li>
|
19
|
+
<% end %>
|
@@ -1,42 +1,19 @@
|
|
1
1
|
<% if current_settings.votes_enabled? && (show_endorsements_card? || current_user) %>
|
2
|
-
<section class="layout-aside__section">
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
</section>
|
2
|
+
<section class="layout-aside__section">
|
3
|
+
<div class="proposal__aside-vote layout-aside__ctas-buttons" data-sticky-buttons>
|
4
|
+
<%= render partial: "vote_button", locals: { proposal: @proposal, from_proposals_list: false } unless @proposal.withdrawn? %>
|
5
|
+
<%= render partial: "votes_count", locals: { proposal: @proposal, from_proposals_list: false } %>
|
6
|
+
</div>
|
7
|
+
</section>
|
8
8
|
<% end %>
|
9
9
|
|
10
|
-
<% if (
|
11
|
-
<section class="layout-aside__section layout-aside__buttons">
|
12
|
-
<% if @proposal.amendable? && allowed_to?(:edit, :proposal, proposal: @proposal) %>
|
13
|
-
<%= link_to edit_proposal_path(@proposal), class: "button button__sm button__transparent-secondary w-full" do %>
|
14
|
-
<span><%= t("edit_proposal", scope: "decidim.proposals.proposals.show") %></span>
|
15
|
-
<%= icon "pencil-line" %>
|
16
|
-
<% end %>
|
17
|
-
<% else %>
|
18
|
-
<%= amend_button_for @proposal %>
|
19
|
-
<% end %>
|
20
|
-
|
21
|
-
<% if amendments_enabled? && can_react_to_emendation?(@proposal) %>
|
10
|
+
<% if ( amendments_enabled? && can_react_to_emendation?(@proposal) ) %>
|
11
|
+
<section class="layout-aside__section layout-aside__buttons">
|
22
12
|
<%= emendation_actions_for @proposal %>
|
23
|
-
|
24
|
-
|
25
|
-
<% if @proposal.withdrawable_by?(current_user) %>
|
26
|
-
<%= action_authorized_link_to :withdraw, withdraw_proposal_path(@proposal), method: :put, class: "button button__sm button__transparent-secondary w-full", title: t("withdraw_btn_hint", scope: "decidim.proposals.proposals.show" ), data: { confirm: t("withdraw_confirmation_html", scope: "decidim.proposals.proposals.show" ) } do %>
|
27
|
-
<span><%= t("withdraw_proposal", scope: "decidim.proposals.proposals.show") %></span>
|
28
|
-
<% end %>
|
29
|
-
<% end %>
|
30
|
-
</section>
|
13
|
+
</section>
|
31
14
|
<% end %>
|
32
15
|
|
33
16
|
<section class="layout-aside__section">
|
34
17
|
<%= cell "decidim/proposals/proposal_link_to_collaborative_draft", @proposal %>
|
35
18
|
<%= cell "decidim/proposals/proposal_link_to_rejected_emendation", @proposal %>
|
36
19
|
</section>
|
37
|
-
|
38
|
-
<section class="layout-aside__section actions__secondary">
|
39
|
-
<%= follow_button_for(@proposal) %>
|
40
|
-
<%= cell "decidim/share_button", nil %>
|
41
|
-
<%= cell "decidim/report_button", @proposal %>
|
42
|
-
</section>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<div id="proposal-voting-rules" class="flash flex-col p-0 gap-0">
|
2
|
+
<button id="dropdown-trigger-proposal-voting-rules" data-component="dropdown" data-target="dropdown-menu-proposal-voting-rules" class="flash__title">
|
3
|
+
<%= t("title", scope: "decidim.proposals.proposals.voting_rules") %>
|
4
|
+
<%= icon "arrow-down-s-line" %>
|
5
|
+
<%= icon "arrow-up-s-line" %>
|
6
|
+
</button>
|
7
|
+
|
8
|
+
<div class="flash__message">
|
9
|
+
<div class="text-base editor-content">
|
10
|
+
<ul id="dropdown-menu-proposal-voting-rules" class="mt-0 mb-2">
|
11
|
+
<% if vote_limit_enabled? %>
|
12
|
+
<li><%= t("vote_limit.description", scope: "decidim.proposals.proposals.voting_rules", limit: component_settings.vote_limit) %></li>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<% if proposal_limit_enabled? %>
|
16
|
+
<li><%= t("proposal_limit.description", scope: "decidim.proposals.proposals.voting_rules", limit: proposal_limit) %></li>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<% if threshold_per_proposal_enabled? %>
|
20
|
+
<li><%= t("threshold_per_proposal.description", scope: "decidim.proposals.proposals.voting_rules", limit: threshold_per_proposal) %></li>
|
21
|
+
<% end %>
|
22
|
+
|
23
|
+
<% if can_accumulate_votes_beyond_threshold? %>
|
24
|
+
<li><%= t("can_accumulate_votes_beyond_threshold.description", scope: "decidim.proposals.proposals.voting_rules", limit: threshold_per_proposal) %></li>
|
25
|
+
<% end %>
|
26
|
+
|
27
|
+
<% if minimum_votes_per_user_enabled? %>
|
28
|
+
<li><%= t("minimum_votes_per_user.description", scope: "decidim.proposals.proposals.voting_rules", votes: minimum_votes_per_user) %></li>
|
29
|
+
<% end %>
|
30
|
+
</ul>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
</div>
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<div
|
2
|
-
<%= t("votes", scope: "decidim.proposals.proposals.voting_rules.vote_limit", number:
|
1
|
+
<div data-remaining-votes-count="true">
|
2
|
+
<%= t("votes", scope: "decidim.proposals.proposals.voting_rules.vote_limit", number: remaining_minimum_votes_count_for(current_user)) %>
|
3
3
|
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<%= alert_box(
|
2
|
+
message(
|
3
|
+
content_tag(:div, class: "") do
|
4
|
+
concat content_tag(:strong, t("already_vote.title", scope: "decidim.proposals.proposals.voting_rules", number: remaining_minimum_votes_count_for(current_user)))
|
5
|
+
concat content_tag(:p, t("already_vote.description", scope: "decidim.proposals.proposals.voting_rules", number: remaining_minimum_votes_count_for(current_user)))
|
6
|
+
concat link_to(t("already_vote.see_other_proposals", scope: "decidim.proposals.proposals.voting_rules"), proposals_path, class: "no-modal")
|
7
|
+
end
|
8
|
+
),
|
9
|
+
:secondary,
|
10
|
+
true,
|
11
|
+
{ id: "remaining-votes-notification", class: "flash secondary #{"hidden" unless remaining_minimum_votes_count_for(current_user).positive?}" }
|
12
|
+
) %>
|
@@ -4,12 +4,14 @@
|
|
4
4
|
<% if component_settings.participatory_texts_enabled? && from_proposals_list %>
|
5
5
|
<%= render partial: "decidim/proposals/proposals/participatory_texts/proposal_vote_button", locals: { proposal:, from_proposals_list: true } %>
|
6
6
|
<% else %>
|
7
|
-
<div id="proposal-<%= proposal.id %>-vote-button">
|
7
|
+
<div id="proposal-<%= proposal.id %>-vote-button" class="card__proposals-votes-container">
|
8
8
|
<% if !current_user %>
|
9
9
|
<% if current_settings.votes_blocked? %>
|
10
|
-
<%= action_authorized_button_to :vote,
|
10
|
+
<%= action_authorized_button_to :vote, proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list:), resource: proposal, class: button_classes, data: { "proposal-vote-button": true }, disabled: true do %>
|
11
|
+
<%= t("decidim.proposals.proposals.vote_button.votes_blocked") %>
|
12
|
+
<% end %>
|
11
13
|
<% else %>
|
12
|
-
<%= action_authorized_button_to :vote, proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list:), resource: proposal, class: button_classes, data: { disable: true, "redirect-url": proposal_path(proposal) } do %>
|
14
|
+
<%= action_authorized_button_to :vote, proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list:), resource: proposal, class: button_classes, data: { "proposal-vote-button": true, disable: true, "redirect-url": proposal_path(proposal) } do %>
|
13
15
|
<%= t("decidim.proposals.proposals.vote_button.vote") %>
|
14
16
|
<span class="sr-only"><%= decidim_html_escape(present(proposal).title) %></span>
|
15
17
|
<% end %>
|
@@ -26,24 +28,26 @@
|
|
26
28
|
disable: true,
|
27
29
|
original: t("decidim.proposals.proposals.vote_button.already_voted"),
|
28
30
|
replace: t("decidim.proposals.proposals.vote_button.already_voted_hover"),
|
31
|
+
"proposal-vote-button": true,
|
29
32
|
"redirect-url": proposal_path(proposal)
|
30
33
|
},
|
31
|
-
class: "#{button_classes}
|
34
|
+
class: "#{button_classes}",
|
32
35
|
id: "vote_button-#{proposal.id}"
|
33
36
|
) do %>
|
34
37
|
<%= t("decidim.proposals.proposals.vote_button.already_voted") %>
|
38
|
+
<%= icon "check-line", class: "already-voted-icon" %>
|
35
39
|
<span class="sr-only"><%= decidim_html_escape(present(proposal).title) %></span>
|
36
40
|
<% end %>
|
37
41
|
<% else %>
|
38
42
|
<% if proposal.maximum_votes_reached? && !proposal.can_accumulate_votes_beyond_threshold && current_component.participatory_space.can_participate?(current_user) %>
|
39
|
-
<%= content_tag :button, t("decidim.proposals.proposals.vote_button.maximum_votes_reached"), class: button_classes, disabled: true %>
|
43
|
+
<%= content_tag :button, t("decidim.proposals.proposals.vote_button.maximum_votes_reached"), class: button_classes, data: { "proposal-vote-button": true }, disabled: true %>
|
40
44
|
<% else %>
|
41
45
|
<% if vote_limit_enabled? && remaining_votes_count_for(current_user) == 0 %>
|
42
|
-
<%= content_tag :button, t("decidim.proposals.proposals.vote_button.no_votes_remaining"), class: button_classes, disabled: true %>
|
46
|
+
<%= content_tag :button, t("decidim.proposals.proposals.vote_button.no_votes_remaining"), class: button_classes, data: { "proposal-vote-button": true }, disabled: true %>
|
43
47
|
<% elsif current_settings.votes_blocked? || !current_component.participatory_space.can_participate?(current_user) %>
|
44
|
-
<%= content_tag :button, t("decidim.proposals.proposals.vote_button.votes_blocked"), class: button_classes, disabled: true %>
|
48
|
+
<%= content_tag :button, t("decidim.proposals.proposals.vote_button.votes_blocked"), class: button_classes, data: { "proposal-vote-button": true }, disabled: true %>
|
45
49
|
<% else %>
|
46
|
-
|
50
|
+
<%= action_authorized_button_to :vote, proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list:), resource: proposal, remote: true, data: { "proposal-vote-button": true, disable: true, "redirect-url": proposal_path(proposal) }, class: button_classes do %>
|
47
51
|
<%= t("decidim.proposals.proposals.vote_button.vote") %>
|
48
52
|
<span class="sr-only"><%= decidim_html_escape(present(proposal).title) %></span>
|
49
53
|
<% end %>
|
@@ -9,7 +9,8 @@
|
|
9
9
|
progress,
|
10
10
|
total:,
|
11
11
|
units_name: "decidim.proposals.proposals.votes_count.count",
|
12
|
-
element_id: "proposal-#{proposal.id}-votes-count"
|
12
|
+
element_id: "proposal-#{proposal.id}-votes-count",
|
13
|
+
class: total.positive? ? "card__proposals-votes-limited" : "card__proposals-votes-unlimited"
|
13
14
|
) %>
|
14
15
|
<% end %>
|
15
16
|
<% end %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<% if show_voting_rules? %>
|
2
2
|
<% announcement_body = capture do %>
|
3
3
|
<div class="editor-content">
|
4
|
-
<ul>
|
4
|
+
<ul class="mt-0 mb-2">
|
5
5
|
<% if vote_limit_enabled? %>
|
6
6
|
<li><%= t(".vote_limit.description", limit: component_settings.vote_limit) %></li>
|
7
7
|
<% end %>
|
@@ -21,15 +21,9 @@
|
|
21
21
|
<% if minimum_votes_per_user_enabled? %>
|
22
22
|
<li>
|
23
23
|
<%= t(".minimum_votes_per_user.description", votes: minimum_votes_per_user) %>
|
24
|
-
<% if votes_given >= minimum_votes_per_user %>
|
25
|
-
<%= t(".minimum_votes_per_user.given_enough_votes") %>
|
26
|
-
<% else %>
|
27
|
-
<%= t(".minimum_votes_per_user.votes_remaining", remaining_votes: minimum_votes_per_user - votes_given) %>
|
28
|
-
<% end %>
|
29
24
|
</li>
|
30
25
|
<% end %>
|
31
26
|
</ul>
|
32
|
-
<%= render partial: "decidim/proposals/proposals/remaining_votes_count" if current_user_can_vote? %>
|
33
27
|
</div>
|
34
28
|
<% end %>
|
35
29
|
|
@@ -1,4 +1,11 @@
|
|
1
|
-
<%
|
1
|
+
<% add_decidim_meta_tags(
|
2
|
+
description: translated_attribute(current_participatory_space.short_description),
|
3
|
+
title: t("decidim.components.pagination.page_title",
|
4
|
+
component_name: component_name,
|
5
|
+
current_page: @proposals.current_page,
|
6
|
+
total_pages: @proposals.total_pages ),
|
7
|
+
url: proposals_url,
|
8
|
+
resource: current_component) %>
|
2
9
|
|
3
10
|
<% append_stylesheet_pack_tag "decidim_proposals", media: "all" %>
|
4
11
|
<% append_javascript_pack_tag "decidim_proposals" %>
|
@@ -8,7 +15,7 @@
|
|
8
15
|
|
9
16
|
<div class="proposal-list__aside__button-container">
|
10
17
|
<% if current_settings.creation_enabled && current_component.participatory_space.can_participate?(current_user) %>
|
11
|
-
<%= action_authorized_link_to :create, new_proposal_path, class: "button button__xl button__secondary w-full", data: { "redirect_url" => new_proposal_path } do %>
|
18
|
+
<%= action_authorized_link_to :create, new_proposal_path, permissions_holder: current_component, class: "button button__xl button__secondary w-full", data: { "redirect_url" => new_proposal_path } do %>
|
12
19
|
<span><%= t("new_proposal", scope: "decidim.proposals.proposals.index") %></span>
|
13
20
|
<%= icon "add-line" %>
|
14
21
|
<% end %>
|
@@ -31,22 +38,7 @@
|
|
31
38
|
|
32
39
|
<% if Decidim::Map.available?(:geocoding, :dynamic) && component_settings.geocoding_enabled? %>
|
33
40
|
<div class="proposal-list__map">
|
34
|
-
<%=
|
35
|
-
<template id="marker-popup">
|
36
|
-
<div class="space-y-6">
|
37
|
-
<a href="${link}" class="card__list">
|
38
|
-
<div class="card__list-content">
|
39
|
-
<h3 class="h4 card__list-title">${title}</h3>
|
40
|
-
<div class="card__list-metadata">
|
41
|
-
{{each JSON.parse(items)}}
|
42
|
-
<span>{{html icon}}{{html text}}</span>
|
43
|
-
{{/each}}
|
44
|
-
</div>
|
45
|
-
</div>
|
46
|
-
</a>
|
47
|
-
</div>
|
48
|
-
</template>
|
49
|
-
<% end %>
|
41
|
+
<%= cell "decidim/map", @proposals, metadata_card: "decidim/proposals/proposal_metadata" %>
|
50
42
|
</div>
|
51
43
|
<% end %>
|
52
44
|
|
@@ -8,7 +8,7 @@ $orderFilterInput.val('<%= order %>');
|
|
8
8
|
var $map = $("#map");
|
9
9
|
var controller = $map.data("map-controller");
|
10
10
|
if (controller) {
|
11
|
-
var markerData = JSON.parse('<%= escape_javascript
|
11
|
+
var markerData = JSON.parse('<%= escape_javascript cell("decidim/map", @proposals, metadata_card: "decidim/proposals/proposal_metadata").geocoded_data.to_json.html_safe %>');
|
12
12
|
controller.clearMarkers();
|
13
13
|
if (markerData.length > 0 ) {
|
14
14
|
controller.addMarkers(markerData);
|
data/app/views/decidim/proposals/proposals/participatory_texts/_proposal_vote_button.html.erb
CHANGED
@@ -4,7 +4,9 @@
|
|
4
4
|
<div id="proposal-<%= proposal.id %>-vote-button">
|
5
5
|
<% if !current_user %>
|
6
6
|
<% if current_settings.votes_blocked? %>
|
7
|
-
<%= action_authorized_button_to :vote,
|
7
|
+
<%= action_authorized_button_to :vote, proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list:), resource: proposal, class: "column button light button--sc disabled", disabled: true do %>
|
8
|
+
<%= t("decidim.proposals.proposals.vote_button.votes_blocked") %>
|
9
|
+
<% end %>
|
8
10
|
<% else %>
|
9
11
|
<%= action_authorized_button_to :vote, proposal_proposal_vote_path(proposal_id: proposal, from_proposals_list:), resource: proposal, class: "column button light button--sc", data: { disable: true, "redirect-url": proposal_path(proposal) } do %>
|
10
12
|
<%= t("decidim.proposals.proposals.vote_button.vote") %>
|
@@ -1,8 +1,8 @@
|
|
1
|
-
<% add_decidim_meta_tags(
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<% add_decidim_meta_tags(
|
2
|
+
description: present(@proposal).body,
|
3
|
+
title: present(@proposal).title,
|
4
|
+
url: proposal_url(@proposal.id),
|
5
|
+
resource: @proposal) %>
|
6
6
|
|
7
7
|
<%
|
8
8
|
edit_link(
|
@@ -26,6 +26,14 @@ extra_admin_link(
|
|
26
26
|
<% append_stylesheet_pack_tag "decidim_proposals", media: "all" %>
|
27
27
|
<% append_javascript_pack_tag "decidim_proposals" %>
|
28
28
|
|
29
|
+
<% content_for :item_header do %>
|
30
|
+
<% if show_voting_rules? %>
|
31
|
+
<div class="layout-item-complementary">
|
32
|
+
<%= render partial: "update_proposal_voting_rules" %>
|
33
|
+
</div>
|
34
|
+
<% end %>
|
35
|
+
<% end %>
|
36
|
+
|
29
37
|
<% content_for :aside do %>
|
30
38
|
<%= render partial: "proposal_aside" %>
|
31
39
|
<% end %>
|
@@ -33,7 +41,9 @@ extra_admin_link(
|
|
33
41
|
<%= render layout: "layouts/decidim/shared/layout_item", locals: { back_path: component_settings.participatory_texts_enabled? ? main_component_path(current_component) : proposals_path } do %>
|
34
42
|
|
35
43
|
<section class="layout-main__section layout-main__heading">
|
36
|
-
|
44
|
+
<% if show_voting_rules? && remaining_minimum_votes_count_for(current_user).positive? && current_component.participatory_space.can_participate?(current_user) %>
|
45
|
+
<%= render partial: "exit_modal" %>
|
46
|
+
<% end %>
|
37
47
|
|
38
48
|
<%= cell("decidim/announcement", proposal_reason_callout_announcement, callout_styles: @proposal.proposal_state&.css_style) if @proposal.answered? && @proposal.published_state? %>
|
39
49
|
|
@@ -46,12 +56,20 @@ extra_admin_link(
|
|
46
56
|
<% end %>
|
47
57
|
|
48
58
|
<% unless component_settings.participatory_texts_enabled? %>
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
<% if not ["section","subsection"].include? @proposal.participatory_text_level %>
|
59
|
+
<% unless ["section","subsection"].include?(@proposal.participatory_text_level) %>
|
60
|
+
<div class="layout-author has_status">
|
53
61
|
<%= cell("decidim/proposals/proposal_metadata", @proposal).state_item&.dig(:text) %>
|
54
|
-
|
62
|
+
</div>
|
63
|
+
<% end %>
|
64
|
+
<div class="layout-author <%= "has_status" unless %w(section subsection).include?(@proposal.participatory_text_level) %>">
|
65
|
+
<div class="relative flex items-center justify-center w-full">
|
66
|
+
<div class="w-10/12 flex items-center gap-4">
|
67
|
+
<%= cell "decidim/coauthorships", @proposal, context_actions: [:date] %>
|
68
|
+
</div>
|
69
|
+
<%= render "decidim/shared/resource_actions", resource: @proposal do %>
|
70
|
+
<%= render "decidim/proposals/proposals/proposal_actions" %>
|
71
|
+
<% end %>
|
72
|
+
</div>
|
55
73
|
</div>
|
56
74
|
<% end %>
|
57
75
|
</section>
|
@@ -88,6 +106,8 @@ extra_admin_link(
|
|
88
106
|
<%= cell "decidim/amendable/amendments", @proposal %>
|
89
107
|
</section>
|
90
108
|
|
109
|
+
<%= cell "decidim/tags", @proposal %>
|
110
|
+
|
91
111
|
<%= render partial: "actions" %>
|
92
112
|
|
93
113
|
<% content_for :item_footer do %>
|
@@ -97,10 +117,10 @@ extra_admin_link(
|
|
97
117
|
<%= content_tag :li, resource_reference(@proposal), class: "metadata__item" %>
|
98
118
|
<%= content_tag :li, resource_version(proposal_presenter, versions_path: proposal_version_path(@proposal, proposal_presenter.versions.count)), class: "metadata__item" %>
|
99
119
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
120
|
+
<% fingerprint_id = dom_id(@proposal, :fingerprint_dialog) %>
|
121
|
+
<%= content_tag :li, class: "metadata__item" do %>
|
122
|
+
<%= content_tag :button, t("decidim.fingerprint.check"), data: { dialog_open: fingerprint_id } %>
|
123
|
+
<% end %>
|
104
124
|
</ul>
|
105
125
|
<%= decidim_modal id: fingerprint_id, class: "fingerprint-modal" do %>
|
106
126
|
<div data-dialog-container>
|