decidim-debates 0.23.6 → 0.24.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) 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 +5 -13
  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/_form.html.erb +6 -0
  24. data/app/views/decidim/debates/debates/show.html.erb +5 -21
  25. data/config/locales/ca.yml +17 -5
  26. data/config/locales/cs.yml +18 -6
  27. data/config/locales/de.yml +18 -6
  28. data/config/locales/en.yml +17 -5
  29. data/config/locales/es-MX.yml +10 -5
  30. data/config/locales/es-PY.yml +10 -5
  31. data/config/locales/es.yml +10 -5
  32. data/config/locales/fi-plain.yml +17 -5
  33. data/config/locales/fi.yml +17 -5
  34. data/config/locales/fr-CA.yml +17 -5
  35. data/config/locales/fr.yml +17 -5
  36. data/config/locales/gl.yml +10 -5
  37. data/config/locales/ja.yml +10 -4
  38. data/config/locales/nl.yml +17 -5
  39. data/config/locales/no.yml +10 -4
  40. data/config/locales/pl.yml +17 -5
  41. data/config/locales/ro-RO.yml +8 -47
  42. data/config/locales/sv.yml +10 -18
  43. data/config/locales/tr-TR.yml +17 -4
  44. data/config/locales/zh-CN.yml +10 -4
  45. data/db/migrate/20200930145546_add_scope_to_debates_debate.rb +7 -0
  46. data/db/migrate/20201126112752_archive_debates.rb +8 -0
  47. data/db/migrate/20210125101735_revert_archive_debates.rb +8 -0
  48. data/lib/decidim/api/debate_type.rb +26 -0
  49. data/lib/decidim/api/debates_type.rb +26 -0
  50. data/lib/decidim/debates/admin_engine.rb +4 -0
  51. data/lib/decidim/debates/api.rb +8 -0
  52. data/lib/decidim/debates/component.rb +22 -10
  53. data/lib/decidim/debates/test/factories.rb +1 -1
  54. data/lib/decidim/debates/version.rb +1 -1
  55. data/lib/decidim/debates.rb +1 -0
  56. metadata +25 -16
  57. data/app/types/decidim/debates/debate_type.rb +0 -28
  58. data/app/types/decidim/debates/debates_type.rb +0 -32
@@ -29,21 +29,16 @@ ro:
29
29
  debates:
30
30
  actions:
31
31
  create: Crează
32
- endorse: Aprobare
33
32
  name: Dezbateri
34
33
  settings:
35
34
  global:
36
35
  announcement: Anunţ
37
36
  comments_enabled: Comentarii activate
38
37
  comments_max_length: Lungimea maximă a comentariilor (Leave 0 pentru valoarea implicită)
39
- scope_id: Domeniu de interes
40
- scopes_enabled: Domenii de interes activate
41
38
  step:
42
39
  announcement: Anunţ
43
40
  comments_blocked: Comentarii blocate
44
41
  creation_enabled: Crearea de dezbateri de către participanți este activată
45
- endorsements_blocked: Aprobări blocate
46
- endorsements_enabled: Aprobări activate
47
42
  debates:
48
43
  actions:
49
44
  close: Închide
@@ -53,10 +48,6 @@ ro:
53
48
  new: '%{name} nou'
54
49
  title: Acțiuni
55
50
  admin:
56
- debate_closes:
57
- edit:
58
- close: Inchide
59
- title: Închide dezbaterea
60
51
  debates:
61
52
  create:
62
53
  invalid: A existat o problemă la crearea dezbaterii.
@@ -79,20 +70,9 @@ ro:
79
70
  name: Dezbatere
80
71
  admin_log:
81
72
  debate:
82
- close: "%{user_name} a închis dezbaterea %{resource_name} cu privire la spațiul %{space_name}"
83
73
  create: "%{user_name} a creat dezbaterea %{resource_name} pentru spațiul %{space_name}"
84
74
  update: "%{user_name} a actualizat dezbaterea %{resource_name} cu privire la spațiul %{space_name}"
85
- debate_m:
86
- commented_time_ago: Comentat acum %{time}
87
75
  debates:
