decidim-debates 0.24.3 → 0.25.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/decidim/debates/versions_controller.rb +1 -1
  3. data/app/models/decidim/debates/debate.rb +8 -13
  4. data/app/packs/entrypoints/decidim_debates_admin.js +4 -0
  5. data/app/{assets/images/decidim/debates/icon.svg → packs/images/decidim/debates/decidim_debates.svg} +0 -0
  6. data/app/{assets/images/decidim/gamification/badges/commented_debates.svg → packs/images/decidim/gamification/badges/decidim_gamification_badges_commented_debates.svg} +0 -0
  7. data/app/{assets/javascripts/decidim/debates/admin/debates.js.es6 → packs/src/decidim/debates/admin/debates.js} +3 -3
  8. data/app/queries/decidim/debates/metrics/debates_metric_manage.rb +1 -1
  9. data/app/views/decidim/debates/admin/debates/_form.html.erb +1 -1
  10. data/app/views/decidim/debates/admin/debates/index.html.erb +2 -0
  11. data/app/views/decidim/debates/debates/_filters.html.erb +1 -1
  12. data/app/views/decidim/debates/debates/index.html.erb +0 -2
  13. data/app/views/decidim/debates/debates/show.html.erb +1 -1
  14. data/app/views/decidim/debates/versions/show.html.erb +1 -1
  15. data/config/assets.rb +8 -0
  16. data/config/locales/ca.yml +2 -0
  17. data/config/locales/cs.yml +2 -0
  18. data/config/locales/de.yml +2 -0
  19. data/config/locales/en.yml +3 -0
  20. data/config/locales/es-MX.yml +2 -0
  21. data/config/locales/es-PY.yml +2 -0
  22. data/config/locales/es.yml +2 -0
  23. data/config/locales/fi-plain.yml +2 -0
  24. data/config/locales/fi.yml +2 -0
  25. data/config/locales/fr-LU.yml +237 -0
  26. data/config/locales/gl.yml +2 -0
  27. data/config/locales/it.yml +53 -0
  28. data/config/locales/ja.yml +10 -0
  29. data/config/locales/lb-LU.yml +1 -0
  30. data/config/locales/nl.yml +2 -0
  31. data/config/locales/pl.yml +3 -1
  32. data/config/locales/pt-BR.yml +89 -0
  33. data/config/locales/ro-RO.yml +4 -0
  34. data/config/locales/sv.yml +2 -0
  35. data/db/migrate/20200708072042_fix_debates_i18n_fields.rb +1 -1
  36. data/lib/decidim/debates/admin_engine.rb +0 -4
  37. data/lib/decidim/debates/component.rb +4 -4
  38. data/lib/decidim/debates/engine.rb +30 -33
  39. data/lib/decidim/debates/version.rb +1 -1
  40. metadata +20 -53
  41. data/app/assets/config/admin/decidim_debates_manifest.js +0 -1
  42. data/app/assets/config/decidim_debates_manifest.js +0 -1
  43. data/config/locales/ja-JP.yml +0 -195
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_dependency "decidim/components/namer"
3
+ require "decidim/components/namer"
4
4
 
5
5
  Decidim.register_component(:debates) do |component|
6
6
  component.engine = Decidim::Debates::Engine
7
7
  component.admin_engine = Decidim::Debates::AdminEngine
8
- component.icon = "decidim/debates/icon.svg"
8
+ component.icon = "media/images/decidim_debates.svg"
9
9
  component.permissions_class_name = "Decidim::Debates::Permissions"
10
10
 
11
11
  component.query_type = "Decidim::Debates::DebatesType"
@@ -52,10 +52,10 @@ Decidim.register_component(:debates) do |component|
52
52
  resource.card = "decidim/debates/debate"
53
53
  resource.reported_content_cell = "decidim/debates/reported_content"
54
54
  resource.searchable = true
55
- resource.actions = %w(create endorse)
55
+ resource.actions = %w(create endorse comment)
56
56
  end
57
57
 
58
- component.actions = %w(create endorse)
58
+ component.actions = %w(create endorse comment)
59
59
 
60
60
  component.exports :comments do |exports|
61
61
  exports.collection do |component_instance|
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "searchlight"
4
- require "kaminari"
5
-
6
3
  module Decidim
7
4
  module Debates
8
5
  # This is the engine that runs on the public interface of `decidim-debates`.
@@ -23,12 +20,14 @@ module Decidim
23
20
  end
24
21
 
25
22
  initializer "decidim_changes" do
