decidim-blogs 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 (77) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/decidim/blogs/icon.svg +1 -3
  3. data/app/cells/decidim/blogs/post_m/footer.erb +1 -1
  4. data/app/cells/decidim/blogs/post_m_cell.rb +6 -0
  5. data/app/controllers/decidim/blogs/posts_controller.rb +2 -0
  6. data/app/helpers/decidim/blogs/application_helper.rb +2 -0
  7. data/app/models/decidim/blogs/post.rb +21 -0
  8. data/app/types/decidim/blogs/blogs_type.rb +30 -0
  9. data/app/types/decidim/blogs/post_input_filter.rb +29 -0
  10. data/app/types/decidim/blogs/post_input_sort.rb +15 -0
  11. data/app/types/decidim/blogs/post_type.rb +24 -0
  12. data/app/views/decidim/blogs/posts/_posts.html.erb +4 -4
  13. data/app/views/decidim/blogs/posts/_sidebar_blog.html.erb +2 -2
  14. data/app/views/decidim/blogs/posts/show.html.erb +34 -9
  15. data/config/locales/am-ET.yml +1 -0
  16. data/config/locales/bg-BG.yml +13 -0
  17. data/config/locales/bg.yml +13 -0
  18. data/config/locales/ca.yml +5 -0
  19. data/config/locales/cs.yml +17 -12
  20. data/config/locales/da-DK.yml +1 -0
  21. data/config/locales/da.yml +1 -0
  22. data/config/locales/de.yml +5 -0
  23. data/config/locales/el-GR.yml +1 -0
  24. data/config/locales/el.yml +84 -0
  25. data/config/locales/en.yml +5 -0
  26. data/config/locales/eo.yml +1 -0
  27. data/config/locales/es-MX.yml +5 -0
  28. data/config/locales/es-PY.yml +5 -0
  29. data/config/locales/es.yml +5 -0
  30. data/config/locales/et-EE.yml +1 -0
  31. data/config/locales/et.yml +1 -0
  32. data/config/locales/fi-plain.yml +5 -0
  33. data/config/locales/fi.yml +9 -4
  34. data/config/locales/fr-CA.yml +84 -0
  35. data/config/locales/fr.yml +5 -0
  36. data/config/locales/ga-IE.yml +1 -0
  37. data/config/locales/hr-HR.yml +1 -0
  38. data/config/locales/hr.yml +1 -0
  39. data/config/locales/hu.yml +4 -0
  40. data/config/locales/is-IS.yml +56 -0
  41. data/config/locales/is.yml +56 -0
  42. data/config/locales/it.yml +5 -0
  43. data/config/locales/ja-JP.yml +83 -0
  44. data/config/locales/ja.yml +83 -0
  45. data/config/locales/ko-KR.yml +1 -0
  46. data/config/locales/ko.yml +1 -0
  47. data/config/locales/lt-LT.yml +1 -0
  48. data/config/locales/lt.yml +1 -0
  49. data/config/locales/lv.yml +84 -0
  50. data/config/locales/mt-MT.yml +1 -0
  51. data/config/locales/mt.yml +1 -0
  52. data/config/locales/nl.yml +5 -0
  53. data/config/locales/no.yml +58 -0
  54. data/config/locales/om-ET.yml +1 -0
  55. data/config/locales/pl.yml +34 -29
  56. data/config/locales/pt-BR.yml +1 -1
  57. data/config/locales/pt.yml +29 -24
  58. data/config/locales/ro-RO.yml +85 -0
  59. data/config/locales/sk-SK.yml +85 -0
  60. data/config/locales/sk.yml +85 -0
  61. data/config/locales/sl.yml +5 -0
  62. data/config/locales/so-SO.yml +1 -0
  63. data/config/locales/sr-CS.yml +13 -0
  64. data/config/locales/sv.yml +5 -0
  65. data/config/locales/ti-ER.yml +1 -0
  66. data/config/locales/vi-VN.yml +1 -0
  67. data/config/locales/vi.yml +1 -0
  68. data/config/locales/zh-CN.yml +83 -0
  69. data/config/locales/zh-TW.yml +1 -0
  70. data/db/migrate/20191212162606_add_user_group_author_to_blogs.rb +7 -0
  71. data/db/migrate/20200128094730_add_endorsements_counter_cache_to_blogs.rb +7 -0
  72. data/db/migrate/20200320105910_index_foreign_keys_in_decidim_blogs_posts.rb +7 -0
  73. data/db/migrate/20200827153709_add_commentable_counter_cache_to_posts.rb +9 -0
  74. data/lib/decidim/blogs/component.rb +9 -0
  75. data/lib/decidim/blogs/test/factories.rb +8 -0
  76. data/lib/decidim/blogs/version.rb +1 -1
  77. metadata +70 -19
