decidim-blogs 0.20.1 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) 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 +13 -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.yml +84 -0
  24. data/config/locales/en.yml +5 -0
  25. data/config/locales/eo.yml +1 -0
  26. data/config/locales/es-MX.yml +5 -0
  27. data/config/locales/es-PY.yml +5 -0
  28. data/config/locales/es.yml +5 -0
  29. data/config/locales/et-EE.yml +1 -0
  30. data/config/locales/et.yml +1 -0
  31. data/config/locales/fi-plain.yml +5 -0
  32. data/config/locales/fi.yml +9 -4
  33. data/config/locales/fr-CA.yml +84 -0
  34. data/config/locales/fr.yml +5 -0
  35. data/config/locales/ga-IE.yml +1 -0
  36. data/config/locales/hr-HR.yml +1 -0
  37. data/config/locales/hr.yml +1 -0
  38. data/config/locales/hu.yml +4 -0
  39. data/config/locales/is.yml +56 -0
  40. data/config/locales/it.yml +5 -0
  41. data/config/locales/ja-JP.yml +83 -0
  42. data/config/locales/ja.yml +83 -0
  43. data/config/locales/ko-KR.yml +1 -0
  44. data/config/locales/ko.yml +1 -0
  45. data/config/locales/lt-LT.yml +1 -0
  46. data/config/locales/lt.yml +1 -0
  47. data/config/locales/lv.yml +84 -0
  48. data/config/locales/mt-MT.yml +1 -0
  49. data/config/locales/mt.yml +1 -0
  50. data/config/locales/nl.yml +5 -0
  51. data/config/locales/no.yml +5 -0
  52. data/config/locales/om-ET.yml +1 -0
  53. data/config/locales/pl.yml +34 -29
  54. data/config/locales/pt-BR.yml +1 -1
  55. data/config/locales/pt.yml +29 -24
  56. data/config/locales/ro-RO.yml +85 -0
  57. data/config/locales/sk-SK.yml +85 -0
  58. data/config/locales/sk.yml +85 -0
  59. data/config/locales/sl.yml +5 -0
  60. data/config/locales/so-SO.yml +1 -0
  61. data/config/locales/sr-CS.yml +13 -0
  62. data/config/locales/sv.yml +5 -0
  63. data/config/locales/ti-ER.yml +1 -0
  64. data/config/locales/vi-VN.yml +1 -0
  65. data/config/locales/vi.yml +1 -0
  66. data/config/locales/zh-CN.yml +83 -0
  67. data/config/locales/zh-TW.yml +1 -0
  68. data/db/migrate/20191212162606_add_user_group_author_to_blogs.rb +7 -0
  69. data/db/migrate/20200128094730_add_endorsements_counter_cache_to_blogs.rb +7 -0
  70. data/db/migrate/20200320105910_index_foreign_keys_in_decidim_blogs_posts.rb +7 -0
  71. data/db/migrate/20200827153709_add_commentable_counter_cache_to_posts.rb +9 -0
  72. data/lib/decidim/blogs/component.rb +8 -0
  73. data/lib/decidim/blogs/test/factories.rb +8 -0
  74. data/lib/decidim/blogs/version.rb +1 -1
  75. metadata +69 -20