26
- Decidim::SettingsChange.subscribe "debates" do |changes|
27
- Decidim::Debates::SettingsChangeJob.perform_later(
28
- changes[:component_id],
29
- changes[:previous_settings],
30
- changes[:current_settings]
31
- )
23
+ config.to_prepare do
24
+ Decidim::SettingsChange.subscribe "debates" do |changes|
25
+ Decidim::Debates::SettingsChangeJob.perform_later(
26
+ changes[:component_id],
27
+ changes[:previous_settings],
28
+ changes[:current_settings]
29
+ )
30
+ end
32
31
  end
33
32
  end
34
33
 
@@ -37,10 +36,6 @@ module Decidim
37
36
  Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Debates::Engine.root}/app/views") # for partials
38
37
  end
39
38
 
40
- initializer "decidim_debates.assets" do |app|
41
- app.config.assets.precompile += %w(decidim_debates_manifest.js)
42
- end
43
-
44
39
  initializer "decidim.debates.commented_debates_badge" do
45
40
  Decidim::Gamification.register_badge(:commented_debates) do |badge|
46
41
  badge.levels = [1, 5, 10, 30, 50]
@@ -56,26 +51,28 @@ module Decidim
56
51
  end
57
52
  end
58
53
 
59
- Decidim::Comments::CommentCreation.subscribe do |data|
60
- comment = Decidim::Comments::Comment.find(data[:comment_id])
61
- next unless comment.decidim_root_commentable_type == "Decidim::Debates::Debate"
62
-
63
- if comment.user_group.present?
64
- comments = Decidim::Comments::Comment.where(
65
- decidim_root_commentable_id: comment.decidim_root_commentable_id,
66
- decidim_root_commentable_type: comment.decidim_root_commentable_type,
67
- user_group: comment.user_group
68
- )
69
-
70
- Decidim::Gamification.increment_score(comment.user_group, :commented_debates) if comments.count == 1
71
- elsif comment.author.present?
72
- comments = Decidim::Comments::Comment.where(
73
- decidim_root_commentable_id: comment.decidim_root_commentable_id,
74
- decidim_root_commentable_type: comment.decidim_root_commentable_type,
75
- author: comment.author
76
- )
77
-
78
- Decidim::Gamification.increment_score(comment.author, :commented_debates) if comments.count == 1
54
+ config.to_prepare do
55
+ Decidim::Comments::CommentCreation.subscribe do |data|
56
+ comment = Decidim::Comments::Comment.find(data[:comment_id])
57
+ next unless comment.decidim_root_commentable_type == "Decidim::Debates::Debate"
58
+
59
+ if comment.user_group.present?
60
+ comments = Decidim::Comments::Comment.where(
61
+ decidim_root_commentable_id: comment.decidim_root_commentable_id,
62
+ decidim_root_commentable_type: comment.decidim_root_commentable_type,
63
+ user_group: comment.user_group
64
+ )
65
+
66
+ Decidim::Gamification.increment_score(comment.user_group, :commented_debates) if comments.count == 1
67
+ elsif comment.author.present?
68
+ comments = Decidim::Comments::Comment.where(
69
+ decidim_root_commentable_id: comment.decidim_root_commentable_id,
70
+ decidim_root_commentable_type: comment.decidim_root_commentable_type,
71
+ author: comment.author
72
+ )
73
+
74
+ Decidim::Gamification.increment_score(comment.author, :commented_debates) if comments.count == 1
75
+ end
79
76
  end
80
77
  end
81
78
  end
@@ -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.24.3"
7
+ "0.25.0.rc1"
8
8
  end
9
9
  end
10
10
  end
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.24.3
4
+ version: 0.25.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-06-01 00:00:00.000000000 Z
14
+ date: 2021-07-28 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: decidim-comments
@@ -19,90 +19,56 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.24.3
22
+ version: 0.25.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.24.3
29
+ version: 0.25.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.24.3
36
+ version: 0.25.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.24.3
44
- - !ruby/object:Gem::Dependency
45
- name: kaminari
46
- requirement: !ruby/object:Gem::Requirement
47
- requirements:
48
- - - "~>"
49
- - !ruby/object:Gem::Version
50
- version: '1.2'
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: 1.2.1
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '1.2'
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: 1.2.1
64
- - !ruby/object:Gem::Dependency
65
- name: searchlight
66
- requirement: !ruby/object:Gem::Requirement
67
- requirements:
68
- - - "~>"
69
- - !ruby/object:Gem::Version
70
- version: '4.1'
71
- type: :runtime
72
- prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - "~>"
76
- - !ruby/object:Gem::Version
77
- version: '4.1'
43
+ version: 0.25.0.rc1
78
44
  - !ruby/object:Gem::Dependency
