decidim-initiatives 0.23.0 → 0.24.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/stylesheet/decidim/initiatives/initiatives.scss +6 -0
  4. data/app/assets/stylesheet/decidim/initiatives/print-initiative.css.scss +22 -0
  5. data/app/cells/decidim/initiatives/content_blocks/highlighted_initiatives/show.erb +4 -8
  6. data/app/cells/decidim/initiatives/content_blocks/highlighted_initiatives_cell.rb +5 -1
  7. data/app/cells/decidim/initiatives/content_blocks/highlighted_initiatives_settings_form/show.erb +2 -1
  8. data/app/cells/decidim/initiatives/content_blocks/highlighted_initiatives_settings_form_cell.rb +12 -1
  9. data/app/commands/decidim/initiatives/admin/update_initiative.rb +3 -3
  10. data/app/commands/decidim/initiatives/admin/update_initiative_answer.rb +3 -3
  11. data/app/commands/decidim/initiatives/approve_membership_request.rb +40 -0
  12. data/app/commands/decidim/initiatives/create_initiative.rb +5 -4
  13. data/app/commands/decidim/initiatives/revoke_membership_request.rb +40 -0
  14. data/app/commands/decidim/initiatives/send_initiative_to_technical_validation.rb +57 -0
  15. data/app/commands/decidim/initiatives/spawn_committee_request.rb +18 -0
  16. data/app/commands/decidim/initiatives/update_initiative.rb +74 -0
  17. data/app/controllers/decidim/initiatives/admin/committee_requests_controller.rb +15 -4
  18. data/app/controllers/decidim/initiatives/admin/initiatives_controller.rb +1 -1
  19. data/app/controllers/decidim/initiatives/admin/moderations/reports_controller.rb +18 -0
  20. data/app/controllers/decidim/initiatives/committee_requests_controller.rb +32 -0
  21. data/app/controllers/decidim/initiatives/initiative_signatures_controller.rb +1 -3
  22. data/app/controllers/decidim/initiatives/initiatives_controller.rb +58 -1
  23. data/app/events/decidim/initiatives/approve_membership_request_event.rb +61 -0
  24. data/app/events/decidim/initiatives/initiative_sent_to_technical_validation_event.rb +19 -0
  25. data/app/events/decidim/initiatives/revoke_membership_request_event.rb +61 -0
  26. data/app/events/decidim/initiatives/spawn_committee_request_event.rb +61 -0
  27. data/app/forms/decidim/initiatives/admin/initiative_form.rb +8 -4
  28. data/app/forms/decidim/initiatives/admin/initiative_type_form.rb +3 -0
  29. data/app/forms/decidim/initiatives/initiative_form.rb +25 -2
  30. data/app/forms/decidim/initiatives/vote_form.rb +3 -1
  31. data/app/helpers/decidim/initiatives/admin/initiative_admin_menu_helper.rb +15 -0
  32. data/app/helpers/decidim/initiatives/create_initiative_helper.rb +3 -2
  33. data/app/models/concerns/decidim/initiatives/has_area.rb +1 -1
  34. data/app/models/decidim/initiative.rb +0 -1
  35. data/app/permissions/decidim/initiatives/admin/permissions.rb +5 -4
  36. data/app/permissions/decidim/initiatives/permissions.rb +47 -20
  37. data/app/presenters/decidim/initiatives/admin_log/initiative_presenter.rb +2 -2
  38. data/app/queries/decidim/initiatives/initiatives_promoted.rb +1 -1
  39. data/app/queries/decidim/initiatives/organization_prioritized_initiatives.rb +13 -2
  40. data/app/serializers/decidim/initiatives/initiative_serializer.rb +3 -0
  41. data/app/services/decidim/initiatives/dummy_timestamp.rb +1 -1
  42. data/app/services/decidim/initiatives/initiative_search.rb +15 -13
  43. data/app/services/decidim/initiatives/pdf_signature_example.rb +27 -27
  44. data/app/views/decidim/initiatives/admin/initiatives/edit.html.erb +1 -1
  45. data/app/views/decidim/initiatives/admin/initiatives/index.html.erb +6 -0
  46. data/app/views/decidim/initiatives/admin/initiatives_type_scopes/edit.html.erb +24 -17
  47. data/app/views/decidim/initiatives/admin/initiatives_type_scopes/new.html.erb +17 -11
  48. data/app/views/decidim/initiatives/create_initiative/_finish_help.html.erb +2 -7
  49. data/app/views/decidim/initiatives/create_initiative/fill_data.html.erb +4 -17
  50. data/app/views/decidim/initiatives/create_initiative/finish.html.erb +11 -11
  51. data/app/views/decidim/initiatives/initiative_signatures/error_on_vote.js.erb +5 -0
  52. data/app/views/decidim/initiatives/initiatives/_committee_members.html.erb +73 -0
  53. data/app/views/decidim/initiatives/initiatives/_form.html.erb +112 -0
  54. data/app/views/decidim/initiatives/initiatives/_result.html.erb +1 -1
  55. data/app/views/decidim/initiatives/initiatives/_send_to_technical_validation.html.erb +8 -0
  56. data/app/views/decidim/initiatives/initiatives/edit.html.erb +78 -0
  57. data/app/views/decidim/initiatives/initiatives/print.html.erb +156 -0
  58. data/app/views/decidim/initiatives/initiatives/show.html.erb +19 -7
  59. data/app/views/layouts/decidim/admin/initiative.html.erb +0 -1
  60. data/app/views/layouts/decidim/admin/initiatives.html.erb +2 -15
  61. data/config/locales/ar.yml +2 -28
  62. data/config/locales/ca.yml +62 -32
  63. data/config/locales/cs.yml +106 -46
  64. data/config/locales/de.yml +147 -64
  65. data/config/locales/el.yml +2 -34
  66. data/config/locales/en.yml +94 -34
  67. data/config/locales/es-MX.yml +8 -35
  68. data/config/locales/es-PY.yml +8 -35
  69. data/config/locales/es.yml +8 -35
  70. data/config/locales/eu.yml +2 -28
  71. data/config/locales/fi-plain.yml +94 -34
  72. data/config/locales/fi.yml +94 -34
  73. data/config/locales/fr-CA.yml +94 -34
  74. data/config/locales/fr.yml +97 -37
  75. data/config/locales/gl.yml +2 -28
  76. data/config/locales/hu.yml +2 -31
  77. data/config/locales/id-ID.yml +2 -28
  78. data/config/locales/is-IS.yml +2 -13
  79. data/config/locales/it.yml +2 -34
  80. data/config/locales/ja.yml +2 -35
  81. data/config/locales/lv.yml +2 -32
  82. data/config/locales/nl.yml +37 -40
  83. data/config/locales/no.yml +20 -31
  84. data/config/locales/pl.yml +86 -33
  85. data/config/locales/pt-BR.yml +2 -28
  86. data/config/locales/pt.yml +2 -34
  87. data/config/locales/ro-RO.yml +2 -34
  88. data/config/locales/ru.yml +2 -21
  89. data/config/locales/si-LK.yml +1 -0
  90. data/config/locales/sk.yml +2 -30
  91. data/config/locales/sr-CS.yml +0 -7
  92. data/config/locales/sv.yml +5 -37
  93. data/config/locales/sw-KE.yml +1 -0
  94. data/config/locales/tr-TR.yml +266 -136
  95. data/config/locales/uk.yml +2 -21
  96. data/config/locales/zh-CN.yml +2 -35
  97. data/db/migrate/20171017095143_update_initiative_scoped_type.rb +0 -1
  98. data/db/migrate/20191107134847_add_scopes_to_initiatives_votes.rb +1 -1
  99. data/db/migrate/20191118105634_allow_multiple_offline_votes.rb +1 -1
  100. data/lib/decidim/api/initiative_api_type.rb +26 -0
  101. data/lib/decidim/api/initiative_committee_member_type.rb +18 -0
  102. data/lib/decidim/api/initiative_type.rb +49 -0
  103. data/lib/decidim/api/initiative_type_interface.rb +8 -3
  104. data/lib/decidim/initiatives.rb +1 -0
  105. data/lib/decidim/initiatives/admin_engine.rb +23 -1
  106. data/lib/decidim/initiatives/api.rb +3 -0
  107. data/lib/decidim/initiatives/engine.rb +14 -9
  108. data/lib/decidim/initiatives/initiatives_filter_form_builder.rb +19 -12
  109. data/lib/decidim/initiatives/participatory_space.rb +6 -6
  110. data/lib/decidim/initiatives/query_extensions.rb +42 -19
  111. data/lib/decidim/initiatives/test/factories.rb +36 -0
  112. data/lib/decidim/initiatives/version.rb +1 -1
  113. metadata +40 -22
  114. data/app/types/decidim/initiatives/initiative_api_type.rb +0 -26
  115. data/app/types/decidim/initiatives/initiative_committee_member_type.rb +0 -18
  116. data/app/types/decidim/initiatives/initiative_type.rb +0 -42
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8db51bc1501da471466745ec235929fd21b662ddce6dbb88eef462b1e476c02
4
- data.tar.gz: 0aadaf993de40321e50400b7dbf76ccd06f71ec24255a2e98190e52688ce6f2a
3
+ metadata.gz: 309f109451d280c9b81e7cbd45d029f362719d74ee45828b6703f7e194df81a2
4
+ data.tar.gz: 7ea66fb898519ef7f5bcba6ff4f1655bf8dd0a08727c7002445f2a81776c3e66
5
5
  SHA512:
6
- metadata.gz: 22090c6da32e3b58852a92c485cd25a309b188e45047a8e30c1a6d9d6d43e5c971fa427804e759673ef0db26e48dfbc262f5b6da3a58893046d15f95a8d87b02
7
- data.tar.gz: d9a8c3349b8be9f88cebda3a177249823c16cac21390b4e1e8f9db9c1dd8ebbba7ca472526b5853b78656bdc0cd5985f67897e1a4c32bd246e36606f2fa18f7f
6
+ metadata.gz: a00f4b05f5d6f52d021b5199e62f481dc0d5940f478a4d72190558be21e166e602d3c9b2d3778696d649f13a58b3480156c055176c1d3a2315a5a4a4e16e157c
7
+ data.tar.gz: 4c4870bf5f8de74122276425cf90b0cb15d10d8731bcff841ceabf9603c9a7c9fe07bec28ae3b22ceea97452ffb9690aed932670c8e58e86c6a5e03a7959a7cb
data/README.md CHANGED
@@ -53,7 +53,7 @@ Just use the following line:
53
53
  Decidim::Initiatives.do_not_require_authorization = true
54
54
  ```
55
55
 
56
- All the settings and their default values which can be overriden can be found in the file [`lib/decidim/initiatives.rb`](https://github.com/decidim/decidim/blob/master/decidim-initiatives/lib/decidim/initiatives.rb).
56
+ All the settings and their default values which can be overriden can be found in the file [`lib/decidim/initiatives.rb`](https://github.com/decidim/decidim/blob/develop/decidim-initiatives/lib/decidim/initiatives.rb).
57
57
 
58
58
  For example, you can also change the minimum number of required committee members to 1 (default is 2) by adding this line:
59
59
  ```