@@ -0,0 +1,5 @@
1
+ sl:
2
+ decidim:
3
+ blogs:
4
+ actions:
5
+ destroy: Izbriši
@@ -0,0 +1 @@
1
+ so:
@@ -0,0 +1,13 @@
1
+ sr:
2
+ decidim:
3
+ blogs:
4
+ posts:
5
+ show:
6
+ back: Nazad na listu
7
+ comments: Komentari
8
+ components:
9
+ blogs:
10
+ settings:
11
+ step:
12
+ endorsements_blocked: Podržavanja su onemogućena
13
+ endorsements_enabled: Podržavanja su omogućena
@@ -48,6 +48,8 @@ sv:
48
48
  title: titel
49
49
  posts:
50
50
  show:
51
+ back: Tillbaka till listan
52
+ comments: Kommentarer
51
53
  view: Visa
52
54
  sidebar_blog:
53
55
  comments: kommentarer
@@ -60,9 +62,12 @@ sv:
60
62
  global:
61
63
  announcement: Meddelande
62
64
  comments_enabled: Kommentarer aktiverade
65
+ comments_max_length: Maximal längd för kommentarer (Lämna 0 för standardvärde)
63
66
  step:
64
67
  announcement: Meddelande
65
68
  comments_blocked: Kommentarer blockerade
69
+ endorsements_blocked: Instämmanden är blockerade
70
+ endorsements_enabled: Instämmanden tillåtna
66
71
  events:
67
72
  blogs:
68
73
  post_created:
@@ -0,0 +1 @@
1
+ ti:
@@ -0,0 +1 @@
1
+ vi:
@@ -0,0 +1 @@
1
+ vi:
@@ -0,0 +1,83 @@
1
+ zh-CN:
2
+ activemodel:
3
+ models:
4
+ decidim/blogs/create_post_event: 新博客文章
5
+ activerecord:
6
+ models:
7
+ decidim/blogs/post:
8
+ other: 员额
9
+ decidim:
10
+ blogs:
11
+ actions:
12
+ confirm_destroy: 您确定要删除此帖子?
13
+ destroy: 删除
14
+ edit: 编辑
15
+ new: 新建帖子
16
+ title: 行动
17
+ admin:
18
+ models:
19
+ components:
20
+ body: 正文内容
21
+ post:
22
+ name: 帖子
23
+ posts:
24
+ create:
25
+ invalid: 创建这个帖子时出错
26
+ success: 帖子创建成功
27
+ destroy:
28
+ success: 帖子已成功删除
29
+ edit:
30
+ save: 更新
31
+ index:
32
+ title: 员额
33
+ new:
34
+ create: 创建
35
+ title: 创建帖子
36
+ update:
37
+ invalid: 保存帖子时出错。
38
+ success: 帖子保存成功
39
+ last_activity:
40
+ new_post_at_html: "<span>在 %{link}的新帖</span>"
41
+ models:
42
+ post:
43
+ fields:
44
+ author: 作者
45
+ body: 正文内容
46
+ created_at: 创建于
47
+ title: 标题
48
+ posts:
49
+ show:
50
+ back: 返回列表
51
+ comments: 评论
52
+ view: 查看
53
+ sidebar_blog:
54
+ comments: 评论
55
+ most_commented_posts: 评论最多的帖子
56
+ read_more: 阅读更多
57
+ components:
58
+ blogs:
59
+ name: 博客
60
+ settings:
61
+ global:
62
+ announcement: 通 知
63
+ comments_enabled: 评论已启用
64
+ comments_max_length: 评论最大长度 (默认值留0)
65
+ step:
66
+ announcement: 通 知
67
+ comments_blocked: 评论已阻止
68
+ endorsements_blocked: 已阻止授权
69
+ endorsements_enabled: 授权已启用
70
+ events:
71
+ blogs:
72
+ post_created:
73
+ email_intro: 帖子"%{resource_title}" 已经发布在"%{participatory_space_title}",您关注的是这个帖子。
74
+ email_outro: 您收到此通知是因为您正在关注 "%{participatory_space_title}"。您可以从上一个链接取消关注它。
75
+ email_subject: 新帖子发布于 %{participatory_space_title}
76
+ notification_title: 帖子 <a href="%{resource_path}">%{resource_title}</a> 已经在 %{participatory_space_title} 中发布
77
+ pages:
78
+ home:
79
+ statistics:
80
+ posts_count: 员额
81
+ participatory_processes:
82
+ statistics:
83
+ posts_count: 员额
@@ -0,0 +1 @@
1
+ zh-TW:
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddUserGroupAuthorToBlogs < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_blogs_posts, :decidim_user_group_id, :integer
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddEndorsementsCounterCacheToBlogs < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_blogs_posts, :endorsements_count, :integer, null: false, default: 0
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class IndexForeignKeysInDecidimBlogsPosts < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_index :decidim_blogs_posts, :decidim_user_group_id
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddCommentableCounterCacheToPosts < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_blogs_posts, :comments_count, :integer, null: false, default: 0, index: true
6
+ Decidim::Blogs::Post.reset_column_information
7
+ Decidim::Blogs::Post.find_each(&:update_comments_count)
8
+ end
9
+ end
@@ -8,6 +8,8 @@ Decidim.register_component(:blogs) do |component|
8
8
  component.icon = "decidim/blogs/icon.svg"
