decidim-initiatives 0.19.1 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -0
  3. data/app/assets/config/admin_decidim_initiatives_manifest.js +2 -1
  4. data/app/assets/images/decidim/gamification/badges/initiatives.svg +1 -87
  5. data/app/assets/images/decidim/initiatives/icon.svg +1 -3
  6. data/app/assets/javascripts/decidim/initiatives/admin/initiatives_types.js.es6 +38 -0
  7. data/app/assets/stylesheet/decidim/initiatives/initiatives-votes.css.scss +0 -1
  8. data/app/assets/stylesheet/decidim/initiatives/initiatives.scss +6 -8
  9. data/app/assets/stylesheet/decidim/initiatives/popularity_item.css.scss +0 -1
  10. data/app/assets/stylesheet/decidim/initiatives/print-initiative.css.scss +0 -3
  11. data/app/cells/decidim/initiatives/content_blocks/highlighted_initiatives/show.erb +4 -3
  12. data/app/cells/decidim/initiatives/initiative_m/footer.erb +1 -1
  13. data/app/cells/decidim/initiatives/initiative_m_cell.rb +25 -0
  14. data/app/cells/decidim/initiatives_votes/vote/show.erb +12 -9
  15. data/app/cells/decidim/initiatives_votes/vote_cell.rb +7 -0
  16. data/app/commands/decidim/initiatives/admin/create_initiative_type.rb +8 -2
  17. data/app/commands/decidim/initiatives/admin/send_initiative_to_technical_validation.rb +17 -0
  18. data/app/commands/decidim/initiatives/admin/update_initiative.rb +29 -10
  19. data/app/commands/decidim/initiatives/admin/update_initiative_type.rb +10 -6
  20. data/app/commands/decidim/initiatives/attachment_methods.rb +37 -0
  21. data/app/commands/decidim/initiatives/create_initiative.rb +25 -3
  22. data/app/commands/decidim/initiatives/unvote_initiative.rb +4 -10
  23. data/app/commands/decidim/initiatives/vote_initiative.rb +47 -31
  24. data/app/controllers/concerns/decidim/initiatives/admin/filterable.rb +51 -0
  25. data/app/controllers/concerns/decidim/initiatives/orderable.rb +3 -1
  26. data/app/controllers/concerns/decidim/initiatives/single_initiative_type.rb +26 -0
  27. data/app/controllers/decidim/initiatives/admin/answers_controller.rb +2 -3
  28. data/app/controllers/decidim/initiatives/admin/initiatives_controller.rb +28 -15
  29. data/app/controllers/decidim/initiatives/create_initiative_controller.rb +43 -9
  30. data/app/controllers/decidim/initiatives/initiative_signatures_controller.rb +19 -23
  31. data/app/controllers/decidim/initiatives/initiative_votes_controller.rb +11 -5
  32. data/app/controllers/decidim/initiatives/initiatives_controller.rb +28 -13
  33. data/app/controllers/decidim/initiatives/initiatives_type_scopes_controller.rb +9 -1
  34. data/app/controllers/decidim/initiatives/versions_controller.rb +20 -0
  35. data/app/controllers/decidim/initiatives/{initiative_widgets_controller.rb → widgets_controller.rb} +2 -2
  36. data/app/events/decidim/initiatives/admin/initiative_sent_to_technical_validation_event.rb +21 -0
  37. data/app/events/decidim/initiatives/admin/support_threshold_reached_event.rb +13 -0
  38. data/app/forms/decidim/initiatives/admin/initiative_form.rb +50 -8
  39. data/app/forms/decidim/initiatives/admin/initiative_type_form.rb +28 -6
  40. data/app/forms/decidim/initiatives/admin/initiative_type_scope_form.rb +0 -1
  41. data/app/forms/decidim/initiatives/initiative_form.rb +69 -2
  42. data/app/forms/decidim/initiatives/vote_form.rb +133 -76
  43. data/app/helpers/decidim/initiatives/application_helper.rb +104 -0
  44. data/app/helpers/decidim/initiatives/create_initiative_helper.rb +10 -11
  45. data/app/helpers/decidim/initiatives/initiative_helper.rb +13 -0
  46. data/app/helpers/decidim/initiatives/initiatives_helper.rb +10 -0
  47. data/app/jobs/decidim/initiatives/export_initiatives_job.rb +25 -0
  48. data/app/mailers/decidim/initiatives/initiatives_mailer.rb +0 -21
  49. data/app/models/concerns/decidim/initiatives/has_area.rb +30 -0
  50. data/app/models/decidim/initiative.rb +200 -51
  51. data/app/models/decidim/initiatives_type.rb +14 -14
  52. data/app/models/decidim/initiatives_type_scope.rb +9 -2
  53. data/app/models/decidim/initiatives_vote.rb +19 -23
  54. data/app/permissions/decidim/initiatives/admin/permissions.rb +21 -10
  55. data/app/permissions/decidim/initiatives/permissions.rb +38 -14
  56. data/app/presenters/decidim/initiatives/initiative_stats_presenter.rb +1 -5
  57. data/app/queries/decidim/initiatives/admin/manageable_initiatives.rb +7 -39
  58. data/app/serializers/decidim/initiatives/initiative_serializer.rb +32 -0
  59. data/app/services/decidim/initiatives/diff_renderer.rb +18 -0
  60. data/app/services/decidim/initiatives/initiative_search.rb +59 -15
  61. data/app/services/decidim/initiatives/status_change_notifier.rb +4 -5
  62. data/app/types/decidim/initiatives/initiative_api_type.rb +26 -0
  63. data/app/types/decidim/initiatives/initiative_committee_member_type.rb +18 -0
  64. data/app/types/decidim/initiatives/initiative_type.rb +42 -0
  65. data/app/views/decidim/initiatives/admin/answers/_info_initiative.html.erb +1 -1
  66. data/app/views/decidim/initiatives/admin/exports/_dropdown.html.erb +8 -0
  67. data/app/views/decidim/initiatives/admin/initiatives/_form.html.erb +60 -15
  68. data/app/views/decidim/initiatives/admin/initiatives/_initiative_attachments.erb +43 -0
  69. data/app/views/decidim/initiatives/admin/initiatives/export_pdf_signatures.pdf.erb +12 -9
  70. data/app/views/decidim/initiatives/admin/initiatives/index.html.erb +10 -45
  71. data/app/views/decidim/initiatives/admin/initiatives_types/_form.html.erb +55 -12
  72. data/app/views/decidim/initiatives/admin/initiatives_types/_initiative_type_scopes.html.erb +28 -25
  73. data/app/views/decidim/initiatives/create_initiative/fill_data.html.erb +61 -16
  74. data/app/views/decidim/initiatives/create_initiative/finish.html.erb +17 -10
  75. data/app/views/decidim/initiatives/create_initiative/previous_form.html.erb +2 -1
  76. data/app/views/decidim/initiatives/create_initiative/promotal_committee.html.erb +1 -1
  77. data/app/views/decidim/initiatives/create_initiative/select_initiative_type.html.erb +1 -2
  78. data/app/views/decidim/initiatives/create_initiative/show_similar_initiatives.html.erb +1 -1
  79. data/app/views/decidim/initiatives/initiative_signatures/fill_personal_data.html.erb +1 -1
  80. data/app/views/decidim/initiatives/initiative_signatures/update_buttons_and_counters.js.erb +1 -1
  81. data/app/views/decidim/initiatives/initiative_votes/update_buttons_and_counters.js.erb +1 -1
  82. data/app/views/decidim/initiatives/initiatives/_author.html.erb +1 -1
  83. data/app/views/decidim/initiatives/initiatives/_filters.html.erb +16 -28
  84. data/app/views/decidim/initiatives/initiatives/_index_header.html.erb +39 -5
  85. data/app/views/decidim/initiatives/initiatives/_initiatives.html.erb +11 -1
  86. data/app/views/decidim/initiatives/initiatives/_interactions.html.erb +2 -3
  87. data/app/views/decidim/initiatives/initiatives/_progress_bar.html.erb +24 -9
  88. data/app/views/decidim/initiatives/initiatives/_tags.html.erb +4 -1
  89. data/app/views/decidim/initiatives/initiatives/_vote_cabin.html.erb +1 -13
  90. data/app/views/decidim/initiatives/initiatives/index.html.erb +1 -1
  91. data/app/views/decidim/initiatives/initiatives/show.html.erb +5 -6
  92. data/app/views/decidim/initiatives/initiatives_type_scopes/search.html.erb +1 -1
  93. data/app/views/decidim/initiatives/versions/index.html.erb +8 -0
  94. data/app/views/decidim/initiatives/versions/show.html.erb +10 -0
  95. data/app/views/layouts/decidim/_initiative_creation_header.html.erb +3 -1
  96. data/app/views/layouts/decidim/_initiative_header.html.erb +2 -1
  97. data/app/views/layouts/decidim/_initiative_signature_creation_header.html.erb +1 -1
  98. data/app/views/layouts/decidim/admin/initiative.html.erb +1 -1
  99. data/app/views/layouts/decidim/initiative.html.erb +1 -0
  100. data/app/views/layouts/decidim/initiative_creation.html.erb +1 -2
  101. data/app/views/layouts/decidim/initiative_signature_creation.html.erb +2 -2
  102. data/config/locales/am-ET.yml +1 -0
  103. data/config/locales/ar.yml +17 -21
  104. data/config/locales/bg-BG.yml +13 -0
  105. data/config/locales/bg.yml +13 -0
  106. data/config/locales/ca.yml +101 -22
  107. data/config/locales/cs.yml +111 -32
  108. data/config/locales/da-DK.yml +1 -0
  109. data/config/locales/da.yml +1 -0
  110. data/config/locales/de.yml +75 -21
  111. data/config/locales/el-GR.yml +1 -0
  112. data/config/locales/el.yml +525 -0
  113. data/config/locales/en.yml +103 -24
  114. data/config/locales/eo.yml +1 -0
  115. data/config/locales/es-MX.yml +100 -21
  116. data/config/locales/es-PY.yml +100 -21
  117. data/config/locales/es.yml +104 -25
  118. data/config/locales/et-EE.yml +1 -0
  119. data/config/locales/et.yml +1 -0
  120. data/config/locales/eu.yml +4 -21
  121. data/config/locales/fi-plain.yml +100 -21
  122. data/config/locales/fi.yml +118 -39
  123. data/config/locales/fr-CA.yml +557 -0
  124. data/config/locales/fr.yml +102 -23
  125. data/config/locales/ga-IE.yml +1 -0
  126. data/config/locales/gl.yml +4 -21
  127. data/config/locales/hr-HR.yml +1 -0
  128. data/config/locales/hr.yml +1 -0
  129. data/config/locales/hu.yml +31 -24
  130. data/config/locales/id-ID.yml +4 -21
  131. data/config/locales/is-IS.yml +251 -0
  132. data/config/locales/is.yml +251 -0
  133. data/config/locales/it.yml +117 -61
  134. data/config/locales/ja-JP.yml +529 -0
  135. data/config/locales/ja.yml +549 -0
  136. data/config/locales/ko-KR.yml +1 -0
  137. data/config/locales/ko.yml +1 -0
  138. data/config/locales/lt-LT.yml +1 -0
  139. data/config/locales/lt.yml +1 -0
  140. data/config/locales/lv.yml +525 -0
  141. data/config/locales/mt-MT.yml +1 -0
  142. data/config/locales/mt.yml +1 -0
  143. data/config/locales/nl.yml +77 -21
  144. data/config/locales/no.yml +368 -9
  145. data/config/locales/om-ET.yml +1 -0
  146. data/config/locales/pl.yml +260 -189
  147. data/config/locales/pt-BR.yml +5 -22
  148. data/config/locales/pt.yml +231 -179
  149. data/config/locales/ro-RO.yml +533 -0
  150. data/config/locales/ru.yml +4 -21
  151. data/config/locales/sk-SK.yml +468 -0
  152. data/config/locales/sk.yml +458 -0
  153. data/config/locales/sl.yml +24 -0
  154. data/config/locales/so-SO.yml +1 -0
  155. data/config/locales/sr-CS.yml +8 -0
  156. data/config/locales/sv.yml +102 -31
  157. data/config/locales/ti-ER.yml +1 -0
  158. data/config/locales/tr-TR.yml +4 -21
  159. data/config/locales/uk.yml +4 -21
  160. data/config/locales/vi-VN.yml +1 -0
  161. data/config/locales/vi.yml +1 -0
  162. data/config/locales/zh-CN.yml +549 -0
  163. data/config/locales/zh-TW.yml +1 -0
  164. data/db/migrate/20190925145648_add_promoting_committee_option.rb +7 -0
  165. data/db/migrate/20191002082220_move_signature_type_to_initative_type.rb +38 -0
  166. data/db/migrate/20191106144259_add_settings_to_initiatives_types.rb +8 -0
  167. data/db/migrate/20191107134847_add_scopes_to_initiatives_votes.rb +28 -0
  168. data/db/migrate/20191116170841_allow_multiple_initiative_votes_counter_caches.rb +32 -0
  169. data/db/migrate/20191118105634_allow_multiple_offline_votes.rb +34 -0
  170. data/db/migrate/20200320105920_index_foreign_keys_in_decidim_initiatives.rb +8 -0
  171. data/db/migrate/20200320105921_index_foreign_keys_in_decidim_initiatives_votes.rb +8 -0
  172. data/db/migrate/20200417120551_add_custom_signature_end_time_option.rb +7 -0
  173. data/db/migrate/20200424110930_add_attachments_enabled_option.rb +7 -0
  174. data/db/migrate/20200514085422_add_area_to_initiatives.rb +7 -0
  175. data/db/migrate/20200514102631_add_area_enabled_option_to_initiatives.rb +7 -0
  176. data/db/migrate/20200528151456_remove_user_groups_from_initiative_votes.rb +7 -0
  177. data/db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb +9 -0
  178. data/db/seeds/city.jpeg +0 -0
  179. data/db/seeds/city2.jpeg +0 -0
  180. data/lib/decidim/api/initiative_type_interface.rb +13 -0
  181. data/lib/decidim/initiatives.rb +0 -14
  182. data/lib/decidim/initiatives/admin_engine.rb +6 -1
  183. data/lib/decidim/initiatives/api.rb +7 -0
  184. data/lib/decidim/initiatives/engine.rb +11 -2
  185. data/lib/decidim/initiatives/participatory_space.rb +20 -1
  186. data/lib/decidim/initiatives/query_extensions.rb +40 -0
  187. data/lib/decidim/initiatives/test/factories.rb +69 -8
  188. data/lib/decidim/initiatives/version.rb +1 -1
  189. data/lib/tasks/decidim_initiatives.rake +1 -3
  190. metadata +96 -20
  191. data/app/views/decidim/initiatives/initiative_widgets/show.html.erb +0 -4
  192. data/app/views/decidim/initiatives/initiatives/_supports.html.erb +0 -22
  193. data/app/views/decidim/initiatives/initiatives/signature_identities.html.erb +0 -42
  194. data/app/views/decidim/initiatives/initiatives_mailer/notify_validating_request.html.erb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 699b286622c83239c3a945ab5e59955165cf31a2cd3c231f8492a24e98800cb9
