decidim-proposals 0.9.3 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -1
  3. data/app/assets/config/admin/decidim_proposals_manifest.js +1 -0
  4. data/app/assets/javascripts/decidim/proposals/admin/proposals.es6 +113 -0
  5. data/app/assets/javascripts/decidim/proposals/identity_selector_dialog.js.es6 +56 -0
  6. data/app/commands/decidim/proposals/admin/answer_proposal.rb +11 -5
  7. data/app/commands/decidim/proposals/admin/create_proposal.rb +25 -3
  8. data/app/commands/decidim/proposals/admin/create_proposal_note.rb +13 -8
  9. data/app/commands/decidim/proposals/admin/import_proposals.rb +83 -0
  10. data/app/commands/decidim/proposals/admin/update_proposal_category.rb +68 -0
  11. data/app/commands/decidim/proposals/create_proposal.rb +0 -12
  12. data/app/commands/decidim/proposals/endorse_proposal.rb +56 -0
  13. data/app/commands/decidim/proposals/publish_proposal.rb +60 -0
  14. data/app/commands/decidim/proposals/unendorse_proposal.rb +40 -0
  15. data/app/commands/decidim/proposals/update_proposal.rb +3 -3
  16. data/app/commands/decidim/proposals/vote_proposal.rb +1 -1
  17. data/app/commands/decidim/proposals/withdraw_proposal.rb +1 -1
  18. data/app/controllers/decidim/proposals/admin/proposal_answers_controller.rb +1 -1
  19. data/app/controllers/decidim/proposals/admin/proposal_notes_controller.rb +2 -2
  20. data/app/controllers/decidim/proposals/admin/proposals_controller.rb +50 -1
  21. data/app/controllers/decidim/proposals/admin/proposals_imports_controller.rb +35 -0
  22. data/app/controllers/decidim/proposals/proposal_endorsements_controller.rb +56 -0
  23. data/app/controllers/decidim/proposals/proposals_controller.rb +82 -9
  24. data/app/events/decidim/proposals/admin/update_proposal_category_event.rb +11 -0
  25. data/app/events/decidim/proposals/creation_enabled_event.rb +8 -0
  26. data/app/events/decidim/proposals/endorsing_enabled_event.rb +8 -0
  27. data/app/events/decidim/proposals/proposal_endorsed_event.rb +29 -0
  28. data/app/events/decidim/proposals/publish_proposal_event.rb +21 -0
  29. data/app/events/decidim/proposals/voting_enabled_event.rb +8 -0
  30. data/app/forms/decidim/proposals/admin/proposal_form.rb +9 -2
  31. data/app/forms/decidim/proposals/admin/proposals_import_form.rb +60 -0
  32. data/app/forms/decidim/proposals/proposal_form.rb +16 -5
  33. data/app/helpers/decidim/proposals/application_helper.rb +1 -0
  34. data/app/helpers/decidim/proposals/proposal_endorsements_helper.rb +117 -0
  35. data/app/helpers/decidim/proposals/proposal_votes_helper.rb +13 -6
  36. data/app/helpers/decidim/proposals/proposal_wizard_helper.rb +105 -0
  37. data/app/jobs/decidim/proposals/settings_change_job.rb +48 -0
  38. data/app/models/decidim/proposals/abilities/current_user_ability.rb +30 -8
  39. data/app/models/decidim/proposals/proposal.rb +38 -38
  40. data/app/models/decidim/proposals/proposal_endorsement.rb +31 -0
  41. data/app/models/decidim/proposals/proposal_note.rb +7 -0
  42. data/app/presenters/decidim/proposals/admin_log/proposal_note_presenter.rb +39 -0
  43. data/app/presenters/decidim/proposals/admin_log/proposal_presenter.rb +47 -0
  44. data/app/presenters/decidim/proposals/admin_log/value_types/proposal_state_presenter.rb +16 -0
  45. data/app/queries/decidim/proposals/similar_proposals.rb +53 -0
  46. data/app/types/decidim/proposals/proposal_type.rb +34 -0
  47. data/app/types/decidim/proposals/proposals_type.rb +34 -0
  48. data/app/views/decidim/participatory_processes/participatory_process_groups/_highlighted_proposals.html.erb +8 -0
  49. data/app/views/decidim/participatory_processes/participatory_process_groups/_proposal.html.erb +27 -0
  50. data/app/views/decidim/participatory_spaces/_highlighted_proposals.html.erb +10 -0
  51. data/app/views/decidim/participatory_spaces/_proposal.html.erb +27 -0
  52. data/app/views/decidim/proposals/admin/proposals/_bulk-actions.html.erb +15 -0
  53. data/app/views/decidim/proposals/admin/proposals/_js-callout.html.erb +6 -0
  54. data/app/views/decidim/proposals/admin/proposals/_proposal-tr.html.erb +63 -0
  55. data/app/views/decidim/proposals/admin/proposals/index.html.erb +12 -73
  56. data/app/views/decidim/proposals/admin/proposals/update_category.js.erb +25 -0
  57. data/app/views/decidim/proposals/admin/proposals_imports/new.html.erb +28 -0
  58. data/app/views/decidim/proposals/proposal_endorsements/_identity.html.erb +4 -0
  59. data/app/views/decidim/proposals/proposal_endorsements/identities.html.erb +12 -0
  60. data/app/views/decidim/proposals/proposal_endorsements/update_buttons_and_counters.js.erb +9 -0
  61. data/app/views/decidim/proposals/proposals/_endorsement_button.html.erb +11 -0
  62. data/app/views/decidim/proposals/proposals/_endorsement_identities_cabin.html.erb +13 -0
  63. data/app/views/decidim/proposals/proposals/_endorsement_xxs.html.erb +9 -0
  64. data/app/views/decidim/proposals/proposals/_endorsements_card_row.html.erb +22 -0
  65. data/app/views/decidim/proposals/proposals/_endorsements_count.html.erb +5 -0
  66. data/app/views/decidim/proposals/proposals/_endorsements_listing.html.erb +34 -0
  67. data/app/views/decidim/proposals/proposals/_proposal.html.erb +2 -2
  68. data/app/views/decidim/proposals/proposals/_proposal_preview.html.erb +36 -0
  69. data/app/views/decidim/proposals/proposals/_proposal_similar.html.erb +21 -0
  70. data/app/views/decidim/proposals/proposals/_vote_button.html.erb +8 -8
  71. data/app/views/decidim/proposals/proposals/_votes_count.html.erb +23 -6
  72. data/app/views/decidim/proposals/proposals/_voting_rules.html.erb +7 -3
  73. data/app/views/decidim/proposals/proposals/_wizard_aside.html.erb +16 -0
  74. data/app/views/decidim/proposals/proposals/_wizard_header.html.erb +31 -0
  75. data/app/views/decidim/proposals/proposals/compare.html.erb +19 -0
  76. data/app/views/decidim/proposals/proposals/edit_draft.html.erb +55 -0
  77. data/app/views/decidim/proposals/proposals/new.html.erb +7 -20
  78. data/app/views/decidim/proposals/proposals/preview.html.erb +18 -0
  79. data/app/views/decidim/proposals/proposals/show.html.erb +13 -4
  80. data/config/locales/ca.yml +156 -15
  81. data/config/locales/en.yml +156 -15
  82. data/config/locales/es.yml +157 -16
  83. data/config/locales/eu.yml +151 -7
  84. data/config/locales/fi.yml +151 -7
  85. data/config/locales/fr.yml +153 -9
  86. data/config/locales/gl.yml +151 -7
  87. data/config/locales/it.yml +151 -7
  88. data/config/locales/nl.yml +151 -7
  89. data/config/locales/pl.yml +148 -22
  90. data/config/locales/pt-BR.yml +151 -7
  91. data/config/locales/pt.yml +151 -7
  92. data/config/locales/ru.yml +0 -9
  93. data/config/locales/sv.yml +151 -7
  94. data/config/locales/uk.yml +87 -13
  95. data/db/migrate/20170307085300_migrate_proposal_reports_data_to_reports.rb +1 -1
  96. data/db/migrate/20171201115434_create_proposal_endorsements.rb +16 -0
  97. data/db/migrate/20171201122623_add_counter_cache_endorsements_to_proposals.rb +8 -0
  98. data/db/migrate/20171212102250_enable_pg_extensions.rb +7 -0
  99. data/db/migrate/20171220084719_add_published_at_to_proposals.rb +14 -0
  100. data/lib/decidim/proposals.rb +15 -0
  101. data/lib/decidim/proposals/admin_engine.rb +8 -0
  102. data/lib/decidim/proposals/commentable_proposal.rb +39 -0
  103. data/lib/decidim/proposals/engine.rb +69 -1
  104. data/lib/decidim/proposals/feature.rb +51 -6
  105. data/lib/decidim/proposals/test/factories.rb +78 -2
  106. data/lib/decidim/proposals/version.rb +1 -1
  107. metadata +76 -20
  108. data/app/events/decidim/proposals/create_proposal_event.rb +0 -9
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Proposals
5
+ ProposalType = GraphQL::ObjectType.define do
6
+ name "Proposal"
7
+ description "A proposal"
8
+
9
+ field :id, !types.ID
10
+ field :title, !types.String, "This proposal's title"
11
+ field :body, types.String, "This proposal's body"
12
+ field :state, types.String, "The state in which proposal is in"
13
+ field :address, types.String, "The physical address (location) of this proposal"
14
+
15
+ field :publishedAt, Decidim::Core::DateTimeType do
16
+ description "The date and time this proposal was published"
17
+ property :published_at
18
+ end
19
+
20
+ field :endorsementsCount, types.Int do
21
+ description "The total amount of endorsements the proposal has received"
22
+ property :proposal_endorsements_count
23
+ end
24
+
25
+ field :voteCount, types.Int do
26
+ description "The total amount of votes the proposal has received"
27
+ resolve ->(proposal, _args, _ctx) {
28
+ current_feature = proposal.feature
29
+ proposal.proposal_votes_count unless current_feature.current_settings.votes_hidden?
30
+ }
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Proposals
5
+ ProposalsType = GraphQL::ObjectType.define do
6
+ interfaces [-> { Decidim::Core::ComponentInterface }]
7
+
8
+ name "Proposals"
9
+ description "A proposals component of a participatory space."
10
+
11
+ connection :proposals, ProposalType.connection_type do
12
+ resolve ->(feature, _args, _ctx) {
13
+ ProposalsTypeHelper.base_scope(feature).includes(:feature)
14
+ }
15
+ end
16
+
17
+ field(:proposal, ProposalType) do
18
+ argument :id, !types.ID
19
+
20
+ resolve ->(feature, args, _ctx) {
21
+ ProposalsTypeHelper.base_scope(feature).find_by(id: args[:id])
22
+ }
23
+ end
24
+ end
25
+
26
+ module ProposalsTypeHelper
27
+ def self.base_scope(feature)
28
+ Proposal
29
+ .where(feature: feature)
30
+ .published
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,8 @@
1
+ <% if proposals.any? %>
2
+ <section class="section row collapse highlighted_proposals">
3
+ <h2 class="section-heading"><%= t(".proposals") %></h2>
4
+ <div class="row small-up-1 medium-up-2 large-up-3 card-grid">
5
+ <%= render partial: 'decidim/participatory_processes/participatory_process_groups/proposal', collection: proposals %>
6
+ </div>
7
+ </section>
8
+ <% end %>
@@ -0,0 +1,27 @@
1
+ <div class="column">
2
+ <article class="card card--proposal">
3
+ <div class="card__content">
4
+ <div class="card__header">
5
+ <%= link_to resource_locator(proposal).path do%>
6
+ <h5 class="card__title"><%= proposal.title %></h5>
7
+ <% end %>
8
+ <div class="card__author author-data author-data--small">
9
+ <%= render partial: "decidim/shared/author_reference", locals: { author: present(proposal).author } %>
10
+ </div>
11
+ <div class="tech-info tech-info--text-left">
12
+ <%= t(".creation_date", date: l(proposal.created_at, format: :decidim_short)) %>
13
+ </div>
14
+ <%= resource_reference(proposal, class: "tech-info--text-left") %>
15
+ </div>
16
+ <%= render partial: "decidim/proposals/proposals/proposal_badge", locals: { proposal: proposal } %>
17
+ <p><%= truncate(proposal.body, length: 100) %></p>
18
+ <%= render partial: "decidim/shared/tags", locals: { resource: proposal, tags_class_extra: "tags--proposal" } %>
19
+ </div>
20
+ <div class="card__footer">
21
+ <div class="card__support">
22
+ <div class="card__support__data"></div>
23
+ <%= link_to t(".view_proposal"), resource_locator(proposal).path, class: "card__button button small secondary" %>
24
+ </div>
25
+ </div>
26
+ </article>
27
+ </div>
@@ -0,0 +1,10 @@
1
+ <% if proposals.any? %>
2
+ <section class="section row collapse highlighted_proposals">
3
+ <h4 class="section-heading">
4
+ <%= t(".proposals") %> <a href="<%= main_feature_path(proposals.first.feature) %>" class="text-small"><%= t(".see_all_proposals") %></a>
5
+ </h4>
6
+ <div class="row small-up-1 medium-up-2 card-grid">
7
+ <%= render partial: 'decidim/participatory_spaces/proposal', collection: proposals %>
8
+ </div>
9
+ </section>
10
+ <% end %>
@@ -0,0 +1,27 @@
1
+ <div class="column">
2
+ <article class="card card--proposal">
3
+ <div class="card__content">
4
+ <div class="card__header">
5
+ <%= link_to resource_locator(proposal).path do%>
6
+ <h5 class="card__title"><%= proposal.title %></h5>
7
+ <% end %>
8
+ <div class="card__author author-data author-data--small">
9
+ <%= render partial: "decidim/shared/author_reference", locals: { author: present(proposal).author } %>
10
+ </div>
11
+ <div class="tech-info tech-info--text-left">
12
+ <%= t(".creation_date", date: l(proposal.created_at, format: :decidim_short)) %>
13
+ </div>
14
+ <%= resource_reference(proposal, class: "tech-info--text-left") %>
15
+ </div>
16
+ <%= render partial: "decidim/proposals/proposals/proposal_badge", locals: { proposal: proposal } %>
17
+ <p><%= truncate(proposal.body, length: 100) %></p>
18
+ <%= render partial: "decidim/shared/tags", locals: { resource: proposal, tags_class_extra: "tags--proposal" } %>
19
+ </div>
20
+ <div class="card__footer">
21
+ <div class="card__support">
22
+ <div class="card__support__data"></div>
23
+ <%= link_to t(".view_proposal"), resource_locator(proposal).path, class: "card__button button small secondary" %>
24
+ </div>
25
+ </div>
26
+ </article>
27
+ </div>
@@ -0,0 +1,15 @@
1
+ <div class="flex--cc flex-gap--1">
2
+ <%= bulk_actions_dropdown %>
3
+
4
+ <div id="js-other-actions-wrapper">
5
+ <%= 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 can? :manage, current_feature %>
6
+
7
+ <% if can? :create, Decidim::Proposals::Proposal %>
8
+ <%= link_to t("actions.new", scope: "decidim.proposals", name: t("models.proposal.name", scope: "decidim.proposals.admin")), new_proposal_path, class: 'button tiny button--simple' if can? :manage, current_feature %>
9
+ <% end %>
10
+
11
+ <%= export_dropdown %>
12
+ </div>
13
+
14
+ <%= bulk_action_recategorize %>
15
+ </div>
@@ -0,0 +1,6 @@
1
+ <div class="callout callout--full <%= css %>" data-closable>
2
+ <%= text %>
3
+ <button class="close-button" type="button" data-close="">
4
+ <span aria-hidden="true">×</span>
5
+ </button>
6
+ </div>
@@ -0,0 +1,63 @@
1
+ <tr data-id="<%= proposal.id %>">
2
+ <td>
3
+ <%= check_box_tag "proposal_ids_s[]", proposal.id, false, class: "js-check-all-proposal js-proposal-list-check js-proposal-id-#{proposal.id}" %><br />
4
+ </td>
5
+ <td>
6
+ <%= proposal.id %><br />
7
+ </td>
8
+ <td>
9
+ <%= proposal.title %><br />
10
+ </td>
11
+ <td>
12
+ <% if proposal.category %>
13
+ <%= translated_attribute proposal.category.name %>
14
+ <% end %>
15
+ </td>
16
+ <% if current_participatory_space.scopes_enabled? %>
17
+ <td>
18
+ <% if proposal.scope %>
19
+ <%= translated_attribute proposal.scope.name %>
20
+ <% else %>
21
+ <%= t("decidim.scopes.global") %>
22
+ <% end %>
23
+ </td>
24
+ <% end %>
25
+ <td>
26
+ <strong class="<%= proposal_state_css_class proposal.state %>">
27
+ <%= humanize_proposal_state proposal.state %>
28
+ </strong>
29
+ </td>
30
+
31
+ <% if current_settings.votes_enabled? %>
32
+ <td>
33
+ <%= proposal.proposal_votes_count %>
34
+ </td>
35
+ <% end %>
36
+
37
+ <% if current_feature.settings.comments_enabled? and !current_settings.comments_blocked? %>
38
+ <td>
39
+ <%= proposal.comments.count %>
40
+ </td>
41
+ <% end %>
42
+
43
+ <% if can? :create, Decidim::Proposals::ProposalNote %>
44
+ <td>
45
+ <%= proposal.proposal_notes_count %>
46
+ </td>
47
+ <% end %>
48
+
49
+ <td>
50
+ <%= l proposal.created_at, format: :decidim_short %>
51
+ </td>
52
+
53
+ <td class="table-list__actions">
54
+ <% if can? :create, Decidim::Proposals::ProposalNote %>
55
+ <%= 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
+ <% end %>
57
+
58
+ <% if can? :update, proposal %>
59
+ <%= icon_link_to "comment-square", edit_proposal_proposal_answer_path(proposal_id: proposal.id, id: proposal.id), t("actions.answer", scope: "decidim.proposals"), class: "action-icon--edit-answer" %>
60
+ <% end %>
61
+ <%= icon_link_to "eye", resource_locator(proposal).path, t("actions.preview", scope: "decidim.proposals.admin"), class: "action-icon--preview", target: :blank %>
62
+ </td>
63
+ </tr>
@@ -1,24 +1,21 @@
1
1
  <div class="card">