88
- close:
89
- invalid: A existat o problemă la închiderea dezbaterii.
90
- success: Dezbatere închisă.
91
- close_debate_modal:
92
- close: Închide
93
- description: Care este rezumatul sau concluzia acestei dezbateri?
94
- send: Închide dezbaterea
95
- closed: Închis
96
76
  count:
97
77
  debates_count:
98
78
  one: "%{count} dezbatere"
@@ -108,22 +88,13 @@ ro:
108
88
  save: Salvează modificările
109
89
  title: Editare dezbatere
110
90
  filters:
111
- activity: Activitatea mea
112
91
  all: Toate
113
92
  category: Categorie
114
93
  category_prompt: Selectați o categorie
115
94
  citizens: Cetățeni
116
- commented: Comentat
117
- my_debates: Dezbaterile mele
118
95
  official: Oficial
119
96
  origin: Origine
120
- scope: Domeniu de interes
121
97
  search: Caută
122
- state: Stare
123
- state_values:
124
- closed: Inchide
125
- open: Deschide
126
- user_groups: Grupuri
127
98
  filters_small_view:
128
99
  close_modal: Închide fereastra
129
100
  filter: Filtrare
@@ -137,24 +108,10 @@ ro:
137
108
  back: Înapoi
138
109
  create: Crează
139
110
  title: Dezbatere nouă
140
- orders:
141
- commented: Cele mai comentate
142
- label: Dezbateri de ordine
143
- random: Ordine aleatorie
144
- recent: Cele mai recente
145
- updated: Actualizate recent
146
111
  show:
147
112
  back: Înapoi la listă
148
- close_debate: Închide dezbaterea
149
113
  date: Data
150
- debate_closed: Inchide
151
- debate_conclusions_are: 'Dezbaterea s-a încheiat la %{date} cu următoarele concluzii:'
152
- edit_conclusions: Editați concluziile
153
114
  edit_debate: Editare dezbatere
154
- groups_count: Grupuri
155
- last_comment_by: Ultimul comentariu din partea
156
- no_comments_yet: Încă nu există comentarii
157
- participants_count: Participanţi
158
115
  update:
159
116
  invalid: A apărut o problemă la actualizarea dezbaterii.
160
117
  success: Dezbatere actualizata cu succes.
@@ -166,7 +123,6 @@ ro:
166
123
  versions_list:
167
124
  back_to_resource: Revenire la dezbatere
168
125
  last_activity:
169
- debate_updated_at_html: "<span>Dezbatere actualizată la %{link}</span>"
170
126
  new_debate_at_html: "<span>Noua dezbatere la %{link}</span>"
171
127
  models:
172
128
  debate:
@@ -203,9 +159,14 @@ ro:
203
159
  email_subject: Dezbaterile sunt acum disponibile în %{participatory_space_title}
204
160
  notification_title: Acum poți începe <a href="%{resource_path}">noi dezbateri</a> în <a href="%{participatory_space_url}">%{participatory_space_title}</a>
205
161
  debate_closed:
206
- email_intro: 'Dezbaterea pentru "%{resource_title}” a fost închisă. Puteți citi concluziile pe pagina sa:'
207
- email_subject: Dezbaterea pentru "%{resource_title}” a fost închisă
208
- notification_title: Dezbaterea pentru <a href="%{resource_path}">%{resource_title}</a> a fost închisă.
162
+ affected_user:
163
+ email_intro: 'Dezbaterea pentru "%{resource_title}” a fost închisă. Puteți citi concluziile pe pagina sa:'
164
+ email_subject: Dezbaterea pentru "%{resource_title} a fost închisă
165
+ notification_title: Dezbaterea pentru <a href="%{resource_path}">%{resource_title}</a> a fost închisă.
166
+ follower:
167
+ email_intro: 'Dezbaterea pentru "%{resource_title}” a fost închisă. Puteți citi concluziile pe pagina sa:'
168
+ email_subject: Dezbaterea pentru "%{resource_title}” a fost închisă
169
+ notification_title: Dezbaterea pentru <a href="%{resource_path}">%{resource_title}</a> a fost închisă.
209
170
  gamification:
210
171
  badges:
211
172
  commented_debates:
@@ -35,8 +35,6 @@ sv:
35
35
  announcement: Meddelande
36
36
  comments_enabled: Kommentarer aktiverade