4
- data.tar.gz: 0cb9e66e1d9cf193cd424ceaba1433ab7219883da8a54ad13ec3eadd46754be5
3
+ metadata.gz: d8db51bc1501da471466745ec235929fd21b662ddce6dbb88eef462b1e476c02
4
+ data.tar.gz: 0aadaf993de40321e50400b7dbf76ccd06f71ec24255a2e98190e52688ce6f2a
5
5
  SHA512:
6
- metadata.gz: 7cc40651ab8f1f0a4e30ed6505321ef117ce4497faf0fa33201df40cd8e558b9ea48928650222a8db4f43dbef3366599bdb563ee70f7d395835dede82c10375f
7
- data.tar.gz: 0c4f048037a4799f6e27336b64ccf3ac0b356366a2389fbf9f322b47f5c6715f7d37624c09d208546e7112d9702e013ad435d1fd3b66e92b8f3c2c2e9f6ab843
6
+ metadata.gz: 22090c6da32e3b58852a92c485cd25a309b188e45047a8e30c1a6d9d6d43e5c971fa427804e759673ef0db26e48dfbc262f5b6da3a58893046d15f95a8d87b02
7
+ data.tar.gz: d9a8c3349b8be9f88cebda3a177249823c16cac21390b4e1e8f9db9c1dd8ebbba7ca472526b5853b78656bdc0cd5985f67897e1a4c32bd246e36606f2fa18f7f
data/README.md CHANGED
@@ -42,6 +42,28 @@ The database requires the extension pg_trgm enabled. Contact your DBA to enable
42
42
  CREATE EXTENSION pg_trgm;