@@ -0,0 +1,85 @@
1
+ ro:
2
+ activemodel:
3
+ models:
4
+ decidim/blogs/create_post_event: Postare nouă pe blog
5
+ activerecord:
6
+ models:
7
+ decidim/blogs/post:
8
+ one: Postează
9
+ few: Mesaje
10
+ other: Mesaje
11
+ decidim:
12
+ blogs:
13
+ actions:
14
+ confirm_destroy: Sunteţi sigur că doriţi să ştergeţi acest post?
15
+ destroy: Ștergere
16
+ edit: Editare
17
+ new: Postare nouă
18
+ title: Acțiuni
19
+ admin:
20
+ models:
21
+ components:
22
+ body: Corp
23
+ post:
24
+ name: Postează
25
+ posts:
26
+ create:
27
+ invalid: A apărut o eroare la crearea acestei postări
28
+ success: Postare creată cu succes
29
+ destroy:
30
+ success: Postare stearsa cu succes
31
+ edit:
32
+ save: Actualizare
33
+ index:
34
+ title: Mesaje
35
+ new:
36
+ create: Crează
37
+ title: Crează postare
38
+ update:
39
+ invalid: A apărut o eroare la salvarea postării.
40
+ success: Postare salvata cu succes
41
+ last_activity:
42
+ new_post_at_html: "<span>Postare nouă la %{link}</span>"
43
+ models:
44
+ post:
45
+ fields:
46
+ author: Autor
47
+ body: Corp
48
+ created_at: Creat la
49
+ title: titlu
50
+ posts:
51
+ show:
52
+ back: Înapoi la listă
53
+ comments: Comentarii
54
+ view: Vizualizare
55
+ sidebar_blog:
56
+ comments: comentarii
57
+ most_commented_posts: Cele mai comentate mesaje
58
+ read_more: Citește mai mult
59
+ components:
60
+ blogs:
61
+ name: Blog
62
+ settings:
63
+ global:
64
+ announcement: Anunţ
65
+ comments_enabled: Comentarii activate
66
+ comments_max_length: Lungimea maximă a comentariilor (Leave 0 pentru valoarea implicită)
67
+ step:
68
+ announcement: Anunţ
69
+ comments_blocked: Comentarii blocate
70
+ endorsements_blocked: Aprobări blocate
71
+ endorsements_enabled: Aprobări activate
72
+ events:
73
+ blogs:
74
+ post_created:
75
+ email_intro: Postarea "%{resource_title}" a fost publicată în "%{participatory_space_title}" pe care o urmărești.
76
+ email_outro: Ați primit această notificare deoarece urmăriți „%{participatory_space_title}”. O puteți anula de la link-ul anterior.
77
+ email_subject: Postare nouă publicată în %{participatory_space_title}
78
+ notification_title: Postarea <a href="%{resource_path}">%{resource_title}</a> a fost publicată în %{participatory_space_title}
79
+ pages:
80
+ home:
81
+ statistics:
82
+ posts_count: Mesaje
83
+ participatory_processes:
84
+ statistics:
85
+ posts_count: Mesaje
@@ -0,0 +1,85 @@
1
+ sk:
2
+ activemodel:
3
+ models:
4
+ decidim/blogs/create_post_event: Nový príspevok na blogu
5
+ activerecord:
6
+ models:
7
+ decidim/blogs/post:
8
+ one: Príspevok
9
+ few: Príspevky
10
+ many: Príspevky
11
+ other: Príspevky
12
+ decidim:
13
+ blogs:
14
+ actions:
15
+ confirm_destroy: Naozaj chcete odstrániť tento príspevok?
16
+ destroy: Odstrániť
17
+ edit: Upraviť
18
+ new: Nový príspevok
19
+ title: Akcie
20
+ admin:
21
+ models:
22
+ components:
23
+ body: Telo textu
24
+ post:
25
+ name: Príspevok
26
+ posts:
27
+ create:
28
+ invalid: Vyskytol sa problém s vytváraním príspevku
29
+ success: Príspevok úspešne vytvorený
30
+ destroy:
31
+ success: Príspevok úspešne odstránený
32
+ edit:
33
+ save: Aktualizovať
34
+ index:
35
+ title: Príspevky
36
+ new:
37
+ create: Vytvoriť
38
+ title: Vytvort príspevok
39
+ update:
40
+ invalid: Vyskytol sa problém s ukladaním príspevku.
41
+ success: Príspevok úspešne uložený
42
+ last_activity:
43
+ new_post_at_html: "<span>Nový príspevok na %{link}</span>"
44
+ models:
45
+ post:
46
+ fields:
47
+ author: Autor
48
+ body: Telo textu
49
+ created_at: Vytvorené
50
+ title: názov
51
+ posts:
52
+ show:
53
+ back: Späť na zoznam
54
+ comments: Komentáre
55
+ view: Zobraziť
56
+ sidebar_blog:
57
+ comments: komentáre
58
+ most_commented_posts: Najviac komentované príspevky
59
+ read_more: Čítať ďalej
60
+ components:
61
+ blogs:
62
+ name: Blog
63
+ settings:
64
+ global:
65
+ announcement: Oznámenie
66
+ comments_enabled: Komentáre povolené
67
+ step:
68
+ announcement: Oznámenie
69
+ comments_blocked: Zablokované komentáre
70
+ endorsements_blocked: Zablokované schválenia
71
+ endorsements_enabled: Povolené schválenia
72
+ events:
73
+ blogs:
74
+ post_created:
75
+ email_intro: Príspevok "%{resource_title}" bol publikovaný v priestore "%{participatory_space_title}", ktorý sledujete.
76
+ email_outro: Túto notifikáciu ste dostali, pretože sledujete priestor "%{participatory_space_title}". Notifikácie môžete zrušiť po kliknutí na predchádzajúci odkaz.
77
+ email_subject: Nový príspevok publikovaný v %{participatory_space_title}
78
+ notification_title: Príspevok <a href="%{resource_path}">%{resource_title}</a> bol publikovaný v %{participatory_space_title}
79
+ pages:
80
+ home:
81
+ statistics:
82
+ posts_count: Príspevky
83
+ participatory_processes:
84
+ statistics:
85
+ posts_count: Príspevky
@@ -0,0 +1,85 @@
1
+ sk:
2
+ activemodel:
3
+ models:
4
+ decidim/blogs/create_post_event: Nový príspevok na blogu
5
+ activerecord:
6
+ models:
7
+ decidim/blogs/post:
8
+ one: Príspevok
9
+ few: Príspevky
10
+ many: Príspevky
11
+ other: Príspevky
12
+ decidim:
13
+ blogs:
14
+ actions:
15
+ confirm_destroy: Naozaj chcete odstrániť tento príspevok?
16
+ destroy: Odstrániť
17
+ edit: Upraviť
18
+ new: Nový príspevok
19
+ title: Akcie
20
+ admin:
21
+ models:
22
+ components:
23
+ body: Telo textu
24
+ post:
25
+ name: Príspevok
26
+ posts:
27
+ create:
28
+ invalid: Vyskytol sa problém s vytváraním príspevku
29
+ success: Príspevok úspešne vytvorený
30
+ destroy:
31
+ success: Príspevok úspešne odstránený
32
+ edit:
33
+ save: Aktualizovať
34
+ index:
35
+ title: Príspevky
36
+ new:
37
+ create: Vytvoriť
38
+ title: Vytvort príspevok
39
+ update:
40
+ invalid: Vyskytol sa problém s ukladaním príspevku.
41
+ success: Príspevok úspešne uložený
42
+ last_activity:
43
+ new_post_at_html: "<span>Nový príspevok na %{link}</span>"
44
+ models:
45
+ post:
46
+ fields:
47
+ author: Autor
48
+ body: Telo textu
49
+ created_at: Vytvorené
50
+ title: názov
51
+ posts:
52
+ show:
53
+ back: Späť na zoznam
54
+ comments: Komentáre
55
+ view: Zobraziť
56
+ sidebar_blog:
57
+ comments: komentáre
58
+ most_commented_posts: Najviac komentované príspevky
59
+ read_more: Čítať ďalej
60
+ components:
61
+ blogs:
62
+ name: Blog
63
+ settings:
64
+ global:
65
+ announcement: Oznámenie
66
+ comments_enabled: Komentáre povolené
67
+ step:
68
+ announcement: Oznámenie
69
+ comments_blocked: Zablokované komentáre
70
+ endorsements_blocked: Zablokované schválenia
71
+ endorsements_enabled: Povolené schválenia
72
+ events:
73
+ blogs:
74
+ post_created:
75
+ email_intro: Príspevok "%{resource_title}" bol publikovaný v priestore "%{participatory_space_title}", ktorý sledujete.
76
+ email_outro: Túto notifikáciu ste dostali, pretože sledujete priestor "%{participatory_space_title}". Notifikácie môžete zrušiť po kliknutí na predchádzajúci odkaz.
77
+ email_subject: Nový príspevok publikovaný v %{participatory_space_title}
78
+ notification_title: Príspevok <a href="%{resource_path}">%{resource_title}</a> bol publikovaný v %{participatory_space_title}
79
+ pages:
80
+ home:
81
+ statistics:
82
+ posts_count: Príspevky
83
+ participatory_processes:
84
+ statistics:
85
+ posts_count: Príspevky
@@ -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,25 @@ 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)
32
40
  resource.searchable = true
33
41
  end
34
42