2
2
  <div class="card-divider">
3
- <h2 class="card-title">
4
- <%= t(".title") %>
5
-
6
- <div class="button--title">
7
-
8
- <% if can? :create, Decidim::Proposals::Proposal %>
9
- <%= link_to t("actions.new", scope: "decidim.proposals", name: t("models.proposal.name", scope: "decidim.proposals.admin")), new_proposal_path, class: 'button tiny button--simple' if can? :manage, current_feature %>
10
- <% end %>
11
-
12
- <%= export_dropdown %>
3
+ <h2 class="card-title flex--sbc">
4
+ <div>
5
+ <%= t(".title") %>
6
+ <span id="js-recategorize-proposals-count" class="component-counter component-counter--inline" title="<%= t("decidim.proposals.admin.proposals.index.selected") %>"></span>
13
7
  </div>
8
+ <%= render partial: "bulk-actions" %>
14
9
  </h2>
15
10
  </div>
16
-
17
11
  <div class="card-section">
18
12
  <div class="table-scroll">
19
13
  <table class="table-list">
20
14
  <thead>
21
15
  <tr>
16
+ <th>
17
+ <%= check_box_tag "proposals_recategorize", "all", false, class: "js-check-all" %>
18
+ </th>
22
19
  <th>
23
20
  <%= sort_link(query, :id, t("models.proposal.fields.id", scope: "decidim.proposals"), default_order: :desc ) %>