43
43
  ```
44
44
 
45
+ ## Deactivating authorization requirement and other module settings
46
+
47
+ Some of the settings of the module need to be set in the code of your app, for example in the file `config/initializers/decidim.rb`.
48
+
49
+ This is the case if you want to enable the creation of initiatives even when no authorization method is set.
50
+
51
+ Just use the following line:
52
+ ```
53
+ Decidim::Initiatives.do_not_require_authorization = true
54
+ ```
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).
57
+
58
+ For example, you can also change the minimum number of required committee members to 1 (default is 2) by adding this line:
59
+ ```
60
+ Decidim::Initiatives.minimum_committee_members = 1
61
+ ```
62
+ Or change the number of days given to gather signatures to 365 (default is 120) with:
63
+ ```
64
+ Decidim::Initiatives.default_signature_time_period_length = 365
65
+ ```
66
+
45
67
  ## Rake tasks
46
68
 
47
69
  This engine comes with three rake tasks that should be executed on daily basis. The best
@@ -1,3 +1,4 @@
1
1
  //= link decidim/initiatives/admin/invite_users.js
2
+ //= link decidim/initiatives/admin/initiatives_types.js
2
3
  //= link decidim/initiatives/scoped_type.js
3
- //= link decidim/initiatives/print-initiative.css
4
+ //= link decidim/initiatives/print-initiative.css
@@ -1,87 +1 @@
1
- <svg version="1.1" id="initiatives-svg"
2
- xmlns="http://www.w3.org/2000/svg"
3
- xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
4
- y="0px" width="1080px" height="1080px" viewBox="0 0 1080 1080" enable-background="new 0 0 1080 1080" xml:space="preserve">
5
- <g id="initiatives" class="stroke-primary">
6
- <polygon class="fill-primary" id="contact" fill="#31536E" points="500.5,967.5 580.5,967.5 610.5,911.5 470.5,911.5 "/>
7
- <g id="cap">
8
- <path class="fill-primary" id="_x35_0-pct_4_" fill="#31536E" fill-opacity="0.5" stroke="#31536E" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
9
- M687.5,682.054c0,14.054-11.393,25.446-25.446,25.446H418.946c-14.054,0-25.446-11.393-25.446-25.446v-0.106
10
- c0-14.055,11.393-25.447,25.446-25.447h243.106c14.055,0,25.447,11.393,25.447,25.446V682.054z"/>
11
- <path class="fill-primary" id="_x32_5-pct_6_" fill="#31536E" fill-opacity="0.25" stroke="#31536E" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
12
- M687.5,733.054c0,14.054-11.393,25.446-25.446,25.446H418.946c-14.054,0-25.446-11.393-25.446-25.446v-0.106
13
- c0-14.055,11.393-25.447,25.446-25.447h243.106c14.055,0,25.447,11.393,25.447,25.446V733.054z"/>
14
- <path class="fill-primary" id="_x35_0-pct_5_" fill="#31536E" fill-opacity="0.5" stroke="#31536E" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
15
- M687.5,784.054c0,14.054-11.393,25.446-25.446,25.446H418.946c-14.054,0-25.446-11.393-25.446-25.446v-0.106
16
- c0-14.055,11.393-25.447,25.446-25.447h243.106c14.055,0,25.447,11.393,25.447,25.446V784.054z"/>
17
- <path class="fill-primary" id="_x32_5-pct_5_" fill="#31536E" fill-opacity="0.25" stroke="#31536E" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
18
- M687.5,835.054c0,14.054-11.393,25.446-25.446,25.446H418.946c-14.054,0-25.446-11.393-25.446-25.446v-0.106
19
- c0-14.055,11.393-25.447,25.446-25.447h243.106c14.055,0,25.447,11.393,25.447,25.446V835.054z"/>
20
- <path class="fill-primary" id="_x35_0-pct_6_" fill="#31536E" fill-opacity="0.5" stroke="#31536E" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
21
- M687.5,886.054c0,14.054-11.393,25.446-25.446,25.446H418.946c-14.054,0-25.446-11.393-25.446-25.446v-0.106
22
- c0-14.055,11.393-25.447,25.446-25.447h243.106c14.055,0,25.447,11.393,25.447,25.446V886.054z"/>
23
- </g>
24
- <path id="glass" fill="none" stroke="#31536E" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
25
- M789.571,371.337c0-137.578-111.529-249.079-249.107-249.079S291.357,233.801,291.357,371.379
26
- c0,80.795,38.475,152.121,98.09,198.121h-0.022c27.35,24,47.839,54.127,58.972,87.004l183.387-0.06
27
- c10.664-31.493,29.915-59.944,55.556-83.944h-0.022C749.299,527.5,789.571,453.998,789.571,371.337z"/>
28
- <g id="filament">
29
- <path class="fill-primary" id="_x35_0-pct_7_" fill="#31536E" fill-opacity="0.5" stroke="#31536E" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
30
- M491.354,656.5c0,0,28.136-43.203,34.573-59.054c5.723-14.089,14.573-59.054,14.573-59.054s8.851,44.966,14.573,59.055
31
- c6.438,15.85,34.573,59.053,34.573,59.053H540.5H491.354z"/>
32
- <path class="fill-primary" id="_x32_5-pct_7_" fill="#31536E" fill-opacity="0.25" stroke="#31536E" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
33
- M496.393,407.685c28.994,28.995,44.37,131.34,44.37,131.34s-102.346-15.375-131.34-44.37
34
- c-28.995-28.995-33.032-71.969-9.016-95.985C424.423,374.653,467.396,378.69,496.393,407.685z"/>
35
- <path class="fill-primary" id="_x32_5-pct_8_" fill="#31536E" fill-opacity="0.25" stroke="#31536E" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
36
- M671.747,494.655c-28.994,28.995-131.34,44.371-131.34,44.371s15.375-102.346,44.37-131.34
37
- c28.994-28.996,71.97-33.032,95.984-9.016C704.779,422.686,700.742,465.66,671.747,494.655z"/>
38
- <line fill="none" stroke="#31536E" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="462.749" y1="461.011" x2="540.5" y2="538.393"/>
39
- <line fill="none" stroke="#31536E" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="540.5" y1="538.393" x2="618.421" y2="461.011"/>
40
- </g>
41
- <g id="stars_4" class="stars">
42
- <path fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
43
- M130.5,374.396c0-14.688-18.667-35.355-35.355-35.355c15.355,0,35.355-20.333,35.355-35.355c0,15.022,16.666,35.355,35.355,35.355
44
- C146.833,339.041,130.5,359.708,130.5,374.396z"/>
45
- <g>
46
- <circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="919.852" cy="859.217" r="13.5"/>
47
- <line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="903.353" y1="842.481" x2="882.14" y2="821.269"/>
48
- <line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="937.294" y1="876.423" x2="958.507" y2="897.636"/>
49
- <line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="936.587" y1="843.188" x2="957.8" y2="821.976"/>
50
- <line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="903.353" y1="876.423" x2="882.14" y2="897.636"/>
51
- </g>
52
- <g>
53
- <line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="885.448" y1="566.135" x2="859.286" y2="592.299"/>
54
- <line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="850.094" y1="601.49" x2="823.931" y2="627.654"/>
55
- <line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="884.741" y1="627.654" x2="858.578" y2="601.49"/>
56
- <line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="849.387" y1="592.299" x2="823.224" y2="566.135"/>
57
- </g>
58
- <path fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
59
- M945.602,73.542c0,0-21.564,4.034-26.516,8.981c-4.948,4.948-8.982,26.516-8.982,26.516s-4.035-21.565-8.982-26.516
60
- c-4.948-4.947-26.516-8.981-26.516-8.981s22.077-4.547,26.516-8.983c4.438-4.438,8.982-26.515,8.982-26.515
61
- s4.034,21.564,8.982,26.515C924.035,69.506,945.602,73.542,945.602,73.542z"/>
62
- <g>
63
- <circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="962.656" cy="362.498" r="16.604"/>
64
- <circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="926.755" cy="362.498" r="6.432"/>
65
- <circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="962.656" cy="398.399" r="6.432"/>
66
- <circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="998.558" cy="362.498" r="6.432"/>
67
- <circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="962.656" cy="326.597" r="6.432"/>
68
- </g>
69
- <g>
70
- <line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="108.246" y1="727.014" x2="163.149" y2="781.919"/>
71
- <line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="163.149" y1="727.014" x2="108.246" y2="781.919"/>
72
- <line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="117.5" y1="754.041" x2="90.5" y2="754.041"/>
73
- <line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="155.5" y1="754.041" x2="182.5" y2="754.041"/>
74
- <line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="136.5" y1="773.041" x2="136.5" y2="800.041"/>
75
- <line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="136.5" y1="735.041" x2="136.5" y2="708.041"/>
76
- </g>
77
- <g>
78
- <line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="320" y1="54.041" x2="320" y2="133.041"/>
79
- <line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="359" y1="94.041" x2="280" y2="94.041"/>
80
- <circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="300" cy="113.541" r="7.039"/>
81
- <circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="300" cy="73.541" r="7.039"/>
82
- <circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="340" cy="113.541" r="7.039"/>
83
- <circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="340" cy="73.541" r="7.039"/>
84
- </g>
85
- </g>
86
- </g>
87
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="initiatives-svg" width="1080" height="1080" x="0" y="0" enable-background="new 0 0 1080 1080" version="1.1" viewBox="0 0 1080 1080" xml:space="preserve"><g id="initiatives" class="stroke-primary"><polygon id="contact" fill="#31536E" points="500.5 967.5 580.5 967.5 610.5 911.5 470.5 911.5" class="fill-primary"/><g id="cap"><path id="_x35_0-pct_4_" fill="#31536E" fill-opacity=".5" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" d="M687.5,682.054c0,14.054-11.393,25.446-25.446,25.446H418.946c-14.054,0-25.446-11.393-25.446-25.446v-0.106 c0-14.055,11.393-25.447,25.446-25.447h243.106c14.055,0,25.447,11.393,25.447,25.446V682.054z" class="fill-primary"/><path id="_x32_5-pct_6_" fill="#31536E" fill-opacity=".25" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" d="M687.5,733.054c0,14.054-11.393,25.446-25.446,25.446H418.946c-14.054,0-25.446-11.393-25.446-25.446v-0.106 c0-14.055,11.393-25.447,25.446-25.447h243.106c14.055,0,25.447,11.393,25.447,25.446V733.054z" class="fill-primary"/><path id="_x35_0-pct_5_" fill="#31536E" fill-opacity=".5" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" d="M687.5,784.054c0,14.054-11.393,25.446-25.446,25.446H418.946c-14.054,0-25.446-11.393-25.446-25.446v-0.106 c0-14.055,11.393-25.447,25.446-25.447h243.106c14.055,0,25.447,11.393,25.447,25.446V784.054z" class="fill-primary"/><path id="_x32_5-pct_5_" fill="#31536E" fill-opacity=".25" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" d="M687.5,835.054c0,14.054-11.393,25.446-25.446,25.446H418.946c-14.054,0-25.446-11.393-25.446-25.446v-0.106 c0-14.055,11.393-25.447,25.446-25.447h243.106c14.055,0,25.447,11.393,25.447,25.446V835.054z" class="fill-primary"/><path id="_x35_0-pct_6_" fill="#31536E" fill-opacity=".5" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" d="M687.5,886.054c0,14.054-11.393,25.446-25.446,25.446H418.946c-14.054,0-25.446-11.393-25.446-25.446v-0.106 c0-14.055,11.393-25.447,25.446-25.447h243.106c14.055,0,25.447,11.393,25.447,25.446V886.054z" class="fill-primary"/></g><path id="glass" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" d="M789.571,371.337c0-137.578-111.529-249.079-249.107-249.079S291.357,233.801,291.357,371.379 c0,80.795,38.475,152.121,98.09,198.121h-0.022c27.35,24,47.839,54.127,58.972,87.004l183.387-0.06 c10.664-31.493,29.915-59.944,55.556-83.944h-0.022C749.299,527.5,789.571,453.998,789.571,371.337z"/><g id="filament"><path id="_x35_0-pct_7_" fill="#31536E" fill-opacity=".5" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" d="M491.354,656.5c0,0,28.136-43.203,34.573-59.054c5.723-14.089,14.573-59.054,14.573-59.054s8.851,44.966,14.573,59.055 c6.438,15.85,34.573,59.053,34.573,59.053H540.5H491.354z" class="fill-primary"/><path id="_x32_5-pct_7_" fill="#31536E" fill-opacity=".25" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" d="M496.393,407.685c28.994,28.995,44.37,131.34,44.37,131.34s-102.346-15.375-131.34-44.37 c-28.995-28.995-33.032-71.969-9.016-95.985C424.423,374.653,467.396,378.69,496.393,407.685z" class="fill-primary"/><path id="_x32_5-pct_8_" fill="#31536E" fill-opacity=".25" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="16" d="M671.747,494.655c-28.994,28.995-131.34,44.371-131.34,44.371s15.375-102.346,44.37-131.34 c28.994-28.996,71.97-33.032,95.984-9.016C704.779,422.686,700.742,465.66,671.747,494.655z" class="fill-primary"/><line x1="462.749" x2="540.5" y1="461.011" y2="538.393" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="8"/><line x1="540.5" x2="618.421" y1="538.393" y2="461.011" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="8"/></g><g id="stars_4" class="stars"><path fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4" d="M130.5,374.396c0-14.688-18.667-35.355-35.355-35.355c15.355,0,35.355-20.333,35.355-35.355c0,15.022,16.666,35.355,35.355,35.355 C146.833,339.041,130.5,359.708,130.5,374.396z"/><g><circle cx="919.852" cy="859.217" r="13.5" fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="903.353" x2="882.14" y1="842.481" y2="821.269" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="937.294" x2="958.507" y1="876.423" y2="897.636" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="936.587" x2="957.8" y1="843.188" y2="821.976" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="903.353" x2="882.14" y1="876.423" y2="897.636" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/></g><g><line x1="885.448" x2="859.286" y1="566.135" y2="592.299" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="850.094" x2="823.931" y1="601.49" y2="627.654" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="884.741" x2="858.578" y1="627.654" y2="601.49" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="849.387" x2="823.224" y1="592.299" y2="566.135" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/></g><path fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4" d="M945.602,73.542c0,0-21.564,4.034-26.516,8.981c-4.948,4.948-8.982,26.516-8.982,26.516s-4.035-21.565-8.982-26.516 c-4.948-4.947-26.516-8.981-26.516-8.981s22.077-4.547,26.516-8.983c4.438-4.438,8.982-26.515,8.982-26.515 s4.034,21.564,8.982,26.515C924.035,69.506,945.602,73.542,945.602,73.542z"/><g><circle cx="962.656" cy="362.498" r="16.604" fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><circle cx="926.755" cy="362.498" r="6.432" fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><circle cx="962.656" cy="398.399" r="6.432" fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><circle cx="998.558" cy="362.498" r="6.432" fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><circle cx="962.656" cy="326.597" r="6.432" fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/></g><g><line x1="108.246" x2="163.149" y1="727.014" y2="781.919" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="163.149" x2="108.246" y1="727.014" y2="781.919" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="117.5" x2="90.5" y1="754.041" y2="754.041" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="155.5" x2="182.5" y1="754.041" y2="754.041" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="136.5" x2="136.5" y1="773.041" y2="800.041" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="136.5" x2="136.5" y1="735.041" y2="708.041" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/></g><g><line x1="320" x2="320" y1="54.041" y2="133.041" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><line x1="359" x2="280" y1="94.041" y2="94.041" fill="none" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><circle cx="300" cy="113.541" r="7.039" fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><circle cx="300" cy="73.541" r="7.039" fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><circle cx="340" cy="113.541" r="7.039" fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/><circle cx="340" cy="73.541" r="7.039" fill="#FFD92B" stroke="#31536E" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4"/></g></g></g></svg>
@@ -1,3 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34">
2
- <path d="M17 1.889C8.654 1.889 1.889 8.654 1.889 17S8.654 32.111 17 32.111 32.111 25.346 32.111 17 25.346 1.889 17 1.889zM17 0c9.389 0 17 7.611 17 17s-7.611 17-17 17S0 26.389 0 17 7.611 0 17 0zm4.722 18.082v-2.97a.944.944 0 1 0-1.889 0v2.97a.944.944 0 1 0 1.89 0zm-2.833 0v-2.97a.944.944 0 0 0-1.889 0v2.97a.944.944 0 1 0 1.889 0zm-3.778.488V8.5a.944.944 0 0 0-1.889 0v10.07a.944.944 0 0 0 1.89 0zM8.5 16.92c.814 0 1.593.78 1.593 1.594v.2c0 4.131 3.302 7.432 7.373 7.356 4.114 0 7.415-3.301 7.339-7.373V15.11a.944.944 0 0 0-1.889 0v3.603c.056 3.025-2.385 5.468-5.467 5.468-3.025.056-5.467-2.386-5.467-5.468v-.2c0-1.857-1.625-3.482-3.482-3.482a.944.944 0 0 0 0 1.889z"/>
3
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34"><path d="M17 1.889C8.654 1.889 1.889 8.654 1.889 17S8.654 32.111 17 32.111 32.111 25.346 32.111 17 25.346 1.889 17 1.889zM17 0c9.389 0 17 7.611 17 17s-7.611 17-17 17S0 26.389 0 17 7.611 0 17 0zm4.722 18.082v-2.97a.944.944 0 1 0-1.889 0v2.97a.944.944 0 1 0 1.89 0zm-2.833 0v-2.97a.944.944 0 0 0-1.889 0v2.97a.944.944 0 1 0 1.889 0zm-3.778.488V8.5a.944.944 0 0 0-1.889 0v10.07a.944.944 0 0 0 1.89 0zM8.5 16.92c.814 0 1.593.78 1.593 1.594v.2c0 4.131 3.302 7.432 7.373 7.356 4.114 0 7.415-3.301 7.339-7.373V15.11a.944.944 0 0 0-1.889 0v3.603c.056 3.025-2.385 5.468-5.467 5.468-3.025.056-5.467-2.386-5.467-5.468v-.2c0-1.857-1.625-3.482-3.482-3.482a.944.944 0 0 0 0 1.889z"/></svg>
@@ -0,0 +1,38 @@
1
+ (() => {
2
+ const $scope = $("#promoting-committee-details");
3
+
4
+ const $promotingCommitteeCheckbox = $(
5
+ "#initiatives_type_promoting_committee_enabled",
6
+ $scope
7
+ );
8
+
9
+ const $signatureType = $("#initiatives_type_signature_type");
10
+
11
+ const $collectUserDataCheckbox = $("#initiatives_type_collect_user_extra_fields");
12
+
13
+ const toggleVisibility = () => {
14
+ if ($promotingCommitteeCheckbox.is(":checked")) {
15
+ $(".minimum-committee-members-details", $scope).show();
16
+ } else {
17
+ $(".minimum-committee-members-details", $scope).hide();
18
+ }
19
+
20
+ if ($signatureType.val() === "offline") {
21
+ $("#initiatives_type_undo_online_signatures_enabled").parent().parent().hide();
22
+ } else {
23
+ $("#initiatives_type_undo_online_signatures_enabled").parent().parent().show();
24
+ }
25
+
26
+ if ($collectUserDataCheckbox.is(":checked")) {
27
+ $("#initiatives_type-extra_fields_legal_information-tabs").parent().parent().show()
28
+ } else {
29
+ $("#initiatives_type-extra_fields_legal_information-tabs").parent().parent().hide()
30
+ }
31
+ };
32
+
33
+ $($promotingCommitteeCheckbox).click(() => toggleVisibility());
34
+ $($signatureType).change(() => toggleVisibility());
35
+ $($collectUserDataCheckbox).click(() => toggleVisibility());
36
+
37
+ toggleVisibility();
38
+ })();
@@ -4,7 +4,6 @@
4
4
  margin: 15pt 0;
5
5
  font-size: 12pt;
6
6
  font-weight: bold;
7
- text-transform: uppercase;
8
7
  text-align: center;
9
8
  }
10
9
 
@@ -44,14 +44,6 @@
44
44
  }
45
45
  }
46
46
 
47
- .pull-left{
48
- float: left;
49
- }
50
-
51
- .pull-right{
52
- float: right;
53
- }
54
-
55
47
  .lowercase{
56
48
  text-transform: lowercase !important;
57
49
  }
@@ -59,3 +51,9 @@
59
51
  .legal_text{
60
52
  font-size: 8pt;
61
53
  }
54
+
55
+ .progress__bar--horizontal{
56
+ &:last-of-type{
57
+ margin-bottom: 1.5rem;
58
+ }
59
+ }
@@ -20,7 +20,6 @@
20
20
 
21
21
  .popularity__desc{
22
22
  color: #8c838a;
23
- text-transform: uppercase;
24
23
  font-size: 90%;
25
24
  padding-top: .3rem;
26
25
  display: block;
@@ -13,7 +13,6 @@
13
13
  margin: 15pt 0;
14
14
  font-size: 12pt;
15
15
  font-weight: bold;
16
- text-transform: uppercase;
17
16
  text-align: center;
18
17
  }
19
18
 
@@ -26,7 +25,6 @@
26
25
  background-color: lightgray;
27
26
  display: inline-block;
28
27
  width: 100%;
29
- text-transform: uppercase;
30
28
  padding-left: 5pt;
31
29
  font-size: 12pt;
32
30
  font-weight: bold;
@@ -92,7 +90,6 @@
92
90
  font-size: 12pt;
93
91
  font-weight: bold;
94
92
  margin-top: 15pt;
95
- text-transform: uppercase;
96
93
  }
97
94
 
98
95
  .print-initiative-legal-text{
@@ -5,15 +5,16 @@
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
- <article class="card card--initiative card--mini">
8
+ <div class="card card--initiative card--mini">
9
9
  <%= link_to decidim_initiatives.initiative_path(initiative), class: "card__link" do %>
10
+ <span class="show-for-sr"><%= translated_attribute initiative.title %></span>
10
11
  <% end %>
11
12
  <div class="card__content">
12
13
  <%= link_to decidim_initiatives.initiative_path(initiative), class: "card__link" do %>
13
- <h4 class="card__title"><%= decidim_html_escape(translated_attribute(initiative.title)) %></h4>
14
+ <span class="card__title"><%= decidim_html_escape(translated_attribute(initiative.title)) %></span>
14
15
  <% end %>
15
16
  </div>
16
- </article>
17
+ </div>
17
18
  </div>
18
19
  <% end %>
19
20
  </div>
@@ -15,7 +15,7 @@
15
15
  <div class="card__support__data"></div>
16
16
  <% end %>
17
17
 
18
- <% if model.closed? || model.offline? %>
18
+ <% if model.closed? || model.offline_signature_type? %>
19
19
  <%= link_to t("initiatives.initiative.check", scope: "layouts.decidim"),
20
20
  resource_path,
21
21
  class: "card__button button button--sc small light secondary" %>
@@ -23,6 +23,17 @@ module Decidim
23
23
  true
24
24
  end
25
25
 
26
+ # Explicitely commenting the used I18n keys so their are not flagged as unused
27
+ # i18n-tasks-use t('decidim.initiatives.show.badge_name.accepted')
28
+ # i18n-tasks-use t('decidim.initiatives.show.badge_name.created')
29
+ # i18n-tasks-use t('decidim.initiatives.show.badge_name.discarded')
30
+ # i18n-tasks-use t('decidim.initiatives.show.badge_name.published')
31
+ # i18n-tasks-use t('decidim.initiatives.show.badge_name.rejected')
32
+ # i18n-tasks-use t('decidim.initiatives.show.badge_name.validating')
33
+ def badge_name
34
+ I18n.t(model.state, scope: "decidim.initiatives.show.badge_name")
35
+ end
36
+
26
37
  def state_classes
27
38
  case state
28
39
  when "accepted", "published"
@@ -48,6 +59,20 @@ module Decidim
48
59
  [present(model).author] +
49
60
  model.committee_members.approved.non_deleted.excluding_author.map { |member| present(member.user) }
50
61
  end
62
+
63
+ def has_image?
64
+ image.present?
65
+ end
66
+
67
+ def image
68
+ @image ||= model.attachments.find do |attachment|
69
+ attachment.file.content_type.start_with?("image")
70
+ end
71
+ end
72
+
73
+ def resource_image_path
74
+ image.url if has_image?
75
+ end
51
76
  end
52
77
  end
53
78
  end
@@ -1,30 +1,33 @@
1
1
  <br>
2
2
  <div class="initiatives-votes-table-row" style="width: 100%; display: inline-block; min-height: 33pt; border-bottom: 1pt solid black;">
3
- <div class="initiatives-votes-table-cell w11" style="width: 10.8%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
3
+ <div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
4
4
  <%= initiative_id %>
5
5
  </div>
6
- <div class="initiatives-votes-table-cell w11" style="width: 10.8%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
6
+ <div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
7
7
  <%= initiative_title %>
8
8
  </div>
9
- <div class="initiatives-votes-table-cell w11" style="width: 10.8%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
9
+ <div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
10
10
  <%= name_and_surname %>
11
11
  </div>
12
- <div class="initiatives-votes-table-cell w11" style="width: 10.8%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
12
+ <div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
13
13
  <%= document_number %>
14
14
  </div>
15
- <div class="initiatives-votes-table-cell w11" style="width: 10.8%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
15
+ <div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
16
16
  <%= date_of_birth %>
17
17
  </div>
18
- <div class="initiatives-votes-table-cell w11" style="width: 10.8%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
18
+ <div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
19
19
  <%= postal_code %>
20
20
  </div>
21
- <div class="initiatives-votes-table-cell w11" style="width: 10.8%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
21
+ <div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
22
22
  <%= time_and_date %>
23
23
  </div>
24
- <div class="initiatives-votes-table-cell w11" style="width: 10.8%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
24
+ <div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
25
25
  <%= timestamp %>
26
26
  </div>
27
- <div class="initiatives-votes-table-cell w11" style="width: 10.8%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
27
+ <div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
28
28
  <%= hash_id %>
29
29
  </div>
30
+ <div class="initiatives-votes-table-cell w11" style="width: 9.4%; padding-left: 5pt; word-wrap: break-word; display: inline-block; float: left; min-height: 36pt;">
31
+ <%= scope %>
32
+ </div>
30
33
  </div>
@@ -37,6 +37,13 @@ module Decidim
37
37
  model.created_at
38
38
  end
39
39
 
40
+ def scope
41
+ return I18n.t("decidim.scopes.global") if model.decidim_scope_id.nil?
42
+ return I18n.t("decidim.initiatives.unavailable_scope") if model.scope.blank?
43
+
44
+ translated_attribute(model.scope.name)
45
+ end
46
+
40
47
  protected
41
48
 
42
49
  def encryptor
@@ -40,14 +40,20 @@ module Decidim
40
40
  organization: form.current_organization,
41
41
  title: form.title,
42
42
  description: form.description,
43
- online_signature_enabled: form.online_signature_enabled,
43
+ signature_type: form.signature_type,
44
+ attachments_enabled: form.attachments_enabled,
44
45
  undo_online_signatures_enabled: form.undo_online_signatures_enabled,
46
+ custom_signature_end_date_enabled: form.custom_signature_end_date_enabled,
47
+ area_enabled: form.area_enabled,
48
+ promoting_committee_enabled: form.promoting_committee_enabled,
45
49
  minimum_committee_members: form.minimum_committee_members,
46
50
  banner_image: form.banner_image,
47
51
  collect_user_extra_fields: form.collect_user_extra_fields,
48
52
  extra_fields_legal_information: form.extra_fields_legal_information,
49
53
  validate_sms_code_on_votes: form.validate_sms_code_on_votes,
50
- document_number_authorization_handler: form.document_number_authorization_handler
54
+ document_number_authorization_handler: form.document_number_authorization_handler,
55
+ child_scope_threshold_enabled: form.child_scope_threshold_enabled,
56
+ only_global_scope_enabled: form.only_global_scope_enabled
51
57
  )
52
58
 
53
59
  return initiative_type unless initiative_type.valid?
@@ -30,12 +30,29 @@ module Decidim
30
30
  initiative.validating!
31
31
  initiative
32
32
  end
33
+
34
+ notify_admins
35
+
33
36
  broadcast(:ok, initiative)
34
37
  end
35
38
 
36
39
  private
37
40
 
38
41
  attr_reader :initiative, :current_user
42
+
43
+ def notify_admins
44
+ affected_users = Decidim::User.org_admins_except_me(current_user).all
45
+
46
+ data = {
47
+ event: "decidim.events.initiatives.admin.initiative_sent_to_technical_validation",
48
+ event_class: Decidim::Initiatives::Admin::InitiativeSentToTechnicalValidationEvent,
49
+ resource: initiative,
50
+ affected_users: affected_users,
51
+ force_send: true
52
+ }
53
+
54
+ Decidim::EventsManager.publish(data)
55
+ end
39
56
  end
40
57
  end
41
58
  end
@@ -6,6 +6,8 @@ module Decidim
6
6
  # A command with all the business logic that updates an
7
7
  # existing initiative.
8
8
  class UpdateInitiative < Rectify::Command
9
+ include Decidim::Initiatives::AttachmentMethods
10
+
9
11
  # Public: Initializes the command.
10
12
  #
11
13
  # initiative - Decidim::Initiative
@@ -14,6 +16,7 @@ module Decidim
14
16
  @form = form
15
17
  @initiative = initiative
16
18
  @current_user = current_user
19
+ @attached_to = initiative
17
20
  end
18
21
 
19
22
  # Executes the command. Broadcasts these events:
@@ -25,11 +28,19 @@ module Decidim
25
28
  def call
26
29
  return broadcast(:invalid) if form.invalid?
27
30
 
31
+ if process_attachments?
32
+ @initiative.attachments.destroy_all
33
+
34
+ build_attachment
35
+ return broadcast(:invalid) if attachment_invalid?
36
+ end
37
+
28
38
  @initiative = Decidim.traceability.update!(
29
39
  initiative,
30
40
  current_user,
31
41
  attributes
32
42
  )
43
+ create_attachment if process_attachments?
33
44
  notify_initiative_is_extended if @notify_extended
34
45
  broadcast(:ok, initiative)
35
46
  rescue ActiveRecord::RecordInvalid
@@ -38,7 +49,7 @@ module Decidim
38
49
 
39
50
  private
40
51
 
41
- attr_reader :form, :initiative, :current_user
52
+ attr_reader :form, :initiative, :current_user, :attachment
42
53
 
43
54
  def attributes
44
55
  attrs = {
@@ -53,20 +64,28 @@ module Decidim
53
64
  end
54
65
 
55
66
  if current_user.admin?
56
- attrs[:signature_start_date] = form.signature_start_date
57
- attrs[:signature_end_date] = form.signature_end_date
58
- attrs[:offline_votes] = form.offline_votes if form.offline_votes
59
- attrs[:state] = form.state if form.state
60
-
61
- if initiative.published?
62
- @notify_extended = true if form.signature_end_date != initiative.signature_end_date &&
63
- form.signature_end_date > initiative.signature_end_date
64
- end
67
+ add_admin_accessible_attrs(attrs)
68
+ elsif initiative.created?
69
+ attrs[:signature_end_date] = form.signature_end_date if initiative.custom_signature_end_date_enabled?
70
+ attrs[:decidim_area_id] = form.area_id if initiative.area_enabled?
65
71
  end
66
72
 
67
73
  attrs
68
74
  end
69
75
 
76
+ def add_admin_accessible_attrs(attrs)
77
+ attrs[:signature_start_date] = form.signature_start_date
78
+ attrs[:signature_end_date] = form.signature_end_date
79
+ attrs[:offline_votes] = form.offline_votes if form.offline_votes
80
+ attrs[:state] = form.state if form.state
81
+ attrs[:decidim_area_id] = form.area_id
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
86
+ end
87
+ end
88
+
70
89
  def notify_initiative_is_extended
71
90
  Decidim::EventsManager.publish(
72
91
  event: "decidim.events.initiatives.initiative_extended",