decidim 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.eslintrc.json +2 -5
- data/.mention-bot +2 -1
- data/.yardopts +8 -0
- data/Gemfile.lock +64 -62
- data/README.md +11 -9
- data/decidim-admin/app/assets/javascripts/decidim/admin/sort_steps.js.es6 +3 -3
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_email_preview.scss +5 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/application.scss +1 -0
- data/decidim-admin/app/commands/decidim/admin/create_newsletter.rb +30 -0
- data/decidim-admin/app/commands/decidim/admin/deliver_newsletter.rb +29 -0
- data/decidim-admin/app/commands/decidim/admin/destroy_participatory_process_step.rb +9 -0
- data/decidim-admin/app/commands/decidim/admin/update_newsletter.rb +33 -0
- data/decidim-admin/app/constraints/decidim/admin/organization_dashboard_constraint.rb +1 -1
- data/decidim-admin/app/controllers/decidim/admin/features_controller.rb +2 -2
- data/decidim-admin/app/controllers/decidim/admin/newsletters_controller.rb +115 -0
- data/decidim-admin/app/controllers/decidim/admin/participatory_processes_controller.rb +4 -4
- data/decidim-admin/app/forms/decidim/admin/newsletter_form.rb +15 -0
- data/decidim-admin/app/jobs/decidim/admin/newsletter_delivery_job.rb +18 -0
- data/decidim-admin/app/jobs/decidim/admin/newsletter_job.rb +32 -0
- data/decidim-admin/app/models/decidim/admin/abilities/admin_user.rb +4 -0
- data/decidim-admin/app/models/decidim/admin/abilities/base.rb +4 -0
- data/decidim-admin/app/models/decidim/admin/abilities/collaborator_user.rb +19 -0
- data/decidim-admin/app/models/decidim/admin/abilities/participatory_process_admin.rb +1 -1
- data/decidim-admin/app/queries/decidim/admin/manageable_participatory_processes_for_user.rb +1 -1
- data/decidim-admin/app/views/decidim/admin/newsletters/_form.html.erb +5 -0
- data/decidim-admin/app/views/decidim/admin/newsletters/edit.html.erb +11 -0
- data/decidim-admin/app/views/decidim/admin/newsletters/index.html.erb +47 -0
- data/decidim-admin/app/views/decidim/admin/newsletters/new.html.erb +11 -0
- data/decidim-admin/app/views/decidim/admin/newsletters/show.html.erb +14 -0
- data/decidim-admin/app/views/decidim/admin/participatory_process_steps/_form.html.erb +1 -1
- data/decidim-admin/app/views/decidim/admin/participatory_processes/_form.html.erb +1 -1
- data/decidim-admin/app/views/decidim/admin/static_pages/_form.html.erb +1 -1
- data/decidim-admin/app/views/layouts/decidim/admin/_sidebar.html.erb +1 -0
- data/decidim-admin/config/locales/ca.yml +40 -0
- data/decidim-admin/config/locales/en.yml +40 -0
- data/decidim-admin/config/locales/es.yml +40 -0
- data/decidim-admin/config/routes.rb +7 -0
- data/decidim-admin/decidim-admin.gemspec +0 -1
- data/decidim-admin/lib/decidim/admin/engine.rb +1 -0
- data/decidim-admin/lib/decidim/admin/features/base_controller.rb +5 -1
- data/decidim-admin/spec/commands/create_newsletter_spec.rb +62 -0
- data/decidim-admin/spec/commands/deliver_newsletter_spec.rb +45 -0
- data/decidim-admin/spec/commands/destroy_participatory_process_step_spec.rb +12 -0
- data/decidim-admin/spec/commands/update_newsletter_spec.rb +64 -0
- data/decidim-admin/spec/features/admin_manages_newsletters_spec.rb +147 -0
- data/decidim-admin/spec/features/admin_manages_participatory_processes_spec.rb +1 -5
- data/decidim-admin/spec/features/static_pages_spec.rb +16 -0
- data/decidim-admin/spec/forms/newsletter_form_spec.rb +47 -0
- data/decidim-admin/spec/jobs/newsletter_delivery_job_spec.rb +25 -0
- data/decidim-admin/spec/jobs/newsletter_job_spec.rb +29 -0
- data/decidim-admin/spec/models/abilities/collaborator_user_spec.rb +66 -0
- data/decidim-admin/spec/organization_dashboard_constraint_spec.rb +55 -0
- data/decidim-admin/spec/queries/manageable_participatory_processes_for_user_spec.rb +8 -0
- data/decidim-admin/spec/shared/manage_processes_examples.rb +1 -5
- data/decidim-api/lib/decidim/api.rb +2 -7
- data/decidim-api/lib/decidim/api/{types/mutation.rb → mutation_type.rb} +0 -0
- data/decidim-api/lib/decidim/api/{types/query.rb → query_type.rb} +0 -0
- data/decidim-budgets/app/assets/javascripts/decidim/budgets/projects.js.es6 +4 -4
- data/decidim-budgets/app/commands/decidim/budgets/add_line_item.rb +4 -2
- data/decidim-budgets/app/commands/decidim/budgets/checkout.rb +7 -3
- data/decidim-budgets/app/models/decidim/budgets/order.rb +16 -1
- data/decidim-budgets/app/models/decidim/budgets/project.rb +16 -0
- data/decidim-budgets/app/views/decidim/budgets/line_items/update_budget.js.erb +7 -7
- data/decidim-budgets/app/views/decidim/budgets/projects/_budget_confirm.html.erb +27 -25
- data/decidim-budgets/app/views/decidim/budgets/projects/_budget_summary.html.erb +4 -13
- data/decidim-budgets/app/views/decidim/budgets/projects/_order_progress.html.erb +23 -21
- data/decidim-budgets/app/views/decidim/budgets/projects/_order_selected_projects.html.erb +25 -23
- data/decidim-budgets/app/views/decidim/budgets/projects/_order_total_budget.html.erb +3 -1
- data/decidim-budgets/app/views/decidim/budgets/projects/_project.html.erb +32 -30
- data/decidim-budgets/app/views/decidim/budgets/projects/_projects.html.erb +1 -3
- data/decidim-budgets/app/views/decidim/budgets/projects/index.html.erb +0 -4
- data/decidim-budgets/app/views/decidim/budgets/projects/show.html.erb +5 -6
- data/decidim-budgets/config/i18n-tasks.yml +1 -0
- data/decidim-budgets/config/locales/ca.yml +7 -2
- data/decidim-budgets/config/locales/en.yml +17 -6
- data/decidim-budgets/config/locales/es.yml +7 -2
- data/decidim-budgets/lib/decidim/budgets/feature.rb +2 -2
- data/decidim-budgets/spec/commands/add_line_item_spec.rb +16 -3
- data/decidim-budgets/spec/commands/cancel_order_spec.rb +7 -1
- data/decidim-budgets/spec/commands/checkout_spec.rb +9 -2
- data/decidim-budgets/spec/commands/remove_line_item_spec.rb +16 -5
- data/decidim-budgets/spec/features/orders_spec.rb +8 -2
- data/decidim-budgets/spec/models/order_spec.rb +31 -2
- data/decidim-budgets/spec/shared/admin_shared_context.rb +1 -1
- data/decidim-comments/README.md +1 -1
- data/decidim-comments/app/assets/javascripts/decidim/comments/bundle.js +0 -0
- data/decidim-comments/app/frontend/comments/add_comment_form.component.jsx +156 -93
- data/decidim-comments/app/frontend/comments/add_comment_form.component.test.jsx +36 -23
- data/decidim-comments/app/frontend/comments/add_comment_form.mutation.graphql +5 -3
- data/decidim-comments/app/frontend/comments/add_comment_form_commentable.fragment.graphql +4 -0
- data/decidim-comments/app/frontend/comments/add_comment_form_session.fragment.graphql +6 -0
- data/decidim-comments/app/frontend/comments/comment.component.jsx +11 -13
- data/decidim-comments/app/frontend/comments/comment.component.test.jsx +22 -21
- data/decidim-comments/app/frontend/comments/comment.fragment.graphql +4 -4
- data/decidim-comments/app/frontend/comments/comment_data.fragment.graphql +4 -3
- data/decidim-comments/app/frontend/comments/comment_order_selector.component.jsx +1 -1
- data/decidim-comments/app/frontend/comments/comment_thread.component.jsx +3 -3
- data/decidim-comments/app/frontend/comments/comment_thread.component.test.jsx +3 -3
- data/decidim-comments/app/frontend/comments/comment_thread.fragment.graphql +1 -1
- data/decidim-comments/app/frontend/comments/comments.component.jsx +47 -39
- data/decidim-comments/app/frontend/comments/comments.component.test.jsx +51 -38
- data/decidim-comments/app/frontend/comments/comments.query.graphql +10 -4
- data/decidim-comments/app/frontend/comments/down_vote_button.component.jsx +6 -3
- data/decidim-comments/app/frontend/comments/up_vote_button.component.jsx +7 -4
- data/decidim-comments/app/frontend/support/generate_comments_data.js +4 -4
- data/decidim-comments/app/models/decidim/comments/comment.rb +7 -9
- data/decidim-comments/app/queries/decidim/comments/{comments_with_replies.rb → sorted_comments.rb} +3 -8
- data/decidim-comments/app/types/decidim/comments/commentable_interface.rb +44 -0
- data/decidim-comments/app/types/decidim/comments/commentable_mutation_type.rb +29 -0
- data/decidim-comments/app/types/decidim/comments/commentable_type.rb +14 -0
- data/decidim-comments/config/locales/ca.yml +3 -1
- data/decidim-comments/config/locales/en.yml +5 -2
- data/decidim-comments/config/locales/es.yml +3 -1
- data/decidim-comments/lib/decidim/comments.rb +4 -0
- data/decidim-comments/{app/types/decidim/comments → lib/decidim/comments/api}/add_comment_type.rb +0 -0
- data/decidim-comments/{app/types/decidim/comments → lib/decidim/comments/api}/comment_mutation_type.rb +0 -0
- data/decidim-comments/{app/types/decidim/comments → lib/decidim/comments/api}/comment_type.rb +11 -17
- data/decidim-comments/lib/decidim/comments/commentable.rb +45 -0
- data/decidim-comments/lib/decidim/comments/comments_helper.rb +15 -10
- data/decidim-comments/lib/decidim/comments/mutation_extensions.rb +8 -16
- data/decidim-comments/lib/decidim/comments/query_extensions.rb +5 -8
- data/decidim-comments/lib/decidim/comments/test/factories.rb +3 -3
- data/decidim-comments/spec/commands/vote_comment_spec.rb +3 -1
- data/decidim-comments/spec/features/comments_spec.rb +28 -14
- data/decidim-comments/spec/features/notifications_spec.rb +1 -1
- data/decidim-comments/spec/helpers/comments_helper_spec.rb +4 -27
- data/decidim-comments/spec/models/comment_spec.rb +7 -11
- data/decidim-comments/spec/models/comment_vote_spec.rb +3 -1
- data/decidim-comments/spec/models/seed_spec.rb +3 -4
- data/decidim-comments/spec/queries/{comments_with_replies_spec.rb → sorted_comments_spec.rb} +12 -29
- data/decidim-comments/spec/types/comment_type_spec.rb +23 -17
- data/decidim-comments/spec/types/commentable_mutation_type_spec.rb +34 -0
- data/decidim-comments/spec/types/commentable_type_spec.rb +48 -0
- data/decidim-comments/spec/types/mutation_type_spec.rb +5 -22
- data/decidim-comments/spec/types/query_type_spec.rb +0 -24
- data/decidim-dev/config/i18n-tasks.yml +4 -0
- data/decidim-dev/decidim-dev.gemspec +1 -1
- data/decidim-dev/lib/decidim/dev/test/rspec_support/action_mailer.rb +10 -4
- data/decidim-dev/lib/decidim/dev/test/rspec_support/feature.rb +6 -5
- data/decidim-dev/lib/decidim/dev/test/rspec_support/i18n.rb +0 -1
- data/decidim-meetings/app/assets/javascripts/decidim/meetings/map.js.es6.erb +8 -3
- data/decidim-meetings/app/assets/stylesheets/decidim/meetings/map.css +3 -1
- data/decidim-meetings/app/controllers/decidim/meetings/meetings_controller.rb +2 -2
- data/decidim-meetings/app/forms/decidim/meetings/admin/close_meeting_form.rb +2 -1
- data/decidim-meetings/app/helpers/decidim/meetings/map_helper.rb +1 -0
- data/decidim-meetings/app/services/decidim/meetings/meeting_search.rb +7 -3
- data/decidim-meetings/app/views/decidim/meetings/meetings/_datetime.html.erb +1 -1
- data/decidim-meetings/app/views/decidim/meetings/meetings/_filters.html.erb +5 -5
- data/decidim-meetings/app/views/decidim/meetings/meetings/_linked_meetings.html.erb +1 -1
- data/decidim-meetings/app/views/decidim/meetings/meetings/index.html.erb +1 -5
- data/decidim-meetings/app/views/decidim/meetings/meetings/show.html.erb +16 -9
- data/decidim-meetings/config/locales/ca.yml +2 -3
- data/decidim-meetings/config/locales/en.yml +2 -3
- data/decidim-meetings/config/locales/es.yml +2 -3
- data/decidim-meetings/spec/features/explore_meetings_spec.rb +75 -24
- data/decidim-meetings/spec/forms/close_meeting_form_spec.rb +1 -1
- data/decidim-meetings/spec/services/meeting_search_spec.rb +15 -12
- data/decidim-meetings/vendor/assets/javascripts/leaflet.markercluster.js +7 -0
- data/decidim-meetings/vendor/assets/stylesheets/MarkerCluster.Default.css +60 -0
- data/decidim-meetings/vendor/assets/stylesheets/MarkerCluster.css +14 -0
- data/decidim-pages/app/models/decidim/pages/page.rb +22 -0
- data/decidim-pages/app/views/decidim/pages/application/show.html.erb +2 -6
- data/decidim-pages/config/locales/ca.yml +2 -2
- data/decidim-pages/config/locales/en.yml +2 -2
- data/decidim-pages/config/locales/es.yml +2 -2
- data/decidim-pages/lib/decidim/pages/feature.rb +2 -2
- data/decidim-pages/spec/features/page_show_spec.rb +0 -33
- data/decidim-proposals/app/controllers/decidim/proposals/admin/proposal_answers_controller.rb +2 -0
- data/decidim-proposals/app/controllers/decidim/proposals/admin/proposals_controller.rb +2 -0
- data/decidim-proposals/app/models/decidim/proposals/abilities/admin_user.rb +45 -0
- data/decidim-proposals/app/models/decidim/proposals/abilities/process_admin_user.rb +57 -0
- data/decidim-proposals/app/models/decidim/proposals/proposal.rb +21 -0
- data/decidim-proposals/app/views/decidim/proposals/admin/proposals/_form.html.erb +1 -1
- data/decidim-proposals/app/views/decidim/proposals/admin/proposals/index.html.erb +16 -10
- data/decidim-proposals/app/views/decidim/proposals/proposal_votes/update_buttons_and_counters.js.erb +4 -4
- data/decidim-proposals/app/views/decidim/proposals/proposals/_filters.html.erb +7 -3
- data/decidim-proposals/app/views/decidim/proposals/proposals/_proposal.html.erb +2 -6
- data/decidim-proposals/app/views/decidim/proposals/proposals/_remaining_votes_count.html.erb +3 -1
- data/decidim-proposals/app/views/decidim/proposals/proposals/_tags.html.erb +1 -1
- data/decidim-proposals/app/views/decidim/proposals/proposals/_vote_button.html.erb +23 -21
- data/decidim-proposals/app/views/decidim/proposals/proposals/_votes_count.html.erb +9 -6
- data/decidim-proposals/app/views/decidim/proposals/proposals/_votes_limit.html.erb +1 -3
- data/decidim-proposals/app/views/decidim/proposals/proposals/index.html.erb +0 -4
- data/decidim-proposals/app/views/decidim/proposals/proposals/new.html.erb +1 -1
- data/decidim-proposals/app/views/decidim/proposals/proposals/show.html.erb +2 -6
- data/decidim-proposals/config/locales/ca.yml +8 -1
- data/decidim-proposals/config/locales/en.yml +8 -1
- data/decidim-proposals/config/locales/es.yml +8 -1
- data/decidim-proposals/lib/decidim/proposals/admin_engine.rb +7 -0
- data/decidim-proposals/lib/decidim/proposals/feature.rb +6 -2
- data/decidim-proposals/spec/features/proposals_spec.rb +226 -40
- data/decidim-proposals/spec/models/decidim/proposals/abilities/admin_user_spec.rb +62 -0
- data/decidim-proposals/spec/models/decidim/proposals/abilities/process_admin_user_spec.rb +63 -0
- data/decidim-proposals/spec/shared/manage_proposals_examples.rb +161 -50
- data/decidim-results/app/models/decidim/results/result.rb +21 -0
- data/decidim-results/app/views/decidim/results/results/index.html.erb +0 -4
- data/decidim-results/app/views/decidim/results/results/show.html.erb +2 -8
- data/decidim-results/config/i18n-tasks.yml +1 -0
- data/decidim-results/config/locales/ca.yml +5 -2
- data/decidim-results/config/locales/en.yml +5 -2
- data/decidim-results/config/locales/es.yml +5 -2
- data/decidim-results/lib/decidim/results/feature.rb +2 -2
- data/decidim-results/spec/services/result_stats_calculator_spec.rb +2 -2
- data/decidim-results/spec/shared/admin_shared_context.rb +1 -1
- data/decidim-system/config/i18n-tasks.yml +1 -1
- data/package.json +50 -51
- data/yarn.lock +198 -151
- metadata +69 -36
- data/decidim-admin/spec/features/admin_access_control.rb +0 -52
- data/decidim-api/lib/decidim/api/types/author_interface.rb +0 -13
- data/decidim-api/lib/decidim/api/types/localized_string.rb +0 -13
- data/decidim-api/lib/decidim/api/types/translated_field.rb +0 -44
- data/decidim-api/spec/types/localized_string_type_spec.rb +0 -31
- data/decidim-api/spec/types/translated_field_type_spec.rb +0 -69
- data/decidim-comments/app/frontend/comments/add_comment_form.fragment.graphql +0 -6
@@ -0,0 +1,14 @@
|
|
1
|
+
<h3><%= t ".preview" %></h3>
|
2
|
+
|
3
|
+
<dl>
|
4
|
+
<dt><%= t ".subject" %></dt>
|
5
|
+
<dd><%= @email.subject %></dd>
|
6
|
+
</dl>
|
7
|
+
|
8
|
+
<iframe src="<%= preview_newsletter_path(@newsletter) %>" class="email-preview">
|
9
|
+
</iframe>
|
10
|
+
|
11
|
+
<div class="actions">
|
12
|
+
<%= link_to t("actions.edit", scope: "decidim.admin"), ['edit', @newsletter] %>
|
13
|
+
<%= link_to t(".deliver"), deliver_newsletter_path(@newsletter), method: :post, class: "button", data: { confirm: t(".confirm_deliver") } %>
|
14
|
+
</div>
|
@@ -13,6 +13,7 @@
|
|
13
13
|
<%= active_link_to t("menu.scopes", scope: "decidim.admin"), decidim_admin.scopes_path, active: :inclusive if can? :read, Decidim::Scope %>
|
14
14
|
<%= active_link_to t("menu.users", scope: "decidim.admin"), decidim_admin.users_path, active: :inclusive if can? :read, :admin_users %>
|
15
15
|
<%= active_link_to t("menu.user_groups", scope: "decidim.admin"), decidim_admin.user_groups_path, active: :inclusive if can? :index, Decidim::UserGroup %>
|
16
|
+
<%= active_link_to t("menu.newsletters", scope: "decidim.admin"), decidim_admin.newsletters_path, active: :inclusive if can? :index, Decidim::Newsletter %>
|
16
17
|
<%= active_link_to t("menu.settings", scope: "decidim.admin"), decidim_admin.edit_organization_path, active: :inclusive if can? :read, current_organization %>
|
17
18
|
</nav>
|
18
19
|
|
@@ -12,6 +12,9 @@ ca:
|
|
12
12
|
feature:
|
13
13
|
name: Nom
|
14
14
|
weight: Pes
|
15
|
+
newsletter:
|
16
|
+
body: Cos
|
17
|
+
subject: Assumpte
|
15
18
|
organization:
|
16
19
|
default_locale: Idioma per defecte
|
17
20
|
description: Descripció
|
@@ -161,6 +164,7 @@ ca:
|
|
161
164
|
success: La funcionalitat s'ha actualitzat correctament.
|
162
165
|
menu:
|
163
166
|
dashboard: Tauler de control
|
167
|
+
newsletters: Butlletins
|
164
168
|
participatory_processes: Processos participatius
|
165
169
|
participatory_processes_submenu:
|
166
170
|
attachments: Adjunts
|
@@ -185,6 +189,13 @@ ca:
|
|
185
189
|
fields:
|
186
190
|
name: Nom
|
187
191
|
name: Categoria
|
192
|
+
newsletter:
|
193
|
+
fields:
|
194
|
+
created_at: Data de creació
|
195
|
+
progress: Progrés
|
196
|
+
sent_at: Enviat el
|
197
|
+
subject: Assumpte
|
198
|
+
name: Butlletí
|
188
199
|
participatory_process:
|
189
200
|
fields:
|
190
201
|
created_at: Data de creació
|
@@ -228,6 +239,35 @@ ca:
|
|
228
239
|
name: Nom
|
229
240
|
phone: Telèfon
|
230
241
|
users_count: Número d'usuaris
|
242
|
+
newsletters:
|
243
|
+
create:
|
244
|
+
error: S'ha produït un error en crear aquest butlletí.
|
245
|
+
success: Butlletí creat amb èxit. Si us plau, revisa'l abans d'enviar.
|
246
|
+
deliver:
|
247
|
+
error: Hi ha hagut un error d'enviament d'aquest butlletí.
|
248
|
+
success: Butlletí enviat amb èxit.
|
249
|
+
destroy:
|
250
|
+
error_already_sent: 'No es pot destruir butlletí de notícies: Ja s''ha enviat.'
|
251
|
+
success: Butlletí destruït amb èxit.
|
252
|
+
edit:
|
253
|
+
save_and_preview: Desar i vista prèvia
|
254
|
+
title: Editar butlletí
|
255
|
+
form:
|
256
|
+
interpolations_hint: 'Consell: Podeu utilitzar "%{name}" en qualsevol part del cos o assumpte i serà reemplaçat pel nom del destinatari.'
|
257
|
+
index:
|
258
|
+
confirm_delete: Esteu segur que voleu suprimir aquest butlletí?
|
259
|
+
title: Butlletins
|
260
|
+
new:
|
261
|
+
save: Desar
|
262
|
+
title: Nou butlletí
|
263
|
+
show:
|
264
|
+
confirm_deliver: Estàs segur de que vols enviar aquest butlletí? Aquesta acció no es pot desfer.
|
265
|
+
deliver: Enviar butlletí
|
266
|
+
preview: Previsualitzar
|
267
|
+
subject: Assumpte
|
268
|
+
update:
|
269
|
+
error: S'ha produït un error en actualitzar aquest butlletí.
|
270
|
+
success: Butlletí actualitzat correctament. Si us plau, revisa'l abans d'enviar-lo.
|
231
271
|
organization:
|
232
272
|
edit:
|
233
273
|
title: Edita organització
|
@@ -13,6 +13,9 @@ en:
|
|
13
13
|
feature:
|
14
14
|
name: Name
|
15
15
|
weight: Weight
|
16
|
+
newsletter:
|
17
|
+
body: Body
|
18
|
+
subject: Subject
|
16
19
|
organization:
|
17
20
|
default_locale: Default locale
|
18
21
|
description: Description
|
@@ -162,6 +165,7 @@ en:
|
|
162
165
|
success: The feature was updated successfully.
|
163
166
|
menu:
|
164
167
|
dashboard: Dashboard
|
168
|
+
newsletters: Newsletters
|
165
169
|
participatory_processes: Participatory processes
|
166
170
|
participatory_processes_submenu:
|
167
171
|
attachments: Attachments
|
@@ -186,6 +190,13 @@ en:
|
|
186
190
|
fields:
|
187
191
|
name: Name
|
188
192
|
name: Category
|
193
|
+
newsletter:
|
194
|
+
fields:
|
195
|
+
created_at: Created at
|
196
|
+
progress: Progress
|
197
|
+
sent_at: Sent at
|
198
|
+
subject: Subject
|
199
|
+
name: Newsletter
|
189
200
|
participatory_process:
|
190
201
|
fields:
|
191
202
|
created_at: Created at
|
@@ -229,6 +240,35 @@ en:
|
|
229
240
|
name: Name
|
230
241
|
phone: Phone
|
231
242
|
users_count: Users count
|
243
|
+
newsletters:
|
244
|
+
create:
|
245
|
+
error: There's been an error creating this newsletter.
|
246
|
+
success: Newsletter created successfully. Please, review it before sending.
|
247
|
+
deliver:
|
248
|
+
error: There's been an error delivering this newsletter.
|
249
|
+
success: Newsletter delivered successfully.
|
250
|
+
destroy:
|
251
|
+
error_already_sent: 'Can''t destroy newsletter: It has already been sent.'
|
252
|
+
success: Newsletter destroyed successfully.
|
253
|
+
edit:
|
254
|
+
save_and_preview: Save and preview
|
255
|
+
title: Edit newsletter
|
256
|
+
form:
|
257
|
+
interpolations_hint: 'Hint: You can use "%{name}" anywhere in the body or subject and it will be replaced by the recipient''s name.'
|
258
|
+
index:
|
259
|
+
confirm_delete: Are you sure you want to delete this newsletter?
|
260
|
+
title: Newsletters
|
261
|
+
new:
|
262
|
+
save: Save
|
263
|
+
title: New newsletter
|
264
|
+
show:
|
265
|
+
confirm_deliver: Are you sure you want to deliver this newsletter? This action cannot be undone.
|
266
|
+
deliver: Deliver newsletter
|
267
|
+
preview: Preview
|
268
|
+
subject: Subject
|
269
|
+
update:
|
270
|
+
error: There's been an error updating this newsletter.
|
271
|
+
success: Newsletter updated successfully. Please review it before sending.
|
232
272
|
organization:
|
233
273
|
edit:
|
234
274
|
title: Edit organization
|
@@ -12,6 +12,9 @@ es:
|
|
12
12
|
feature:
|
13
13
|
name: Nombre
|
14
14
|
weight: Peso
|
15
|
+
newsletter:
|
16
|
+
body: Cuerpo
|
17
|
+
subject: Asunto
|
15
18
|
organization:
|
16
19
|
default_locale: Configuración regional predeterminada
|
17
20
|
description: Descripción
|
@@ -161,6 +164,7 @@ es:
|
|
161
164
|
success: La funcionalidad se ha actualizado correctamente.
|
162
165
|
menu:
|
163
166
|
dashboard: Panel de control
|
167
|
+
newsletters: Boletines
|
164
168
|
participatory_processes: Procesos participativos
|
165
169
|
participatory_processes_submenu:
|
166
170
|
attachments: Archivos adjuntos
|
@@ -185,6 +189,13 @@ es:
|
|
185
189
|
fields:
|
186
190
|
name: Nombre
|
187
191
|
name: Categoría
|
192
|
+
newsletter:
|
193
|
+
fields:
|
194
|
+
created_at: Fecha de creación
|
195
|
+
progress: Progreso
|
196
|
+
sent_at: Enviado el
|
197
|
+
subject: Asunto
|
198
|
+
name: Boletín
|
188
199
|
participatory_process:
|
189
200
|
fields:
|
190
201
|
created_at: Fecha de creación
|
@@ -228,6 +239,35 @@ es:
|
|
228
239
|
name: Nombre
|
229
240
|
phone: Teléfono
|
230
241
|
users_count: Número de usuarios
|
242
|
+
newsletters:
|
243
|
+
create:
|
244
|
+
error: Se ha producido un error al crear este boletín.
|
245
|
+
success: Boletín creado con éxito. Por favor, revíselo antes de enviarlo.
|
246
|
+
deliver:
|
247
|
+
error: Ha habido un error de entrega de este boletín.
|
248
|
+
success: Boletín enviado con éxito.
|
249
|
+
destroy:
|
250
|
+
error_already_sent: 'No se puede destruir el boletín de noticias: Ya se ha enviado.'
|
251
|
+
success: Boletín destruido con éxito.
|
252
|
+
edit:
|
253
|
+
save_and_preview: Guardar y vista previa
|
254
|
+
title: Editar boletín
|
255
|
+
form:
|
256
|
+
interpolations_hint: 'Sugerencia: Puede utilizar "%{name}" en cualquier parte del cuerpo o asunto y será reemplazado por el nombre del destinatario.'
|
257
|
+
index:
|
258
|
+
confirm_delete: '¿Estás seguro de que quieres eliminar este boletín?'
|
259
|
+
title: Boletines
|
260
|
+
new:
|
261
|
+
save: Guardar
|
262
|
+
title: Nuevo boletín
|
263
|
+
show:
|
264
|
+
confirm_deliver: '¿Estás seguro de que quieres enviar este boletín? Esta acción no se puede deshacer.'
|
265
|
+
deliver: Enviar boletín
|
266
|
+
preview: Previsualizar
|
267
|
+
subject: Asunto
|
268
|
+
update:
|
269
|
+
error: Se ha producido un error al actualizar este boletín.
|
270
|
+
success: Boletín actualizado correctamente. Por favor revísalo antes de enviarlo.
|
231
271
|
organization:
|
232
272
|
edit:
|
233
273
|
title: Editar organización
|
@@ -24,7 +24,6 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.add_dependency "foundation_rails_helper", "~> 3.0.0.rc"
|
25
25
|
s.add_dependency "active_link_to", "~> 1.0.0"
|
26
26
|
s.add_dependency "carrierwave", "~> 1.0.0.rc"
|
27
|
-
s.add_dependency "cancancan", "~> 1.15.0"
|
28
27
|
|
29
28
|
s.add_development_dependency "decidim-dev", Decidim.version
|
30
29
|
end
|
@@ -33,6 +33,7 @@ module Decidim
|
|
33
33
|
Decidim.configure do |config|
|
34
34
|
config.abilities += ["Decidim::Admin::Abilities::AdminUser"]
|
35
35
|
config.abilities += ["Decidim::Admin::Abilities::ParticipatoryProcessAdmin"]
|
36
|
+
config.abilities += ["Decidim::Admin::Abilities::CollaboratorUser"]
|
36
37
|
end
|
37
38
|
end
|
38
39
|
end
|
@@ -16,10 +16,14 @@ module Decidim
|
|
16
16
|
|
17
17
|
delegate :active_step, to: :current_participatory_process, prefix: false
|
18
18
|
|
19
|
-
before_action do
|
19
|
+
before_action except: [:index, :show] do
|
20
20
|
authorize! :manage, current_feature
|
21
21
|
end
|
22
22
|
|
23
|
+
before_action on: [:index, :show] do
|
24
|
+
authorize! :read, current_feature
|
25
|
+
end
|
26
|
+
|
23
27
|
def current_feature
|
24
28
|
request.env["decidim.current_feature"]
|
25
29
|
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
module Decidim
|
5
|
+
module Admin
|
6
|
+
describe CreateNewsletter, :db do
|
7
|
+
describe "call" do
|
8
|
+
let(:user) { create(:user, organization: organization) }
|
9
|
+
let(:organization) { create(:organization) }
|
10
|
+
|
11
|
+
let(:form) do
|
12
|
+
double(
|
13
|
+
subject: Decidim::Faker::Localized.paragraph(3),
|
14
|
+
body: Decidim::Faker::Localized.paragraph(3),
|
15
|
+
valid?: true
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
let(:command) { described_class.new(form, user) }
|
20
|
+
|
21
|
+
describe "when the form is not valid" do
|
22
|
+
before do
|
23
|
+
expect(form).to receive(:valid?).and_return(false)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "broadcasts invalid" do
|
27
|
+
expect { command.call }.to broadcast(:invalid)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "doesn't create a newsletter" do
|
31
|
+
expect do
|
32
|
+
command.call
|
33
|
+
end.not_to change { Newsletter.count }
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
describe "when the form is valid" do
|
38
|
+
it "broadcasts ok" do
|
39
|
+
expect { command.call }.to broadcast(:ok)
|
40
|
+
end
|
41
|
+
|
42
|
+
it "creates a new category" do
|
43
|
+
expect do
|
44
|
+
command.call
|
45
|
+
end.to change { Newsletter.count }.by(1)
|
46
|
+
end
|
47
|
+
|
48
|
+
it "creates a newsletter with the right attributes" do
|
49
|
+
command.call
|
50
|
+
newsletter = Newsletter.last
|
51
|
+
|
52
|
+
expect(newsletter.author).to eq(user)
|
53
|
+
expect(newsletter.organization).to eq(organization)
|
54
|
+
expect(newsletter.subject).to eq(form.subject.stringify_keys)
|
55
|
+
expect(newsletter.sent?).to eq(false)
|
56
|
+
expect(newsletter.body).to eq(form.body.stringify_keys)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
module Decidim
|
5
|
+
module Admin
|
6
|
+
describe DeliverNewsletter, :db do
|
7
|
+
describe "call" do
|
8
|
+
let(:organization) { create(:organization) }
|
9
|
+
let(:newsletter) do
|
10
|
+
create(:newsletter,
|
11
|
+
organization: organization,
|
12
|
+
body: Decidim::Faker::Localized.sentence(3))
|
13
|
+
end
|
14
|
+
|
15
|
+
let!(:deliverable_users) do
|
16
|
+
create_list(:user, 5, organization: organization, newsletter_notifications: true)
|
17
|
+
end
|
18
|
+
|
19
|
+
let!(:not_deliverable_users) do
|
20
|
+
create_list(:user, 3, organization: organization, newsletter_notifications: false)
|
21
|
+
end
|
22
|
+
|
23
|
+
let(:command) { described_class.new(newsletter) }
|
24
|
+
|
25
|
+
it "updates the counters and delivers to the right users" do
|
26
|
+
clear_emails
|
27
|
+
expect(emails.length).to eq(0)
|
28
|
+
|
29
|
+
perform_enqueued_jobs { command.call }
|
30
|
+
|
31
|
+
expect(emails.length).to eq(5)
|
32
|
+
|
33
|
+
deliverable_users.each do |user|
|
34
|
+
email = emails.find { |e| e.to.include? user.email }
|
35
|
+
expect(email_body(email)).to include(newsletter.body[user.locale])
|
36
|
+
end
|
37
|
+
|
38
|
+
newsletter.reload
|
39
|
+
expect(newsletter.total_deliveries).to eq(5)
|
40
|
+
expect(newsletter.total_recipients).to eq(5)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -26,6 +26,8 @@ describe Decidim::Admin::DestroyParticipatoryProcessStep, class: true do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
context "when destroying an inactive step" do
|
29
|
+
let(:reorderer) { double(call: true) }
|
30
|
+
|
29
31
|
it "broadcasts ok" do
|
30
32
|
expect { subject.call(inactive_step) }.to broadcast(:ok)
|
31
33
|
end
|
@@ -34,6 +36,16 @@ describe Decidim::Admin::DestroyParticipatoryProcessStep, class: true do
|
|
34
36
|
subject.call(inactive_step)
|
35
37
|
expect(inactive_step).not_to be_persisted
|
36
38
|
end
|
39
|
+
|
40
|
+
it "reorders the remaining steps" do
|
41
|
+
allow(Decidim::Admin::ReorderParticipatoryProcessSteps)
|
42
|
+
.to receive(:new)
|
43
|
+
.with([active_step], [active_step.id])
|
44
|
+
.and_return(reorderer)
|
45
|
+
expect(reorderer).to receive(:call)
|
46
|
+
|
47
|
+
subject.call(inactive_step)
|
48
|
+
end
|
37
49
|
end
|
38
50
|
end
|
39
51
|
|