37
37
  comments_max_length: Maximal längd för kommentarer (Lämna 0 för standardvärde)
38
- scope_id: Omfång
39
- scopes_enabled: Omfång aktiverade
40
38
  step:
41
39
  announcement: Meddelande
42
40
  comments_blocked: Kommentarer blockerade
@@ -81,8 +79,6 @@ sv:
81
79
  close: "%{user_name} stängde debatten %{resource_name} i utrymmet %{space_name}"
82
80
  create: "%{user_name} skapade debatten %{resource_name} på platsen %{space_name}"
83
81
  update: "%{user_name} uppdaterade debatten %{resource_name} på platsen %{space_name}"
84
- debate_m:
85
- commented_time_ago: Kommenterade för %{time} sedan
86
82
  debates:
87
83
  close:
88
84
  invalid: Det gick inte att stänga debatten.
@@ -106,22 +102,13 @@ sv:
106
102
  save: Spara ändringar
107
103
  title: Redigera debatt
108
104
  filters:
109
- activity: Min aktivitet
110
105
  all: Alla
111
106
  category: Kategori
112
107
  category_prompt: Välj en kategori
113
108
  citizens: Medborgare
114
- commented: Kommenterade
115
- my_debates: Mina debatter
116
109
  official: Officiell
117
110
  origin: Ursprung
118
- scope: Omfång
119
111
  search: Sök
120
- state: Status
121
- state_values:
122
- closed: Stängda
123
- open: Öppna
124
- user_groups: Grupper
125
112
  filters_small_view:
126
113
  close_modal: Stäng fönstret
127
114
  filter: Filtrera
@@ -164,7 +151,6 @@ sv:
164
151
  versions_list:
165
152
  back_to_resource: Gå tillbaka till debatten
166
153
  last_activity:
167
- debate_updated_at_html: "<span>Debatt uppdaterades på %{link}</span>"
168
154
  new_debate_at_html: "<span>Ny debatt i %{link}</span>"
169
155
  models:
170
156
  debate:
@@ -201,10 +187,16 @@ sv:
201
187
  email_subject: Debatter är nu tillgängliga i %{participatory_space_title}
202
188
  notification_title: Nu kan du starta <a href="%{resource_path}">nya debatter</a> i <a href="%{participatory_space_url}">%{participatory_space_title}</a>
203
189
  debate_closed:
204
- email_intro: 'Debatten "%{resource_title}" stängdes. Du kan läsa slutsatserna från dess sida:'
205
- email_outro: Du har fått det här meddelandet eftersom du följer debatten "%{resource_title}". Du kan sluta följa det föregående länk.
206
- email_subject: Debatten "%{resource_title}" stängdes
207
- notification_title: Debatten <a href="%{resource_path}">%{resource_title}</a> stängdes.
190
+ affected_user:
191
+ email_intro: 'Debatten "%{resource_title}" stängdes. Du kan läsa slutsatserna från dess sida:'
192
+ email_outro: Du har fått det här meddelandet eftersom du följer debatten "%{resource_title}". Du kan sluta följa det på föregående länk.
193
+ email_subject: Debatten "%{resource_title}" stängdes
194
+ notification_title: Debatten <a href="%{resource_path}">%{resource_title}</a> stängdes.
195
+ follower:
196
+ email_intro: 'Debatten "%{resource_title}" stängdes. Du kan läsa slutsatserna från dess sida:'
197
+ email_outro: Du har fått det här meddelandet eftersom du följer debatten "%{resource_title}". Du kan sluta följa det på föregående länk.
198
+ email_subject: Debatten "%{resource_title}" stängdes
199
+ notification_title: Debatten <a href="%{resource_path}">%{resource_title}</a> stängdes.
208
200
  gamification:
209
201
  badges:
210
202
  commented_debates:
@@ -65,6 +65,10 @@ tr:
65
65
  edit:
66
66
  title: Tartışmayı düzenle
67
67
  update: Tartışmayı güncelle
68
+ form:
69
+ debate_type: Tartışma türü
70
+ finite: Sonlu (Başlangıç ​​ve bitiş saatleri ile)
71
+ open: Açık (Başlangıç ​​veya bitiş zamanı yok)
68
72
  index:
69
73
  title: Tartışmalar
70
74
  new:
@@ -73,6 +77,8 @@ tr:
73
77
  update:
74
78
  invalid: Bu tartışmayı güncellerken bir sorun oluştu.
75
79
  success: Tartışma başarıyla güncellendi.
80
+ exports:
81
+ comments: Yorumlar
76
82
  models:
77
83
  debate:
78
84
  name: Tartışma
@@ -152,6 +158,7 @@ tr:
152
158
  groups_count: Gruplar
153
159
  last_comment_by: Son yorum
154
160
  no_comments_yet: Henüz yorum yok
161
+ open: Açık tartışma
155
162
  participants_count: Katılımcılar
156
163
  update:
157
164
  invalid: Bu tartışmayı güncellerken bir sorun oluştu.
@@ -200,10 +207,16 @@ tr:
200
207
  email_subject: Tartışmalar artık %{participatory_space_title} içinde mevcut
201
208
  notification_title: Artık <a href="%{participatory_space_url}">%{participatory_space_title} </a> ’de <a href="%{resource_path}"> yeni tartışmalar </a> başlatabilirsiniz
202
209
  debate_closed:
203
- email_intro: '"%{resource_title}" tartışması kapatıldı. Sonuçları sayfasından okuyabilirsiniz:'
204
- email_outro: Bu bildirimi, "%{resource_title}" tartışmasını takip ettiğiniz için aldınız. Önceki bağlantıdan takibini bırakabilirsiniz.
205
- email_subject: '"%{resource_title}" tartışması kapatıldı'
206
- notification_title: <a href="%{resource_path}">%{resource_title} </a> tartışması kapatıldı.
210
+ affected_user:
211
+ email_intro: '"%{resource_title}" tartışması kapatıldı. Sonuçları sayfasından okuyabilirsiniz:'
212
+ email_outro: Bu bildirimi, "%{resource_title}" tartışmasını takip ettiğiniz için aldınız. Önceki bağlantıdan takibini bırakabilirsiniz.
213
+ email_subject: '"%{resource_title}" tartışması kapatıldı'
214
+ notification_title: <a href="%{resource_path}">%{resource_title} </a> tartışması kapatıldı.
215
+ follower:
216
+ email_intro: '"%{resource_title}" tartışması kapatıldı. Sonuçları sayfasından okuyabilirsiniz:'
217
+ email_outro: Bu bildirimi, "%{resource_title}" tartışmasını takip ettiğiniz için aldınız. Önceki bağlantıdan takibini bırakabilirsiniz.
218
+ email_subject: '"%{resource_title}" tartışması kapatıldı'
219
+ notification_title: <a href="%{resource_path}">%{resource_title} </a> tartışması kapatıldı.
207
220
  gamification:
208
221
  badges:
209
222
  commented_debates:
@@ -195,10 +195,16 @@ zh-CN:
195
195
  email_outro: 您收到此通知是因为您正在关注 %{participatory_space_title}。您可以停止收到跟随上一个链接的通知。
196
196
  email_subject: 在 %{participatory_space_title} 中可以使用的辩论
197
197
  debate_closed:
198
- email_intro: '"%{resource_title}"辩论已经关闭。您可以从其页面阅读结论:'
199
- email_outro: 您收到此通知是因为您正在关注"%{resource_title}"的辩论。您可以从上一个链接取消跟进。
200
- email_subject: '"%{resource_title}"辩论已关闭'
201
- notification_title: <a href="%{resource_path}">%{resource_title}</a> 辩论已经结束。
198
+ affected_user:
199
+ email_intro: '"%{resource_title}"辩论已经关闭。您可以从其页面阅读结论:'
200
+ email_outro: 您收到此通知是因为您正在关注"%{resource_title}"的辩论。您可以从上一个链接取消跟进。
201
+ email_subject: '"%{resource_title}"辩论已关闭'
202
+ notification_title: <a href="%{resource_path}">%{resource_title}</a> 辩论已经结束。
203
+ follower:
204
+ email_intro: '"%{resource_title}"辩论已经关闭。您可以从其页面阅读结论:'
205
+ email_outro: 您收到此通知是因为您正在关注"%{resource_title}"的辩论。您可以从上一个链接取消跟进。
206
+ email_subject: '"%{resource_title}"辩论已关闭'
207
+ notification_title: <a href="%{resource_path}">%{resource_title}</a> 辩论已经结束。
202
208
  gamification:
203
209
  badges:
204
210
  commented_debates:
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddScopeToDebatesDebate < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_reference :decidim_debates_debates, :decidim_scope, foreign_key: true, index: true
6
+ end
7
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ArchiveDebates < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_debates_debates, :archived_at, :datetime
6
+ add_index :decidim_debates_debates, :archived_at
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RevertArchiveDebates < ActiveRecord::Migration[5.2]
4
+ def change
5
+ remove_index :decidim_debates_debates, :archived_at
6
+ remove_column :decidim_debates_debates, :archived_at
7
+ end
8
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Debates
5
+ class DebateType < Decidim::Api::Types::BaseObject
6
+ implements Decidim::Core::CategorizableInterface
7
+ implements Decidim::Comments::CommentableInterface
8
+ implements Decidim::Core::AuthorableInterface
9
+ implements Decidim::Core::ScopableInterface
10
+
11
+ description "A debate"
12
+
13
+ field :id, GraphQL::Types::ID, "The internal ID for this debate", null: false
14
+ field :title, Decidim::Core::TranslatedFieldType, "The title for this debate", null: true
15
+ field :description, Decidim::Core::TranslatedFieldType, "The description for this debate", null: true
16
+ field :instructions, Decidim::Core::TranslatedFieldType, "The instructions for this debate", null: true
17
+ field :start_time, Decidim::Core::DateTimeType, "The start time for this debate", null: true
18
+ field :end_time, Decidim::Core::DateTimeType, "The end time for this debate", null: true
19
+ field :image, GraphQL::Types::String, "The image of this debate", null: true
20
+ field :created_at, Decidim::Core::DateTimeType, "When this debate was created", null: true
21
+ field :updated_at, Decidim::Core::DateTimeType, "When this debate was updated", null: true
22
+ field :information_updates, Decidim::Core::TranslatedFieldType, "The information updates for this debate", null: true
23
+ field :reference, GraphQL::Types::String, "The reference for this debate", null: true
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Debates
5
+ class DebatesType < Decidim::Api::Types::BaseObject
6
+ implements Decidim::Core::ComponentInterface
7
+
8
+ graphql_name "Debates"
9
+ description "A debates component of a participatory space."
10
+
11
+ field :debates, Decidim::Debates::DebateType.connection_type, null: true, connection: true
12
+
13
+ def debates
14
+ Debate.where(component: object).includes(:component)
15
+ end
16
+
17
+ field :debate, Decidim::Debates::DebateType, null: true do
18
+ argument :id, GraphQL::Types::ID, required: true
19
+ end
20
+
21
+ def debate(**args)
22
+ Debate.where(component: object).find_by(id: args[:id])
23
+ end
24
+ end
25
+ end
26
+ end
@@ -21,6 +21,10 @@ module Decidim
21
21
  def load_seed
22
22
  nil
23
23
  end
24
+
25
+ initializer "decidim_debates.admin_assets" do |app|
26
+ app.config.assets.precompile += %w(admin/decidim_debates_manifest.js)
27
+ end
24
28
  end
25
29
  end
26
30
  end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Debates
5
+ autoload :DebateType, "decidim/api/debate_type"
6
+ autoload :DebatesType, "decidim/api/debates_type"
7
+ end
8
+ end
@@ -50,12 +50,23 @@ Decidim.register_component(:debates) do |component|
50
50
  component.register_resource(:debate) do |resource|
51
51
  resource.model_class_name = "Decidim::Debates::Debate"
52
52
  resource.card = "decidim/debates/debate"
53
+ resource.reported_content_cell = "decidim/debates/reported_content"
53
54
  resource.searchable = true
54
55
  resource.actions = %w(create endorse)
55
56
  end
56
57
 
57
58
  component.actions = %w(create endorse)
58
59
 
60
+ component.exports :comments do |exports|
61
+ exports.collection do |component_instance|
62
+ Decidim::Comments::Export.comments_for_resource(
63
+ Decidim::Debates::Debate, component_instance
64
+ )
65
+ end
66
+
67
+ exports.serializer Decidim::Comments::CommentSerializer
68
+ end
69
+
59
70
  component.seeds do |participatory_space|