9
9
  component.permissions_class_name = "Decidim::Blog::Permissions"
10
10
 
11
+ component.query_type = "Decidim::Blogs::BlogsType"
12
+
11
13
  component.on(:before_destroy) do |instance|
12
14
  raise StandardError, "Can't remove this component" if Decidim::Blogs::Post.where(component: instance).any?
13
15
  end
@@ -16,19 +18,26 @@ Decidim.register_component(:blogs) do |component|
16
18
  Decidim::Blogs::Post.where(component: components).count
17
19
  end
18
20
 
21
+ component.actions = %w(endorse vote create withdraw amend)
22
+
19
23
  component.settings(:global) do |settings|
20
24
  settings.attribute :announcement, type: :text, translated: true, editor: true
21
25
  settings.attribute :comments_enabled, type: :boolean, default: true
26
+ settings.attribute :comments_max_length, type: :integer, required: false
22
27
  end
23
28
 
24
29
  component.settings(:step) do |settings|
25
30
  settings.attribute :announcement, type: :text, translated: true, editor: true
26
31
  settings.attribute :comments_blocked, type: :boolean, default: false
32
+ settings.attribute :endorsements_enabled, type: :boolean, default: true
33
+ settings.attribute :endorsements_blocked, type: :boolean
27
34
  end
28
35
 
29
36
  component.register_resource(:blogpost) do |resource|
30
37
  resource.model_class_name = "Decidim::Blogs::Post"
31
38
  resource.card = "decidim/blogs/post"
39
+ resource.actions = %w(endorse vote amend)
40
+ resource.searchable = true
32
41
  end
33
42
 
34
43
  component.seeds do |participatory_space|