79
45
  name: decidim-admin
80
46
  requirement: !ruby/object:Gem::Requirement
81
47
  requirements:
82
48
  - - '='
83
49
  - !ruby/object:Gem::Version
84
- version: 0.24.3
50
+ version: 0.25.0.rc1
85
51
  type: :development
86
52
  prerelease: false
87
53
  version_requirements: !ruby/object:Gem::Requirement
88
54
  requirements:
89
55
  - - '='
90
56
  - !ruby/object:Gem::Version
91
- version: 0.24.3
57
+ version: 0.25.0.rc1
92
58
  - !ruby/object:Gem::Dependency
93
59
  name: decidim-dev
94
60
  requirement: !ruby/object:Gem::Requirement
95
61
  requirements:
96
62
  - - '='
97
63
  - !ruby/object:Gem::Version
98
- version: 0.24.3
64
+ version: 0.25.0.rc1
99
65
  type: :development
100
66
  prerelease: false
101
67
  version_requirements: !ruby/object:Gem::Requirement
102
68
  requirements:
103
69
  - - '='
104
70
  - !ruby/object:Gem::Version
105
- version: 0.24.3
71
+ version: 0.25.0.rc1
106
72
  description: A debates component for decidim's participatory spaces.
107
73
  email:
108
74
  - josepjaume@gmail.com
@@ -115,11 +81,6 @@ extra_rdoc_files: []
115
81
  files:
116
82
  - README.md
117
83
  - Rakefile
118
- - app/assets/config/admin/decidim_debates_manifest.js
119
- - app/assets/config/decidim_debates_manifest.js
120
- - app/assets/images/decidim/debates/icon.svg
121
- - app/assets/images/decidim/gamification/badges/commented_debates.svg
122
- - app/assets/javascripts/decidim/debates/admin/debates.js.es6
123
84
  - app/cells/decidim/debates/debate_activity_cell.rb
124
85
  - app/cells/decidim/debates/debate_cell.rb
125
86
  - app/cells/decidim/debates/debate_m/data.erb
@@ -159,6 +120,10 @@ files:
159
120
  - app/jobs/decidim/debates/settings_change_job.rb
160
121
  - app/models/decidim/debates/application_record.rb
161
122
  - app/models/decidim/debates/debate.rb
123
+ - app/packs/entrypoints/decidim_debates_admin.js
124
+ - app/packs/images/decidim/debates/decidim_debates.svg
125
+ - app/packs/images/decidim/gamification/badges/decidim_gamification_badges_commented_debates.svg
126
+ - app/packs/src/decidim/debates/admin/debates.js
162
127
  - app/permissions/decidim/debates/admin/permissions.rb
163
128
  - app/permissions/decidim/debates/permissions.rb
164
129
  - app/presenters/decidim/debates/admin_log/debate_presenter.rb
@@ -191,6 +156,7 @@ files:
191
156
  - app/views/decidim/debates/debates/show.html.erb
192
157
  - app/views/decidim/debates/versions/index.html.erb
193
158
  - app/views/decidim/debates/versions/show.html.erb
159
+ - config/assets.rb
194
160
  - config/locales/am-ET.yml
195
161
  - config/locales/ar-SA.yml
196
162
  - config/locales/ar.yml
@@ -217,6 +183,7 @@ files:
217
183
  - config/locales/fi-plain.yml
218
184
  - config/locales/fi.yml
219
185
  - config/locales/fr-CA.yml
186
+ - config/locales/fr-LU.yml
220
187
  - config/locales/fr.yml
221
188
  - config/locales/ga-IE.yml
222
189
  - config/locales/gl.yml
@@ -227,10 +194,10 @@ files:
227
194
  - config/locales/is-IS.yml
228
195
  - config/locales/is.yml
229
196
  - config/locales/it.yml
230
- - config/locales/ja-JP.yml
231
197
  - config/locales/ja.yml
232
198
  - config/locales/ko-KR.yml
233
199
  - config/locales/ko.yml
200
+ - config/locales/lb-LU.yml
234
201
  - config/locales/lt-LT.yml
235
202
  - config/locales/lt.yml
236
203
  - config/locales/lv.yml
@@ -303,11 +270,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
303
270
  version: '2.7'
