decidim-initiatives 0.23.3 → 0.24.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) 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/cells/decidim/initiatives/initiative_m/tags.erb +1 -1
  10. data/app/commands/decidim/initiatives/admin/update_initiative.rb +3 -3
  11. data/app/commands/decidim/initiatives/admin/update_initiative_answer.rb +3 -3
  12. data/app/commands/decidim/initiatives/approve_membership_request.rb +40 -0
  13. data/app/commands/decidim/initiatives/create_initiative.rb +5 -4
  14. data/app/commands/decidim/initiatives/revoke_membership_request.rb +40 -0
  15. data/app/commands/decidim/initiatives/send_initiative_to_technical_validation.rb +57 -0
  16. data/app/commands/decidim/initiatives/spawn_committee_request.rb +18 -0
  17. data/app/commands/decidim/initiatives/update_initiative.rb +74 -0
  18. data/app/controllers/decidim/initiatives/admin/committee_requests_controller.rb +15 -4
  19. data/app/controllers/decidim/initiatives/admin/initiatives_controller.rb +1 -1
  20. data/app/controllers/decidim/initiatives/admin/moderations/reports_controller.rb +18 -0
  21. data/app/controllers/decidim/initiatives/committee_requests_controller.rb +32 -0
  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 +1 -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 +63 -30
  37. data/app/queries/decidim/initiatives/initiatives_promoted.rb +1 -1
  38. data/app/queries/decidim/initiatives/organization_prioritized_initiatives.rb +13 -2
  39. data/app/serializers/decidim/initiatives/initiative_serializer.rb +3 -0
  40. data/app/services/decidim/initiatives/dummy_timestamp.rb +1 -1
  41. data/app/services/decidim/initiatives/initiative_search.rb +15 -13
  42. data/app/services/decidim/initiatives/pdf_signature_example.rb +27 -27
  43. data/app/views/decidim/initiatives/admin/initiatives/edit.html.erb +1 -1
  44. data/app/views/decidim/initiatives/admin/initiatives/index.html.erb +6 -0
  45. data/app/views/decidim/initiatives/admin/initiatives_type_scopes/edit.html.erb +24 -17
  46. data/app/views/decidim/initiatives/admin/initiatives_type_scopes/new.html.erb +17 -11
  47. data/app/views/decidim/initiatives/create_initiative/_finish_help.html.erb +2 -7
  48. data/app/views/decidim/initiatives/create_initiative/fill_data.html.erb +4 -17
  49. data/app/views/decidim/initiatives/create_initiative/finish.html.erb +11 -11
  50. data/app/views/decidim/initiatives/initiatives/_committee_members.html.erb +73 -0
  51. data/app/views/decidim/initiatives/initiatives/_filters_small_view.html.erb +1 -1
  52. data/app/views/decidim/initiatives/initiatives/_form.html.erb +112 -0
  53. data/app/views/decidim/initiatives/initiatives/_result.html.erb +1 -1
  54. data/app/views/decidim/initiatives/initiatives/_send_to_technical_validation.html.erb +8 -0
  55. data/app/views/decidim/initiatives/initiatives/edit.html.erb +78 -0
  56. data/app/views/decidim/initiatives/initiatives/print.html.erb +156 -0
  57. data/app/views/decidim/initiatives/initiatives/show.html.erb +19 -7
  58. data/app/views/layouts/decidim/admin/initiative.html.erb +0 -1
  59. data/app/views/layouts/decidim/admin/initiatives.html.erb +2 -15
  60. data/config/locales/ar.yml +2 -29
  61. data/config/locales/ca.yml +90 -30
  62. data/config/locales/cs.yml +108 -48
  63. data/config/locales/de.yml +91 -31
  64. data/config/locales/el.yml +2 -35
  65. data/config/locales/en.yml +94 -34
  66. data/config/locales/es-MX.yml +94 -34
  67. data/config/locales/es-PY.yml +94 -34
  68. data/config/locales/es.yml +93 -33
  69. data/config/locales/eu.yml +2 -29
  70. data/config/locales/fi-plain.yml +94 -34
  71. data/config/locales/fi.yml +94 -34
  72. data/config/locales/fr-CA.yml +96 -36
  73. data/config/locales/fr.yml +96 -36
  74. data/config/locales/gl.yml +2 -33
  75. data/config/locales/hu.yml +3 -32
  76. data/config/locales/id-ID.yml +2 -29
  77. data/config/locales/is-IS.yml +2 -14
  78. data/config/locales/it.yml +2 -35
  79. data/config/locales/ja.yml +2 -35
  80. data/config/locales/lv.yml +2 -33
  81. data/config/locales/nl.yml +31 -34
  82. data/config/locales/no.yml +2 -32
  83. data/config/locales/pl.yml +101 -33
  84. data/config/locales/pt-BR.yml +2 -29
  85. data/config/locales/pt.yml +3 -36
  86. data/config/locales/ro-RO.yml +2 -35
  87. data/config/locales/ru.yml +2 -22
  88. data/config/locales/sk.yml +2 -31
  89. data/config/locales/sr-CS.yml +0 -7
  90. data/config/locales/sv.yml +53 -34
  91. data/config/locales/tr-TR.yml +68 -34
  92. data/config/locales/uk.yml +2 -22
  93. data/config/locales/zh-CN.yml +2 -35
  94. data/db/migrate/20171017095143_update_initiative_scoped_type.rb +0 -1
  95. data/db/migrate/20191107134847_add_scopes_to_initiatives_votes.rb +1 -1
  96. data/db/migrate/20191118105634_allow_multiple_offline_votes.rb +1 -1
  97. data/db/migrate/20210310120720_add_followable_counter_cache_to_initiatives.rb +16 -0
  98. data/lib/decidim/api/initiative_api_type.rb +26 -0
  99. data/lib/decidim/api/initiative_committee_member_type.rb +18 -0
  100. data/lib/decidim/api/initiative_type.rb +49 -0
  101. data/lib/decidim/api/initiative_type_interface.rb +8 -3
  102. data/lib/decidim/initiatives.rb +1 -0
  103. data/lib/decidim/initiatives/admin_engine.rb +23 -1
  104. data/lib/decidim/initiatives/api.rb +3 -0
  105. data/lib/decidim/initiatives/engine.rb +14 -9
  106. data/lib/decidim/initiatives/initiatives_filter_form_builder.rb +19 -12
  107. data/lib/decidim/initiatives/participatory_space.rb +6 -6
  108. data/lib/decidim/initiatives/query_extensions.rb +42 -19
  109. data/lib/decidim/initiatives/test/factories.rb +36 -0
  110. data/lib/decidim/initiatives/version.rb +1 -1
  111. metadata +33 -17
  112. data/app/types/decidim/initiatives/initiative_api_type.rb +0 -26
  113. data/app/types/decidim/initiatives/initiative_committee_member_type.rb +0 -18
  114. data/app/types/decidim/initiatives/initiative_type.rb +0 -42
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Initiatives
5
- InitiativeApiType = GraphQL::ObjectType.define do
6
- name "InitiativeType"
7
- description "An initiative type"
8
-
9
- field :id, !types.ID, "The internal ID for this initiative type"
10
- field :title, Decidim::Core::TranslatedFieldType, "Initiative type name"
11
- field :description, Decidim::Core::TranslatedFieldType, "This is the initiative type description"
12
- field :createdAt, Decidim::Core::DateTimeType, "The date this initiative type was created", property: :created_at
13
- field :updatedAt, Decidim::Core::DateTimeType, "The date this initiative type was updated", property: :updated_at
14
- field :bannerImage, types.String, "Banner image", property: :banner_image
15
- field :collectUserExtraFields, types.Boolean, "Collect participant personal data on signature", property: :collect_user_extra_fields
16
- field :extraFieldsLegalInformation, types.String, "Legal information about the collection of personal data", property: :extra_fields_legal_information
17
- field :minimumCommitteeMembers, types.Int, "Minimum of committee members", property: :minimum_committee_members
18
- field :validateSmsCodeOnVotes, types.Boolean, "Add SMS code validation step to signature process", property: :validate_sms_code_on_votes
19
- field :undoOnlineSignaturesEnabled, types.Boolean, "Enable participants to undo their online signatures", property: :undo_online_signatures_enabled
20
- field :promotingComitteeEnabled, types.Boolean, "If promoting committee is enabled", property: :promoting_committee_enabled
21
- field :signatureType, types.String, "Signature type of the initiative", property: :signature_type
22
-
23
- field :initiatives, !types[Decidim::Initiatives::InitiativeType], "The initiatives that have this type"
24
- end
25
- end
26
- end
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Initiatives
5
- # This type represents a initiative committee member.
6
- InitiativeCommitteeMemberType = GraphQL::ObjectType.define do
7
- name "InitiativeCommitteeMemberType"
8
- description "A initiative committee member"
9
-
10
- field :id, !types.ID, "Internal ID for this member of the committee"
11
- field :user, Decidim::Core::UserType, "The decidim user for this initiative committee member"
12
-
13
- field :state, types.Int, "Type of the committee member"
14
- field :createdAt, Decidim::Core::DateTimeType, "The date this initiative committee member was created", property: :created_at
15
- field :updatedAt, Decidim::Core::DateTimeType, "The date this initiative committee member was updated", property: :updated_at
16
- end
17
- end
18
- end
@@ -1,42 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Initiatives
5
- # This type represents a Initiative.
6
- InitiativeType = GraphQL::ObjectType.define do
7
- interfaces [
8
- -> { Decidim::Core::ParticipatorySpaceInterface },
9
- -> { Decidim::Core::ScopableInterface },
10
- -> { Decidim::Core::AttachableInterface },
11
- -> { Decidim::Core::AuthorInterface },
12
- -> { Decidim::Initiatives::InitiativeTypeInterface }
13
- ]
14
-
15
- name "Initiative"
16
- description "A initiative"
17
-
18
- field :description, Decidim::Core::TranslatedFieldType, "The description of this initiative."
19
- field :slug, !types.String
20
- field :hashtag, types.String, "The hashtag for this initiative"
21
- field :createdAt, !Decidim::Core::DateTimeType, "The time this initiative was created", property: :created_at
22
- field :updatedAt, !Decidim::Core::DateTimeType, "The time this initiative was updated", property: :updated_at
23
- field :publishedAt, !Decidim::Core::DateTimeType, "The time this initiative was published", property: :published_at
24
- field :reference, !types.String, "Reference prefix for this initiative"
25
- field :state, types.String, "Current status of the initiative"
26
- field :signatureType, types.String, "Signature type of the initiative", property: :signature_type
27
- field :signatureStartDate, !Decidim::Core::DateType, "The signature start date", property: :signature_start_date
28
- field :signatureEndDate, !Decidim::Core::DateType, "The signature end date", property: :signature_end_date
29
- field :offlineVotes, types.Int, "The number of offline votes in this initiative", property: :offline_votes
30
- field :initiativeVotesCount, types.Int, "The number of votes in this initiative", property: :initiative_votes_count
31
- field :initiativeSupportsCount, types.Int, "The number of supports in this initiative", property: :initiative_supports_count
32
-
33
- field :author, !Decidim::Core::AuthorInterface, "The initiative author" do
34
- resolve lambda { |obj, _args, _ctx|
35
- obj.user_group || obj.author
36
- }
37
- end
38
-
39
- field :committeeMembers, types[Decidim::Initiatives::InitiativeCommitteeMemberType], property: :committee_members
40
- end
41
- end
42
- end