@@ -16,5 +16,13 @@ FactoryBot.define do
16
16
  body { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
17
17
  component { build(:component, manifest_name: "blogs") }
18
18
  author { build(:user, :confirmed, organization: component.organization) }
19
+
20
+ trait :with_endorsements do
21
+ after :create do |post|
22
+ 5.times.collect do
23
+ create(:endorsement, resource: post, author: build(:user, organization: post.participatory_space.organization))
24
+ end
25
+ end
26
+ end
19
27
  end
20
28
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-pages version.
5
5
  module Blogs
6
6
  def self.version
7
- "0.19.1"
7
+ "0.23.0"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-blogs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.1
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Massot Gil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-13 00:00:00.000000000 Z
11
+ date: 2020-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-admin
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.19.1
19
+ version: 0.23.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.19.1
26
+ version: 0.23.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: decidim-comments
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.19.1
33
+ version: 0.23.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.19.1
40
+ version: 0.23.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: decidim-core
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.19.1
47
+ version: 0.23.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.19.1
54
+ version: 0.23.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: httparty
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -86,70 +86,76 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.1'
89
+ version: '1.2'
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: 1.2.1
90
93
  type: :runtime
91
94
  prerelease: false
92
95
  version_requirements: !ruby/object:Gem::Requirement
93
96
  requirements:
94
97
  - - "~>"
95
98
  - !ruby/object:Gem::Version
96
- version: '1.1'
99
+ version: '1.2'
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: 1.2.1
97
103
  - !ruby/object:Gem::Dependency
98
104
  name: decidim-admin
99
105
  requirement: !ruby/object:Gem::Requirement
100
106
  requirements:
101
107
  - - '='
102
108
  - !ruby/object:Gem::Version
103
- version: 0.19.1
109
+ version: 0.23.0
104
110
  type: :development
105
111
  prerelease: false
106
112
  version_requirements: !ruby/object:Gem::Requirement
107
113
  requirements:
108
114
  - - '='
109
115
  - !ruby/object:Gem::Version
110
- version: 0.19.1
116
+ version: 0.23.0
111
117
  - !ruby/object:Gem::Dependency
112
118
  name: decidim-assemblies
113
119
  requirement: !ruby/object:Gem::Requirement
114
120
  requirements:
115
121
  - - '='
116
122
  - !ruby/object:Gem::Version
117
- version: 0.19.1
123
+ version: 0.23.0
118
124
  type: :development
119
125
  prerelease: false
120
126
  version_requirements: !ruby/object:Gem::Requirement
121
127
  requirements:
122
128
  - - '='
123
129
  - !ruby/object:Gem::Version
124
- version: 0.19.1
130
+ version: 0.23.0
125
131
  - !ruby/object:Gem::Dependency
126
132
  name: decidim-dev
127
133
  requirement: !ruby/object:Gem::Requirement
128
134
  requirements:
129
135
  - - '='
130
136
  - !ruby/object:Gem::Version
131
- version: 0.19.1
137
+ version: 0.23.0
132
138
  type: :development
133
139
  prerelease: false
134
140
  version_requirements: !ruby/object:Gem::Requirement
135
141
  requirements:
136
142
  - - '='
137
143
  - !ruby/object:Gem::Version
138
- version: 0.19.1
144
+ version: 0.23.0
139
145
  - !ruby/object:Gem::Dependency
140
146
  name: decidim-participatory_processes
141
147
  requirement: !ruby/object:Gem::Requirement
142
148
  requirements:
143
149
  - - '='
144
150
  - !ruby/object:Gem::Version
145
- version: 0.19.1
151
+ version: 0.23.0
146
152
  type: :development
147
153
  prerelease: false
148
154
  version_requirements: !ruby/object:Gem::Requirement
149
155
  requirements:
150
156
  - - '='
151
157
  - !ruby/object:Gem::Version
152
- version: 0.19.1
158
+ version: 0.23.0
153
159
  description: A Blog component for decidim's participatory spaces.
154
160
  email:
155
161
  - isaac.mg@coditramuntana.com
@@ -181,6 +187,10 @@ files:
181
187
  - app/models/decidim/blogs/post.rb
182
188
  - app/permissions/decidim/blog/permissions.rb
183
189
  - app/presenters/decidim/blogs/post_presenter.rb
190
+ - app/types/decidim/blogs/blogs_type.rb
191
+ - app/types/decidim/blogs/post_input_filter.rb
192
+ - app/types/decidim/blogs/post_input_sort.rb
193
+ - app/types/decidim/blogs/post_type.rb
184
194
  - app/views/decidim/blogs/admin/posts/_form.html.erb
185
195
  - app/views/decidim/blogs/admin/posts/edit.html.erb
186
196
  - app/views/decidim/blogs/admin/posts/index.html.erb
@@ -190,38 +200,79 @@ files:
190
200
  - app/views/decidim/blogs/posts/_sidebar_blog.html.erb
191
201
  - app/views/decidim/blogs/posts/index.html.erb
192
202
  - app/views/decidim/blogs/posts/show.html.erb
203
+ - config/locales/am-ET.yml
193
204
  - config/locales/ar-SA.yml
194
205
  - config/locales/ar.yml
206
+ - config/locales/bg-BG.yml
207
+ - config/locales/bg.yml
195
208
  - config/locales/ca.yml
196
209
  - config/locales/cs-CZ.yml
197
210
  - config/locales/cs.yml
211
+ - config/locales/da-DK.yml
212
+ - config/locales/da.yml
198
213
  - config/locales/de.yml
214
+ - config/locales/el-GR.yml
215
+ - config/locales/el.yml
199
216
  - config/locales/en.yml
200
217
  - config/locales/eo-UY.yml
218
+ - config/locales/eo.yml
201
219
  - config/locales/es-MX.yml
202
220
  - config/locales/es-PY.yml
203
221
  - config/locales/es.yml
222
+ - config/locales/et-EE.yml
223
+ - config/locales/et.yml
204
224
  - config/locales/eu.yml
205
225
  - config/locales/fi-pl.yml
206
226
  - config/locales/fi-plain.yml
207
227
  - config/locales/fi.yml
228
+ - config/locales/fr-CA.yml
208
229
  - config/locales/fr.yml
230
+ - config/locales/ga-IE.yml
209
231
  - config/locales/gl.yml
232
+ - config/locales/hr-HR.yml
233
+ - config/locales/hr.yml
210
234
  - config/locales/hu.yml
211
235
  - config/locales/id-ID.yml
236
+ - config/locales/is-IS.yml
237
+ - config/locales/is.yml
212
238
  - config/locales/it.yml
239
+ - config/locales/ja-JP.yml
240
+ - config/locales/ja.yml
241
+ - config/locales/ko-KR.yml
242
+ - config/locales/ko.yml
243
+ - config/locales/lt-LT.yml
244
+ - config/locales/lt.yml
245
+ - config/locales/lv.yml
246
+ - config/locales/mt-MT.yml
247
+ - config/locales/mt.yml
213
248
  - config/locales/nl.yml
214
249
  - config/locales/no.yml
250
+ - config/locales/om-ET.yml
215
251
  - config/locales/pl.yml
216
252
  - config/locales/pt-BR.yml
217
253
  - config/locales/pt.yml
254
+ - config/locales/ro-RO.yml
218
255
  - config/locales/ru.yml
256
+ - config/locales/sk-SK.yml
257
+ - config/locales/sk.yml
258
+ - config/locales/sl.yml
259
+ - config/locales/so-SO.yml
260
+ - config/locales/sr-CS.yml
219
261
  - config/locales/sv.yml
262
+ - config/locales/ti-ER.yml
220
263
  - config/locales/tr-TR.yml
221
264
  - config/locales/uk.yml
265
+ - config/locales/vi-VN.yml
266
+ - config/locales/vi.yml
267
+ - config/locales/zh-CN.yml
268
+ - config/locales/zh-TW.yml
222
269
  - db/migrate/20171129131353_create_decidim_blogs_posts.rb
223
270
  - db/migrate/20171211084630_add_author_to_decidim_blogs_posts.rb
224
271
  - db/migrate/20181017084519_make_blogposts_authors_polymorphics.rb
272
+ - db/migrate/20191212162606_add_user_group_author_to_blogs.rb
273
+ - db/migrate/20200128094730_add_endorsements_counter_cache_to_blogs.rb
274
+ - db/migrate/20200320105910_index_foreign_keys_in_decidim_blogs_posts.rb
275
+ - db/migrate/20200827153709_add_commentable_counter_cache_to_posts.rb
225
276
  - lib/decidim/blogs.rb
226
277
  - lib/decidim/blogs/admin.rb
227
278
  - lib/decidim/blogs/admin_engine.rb
@@ -241,7 +292,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
241
292
  requirements:
242
293
  - - ">="
243
294
  - !ruby/object:Gem::Version
244
- version: '2.5'
295
+ version: '2.6'
245
296
  required_rubygems_version: !ruby/object:Gem::Requirement
246
297
  requirements:
247
298
  - - ">="