decidim-debates 0.23.2 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/admin/decidim_debates_manifest.js +1 -0
  3. data/app/assets/javascripts/decidim/debates/admin/debates.js.es6 +25 -0
  4. data/app/cells/decidim/debates/debate_activity_cell.rb +13 -5
  5. data/app/cells/decidim/debates/debate_m/open_date.erb +7 -0
  6. data/app/cells/decidim/debates/debate_m_cell.rb +1 -1
  7. data/app/cells/decidim/debates/reported_content/show.erb +4 -0
  8. data/app/cells/decidim/debates/reported_content_cell.rb +13 -0
  9. data/app/commands/decidim/debates/admin/create_debate.rb +3 -2
  10. data/app/commands/decidim/debates/admin/update_debate.rb +2 -1
  11. data/app/commands/decidim/debates/create_debate.rb +1 -0
  12. data/app/commands/decidim/debates/update_debate.rb +2 -1
  13. data/app/controllers/decidim/debates/debates_controller.rb +1 -5
  14. data/app/forms/decidim/debates/admin/close_debate_form.rb +1 -1
  15. data/app/forms/decidim/debates/admin/debate_form.rb +30 -2
  16. data/app/forms/decidim/debates/close_debate_form.rb +1 -1
  17. data/app/forms/decidim/debates/debate_form.rb +17 -0
  18. data/app/models/decidim/debates/debate.rb +11 -1
  19. data/app/permissions/decidim/debates/admin/permissions.rb +8 -1
  20. data/app/views/decidim/debates/admin/debates/_form.html.erb +15 -2
  21. data/app/views/decidim/debates/admin/debates/index.html.erb +10 -2
  22. data/app/views/decidim/debates/debates/_filters.html.erb +1 -1
  23. data/app/views/decidim/debates/debates/_filters_small_view.html.erb +1 -1
  24. data/app/views/decidim/debates/debates/_form.html.erb +6 -0
  25. data/app/views/decidim/debates/debates/show.html.erb +5 -21
  26. data/config/locales/ca.yml +18 -4
  27. data/config/locales/cs.yml +18 -4
  28. data/config/locales/de.yml +18 -4
  29. data/config/locales/en.yml +18 -4
  30. data/config/locales/es-MX.yml +17 -4
  31. data/config/locales/es-PY.yml +17 -4
  32. data/config/locales/es.yml +17 -4
  33. data/config/locales/fi-plain.yml +18 -4
  34. data/config/locales/fi.yml +18 -4
  35. data/config/locales/fr-CA.yml +18 -4
  36. data/config/locales/fr.yml +18 -4
  37. data/config/locales/gl.yml +10 -4
  38. data/config/locales/ja.yml +10 -4
  39. data/config/locales/nl.yml +18 -4
  40. data/config/locales/no.yml +10 -4
  41. data/config/locales/pl.yml +37 -6
  42. data/config/locales/ro-RO.yml +64 -0
  43. data/config/locales/sv.yml +10 -4
  44. data/config/locales/tr-TR.yml +17 -4
  45. data/config/locales/zh-CN.yml +10 -4
  46. data/db/migrate/20200930145546_add_scope_to_debates_debate.rb +7 -0
  47. data/db/migrate/20201126112752_archive_debates.rb +8 -0
  48. data/db/migrate/20210125101735_revert_archive_debates.rb +8 -0
  49. data/db/migrate/20210310120652_add_followable_counter_cache_to_debates.rb +16 -0
  50. data/lib/decidim/api/debate_type.rb +26 -0
  51. data/lib/decidim/api/debates_type.rb +26 -0
  52. data/lib/decidim/debates.rb +1 -0
  53. data/lib/decidim/debates/admin_engine.rb +4 -0
  54. data/lib/decidim/debates/api.rb +8 -0
  55. data/lib/decidim/debates/component.rb +22 -10
  56. data/lib/decidim/debates/test/factories.rb +1 -1
  57. data/lib/decidim/debates/version.rb +1 -1
  58. metadata +24 -14
  59. data/app/types/decidim/debates/debate_type.rb +0 -28
  60. data/app/types/decidim/debates/debates_type.rb +0 -32
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Debates
5
- DebateType = GraphQL::ObjectType.define do
6
- interfaces [
7
- -> { Decidim::Core::CategorizableInterface },
8
- -> { Decidim::Comments::CommentableInterface },
9
- -> { Decidim::Core::AuthorableInterface }
10
- ]
11
-
12
- name "Debate"
13
- description "A debate"
14
-
15
- field :id, !types.ID, "The internal ID for this debate"
16
- field :title, Decidim::Core::TranslatedFieldType, "The title for this debate"
17
- field :description, Decidim::Core::TranslatedFieldType, "The description for this debate"
18
- field :instructions, Decidim::Core::TranslatedFieldType, "The instructions for this debate"
19
- field :startTime, Decidim::Core::DateTimeType, "The start time for this debate", property: :start_time
20
- field :endTime, Decidim::Core::DateTimeType, "The end time for this debate", property: :end_time
21
- field :image, types.String, "The image of this debate"
22
- field :createdAt, Decidim::Core::DateTimeType, "When this debate was created", property: :created_at
23
- field :updatedAt, Decidim::Core::DateTimeType, "When this debate was updated", property: :updated_at
24
- field :informationUpdates, Decidim::Core::TranslatedFieldType, "The information updates for this debate", property: :information_updates
25
- field :reference, types.String, "The reference for this debate"
26
- end
27
- end
28
- end
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Debates
5
- DebatesType = GraphQL::ObjectType.define do
6
- interfaces [-> { Decidim::Core::ComponentInterface }]
7
-
8
- name "Debates"
9
- description "A debates component of a participatory space."
10
-
11
- connection :debates, DebateType.connection_type do
12
- resolve ->(component, _args, _ctx) {
13
- DebatesTypeHelper.base_scope(component).includes(:component)
14
- }
15
- end
16
-
17
- field(:debate, DebateType) do
18
- argument :id, !types.ID
19
-
20
- resolve ->(component, args, _ctx) {
21
- DebatesTypeHelper.base_scope(component).find_by(id: args[:id])
22
- }
23
- end
24
- end
25
-
26
- module DebatesTypeHelper
27
- def self.base_scope(component)
28
- Debate.where(component: component)
29
- end
30
- end
31
- end
32
- end