@@ -57,3 +57,9 @@
57
57
  margin-bottom: 1.5rem;
58
58
  }
59
59
  }
60
+
61
+ fieldset{
62
+ border: 1px solid #e8e8e8;
63
+ padding: .5em;
64
+ margin-bottom: 1em;
65
+ }
@@ -1,4 +1,10 @@
1
1
  @media all{
2
+ .printable{
3
+ width: 80%;
4
+ margin-left: auto;
5
+ margin-right: auto;
6
+ }
7
+
2
8
  .initiative-letterhead{
3
9
  font-size: 14pt;
4
10
  font-weight: bold;
@@ -104,6 +110,14 @@
104
110
  }
105
111
 
106
112
  @media print{
113
+ .process-header{
114
+ display: none;
115
+ }
116
+
117
+ .main-nav{
118
+ display: none;
119
+ }
120
+
107
121
  .title-bar{
108
122
  display: none;
109
123
  }
@@ -119,4 +133,12 @@
119
133
  .page-break{
120
134
  page-break-before: auto;
121
135
  }
136
+
137
+ .main-footer{
138
+ display: none;
139
+ }
140
+
141
+ .mini-footer{
142
+ display: none;
143
+ }
122
144
  }
@@ -5,16 +5,12 @@
5
5
  <div class="row small-up-1 smallmedium-up-2 mediumlarge-up-3 large-up-4 card-grid">
6
6
  <% highlighted_initiatives.each do |initiative| %>
7
7
  <div class="column">
8
- <div class="card card--initiative card--mini">
9
- <%= link_to decidim_initiatives.initiative_path(initiative), class: "card__link" do %>
10
- <span class="show-for-sr"><%= translated_attribute initiative.title %></span>
11
- <% end %>
8
+ <%= link_to decidim_initiatives.initiative_path(initiative), class: "card card--initiative card--mini" do %>
9
+ <span class="show-for-sr"><%= translated_attribute initiative.title %></span>
12
10
  <div class="card__content">
13
- <%= link_to decidim_initiatives.initiative_path(initiative), class: "card__link" do %>
14
- <span class="card__title"><%= decidim_html_escape(translated_attribute(initiative.title)) %></span>
15
- <% end %>
11
+ <span class="card__title card__link"><%= decidim_html_escape(translated_attribute(initiative.title)) %></span>
16
12
  </div>
17
- </div>
13
+ <% end %>
18
14
  </div>
19
15
  <% end %>
20
16
  </div>
@@ -16,9 +16,13 @@ module Decidim
16
16
  model.settings.max_results
17
17
  end
18
18
 
19
+ def order
20
+ model.settings.order
21
+ end
22
+
19
23
  def highlighted_initiatives
20
24
  @highlighted_initiatives ||= OrganizationPrioritizedInitiatives
21
- .new(current_organization)
25
+ .new(current_organization, order)
22
26
  .query
23
27
  .limit(max_results)
24
28
  end
@@ -1,3 +1,4 @@
1
1
  <% form.fields_for :settings, form.object.settings do |settings_fields| %>
2
- <%= settings_fields.select :max_results, [4, 8, 12], prompt: "", label: label %>
2
+ <%= settings_fields.select :max_results, [4, 8, 12], prompt: "", label: max_results_label %>
3
+ <%= settings_fields.select :order, order_select, prompt: "", label: order_label %>
3
4
  <% end %>
@@ -10,9 +10,20 @@ module Decidim
10
10
  options[:content_block]
11
11
  end
12
12
 
13
- def label
13
+ def max_results_label
14
14
  I18n.t("decidim.initiatives.admin.content_blocks.highlighted_initiatives.max_results")
15
15
  end
16
+
17
+ def order_label
18
+ I18n.t("decidim.initiatives.admin.content_blocks.highlighted_initiatives.order.label")
19
+ end
20
+
21
+ def order_select
22
+ [
23
+ [I18n.t("decidim.initiatives.admin.content_blocks.highlighted_initiatives.order.default"), "default"],
24
+ [I18n.t("decidim.initiatives.admin.content_blocks.highlighted_initiatives.order.most_recent"), "most_recent"]
25
+ ]
26
+ end
16
27
  end
17
28
  end
18
29
  end
@@ -80,9 +80,9 @@ module Decidim
80
80
  attrs[:state] = form.state if form.state
81
81
  attrs[:decidim_area_id] = form.area_id
82
82
 
83
- if initiative.published?
84
- @notify_extended = true if form.signature_end_date != initiative.signature_end_date &&
85
- form.signature_end_date > initiative.signature_end_date
83
+ if initiative.published? && form.signature_end_date != initiative.signature_end_date &&
84
+ form.signature_end_date > initiative.signature_end_date
85
+ @notify_extended = true
86
86
  end
87
87
  end
88
88
 
@@ -53,9 +53,9 @@ module Decidim
53
53
  attrs[:signature_start_date] = form.signature_start_date
54
54
  attrs[:signature_end_date] = form.signature_end_date
55
55
 
56
- if initiative.published?
57
- @notify_extended = true if form.signature_end_date != initiative.signature_end_date &&
58
- form.signature_end_date > initiative.signature_end_date
56
+ if initiative.published? && form.signature_end_date != initiative.signature_end_date &&
57
+ form.signature_end_date > initiative.signature_end_date
58
+ @notify_extended = true
59
59
  end
60
60
  end
61
61
 
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Initiatives
5
+ # A command with all the business logic that creates a new initiative.
6
+ class ApproveMembershipRequest < Rectify::Command
7
+ # Public: Initializes the command.
8
+ #
9
+ # membership_request - A pending committee member
10
+ def initialize(membership_request)
11
+ @membership_request = membership_request
12
+ end
13
+
14
+ # Executes the command. Broadcasts these events:
15
+ #
16
+ # - :ok when everything is valid.
17
+ #
18
+ # Returns nothing.
19
+ def call
20
+ @membership_request.accepted!
21
+ notify_applicant
22
+
23
+ broadcast(:ok, @membership_request)
24
+ end
25
+
26
+ private
27
+
28
+ def notify_applicant
29
+ Decidim::EventsManager.publish(
30
+ event: "decidim.events.initiatives.approve_membership_request",
31
+ event_class: Decidim::Initiatives::ApproveMembershipRequestEvent,
32
+ resource: @membership_request.initiative,
33
+ affected_users: [@membership_request.user],
34
+ force_send: true,
35
+ extra: { author: @membership_request.initiative.author }
36
+ )
37
+ end
38
+ end
39
+ end
40
+ end
@@ -5,7 +5,7 @@ module Decidim
5
5
  # A command with all the business logic that creates a new initiative.
6
6
  class CreateInitiative < Rectify::Command
7
7
  include CurrentLocale
8
- include AttachmentMethods
8
+ include ::Decidim::MultipleAttachmentsMethods
9
9
 
10
10
  # Public: Initializes the command.
11
11
  #
@@ -26,8 +26,8 @@ module Decidim
26
26
  return broadcast(:invalid) if form.invalid?
27
27
 
28
28
  if process_attachments?
29
- build_attachment
30
- return broadcast(:invalid) if attachment_invalid?
29
+ build_attachments
30
+ return broadcast(:invalid) if attachments_invalid?
31
31
  end
32
32
 
33
33
  initiative = create_initiative
@@ -51,7 +51,8 @@ module Decidim
51
51
  initiative.transaction do
52
52
  initiative.save!
53
53
  @attached_to = initiative
54
- create_attachment if process_attachments?
54
+ create_attachments if process_attachments?
55
+
55
56
  create_components_for(initiative)
56
57
  send_notification(initiative)
57
58
  add_author_as_follower(initiative)
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Initiatives
5
+ # A command with all the business logic that creates a new initiative.
6
+ class RevokeMembershipRequest < Rectify::Command
7
+ # Public: Initializes the command.
8
+ #
9
+ # membership_request - A pending committee member
10
+ def initialize(membership_request)
11
+ @membership_request = membership_request
12
+ end
13
+
14
+ # Executes the command. Broadcasts these events:
15
+ #
16
+ # - :ok when everything is valid.
17
+ #
18
+ # Returns nothing.
19
+ def call
20
+ @membership_request.rejected!
21
+ notify_applicant
22
+
23
+ broadcast(:ok, @membership_request)
24
+ end
25
+
26
+ private
27
+
28
+ def notify_applicant
29
+ Decidim::EventsManager.publish(
30
+ event: "decidim.events.initiatives.revoke_membership_request",
31
+ event_class: Decidim::Initiatives::RevokeMembershipRequestEvent,
32
+ resource: @membership_request.initiative,
33
+ affected_users: [@membership_request.user],
34
+ force_send: true,
35
+ extra: { author: @membership_request.initiative.author }
36
+ )
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Initiatives
5
+ # A command with all the business logic that sends an
6
+ # existing initiative to technical validation.
7
+ class SendInitiativeToTechnicalValidation < Rectify::Command
8
+ # Public: Initializes the command.
9
+ #
10
+ # initiative - Decidim::Initiative
11
+ # current_user - the user performing the action
12
+ def initialize(initiative, current_user)
13
+ @initiative = initiative
14
+ @current_user = current_user
15
+ end
16
+
17
+ # Executes the command. Broadcasts these events:
18
+ #
19
+ # - :ok when everything is valid.
20
+ # - :invalid if the form wasn't valid and we couldn't proceed.
21
+ #
22
+ # Returns nothing.
23
+ def call
24
+ @initiative = Decidim.traceability.perform_action!(
25
+ :send_to_technical_validation,
26
+ initiative,
27
+ current_user
28
+ ) do
29
+ initiative.validating!
30
+ initiative
31
+ end
32
+
33
+ notify_admins
34
+
35
+ broadcast(:ok, initiative)
36
+ end
37
+
38
+ private
39
+
40
+ attr_reader :initiative, :current_user
41
+
42
+ def notify_admins
43
+ affected_users = Decidim::User.org_admins_except_me(current_user).all
44
+
45
+ data = {
46
+ event: "decidim.events.initiatives.initiative_sent_to_technical_validation",
47
+ event_class: Decidim::Initiatives::InitiativeSentToTechnicalValidationEvent,
48
+ resource: initiative,
49
+ affected_users: affected_users,
50
+ force_send: true
51
+ }
52
+
53
+ Decidim::EventsManager.publish(data)
54
+ end
55
+ end
56
+ end
57
+ end
@@ -26,6 +26,7 @@ module Decidim
26
26
  request = create_request
27
27
 
28
28
  if request.persisted?
29
+ notify_author
29
30
  broadcast(:ok, request)
30
31
  else
31
32
  broadcast(:invalid, request)
@@ -47,6 +48,23 @@ module Decidim
47
48
  request.save
48
49
  request
49
50
  end
51
+
52
+ def notify_author
53
+ return if initiative.author == current_user
54
+
55
+ Decidim::EventsManager.publish(
56
+ event: "decidim.events.initiatives.spawn_committee_request",
57
+ event_class: Decidim::Initiatives::SpawnCommitteeRequestEvent,
58
+ resource: initiative,
59
+ affected_users: [initiative.author],
60
+ force_send: true,
61
+ extra: { applicant: current_user }
62
+ )
63
+ end
64
+
65
+ def initiative
66
+ @initiative ||= Decidim::Initiative.find(form.initiative_id)
67
+ end
50
68
  end
51
69
  end
52
70
  end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Initiatives
5
+ # A command with all the business logic that updates an
6
+ # existing initiative.
7
+ class UpdateInitiative < Rectify::Command
8
+ include ::Decidim::MultipleAttachmentsMethods
9
+ include CurrentLocale
10
+
11
+ # Public: Initializes the command.
12
+ #
13
+ # initiative - Decidim::Initiative
14
+ # form - A form object with the params.
15
+ def initialize(initiative, form, current_user)
16
+ @form = form
17
+ @initiative = initiative
18
+ @current_user = current_user
19
+ @attached_to = initiative
20
+ end
21
+
22
+ # Executes the command. Broadcasts these events:
23
+ #
24
+ # - :ok when everything is valid.
25
+ # - :invalid if the form wasn't valid and we couldn't proceed.
26
+ #
27
+ # Returns nothing.
28
+ def call
29
+ return broadcast(:invalid) if form.invalid?
30
+
31
+ if process_attachments?
32
+ @initiative.attachments.where(id: form.documents).destroy_all
33
+
34
+ build_attachments
35
+ return broadcast(:invalid) if attachments_invalid?
36
+ end
37
+ @initiative = Decidim.traceability.update!(
38
+ initiative,
39
+ current_user,
40
+ attributes
41
+ )
42
+
43
+ create_attachments if process_attachments?
44
+ broadcast(:ok, initiative)
45
+ rescue ActiveRecord::RecordInvalid
46
+ broadcast(:invalid, initiative)
47
+ end
48
+
49
+ private
50
+
51
+ attr_reader :form, :initiative, :current_user
52
+
53
+ def attributes
54
+ attrs = {
55
+ title: { current_locale => form.title },
56
+ description: { current_locale => form.description },
57
+ hashtag: form.hashtag
58
+ }
59
+
60
+ if form.signature_type_updatable?
61
+ attrs[:signature_type] = form.signature_type
62
+ attrs[:scoped_type_id] = form.scoped_type_id if form.scoped_type_id
63
+ end
64
+
65
+ if initiative.created?
66
+ attrs[:signature_end_date] = form.signature_end_date if initiative.custom_signature_end_date_enabled?
67
+ attrs[:decidim_area_id] = form.area_id if initiative.area_enabled?
68
+ end
69
+
70
+ attrs
71
+ end
72
+ end
73
+ end
74
+ end