24
21
  </th>
@@ -29,7 +26,7 @@
29
26
  <%= sort_link(query, :category_name, t("models.proposal.fields.category", scope: "decidim.proposals") ) %>
30
27
  </th>
31
28
 
32
- <% if scopes_enabled?(current_participatory_space) %>
29
+ <% if current_participatory_space.scopes_enabled? %>
33
30
  <th>
34
31
  <%= sort_link(query, :scope_name, t("models.proposal.fields.scope", scope: "decidim.proposals") ) %>
35
32
  </th>
@@ -66,67 +63,7 @@
66
63
  </thead>
67
64
  <tbody>
68
65
  <% proposals.each do |proposal| %>
69
- <tr data-id="<%= proposal.id %>">
70
- <td>
71
- <%= proposal.id %><br />
72
- </td>
73
- <td>
74
- <%= proposal.title %><br />
75
- </td>
76
- <td>
77
- <% if proposal.category %>
78
- <%= translated_attribute proposal.category.name %>
79
- <% end %>
80
- </td>
81
- <% if scopes_enabled?(current_participatory_space) %>
82
- <td>
83
- <% if proposal.scope %>
84
- <%= translated_attribute proposal.scope.name %>
85
- <% else %>
86
- <%= t("decidim.scopes.global") %>
87
- <% end %>
88
- </td>
89
- <% end %>
90
- <td>
91
- <strong class="<%= proposal_state_css_class proposal.state %>">
92
- <%= humanize_proposal_state proposal.state %>
93
- </strong>
94
- </td>
95
-
96
- <% if current_settings.votes_enabled? %>
97
- <td>
98
- <%= proposal.proposal_votes_count %>
99
- </td>
100
- <% end %>
101
-
102
- <% if current_feature.settings.comments_enabled? and !current_settings.comments_blocked? %>
103
- <td>
104
- <%= proposal.comments.count %>
105
- </td>
106
- <% end %>
107
-
108
- <% if can? :create, Decidim::Proposals::ProposalNote %>
109
- <td>
110
- <%= proposal.proposal_notes_count %>
111
- </td>
112
- <% end %>
113
-
114
- <td>
115
- <%= l proposal.created_at, format: :decidim_short %>
116
- </td>
117
-
118
- <td class="table-list__actions">
119
-
120
- <% if can? :create, Decidim::Proposals::ProposalNote %>
121
- <%= icon_link_to "chat", proposal_proposal_notes_path(proposal_id: proposal.id), t("actions.private_notes", scope: "decidim.proposals"), class: "action-icon--index-notes" %>
122
- <% end %>
123
-
124
- <% if can? :update, proposal %>
125
- <%= icon_link_to "comment-square", edit_proposal_proposal_answer_path(proposal_id: proposal.id, id: proposal.id), t("actions.answer", scope: "decidim.proposals"), class: "action-icon--edit-answer" %>
126
- <% end %>
127
- <%= icon_link_to "eye", resource_locator(proposal).path, t("actions.preview", scope: "decidim.proposals.admin"), class: "action-icon--preview", target: :blank %>
128
- </td>
129
- </tr>
66
+ <%= render partial: "proposal-tr", locals: {proposal: proposal} %>
130
67
  <% end %>