60
71
  admin_user = Decidim::User.find_by(
61
72
  organization: participatory_space.organization,
@@ -83,19 +94,20 @@ Decidim.register_component(:debates) do |component|
83
94
  Decidim::Component.create!(params)
84
95
  end
85
96
 
86
- 3.times do
97
+ 5.times do |x|
98
+ finite = x != 2
87
99
  params = {
88
100
  component: component,
89
101
  category: participatory_space.categories.sample,
90
- title: Decidim::Faker::Localized.sentence(2),
102
+ title: Decidim::Faker::Localized.sentence(word_count: 2),
91
103
  description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
92
- Decidim::Faker::Localized.paragraph(3)
104
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
93
105
  end,
94
106
  instructions: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
95
- Decidim::Faker::Localized.paragraph(3)
107
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
96
108
  end,
97
- start_time: 3.weeks.from_now,
98
- end_time: 3.weeks.from_now + 4.hours,
109
+ start_time: (3.weeks.from_now if finite),
110
+ end_time: (3.weeks.from_now + 4.hours if finite),
99
111
  author: component.organization
100
112
  }
101
113
 
@@ -111,7 +123,7 @@ Decidim.register_component(:debates) do |component|
111
123
 
112
124
  closed_debate = Decidim::Debates::Debate.last
113
125
  closed_debate.conclusions = Decidim::Faker::Localized.wrapped("<p>", "</p>") do
114
- Decidim::Faker::Localized.paragraph(3)
126
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
115
127
  end
116
128
  closed_debate.closed_at = Time.current
117
129
  closed_debate.save!
@@ -119,12 +131,12 @@ Decidim.register_component(:debates) do |component|
119
131
  params = {
120
132
  component: component,
121
133
  category: participatory_space.categories.sample,
122
- title: Decidim::Faker::Localized.sentence(2),
134
+ title: Decidim::Faker::Localized.sentence(word_count: 2),
123
135
  description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
124
- Decidim::Faker::Localized.paragraph(3)
136
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
125
137
  end,
126
138
  instructions: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
127
- Decidim::Faker::Localized.paragraph(3)
139
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
128
140
  end,
129
141
  author: user
130
142
  }
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  def generate_localized_debate_title
4
- Decidim::Faker::Localized.localized { "<script>alert(\"TITLE\");</script> " + generate(:title) }
4
+ Decidim::Faker::Localized.localized { "<script>alert(\"TITLE\");</script> #{generate(:title)}" }
5
5
  end
6
6
 
7
7
  FactoryBot.define do
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-debates version.
5
5
  module Debates
6
6
  def self.version
7
- "0.23.6"
7
+ "0.24.0.rc1"
8
8
  end
9
9
  end
10
10
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "decidim/debates/admin"
4
+ require "decidim/debates/api"
4
5
  require "decidim/debates/engine"
5
6
  require "decidim/debates/admin_engine"
6
7
  require "decidim/debates/component"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-debates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.6
4
+ version: 0.24.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2021-05-10 00:00:00.000000000 Z
14
+ date: 2021-03-01 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: decidim-comments
@@ -19,28 +19,28 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.23.6
22
+ version: 0.24.0.rc1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.23.6
29
+ version: 0.24.0.rc1
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: decidim-core
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
34
  - - '='
35
35
  - !ruby/object:Gem::Version
36
- version: 0.23.6
36
+ version: 0.24.0.rc1
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - '='
42
42
  - !ruby/object:Gem::Version
43
- version: 0.23.6
43
+ version: 0.24.0.rc1
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: kaminari
46
46
  requirement: !ruby/object:Gem::Requirement
@@ -81,28 +81,28 @@ dependencies:
81
81
  requirements:
82
82
  - - '='
83
83
  - !ruby/object:Gem::Version
84
- version: 0.23.6
84
+ version: 0.24.0.rc1
85
85
  type: :development
86
86
  prerelease: false
87
87
  version_requirements: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - '='
90
90
  - !ruby/object:Gem::Version
91
- version: 0.23.6
91
+ version: 0.24.0.rc1
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: decidim-dev
94
94
  requirement: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - '='
97
97
  - !ruby/object:Gem::Version
98
- version: 0.23.6
98
+ version: 0.24.0.rc1
99
99
  type: :development
100
100
  prerelease: false
101
101
  version_requirements: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - '='
104
104
  - !ruby/object:Gem::Version
105
- version: 0.23.6
105
+ version: 0.24.0.rc1
106
106
  description: A debates component for decidim's participatory spaces.
107
107
  email:
108
108
  - josepjaume@gmail.com
@@ -115,17 +115,22 @@ extra_rdoc_files: []
115
115
  files:
116
116
  - README.md
117
117
  - Rakefile
118
+ - app/assets/config/admin/decidim_debates_manifest.js
118
119
  - app/assets/config/decidim_debates_manifest.js
119
120
  - app/assets/images/decidim/debates/icon.svg
120
121
  - app/assets/images/decidim/gamification/badges/commented_debates.svg
122
+ - app/assets/javascripts/decidim/debates/admin/debates.js.es6
121
123
  - app/cells/decidim/debates/debate_activity_cell.rb
122
124
  - app/cells/decidim/debates/debate_cell.rb
123
125
  - app/cells/decidim/debates/debate_m/data.erb
124
126
  - app/cells/decidim/debates/debate_m/footer.erb
125
127
  - app/cells/decidim/debates/debate_m/multiple_dates.erb
128
+ - app/cells/decidim/debates/debate_m/open_date.erb
126
129
  - app/cells/decidim/debates/debate_m/single_date.erb
127
130
  - app/cells/decidim/debates/debate_m/tags.erb
128
131
  - app/cells/decidim/debates/debate_m_cell.rb
132
+ - app/cells/decidim/debates/reported_content/show.erb
133
+ - app/cells/decidim/debates/reported_content_cell.rb
129
134
  - app/commands/decidim/debates/admin/close_debate.rb
130
135
  - app/commands/decidim/debates/admin/create_debate.rb
131
136
  - app/commands/decidim/debates/admin/update_debate.rb
@@ -167,8 +172,6 @@ files:
167
172
  - app/serializers/decidim/debates/data_portability_debate_serializer.rb
168
173
  - app/services/decidim/debates/debate_search.rb
169
174
  - app/services/decidim/debates/diff_renderer.rb
170
- - app/types/decidim/debates/debate_type.rb
171
- - app/types/decidim/debates/debates_type.rb
172
175
  - app/views/decidim/debates/admin/debate_closes/edit.html.erb
173
176
  - app/views/decidim/debates/admin/debates/_form.html.erb
174
177
  - app/views/decidim/debates/admin/debates/edit.html.erb
@@ -271,9 +274,15 @@ files:
271
274
  - db/migrate/20200716143929_add_endorsable_to_debates.rb
272
275
  - db/migrate/20200827154116_add_commentable_counter_cache_to_debates.rb
273
276
  - db/migrate/20200902133452_add_cached_comment_metadata_to_debates.rb
277
+ - db/migrate/20200930145546_add_scope_to_debates_debate.rb
278
+ - db/migrate/20201126112752_archive_debates.rb
279
+ - db/migrate/20210125101735_revert_archive_debates.rb
280
+ - lib/decidim/api/debate_type.rb
281
+ - lib/decidim/api/debates_type.rb
274
282
  - lib/decidim/debates.rb
275
283
  - lib/decidim/debates/admin.rb
276
284
  - lib/decidim/debates/admin_engine.rb
285
+ - lib/decidim/debates/api.rb
277
286
  - lib/decidim/debates/component.rb
278
287
  - lib/decidim/debates/engine.rb
279
288
  - lib/decidim/debates/test/factories.rb
@@ -290,14 +299,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
290
299
  requirements:
291
300
  - - ">="
292
301
  - !ruby/object:Gem::Version
293
- version: '2.6'
302
+ version: '2.7'
294
303
  required_rubygems_version: !ruby/object:Gem::Requirement
295
304
  requirements:
296
- - - ">="
305
+ - - ">"
297
306
  - !ruby/object:Gem::Version
298
- version: '0'
307
+ version: 1.3.1
299
308
  requirements: []
300
- rubygems_version: 3.0.3
309
+ rubygems_version: 3.1.2
301
310
  signing_key:
302
311
  specification_version: 4
303
312
  summary: Decidim debates module
@@ -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