304
271
  required_rubygems_version: !ruby/object:Gem::Requirement
305
272
  requirements:
306
- - - ">="
273
+ - - ">"
307
274
  - !ruby/object:Gem::Version
308
- version: '0'
275
+ version: 1.3.1
309
276
  requirements: []
310
- rubygems_version: 3.1.2
277
+ rubygems_version: 3.1.4
311
278
  signing_key:
312
279
  specification_version: 4
313
280
  summary: Decidim debates module
@@ -1 +0,0 @@
1
- //= link decidim/debates/admin/debates.js
@@ -1 +0,0 @@
1
- //= link_tree ../images/decidim
@@ -1,195 +0,0 @@
1
- ja:
2
- activemodel:
3
- attributes:
4
- debate:
5
- category_id: カテゴリ
6
- closed_at: 終了日時
7
- conclusions: まとめ
8
- decidim_category_id: カテゴリ
9
- description: 説明
10
- end_time: 終了時刻
11
- information_updates: 情報の更新
12
- instructions: Instructions to participate
13
- start_time: 開始
14
- title: タイトル
15
- user_group_id: ディベートを作成
16
- models:
17
- decidim/debates/close_debate_event: ディベートが終了しました
18
- decidim/debates/create_debate_event: ディベート
19
- decidim/debates/creation_disabled_event: ディベートは無効です
20
- decidim/debates/creation_enabled_event: ディベートは有効です
21
- activerecord:
22
- models:
23
- decidim/debates/debate:
24
- other: ディベート数
25
- decidim:
26
- components:
27
- debates:
28
- actions:
29
- create: 作成
30
- name: ディベート数
31
- settings:
32
- global:
33
- announcement: お知らせ
34
- comments_enabled: コメントは有効です
35
- comments_max_length: コメント最大長 (デフォルト値は 0 のまま)
36
- step:
37
- announcement: お知らせ
38
- comments_blocked: コメントがブロックされました
39
- creation_enabled: 参加者によるディベートの作成が有効になりました
40
- debates:
41
- actions:
42
- close: 閉じる
43
- confirm_destroy: よろしいですか?
44
- destroy: 削除
45
- edit: 編集
46
- new: 新しい %{name}
47
- title: アクション
48
- admin:
49
- debate_closes:
50
- edit:
51
- close: 閉じる
52
- title: 議論を閉じる
53
- debates:
54
- create:
55
- invalid: 議論を起こすのに問題があった。
56
- success: ディベートが正常に作成されました。
57
- destroy:
58
- success: ディベートを削除しました。
59
- edit:
60
- title: ディベートを編集
61
- update: 討論を更新
62
- index:
63
- title: ディベート数
64
- new:
65
- create: ディベートを作成
66
- title: 新しい議論
67
- update:
68
- invalid: この議論を更新する際に問題が発生しました。
69
- success: ディベートが正常に更新されました。
70
- models:
71
- debate:
72
- name: ディベート
73
- admin_log:
74
- debate:
75
- close: "%{user_name} は、 %{resource_name} スペースの %{space_name} 議論を終了しました"
76
- create: "%{user_name} が %{resource_name} スペースで %{space_name} ディベートを作成しました"
77
- update: "%{user_name} が %{resource_name} スペースの %{space_name} ディベートを更新しました"
78
- debates:
79
- close:
80
- invalid: 議論を閉じるのに失敗しました。
81
- success: 議論が正常に終了しました。
82
- close_debate_modal:
83
- close: 閉じる
84
- description: この討論の要約または結論は何ですか?
85
- send: 議論を閉じる
86
- closed: 終了
87
- count:
88
- debates_count:
89
- other: "%{count} 個のディベート数"
90
- create:
91
- invalid: 議論を起こすのに問題があった。
92
- success: ディベートが正常に作成されました。
93
- debate:
94
- participate: 参加
95
- edit:
96
- back: 戻る
97
- save: 変更を保存
98
- title: ディベートを編集
99
- filters:
100
- all: すべて
101
- category: カテゴリ
102
- category_prompt: カテゴリを選択
103
- citizens: Citizens
104
- official: オフィシャル
105
- origin: 原点:
106
- search: 検索
107
- filters_small_view:
108
- close_modal: モーダルを閉じる
109
- filter: フィルター
110
- filter_by: フィルター
111
- unfold: 展開する
112
- form:
113
- select_a_category: カテゴリを選択してください
114
- index:
115
- new_debate: 新しい議論
116
- new:
117
- back: 戻る
118
- create: 作成
119
- title: 新しい議論
120
- show:
121
- back: リストに戻る
122
- close_debate: 議論を終了する
123
- date: 日付
124
- debate_closed: 終了
125
- debate_conclusions_are: '議論は %{date} に、以下の結論を持って終了しました。'
126
- edit_conclusions: 結論を編集
127
- edit_debate: ディベートを編集
128
- update:
129
- invalid: 議論の更新に問題がありました。
130
- success: ディベートが正常に更新されました。
131
- versions:
132
- debates:
133
- back_to_resource: 討論に戻る
134
- index:
135
- title: バージョン
136
- versions_list:
137
- back_to_resource: 討論に戻る
138
- last_activity:
139
- new_debate_at_html: "<span> %{link}での新しいディベート</span>"
140
- models:
141
- debate:
142
- fields:
143
- end_time: 終了日
144
- official_debate: 公式の議論
145
- start_time: 開始日
146
- title: タイトル
147
- events:
148
- debates:
149
- create_debate_event:
150
- space_followers:
151
- email_intro: |-
152
- こんにちは、
153
- %{resource_title}参加スペースに新しいディベート「 %{space_title} 」が作成されました。チェックして貢献:
154
- email_outro: '%{space_title} の参加スペースをフォローしているため、この通知を受信しました。前のリンクに続く通知の受信を停止できます。'
155
- email_subject: '%{resource_title}に新しいディベーション " %{space_title}"'
156
- notification_title: <a href="%{resource_path}">%{resource_title}</a> のディベートは <a href="%{space_path}">%{space_title}</a> に作成されました。
157
- user_followers:
158
- email_intro: |-
159
- こんにちは、
160
- %{author_name} %{author_nickname}さん、あなたがフォローしている人が新しいディベート「%{resource_title}」を作成しました。チェックして貢献してください:
161
- email_outro: '%{author_nickname}をフォローしているため、この通知を受け取りました。前のリンクに続く通知の受信を停止することができます。'
162
- email_subject: '%{resource_title}による新しい議論 " %{author_nickname}"'
163
- notification_title: <a href="%{author_path}">%{author_name} %{author_nickname}</a> が <a href="%{resource_path}">%{resource_title}</a> ディベートを作成しました。
164
- creation_disabled:
165
- email_intro: 'ディベートの作成は %{participatory_space_title}で行われなくなりました。このページからまだディベートに参加できます:'
166
- email_outro: '%{participatory_space_title}をフォローしているため、この通知を受け取りました。前のリンクに続く通知の受信を停止することができます。'
167
- email_subject: '%{participatory_space_title} でディベートの作成が無効になりました'
168
- notification_title: ディベートの作成は <a href="%{participatory_space_url}">%{participatory_space_title}</a> で無効になりました
169
- creation_enabled:
170
- email_intro: '%{participatory_space_title}で新しいディベートを開始できます! このページに参加してください:'
171
- email_outro: '%{participatory_space_title}をフォローしているため、この通知を受け取りました。前のリンクに続く通知の受信を停止することができます。'
172
- email_subject: ディベートは %{participatory_space_title} で利用可能になりました
173
- notification_title: <a href="%{participatory_space_url}">%{participatory_space_title}</a> 内で <a href="%{resource_path}">新しい討論</a> を開始できます。
174
- debate_closed:
175
- email_intro: '「%{resource_title}」の議論は終了しました。そのページから結論を読むことができます。'
176
- email_outro: '%{resource_title} をフォローしているため、この通知を受け取りました。前のリンクから通知の受信を停止することができます。'
177
- email_subject: '「%{resource_title}」の議論は終了しました'
178
- notification_title: <a href="%{resource_path}">%{resource_title}</a> の議論は終了しました。
179
- gamification:
180
- badges:
181
- commented_debates:
182
- conditions:
183
- - 参加する公開討論を選択する
184
- description: このバッジは、コメントを残してさまざまなディベートに積極的に参加するときに付与されます。
185
- description_another: この参加者は %{score} 討論に参加しました。
186
- description_own: '%{score} 件のディベートに参加しました。'
187
- name: ディベート数
188
- next_level_in: さらに %{score} のディベートに参加して、次のレベルに到達しましょう!
189
- unearned_another: この参加者はまだ議論に参加していません。
190
- unearned_own: まだディベートに参加していません。
191
- metrics:
192
- debates:
193
- description: 作成されたディベート数
194
- object: 討論会
195
- title: ディベート数