131
68
  </tbody>
132
69
  </table>
@@ -134,3 +71,5 @@
134
71
  </div>
135
72
  </div>
136
73
  </div>
74
+
75
+ <%= javascript_include_tag "decidim/proposals/admin/proposals" %>
@@ -0,0 +1,25 @@
1
+ <% if flash.now[:error].present? %>
2
+ $("#js-form-recategorize-proposals #category_id").addClass("is-invalid-input")
3
+ $("<%= escape_javascript(render partial: %q{js-callout}, locals: {css: %q{alert}, text: flash.now[:error]}) %>").appendTo(".callout-wrapper");
4
+ <% end %>
5
+
6
+ <% if flash.now[:alert].present? %>
7
+ $("#js-form-recategorize-proposals #category_id").removeClass("is-invalid-input")
8
+ $("<%= escape_javascript(render partial: %q{js-callout}, locals: {css: %q{warning}, text: flash.now[:alert]}) %>").appendTo(".callout-wrapper");
9
+ <% end %>
10
+
11
+ <% if flash.now[:notice].present? %>
12
+ $("<%= escape_javascript(render partial: %q{js-callout}, locals: {css: %q{success}, text: flash.now[:notice]}) %>").appendTo(".callout-wrapper");
13
+
14
+ <% @proposal_ids.each do |id| %>
15
+ $(".table-list [data-id='<%= id %>']")
16
+ .replaceWith("<%= escape_javascript(render partial: %q{proposal-tr}, locals: {proposal: proposal_find(id)}) %>");
17
+ <% end %>
18
+
19
+ $("#js-form-recategorize-proposals #category_id").removeClass("is-invalid-input")
20
+ $(".js-check-all").prop('checked', false);
21
+ $(".js-check-all-proposal").prop('checked', false);
22
+ hideRecategorizeProposalActions();
23
+ showOtherActionsButtons();
24
+ selectedProposalsCountUpdate();
25
+ <% end %>
@@ -0,0 +1,28 @@
1
+ <%= decidim_form_for(@form, url: proposals_import_path, html: { class: "form import_proposals" }) do |f| %>
2
+ <% if @form.origin_features.any? %>
3
+ <div class="card">
4
+ <div class="card-divider">
5
+ <h2 class="card-title"><%= title %></h2>
6
+ </div>
7
+
8
+ <div class="card-section">
9
+ <div class="row column">
10
+ <%= f.select :origin_feature_id, @form.origin_features_collection, prompt: t(".select_feature") %>
11
+ </div>
12
+ <div class="row column">
13
+ <%= f.label t(".select_states") %>
14
+ <%= f.collection_check_boxes :states, @form.states_collection, :value, :name %>
15
+ </div>
16
+ <div class="row column">
17
+ <%= f.check_box :import_proposals %>
18
+ </div>
19
+ </div>
20
+ </div>
21
+
22
+ <div class="button--double form-general-submit">
23
+ <%= f.submit t(".create") %>
24
+ </div>
25
+ <% else %>
26
+ <p><%= t(".no_features") %></p>
27
+ <% end %>
28
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <li class="<%= selected ? 'selected' : '' %>" data-method="<%= http_method.to_s.upcase %>" data-url="<%= current_endorsement_url %>">
2
+ <%= render partial: "decidim/shared/author_reference", locals: { author: identity } %>
3
+ <%= icon("circle-check", class: "icon--big #{selected ? '' : 'invisible'}") %>
4
+ </li>
@@ -0,0 +1,12 @@
1
+ <div class="reveal__header reveal__header--nomargin reveal__bg p-s">
2
+ <h6 class="heading6 m-none"><%=t '.select_identity' %></h6>
3
+ </div>
4
+ <ul class="reveal__list">
5
+ <%= render_endorsement_identity(proposal, current_user) %>
6
+ <% @user_verified_groups.each do |user_group| %>
7
+ <%= render_endorsement_identity(proposal, current_user, user_group) %>
8
+ <% end %>
9
+ </ul>
10
+ <div class="reveal__footer reveal__bg text-right p-s">
11
+ <button class="button button--nomargin button--sc" type="button" data-close><%= t('.done') %></button>
12
+ </div>
@@ -0,0 +1,9 @@
1
+ <% fully_endorsed= fully_endorsed?(proposal, current_user) %>
2
+ var $proposalEndorsementsRowCount = $('#proposal-<%= proposal.id %>-endorsements-count');
3
+ morphdom($proposalEndorsementsRowCount[0], '<%= j(render partial: 'decidim/proposals/proposals/endorsements_count', locals: { proposal: proposal, fully_endorsed: fully_endorsed }).strip.html_safe %>');
4
+ var $proposalEndorsementsRowButton = $($('#select-identity-button')[0]);
5
+ <% if fully_endorsed %>
6
+ $proposalEndorsementsRowButton.addClass('success')
7
+ <% else %>
8
+ $proposalEndorsementsRowButton.removeClass('success')
9
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <div id="proposal-<%= proposal.id %>-endorsement-button<%= user_group&.id ? "-#{user_group.id}" : '' %>">
2
+ <% if !current_user %>
3
+ <%= action_authorized_button_to :endorse, endorse_label, current_endorsement_url, class: "button #{endorsement_button_classes(from_proposals_list)} secondary" %>
4
+ <% else %>
5
+ <% if proposal.endorsed_by?(current_user, user_group) %>
6
+ <%= action_authorized_button_to :endorse, unendorse_label, current_endorsement_url, method: :delete, remote: true, data: { original: t('.already_endorsed'), replace: t('.already_endorsed_hover') }, class: "button #{endorsement_button_classes(from_proposals_list)} success", id: "endorsement_button" %>
7
+ <% else %>
8
+ <%= action_authorized_button_to :endorse, endorse_label, current_endorsement_url, remote: true, data: { }, class: "button #{endorsement_button_classes(from_proposals_list)} secondary" %>
9
+ <% end %>
10
+ <% end %>
11
+ </div>