decidim-blogs 0.29.1 → 0.29.3

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 (52) hide show
  1. checksums.yaml +4 -4
  2. data/app/commands/decidim/blogs/admin/create_post.rb +5 -5
  3. data/app/forms/decidim/blogs/admin/post_form.rb +1 -1
  4. data/app/jobs/decidim/blogs/application_job.rb +8 -0
  5. data/app/jobs/decidim/blogs/publish_post_job.rb +27 -0
  6. data/app/models/decidim/blogs/post.rb +3 -7
  7. data/app/views/decidim/blogs/posts/index.html.erb +9 -1
  8. data/config/locales/ar.yml +3 -1
  9. data/config/locales/bg.yml +0 -1
  10. data/config/locales/bn-BD.yml +1 -0
  11. data/config/locales/bs-BA.yml +9 -0
  12. data/config/locales/ca-IT.yml +98 -0
  13. data/config/locales/ca.yml +1 -1
  14. data/config/locales/cs.yml +1 -1
  15. data/config/locales/el.yml +0 -1
  16. data/config/locales/es-MX.yml +1 -1
  17. data/config/locales/es-PY.yml +1 -1
  18. data/config/locales/es.yml +1 -1
  19. data/config/locales/eu.yml +7 -7
  20. data/config/locales/fr-CA.yml +1 -1
  21. data/config/locales/fr.yml +1 -1
  22. data/config/locales/ga-IE.yml +0 -1
  23. data/config/locales/gl.yml +0 -1
  24. data/config/locales/hu.yml +0 -1
  25. data/config/locales/id-ID.yml +0 -2
  26. data/config/locales/is-IS.yml +0 -2
  27. data/config/locales/it.yml +0 -2
  28. data/config/locales/ko.yml +0 -1
  29. data/config/locales/lb.yml +0 -2
  30. data/config/locales/lt.yml +0 -1
  31. data/config/locales/lv.yml +0 -2
  32. data/config/locales/nl.yml +1 -2
  33. data/config/locales/no.yml +0 -1
  34. data/config/locales/pl.yml +0 -1
  35. data/config/locales/pt-BR.yml +0 -1
  36. data/config/locales/pt.yml +36 -1
  37. data/config/locales/ro-RO.yml +37 -25
  38. data/config/locales/ru.yml +0 -1
  39. data/config/locales/sk.yml +0 -2
  40. data/config/locales/sl.yml +0 -5
  41. data/config/locales/sq-AL.yml +0 -1
  42. data/config/locales/sv.yml +1 -1
  43. data/config/locales/tr-TR.yml +0 -2
  44. data/config/locales/uk.yml +0 -2
  45. data/config/locales/zh-CN.yml +0 -2
  46. data/config/locales/zh-TW.yml +0 -1
  47. data/decidim-blogs.gemspec +1 -1
  48. data/lib/decidim/api/blogs_type.rb +1 -3
  49. data/lib/decidim/api/post_type.rb +13 -0
  50. data/lib/decidim/blogs/test/factories.rb +11 -1
  51. data/lib/decidim/blogs/version.rb +1 -1
  52. metadata +22 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd8e4941f6fd9d4356b444c98e0c2231fb92255c0f11b2771871ee9a340ebbe4
4
- data.tar.gz: 03211e3c91f678cb1e4ffd49995e1c6eaa4cf04974d79a6b1f827466242c68de
3
+ metadata.gz: fb45e1cd9d866ac33dc5c62d1afc787f41fa418ee94551771424b4394c9dd580
4
+ data.tar.gz: cb1146dbca44d4189e08f4a4ca9f91b7e0bc9776406f0e6fdc9ae3d55e947493
5
5
  SHA512:
6
- metadata.gz: c2a341585ff2edd24454796eb4fe2fc301fa10320e937ad520c6da11e4954ae05ca843610647a24b8cddf8b966cb7d0d59238fb0c624f318e8a1a2df98f34c51
7
- data.tar.gz: cb235a139923a61bc535f6ca9d220ede655c278848217323483bfced299d42c9cf959e5973c84bb643ff09c0ed648227e741e17f16928f7b3688db1552d6e0b3
6
+ metadata.gz: 5f78267705f4dc1c5696843bdedc8002a60dcde202424d1ca4e05c2525ada316c734a580dc194543fc5cb8bd41bd1f9101fe554259cac7f06b774705a004cd8f
7
+ data.tar.gz: a1a33c5ee90aa374ffec5e4429956a13dc60c6477734087598a4da257c6910407abe7ccafa1a552e9b0a337b9262eb30aa43a94a3177b35543998647daa0b9c9
@@ -15,11 +15,11 @@ module Decidim
15
15
  def extra_params = { visibility: "all" }
16
16
 
17
17
  def run_after_hooks
18
- Decidim::EventsManager.publish(
19
- event: "decidim.events.blogs.post_created",
20
- event_class: Decidim::Blogs::CreatePostEvent,
21
- resource:,
22
- followers: resource.participatory_space.followers
18
+ resource.reload
19
+ Decidim::Blogs::PublishPostJob.set(wait_until: resource.published_at).perform_later(
20
+ resource.id,
21
+ current_user,
22
+ resource.published_at
23
23
  )
24
24
  end
25
25
  end
@@ -8,7 +8,7 @@ module Decidim
8
8
  include TranslatableAttributes
9
9
 
10
10
  translatable_attribute :title, String
11
- translatable_attribute :body, String
11
+ translatable_attribute :body, Decidim::Attributes::RichText
12
12
 
13
13
  attribute :decidim_author_id, Integer
14
14
  attribute :published_at, Decidim::Attributes::TimeWithZone
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Blogs
5
+ class ApplicationJob < Decidim::ApplicationJob
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Blogs
5
+ class PublishPostJob < ApplicationJob
6
+ queue_as :default
7
+
8
+ def perform(post_id, current_user, published_date)
9
+ resource = Decidim::Blogs::Post.find(post_id)
10
+
11
+ return unless resource.published?
12
+ return unless resource.published_at == published_date
13
+
14
+ Decidim.traceability.perform_action!(:publish, resource, current_user, visibility: "all") do
15
+ resource
16
+ end
17
+
18
+ Decidim::EventsManager.publish(
19
+ event: "decidim.events.blogs.post_created",
20
+ event_class: Decidim::Blogs::CreatePostEvent,
21
+ resource:,
22
+ followers: resource.participatory_space.followers
23
+ )
24
+ end
25
+ end
26
+ end
27
+ end
@@ -15,6 +15,7 @@ module Decidim
15
15
  include Decidim::Endorsable
16
16
  include Decidim::Followable
17
17
  include Decidim::Reportable
18
+ include Decidim::Publicable
18
19
  include Decidim::TranslatableResource
19
20
  include Traceable
20
21
  include Loggable
@@ -26,7 +27,7 @@ module Decidim
26
27
  validates :title, presence: true
27
28
 
28
29
  scope :created_at_desc, -> { order(arel_table[:created_at].desc) }
29
- scope :published, -> { where("published_at <= ?", Time.current) }
30
+ scope :published, -> { where(published_at: ..Time.current) }
30
31
 
31
32
  searchable_fields({
32
33
  participatory_space: { component: :participatory_space },
@@ -52,7 +53,7 @@ module Decidim
52
53
  end
53
54
 
54
55
  def published?
55
- published_at <= Time.current
56
+ super && published_at <= Time.current
56
57
  end
57
58
 
58
59
  # Public: Overrides the `comments_have_alignment?` Commentable concern method.
@@ -86,11 +87,6 @@ module Decidim
86
87
  :admin
87
88
  end
88
89
 
89
- # Public: Overrides the `reported_content_url` Reportable concern method.
90
- def reported_content_url
91
- ResourceLocatorPresenter.new(self).url
92
- end
93
-
94
90
  # Public: Overrides the `reported_attributes` Reportable concern method.
95
91
  def reported_attributes
96
92
  [:title, :body]
@@ -1,4 +1,12 @@
1
- <% add_decidim_page_title component_name %>
1
+ <% add_decidim_meta_tags(
2
+ description: translated_attribute(current_component.participatory_space.try(:description)),
3
+ title: t("decidim.components.pagination.page_title",
4
+ component_name:,
5
+ current_page: paginate_posts.current_page,
6
+ total_pages: paginate_posts.total_pages ),
7
+ url: posts_url,
8
+ resource: current_component) %>
9
+
2
10
  <%= append_javascript_pack_tag "decidim_blogs" %>
3
11
  <%= append_stylesheet_pack_tag "decidim_blogs" %>
4
12
 
@@ -22,7 +22,6 @@ ar:
22
22
  blogs:
23
23
  actions:
24
24
  author_id: إنشاء مشاركة كـ
25
- confirm_destroy: هل أنت متأكد أنك تريد حذف هذه المشاركة؟
26
25
  destroy: حذف
27
26
  edit: تعديل
28
27
  new: منشور جديد
@@ -44,6 +43,9 @@ ar:
44
43
  create: "%{user_name} أنشأ منشور المدونة %{resource_name} في %{space_name}"
45
44
  delete: "%{user_name} حذف منشور المدونة%{resource_name} من %{space_name}"
46
45
  update: "%{user_name} حدث منشور المدونة %{resource_name} في %{space_name}"
46
+ content_blocks:
47
+ highlighted_posts:
48
+ name: المنشورات
47
49
  last_activity:
48
50
  new_post: 'منشور جديد:'
49
51
  models:
@@ -18,7 +18,6 @@ bg:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Създаване на публикация като
21
- confirm_destroy: Сигурни ли сте, че желаете да изтриете тази публикация?
22
21
  destroy: Изтрий
23
22
  edit: Редактирай
24
23
  new: Нова публикация
@@ -0,0 +1 @@
1
+ bn:
@@ -0,0 +1,9 @@
1
+ ---
2
+ bs:
3
+ decidim:
4
+ components:
5
+ blogs:
6
+ settings:
7
+ step:
8
+ endorsements_blocked: Podržavanja su onemogućena
9
+ endorsements_enabled: Podržavanja su omogućena
@@ -0,0 +1,98 @@
1
+ ---
2
+ ca-IT:
3
+ activemodel:
4
+ attributes:
5
+ post:
6
+ body: Cos del text
7
+ decidim_author_id: Autoria
8
+ published_at: Hora de publicació
9
+ title: Títol
10
+ models:
11
+ decidim/blogs/create_post_event: Nova publicació al blog
12
+ activerecord:
13
+ models:
14
+ decidim/blogs/post:
15
+ one: Publicació
16
+ other: Publicacions
17
+ decidim:
18
+ blogs:
19
+ actions:
20
+ author_id: Crear publicació com
21
+ confirm_destroy: Segur que vols eliminar aquesta publicació?
22
+ destroy: Esborrar
23
+ edit: Edita
24
+ new: Nova publicació
25
+ title: Accions
26
+ admin:
27
+ posts:
28
+ create:
29
+ invalid: S'ha produït un error en crear aquesta publicació.
30
+ success: Publicació creada correctament.
31
+ destroy:
32
+ success: La publicació s'ha eliminat correctament.
33
+ edit:
34
+ save: Actualitza
35
+ title: Editar publicació
36
+ index:
37
+ not_published_yet: No publicada encara.
38
+ title: Publicacions
39
+ new:
40
+ create: Crear
41
+ title: Crea una publicació
42
+ update:
43
+ invalid: S'ha produït un error en guardar la publicació.
44
+ success: S'ha desat la publicació correctament.
45
+ admin_log:
46
+ post:
47
+ create: "%{user_name} ha creat el post %{resource_name} al blog de %{space_name}"
48
+ delete: "%{user_name} ha eliminat el post %{resource_name} del blog de %{space_name}"
49
+ update: "%{user_name} ha actualitzat el post %{resource_name} en el blog de %{space_name}"
50
+ content_blocks:
51
+ highlighted_posts:
52
+ last_published: Darrera publicació
53
+ name: Publicacions
54
+ see_all: Veure totes les publicacions
55
+ last_activity:
56
+ new_post: 'Nova publicació:'
57
+ models:
58
+ post:
59
+ fields:
60
+ author: Autora
61
+ body: Cos
62
+ official_blog_post: Post oficial
63
+ published_at: Hora de publicació
64
+ title: Títol
65
+ posts:
66
+ index:
67
+ count:
68
+ one: "%{count} publicació"
69
+ other: "%{count} publicacions"
70
+ empty: Encara no hi ha cap publicació.
71
+ components:
72
+ blogs:
73
+ actions:
74
+ comment: Comentar
75
+ create: Crear
76
+ destroy: Esborrar
77
+ endorse: Adherir-se
78
+ update: Actualitzar
79
+ name: Blog
80
+ settings:
81
+ global:
82
+ announcement: Avís
83
+ comments_enabled: Comentaris habilitats
84
+ comments_max_length: Longitud màxima dels comentaris (deixa 0 si vols mantenir la configuració per defecte)
85
+ step:
86
+ announcement: Avís
87
+ comments_blocked: Comentaris bloquejats
88
+ endorsements_blocked: Adhesions bloquejades
89
+ endorsements_enabled: Adhesions habilitades
90
+ events:
91
+ blogs:
92
+ post_created:
93
+ email_intro: La publicació "%{resource_title}" s'ha publicat al "%{participatory_space_title}", el qual segueixes.
94
+ email_outro: Has rebut aquesta notificació perquè estàs seguint l'espai "%{participatory_space_title}". Pots deixar de seguir-lo des de l'enllaç anterior.
95
+ email_subject: Nova publicació publicada a %{participatory_space_title}
96
+ notification_title: La publicació <a href="%{resource_path}">%{resource_title}</a> ha estat publicada a %{participatory_space_title}
97
+ statistics:
98
+ posts_count: Publicacions
@@ -19,7 +19,7 @@ ca:
19
19
  actions:
20
20
  author_id: Crear publicació com
21
21
  confirm_destroy: Segur que vols eliminar aquesta publicació?
22
- destroy: Suprimeix
22
+ destroy: Esborrar
23
23
  edit: Edita
24
24
  new: Nova publicació
25
25
  title: Accions
@@ -20,7 +20,7 @@ cs:
20
20
  blogs:
21
21
  actions:
22
22
  author_id: Vytvořit příspěvek jako
23
- confirm_destroy: Opravdu chcete tento příspěvek smazat?
23
+ confirm_destroy: Opravdu chcete odstranit tento příspěvek?
24
24
  destroy: Smazat
25
25
  edit: Upravit
26
26
  new: Nový příspěvek
@@ -18,7 +18,6 @@ el:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Δημιουργία ανάρτησης ως
21
- confirm_destroy: Είστε βέβαιοι ότι θέλετε να διαγράψετε αυτήν τη δημοσίευση;
22
21
  destroy: Διαγραφή
23
22
  edit: Επεξεργασία
24
23
  new: Νέα δημοσίευση
@@ -67,7 +67,7 @@ es-MX:
67
67
  count:
68
68
  one: "%{count} publicación"
69
69
  other: "%{count} publicaciones"
70
- empty: Aún no hay ninguna publicación.
70
+ empty: Aún no hay publicaciones.
71
71
  components:
72
72
  blogs:
73
73
  actions:
@@ -67,7 +67,7 @@ es-PY:
67
67
  count:
68
68
  one: "%{count} publicación"
69
69
  other: "%{count} publicaciones"
70
- empty: Aún no hay ninguna publicación.
70
+ empty: Aún no hay publicaciones.
71
71
  components:
72
72
  blogs:
73
73
  actions:
@@ -67,7 +67,7 @@ es:
67
67
  count:
68
68
  one: "%{count} publicación"
69
69
  other: "%{count} publicaciones"
70
- empty: Aún no hay ninguna publicación.
70
+ empty: Aún no hay publicaciones.
71
71
  components:
72
72
  blogs:
73
73
  actions:
@@ -18,7 +18,7 @@ eu:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Sortu argitalpena hau bezala
21
- confirm_destroy: Ziur zaude post hau argitalpen ezabatu nahi duzula?
21
+ confirm_destroy: Ziur zaude korreo elektronikoa hau ezabatu nahi duzula?
22
22
  destroy: Ezabatu
23
23
  edit: Editatu
24
24
  new: Beste argitalpen bat
@@ -44,9 +44,9 @@ eu:
44
44
  success: Argitalpena zuzen gordea.
45
45
  admin_log:
46
46
  post:
47
- create: "%{user_name} k %{resource_name} blogeko argitalpena sortu du %{space_name} espazioan"
48
- delete: "%{user_name} k %{resource_name} blogeko argitalpena ezabatu du %{space_name} espazioan"
49
- update: "%{user_name} k %{resource_name} blogeko argitalpena eguneratu egin da %{space_name} espazioan"
47
+ create: "%{user_name} parte-hartzailekak %{resource_name} blogeko argitalpena sortu du %{space_name} espazioan"
48
+ delete: "%{user_name} parte-hartzailekak %{resource_name} blogeko argitalpena ezabatu du %{space_name} espazioan"
49
+ update: "%{user_name} parte-hartzailekak %{resource_name} blogeko argitalpena eguneratu egin da %{space_name} espazioan"
50
50
  content_blocks:
51
51
  highlighted_posts:
52
52
  last_published: Azken argitarapena
@@ -65,8 +65,8 @@ eu:
65
65
  posts:
66
66
  index:
67
67
  count:
68
- one: "%{count} argitalpen"
69
- other: "%{count} edukin"
68
+ one: "Argitalpen %{count}"
69
+ other: "%{count} argitalpen"
70
70
  empty: Oraindik ez dago argitalpenik.
71
71
  components:
72
72
  blogs:
@@ -93,6 +93,6 @@ eu:
93
93
  email_intro: '"%{resource_title}" argitalpena jarraitzen ari zaren "%{participatory_space_title}" espazioan argitaratu da.'
94
94
  email_outro: Jakinarazpena jaso duzu "%{participatory_space_title}" jarraitzen ari zarelako. Aurreko estekan utzi ahal diozu jarraitzeari.
95
95
  email_subject: Argitalpen berria %{participatory_space_title} espazioan
96
- notification_title: <a href="%{resource_path}">%{resource_title}</a> posta %{participatory_space_title} argitaratu da
96
+ notification_title: <a href="%{resource_path}">%{resource_title}</a> sarrera %{participatory_space_title} argitaratu da
97
97
  statistics:
98
98
  posts_count: Argitalpenak
@@ -18,7 +18,7 @@ fr-CA:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Créer un article comme
21
- confirm_destroy: Êtes-vous certain de vouloir supprimer cet article ?
21
+ confirm_destroy: Êtes-vous sûr(e) de vouloir supprimer cet article ?
22
22
  destroy: Supprimer
23
23
  edit: Modifier
24
24
  new: Nouvel article
@@ -18,7 +18,7 @@ fr:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Créer un article en tant que
21
- confirm_destroy: Êtes-vous certain de vouloir supprimer cet article ?
21
+ confirm_destroy: Êtes-vous sûr(e) de vouloir supprimer cet article ?
22
22
  destroy: Supprimer
23
23
  edit: Modifier
24
24
  new: Nouvel article
@@ -11,7 +11,6 @@ ga:
11
11
  decidim:
12
12
  blogs:
13
13
  actions:
14
- destroy: Scrios
15
14
  edit: Eagar
16
15
  new: Postáil nua
17
16
  title: Gníomhartha
@@ -12,7 +12,6 @@ gl:
12
12
  blogs:
13
13
  actions:
14
14
  author_id: Crear publicación como
15
- confirm_destroy: Tes a certeza de querer eliminar esta publicación?
16
15
  destroy: Eliminar
17
16
  edit: Editar
18
17
  new: Nova publicación
@@ -18,7 +18,6 @@ hu:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Bejegyzés létrehozása
21
- confirm_destroy: Biztos, hogy törlöd ezt a bejegyzést?
22
21
  destroy: Törlés
23
22
  edit: Szerkesztés
24
23
  new: Új bejegyzés
@@ -10,8 +10,6 @@ id:
10
10
  decidim:
11
11
  blogs:
12
12
  actions:
13
- confirm_destroy: Anda yakin ingin menghapus posting ini?
14
- destroy: Menghapus
15
13
  edit: Edit
16
14
  new: Berita Baru
17
15
  title: Tindakan
@@ -3,8 +3,6 @@ is:
3
3
  decidim:
4
4
  blogs:
5
5
  actions:
6
- confirm_destroy: Ertu viss um að þú viljir eyða þessu færslu?
7
- destroy: Eyða
8
6
  edit: Breyta
9
7
  title: Aðgerðir
10
8
  admin:
@@ -12,8 +12,6 @@ it:
12
12
  blogs:
13
13
  actions:
14
14
  author_id: Crea post come
15
- confirm_destroy: Sei sicuro di voler eliminare questo post?
16
- destroy: Elimina
17
15
  edit: Modifica
18
16
  new: Nuovo post
19
17
  title: Azioni
@@ -8,7 +8,6 @@ ko:
8
8
  decidim:
9
9
  blogs:
10
10
  actions:
11
- destroy: 삭제
12
11
  edit: 수정
13
12
  new: 새 게시물
14
13
  title: 작업
@@ -12,8 +12,6 @@ lb:
12
12
  blogs:
13
13
  actions:
14
14
  author_id: Beitrag erstellen als
15
- confirm_destroy: Möchten Sie diesen Beitrag wirklich löschen?
16
- destroy: Löschen
17
15
  edit: Bearbeiten
18
16
  new: Neuer Beitrag
19
17
  title: Aktionen
@@ -20,7 +20,6 @@ lt:
20
20
  blogs:
21
21
  actions:
22
22
  author_id: Sukurti įrašą kaip
23
- confirm_destroy: Ar tikrai norite ištrinti šį įrašą?
24
23
  destroy: Ištrinti
25
24
  edit: Redaguoti
26
25
  new: Naujas įrašas
@@ -12,8 +12,6 @@ lv:
12
12
  decidim:
13
13
  blogs:
14
14
  actions:
15
- confirm_destroy: Vai tiešām vēlaties dzēst šo ziņu?
16
- destroy: Dzēst
17
15
  edit: Labot
18
16
  new: Jauna ziņa
19
17
  title: Darbības
@@ -12,8 +12,7 @@ nl:
12
12
  blogs:
13
13
  actions:
14
14
  author_id: Bericht aanmaken als
15
- confirm_destroy: Weet je zeker dat je dit bericht wilt verwijderen?
16
- destroy: Verwijder
15
+ destroy: Verwijderen
17
16
  edit: Bewerk
18
17
  new: Nieuwe blogpost
19
18
  title: acties
@@ -12,7 +12,6 @@
12
12
  blogs:
13
13
  actions:
14
14
  author_id: Opprett innlegg som
15
- confirm_destroy: Er du sikker på at du vil slette dette innlegget?
16
15
  destroy: Slett
17
16
  edit: Editar
18
17
  new: Nytt innlegg
@@ -20,7 +20,6 @@ pl:
20
20
  blogs:
21
21
  actions:
22
22
  author_id: Utwórz wpis jako
23
- confirm_destroy: Czy na pewno chcesz usunąć ten wpis?
24
23
  destroy: Usuń
25
24
  edit: Edytuj
26
25
  new: Nowy wpis
@@ -18,7 +18,6 @@ pt-BR:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Criar publicação como
21
- confirm_destroy: Deseja mesmo excluir este post?
22
21
  destroy: Excluir
23
22
  edit: Editar
24
23
  new: Nova postagem
@@ -1,6 +1,12 @@
1
1
  ---
2
2
  pt:
3
3
  activemodel:
4
+ attributes:
5
+ post:
6
+ body: Corpo
7
+ decidim_author_id: Autor
8
+ published_at: Hora de publicação
9
+ title: Título
4
10
  models:
5
11
  decidim/blogs/create_post_event: Nova publicação no blog
6
12
  activerecord:
@@ -12,33 +18,62 @@ pt:
12
18
  blogs:
13
19
  actions:
14
20
  author_id: Criar publicação como
15
- confirm_destroy: Tem a certeza de que deseja eliminar esta publicação?
21
+ confirm_destroy: Tem a certeza de que quer eliminar esta publicação?
16
22
  destroy: Eliminar
17
23
  edit: Editar
18
24
  new: Nova publicação
19
25
  title: Ações
20
26
  admin:
21
27
  posts:
28
+ create:
29
+ invalid: Ocorreu um problema ao criar esta publicação.
30
+ success: Publicação criada corretamente.
22
31
  edit:
23
32
  save: Actualizar
24
33
  title: Editar publicação
25
34
  index:
35
+ not_published_yet: Ainda não publicado
26
36
  title: Publicações
27
37
  new:
28
38
  create: Criar
29
39
  title: Criar publicação
30
40
  update:
31
41
  invalid: Ocorreu um problema ao guardar a publicação.
42
+ success: Publicação guardada corretamente.
43
+ admin_log:
44
+ post:
45
+ create: "%{user_name} criou a publicação %{resource_name} no espaço %{space_name}"
46
+ delete: "%{user_name} eliminou a publicação %{resource_name} no espaço %{space_name}"
47
+ update: "%{user_name} atualizou a publicação %{resource_name} no espaço %{space_name}"
48
+ content_blocks:
49
+ highlighted_posts:
50
+ last_published: Última publicação
51
+ name: Publicações
52
+ see_all: Ver todas as publicações
53
+ last_activity:
54
+ new_post: 'Nova publicação:'
32
55
  models:
33
56
  post:
34
57
  fields:
35
58
  author: Autor
36
59
  body: Corpo
60
+ official_blog_post: Publicação oficial
61
+ published_at: Hora de publicação
62
+ title: Título
63
+ posts:
64
+ index:
65
+ count:
66
+ one: "%{count} publicação"
67
+ other: "%{count} publicações"
68
+ empty: Ainda não há publicações.
37
69
  components:
38
70
  blogs:
39
71
  actions:
40
72
  comment: Comentar
73
+ create: Criar
74
+ destroy: Eliminar
41
75
  endorse: Apoiar
76
+ update: Atualizar
42
77
  name: Blog
43
78
  settings:
44
79
  global:
@@ -5,7 +5,7 @@ ro:
5
5
  post:
6
6
  body: Conținut
7
7
  decidim_author_id: Autor
8
- published_at: Publicat la
8
+ published_at: Dată publicare
9
9
  title: Titlu
10
10
  models:
11
11
  decidim/blogs/create_post_event: Postare nouă pe blog
@@ -18,10 +18,10 @@ ro:
18
18
  decidim:
19
19
  blogs:
20
20
  actions:
21
- author_id: Creează postare ca
22
- confirm_destroy: Sigur doreștiştergi această postare?
23
- destroy: Șterge
24
- edit: Editează
21
+ author_id: Creeați postare ca
22
+ confirm_destroy: Sunteți sigur că doriți ștergeți această postare?
23
+ destroy: Ștergeți
24
+ edit: Modificați
25
25
  new: Postare nouă
26
26
  title: Acțiuni
27
27
  admin:
@@ -32,22 +32,27 @@ ro:
32
32
  destroy:
33
33
  success: Postarea a fost ștearsă cu succes.
34
34
  edit:
35
- save: Actualizează
36
- title: Editează postarea
35
+ save: Actualizați
36
+ title: Modificați postarea
37
37
  index:
38
38
  not_published_yet: Nu a fost publicat încă.
39
39
  title: Postări
40
40
  new:
41
- create: Creează
42
- title: Creează postare
41
+ create: Creați
42
+ title: Creați postare nouă
43
43
  update:
44
- invalid: A apărut o eroare la salvarea postării.
45
- success: Postarea a fost salvată cu succes.
44
+ invalid: A apărut o eroare la actualizarea acestei postări.
45
+ success: Postarea a fost actualizată cu succes.
46
46
  admin_log:
47
47
  post:
48
- create: "%{user_name} a creat postarea de blog %{resource_name} în %{space_name}"
49
- delete: "%{user_name} a șters postarea de blog %{resource_name} din %{space_name}"
50
- update: "%{user_name} a actualizat postarea de blog %{resource_name} în %{space_name}"
48
+ create: "%{user_name} a creat postarea %{resource_name} în %{space_name}"
49
+ delete: "%{user_name} a șters postarea %{resource_name} din %{space_name}"
50
+ update: "%{user_name} a actualizat postarea %{resource_name} în %{space_name}"
51
+ content_blocks:
52
+ highlighted_posts:
53
+ last_published: Publicate recent
54
+ name: Postări
55
+ see_all: Vedeți toate postările
51
56
  last_activity:
52
57
  new_post: 'Postare nouă:'
53
58
  models:
@@ -56,32 +61,39 @@ ro:
56
61
  author: Autor
57
62
  body: Conținut
58
63
  official_blog_post: Postare oficială
59
- published_at: Publicat la
64
+ published_at: Dată publicare
60
65
  title: Titlu
66
+ posts:
67
+ index:
68
+ count:
69
+ one: "%{count} postare"
70
+ few: "%{count} postări"
71
+ other: "%{count} postări"
72
+ empty: Nu există postări încă.
61
73
  components:
62
74
  blogs:
63
75
  actions:
64
- comment: Comentariu
65
- create: Creează
66
- destroy: Șterge
67
- endorse: Susține
68
- update: Actualizează
76
+ comment: Comentați
77
+ create: Creați
78
+ destroy: Ștergeți
79
+ endorse: Susțineți
80
+ update: Actualizați
69
81
  name: Blog
70
82
  settings:
71
83
  global:
72
- announcement: Anunţ
84
+ announcement: Anunț
73
85
  comments_enabled: Comentarii activate
74
86
  comments_max_length: Lungimea maximă a comentariilor (lăsați 0 pentru valoarea implicită)
75
87
  step:
76
- announcement: Anunţ
88
+ announcement: Anunț
77
89
  comments_blocked: Comentarii blocate
78
- endorsements_blocked: Susțineri blocate
90
+ endorsements_blocked: Susțineri dezactivate
79
91
  endorsements_enabled: Susțineri activate
80
92
  events:
81
93
  blogs:
82
94
  post_created:
83
- email_intro: Postarea "%{resource_title}" a fost publicată în "%{participatory_space_title}" pe care o urmărești.
84
- email_outro: Ai primit această notificare deoarece urmărești „%{participatory_space_title}”. Poți anula abonarea de la link-ul anterior.
95
+ email_intro: Postarea "%{resource_title}" a fost publicată în "%{participatory_space_title}" pe care o urmăriți.
96
+ email_outro: Ați primit această notificare deoarece urmarăți „%{participatory_space_title}”. Puteți anula abonarea de la link-ul anterior.
85
97
  email_subject: Postare nouă publicată în %{participatory_space_title}
86
98
  notification_title: Postarea <a href="%{resource_path}">%{resource_title}</a> a fost publicată în %{participatory_space_title}
87
99
  statistics:
@@ -20,7 +20,6 @@ ru:
20
20
  blogs:
21
21
  actions:
22
22
  author_id: Создать пост как
23
- confirm_destroy: Вы действительно хотите удалить этот пост?
24
23
  destroy: Удалить
25
24
  edit: Редактировать
26
25
  new: Создать новый пост
@@ -13,8 +13,6 @@ sk:
13
13
  decidim:
14
14
  blogs:
15
15
  actions:
16
- confirm_destroy: Naozaj chcete odstrániť tento príspevok?
17
- destroy: Odstrániť
18
16
  edit: Upraviť
19
17
  new: Nový príspevok
20
18
  title: Akcie
@@ -1,6 +1 @@
1
- ---
2
1
  sl:
3
- decidim:
4
- blogs:
5
- actions:
6
- destroy: Izbriši
@@ -18,7 +18,6 @@ sq:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Krijo postimin si
21
- confirm_destroy: Je i sigurt që dëshiron ta fshish këtë postim?
22
21
  destroy: Fshij
23
22
  edit: Përpuno
24
23
  new: Postim i ri
@@ -18,7 +18,7 @@ sv:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Skapa inlägg som
21
- confirm_destroy: Vill du radera inlägget?
21
+ confirm_destroy: Är du säker på att du vill radera inlägget?
22
22
  destroy: Radera
23
23
  edit: Redigera
24
24
  new: Nytt inlägg
@@ -17,8 +17,6 @@ tr:
17
17
  decidim:
18
18
  blogs:
19
19
  actions:
20
- confirm_destroy: Bu yayını silmek istediğinize emin misiniz?
21
- destroy: silmek
22
20
  edit: Düzenle
23
21
  new: Yeni posta
24
22
  title: Eylemler
@@ -13,8 +13,6 @@ uk:
13
13
  decidim:
14
14
  blogs:
15
15
  actions:
16
- confirm_destroy: Ви дійсно бажаєте видалити цей проект?
17
- destroy: Видалити
18
16
  edit: Редагувати
19
17
  new: Створити новий допис
20
18
  title: Дії
@@ -10,8 +10,6 @@ zh-CN:
10
10
  decidim:
11
11
  blogs:
12
12
  actions:
13
- confirm_destroy: 您确定要删除此帖子?
14
- destroy: 删除
15
13
  edit: 编辑
16
14
  new: 新建帖子
17
15
  title: 行动
@@ -17,7 +17,6 @@ zh-TW:
17
17
  blogs:
18
18
  actions:
19
19
  author_id: 發佈文章
20
- confirm_destroy: 您確定要刪除此文章嗎?
21
20
  destroy: 刪除
22
21
  edit: 編輯
23
22
  new: 新貼文
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.version = Decidim::Blogs.version
11
11
  s.authors = ["Isaac Massot Gil"]
12
12
  s.email = ["isaac.mg@coditramuntana.com"]
13
- s.license = "AGPL-3.0"
13
+ s.license = "AGPL-3.0-or-later"
14
14
  s.homepage = "https://decidim.org"
15
15
  s.metadata = {
16
16
  "bug_tracker_uri" => "https://github.com/decidim/decidim/issues",
@@ -2,9 +2,7 @@
2
2
 
3
3
  module Decidim
4
4
  module Blogs
5
- class BlogsType < Decidim::Api::Types::BaseObject
6
- implements Decidim::Core::ComponentInterface
7
-
5
+ class BlogsType < Decidim::Core::ComponentType
8
6
  graphql_name "Blogs"
9
7
  description "A blogs component of a participatory space."
10
8
 
@@ -17,6 +17,19 @@ module Decidim
17
17
  field :title, Decidim::Core::TranslatedFieldType, "The title for this post", null: true
18
18
  field :body, Decidim::Core::TranslatedFieldType, "The body of this post", null: true
19
19
  field :published_at, Decidim::Core::DateTimeType, "The time this page was published", null: false
20
+
21
+ def self.authorized?(object, context)
22
+ context[:post] = object
23
+
24
+ chain = [
25
+ allowed_to?(:read, :blogpost, object, context),
26
+ !object.hidden?
27
+ ].all?
28
+
29
+ super && chain
30
+ rescue Decidim::PermissionAction::PermissionNotSetError
31
+ false
32
+ end
20
33
  end
21
34
  end
22
35
  end
@@ -42,15 +42,25 @@ FactoryBot.define do
42
42
  component { build(:post_component, skip_injection:) }
43
43
  author { build(:user, :confirmed, skip_injection:, organization: component.organization) }
44
44
 
45
+ trait :published do
46
+ published_at { 2.minutes.ago }
47
+ end
48
+
45
49
  trait :with_endorsements do
46
50
  after :create do |post, evaluator|
47
51
  5.times.collect do
48
52
  create(:endorsement,
49
53
  resource: post,
50
54
  skip_injection: evaluator.skip_injection,
51
- author: build(:user, skip_injection: evaluator.skip_injection, organization: post.participatory_space.organization))
55
+ author: build(:user, :confirmed, skip_injection: evaluator.skip_injection, organization: post.participatory_space.organization))
52
56
  end
53
57
  end
54
58
  end
59
+
60
+ trait :hidden do
61
+ after :create do |post, evaluator|
62
+ create(:moderation, hidden_at: Time.current, reportable: post, skip_injection: evaluator.skip_injection)
63
+ end
64
+ end
55
65
  end
56
66
  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.29.1"
7
+ "0.29.3"
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.29.1
4
+ version: 0.29.3
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: 2024-10-02 00:00:00.000000000 Z
11
+ date: 2025-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-admin
@@ -16,98 +16,98 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.29.1
19
+ version: 0.29.3
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.29.1
26
+ version: 0.29.3
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.29.1
33
+ version: 0.29.3
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.29.1
40
+ version: 0.29.3
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.29.1
47
+ version: 0.29.3
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.29.1
54
+ version: 0.29.3
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: decidim-admin
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.29.1
61
+ version: 0.29.3
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 0.29.1
68
+ version: 0.29.3
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: decidim-assemblies
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 0.29.1
75
+ version: 0.29.3
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 0.29.1
82
+ version: 0.29.3
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: decidim-dev
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 0.29.1
89
+ version: 0.29.3
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 0.29.1
96
+ version: 0.29.3
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: decidim-participatory_processes
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 0.29.1
103
+ version: 0.29.3
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 0.29.1
110
+ version: 0.29.3
111
111
  description: A Blog component for decidim's participatory spaces.
112
112
  email:
113
113
  - isaac.mg@coditramuntana.com
@@ -139,6 +139,8 @@ files:
139
139
  - app/helpers/decidim/blogs/admin/posts_helper.rb
140
140
  - app/helpers/decidim/blogs/application_helper.rb
141
141
  - app/helpers/decidim/blogs/posts_helper.rb
142
+ - app/jobs/decidim/blogs/application_job.rb
143
+ - app/jobs/decidim/blogs/publish_post_job.rb
142
144
  - app/models/decidim/blogs/application_record.rb
143
145
  - app/models/decidim/blogs/post.rb
144
146
  - app/packs/entrypoints/decidim_blogs.js
@@ -161,6 +163,9 @@ files:
161
163
  - config/locales/ar.yml
162
164
  - config/locales/bg-BG.yml
163
165
  - config/locales/bg.yml
166
+ - config/locales/bn-BD.yml
167
+ - config/locales/bs-BA.yml
168
+ - config/locales/ca-IT.yml
164
169
  - config/locales/ca.yml
165
170
  - config/locales/cs-CZ.yml
166
171
  - config/locales/cs.yml
@@ -261,7 +266,7 @@ files:
261
266
  - lib/decidim/blogs/version.rb
262
267
  homepage: https://decidim.org
263
268
  licenses:
264
- - AGPL-3.0
269
+ - AGPL-3.0-or-later
265
270
  metadata:
266
271
  bug_tracker_uri: https://github.com/decidim/decidim/issues
267
272
  documentation_uri: https://docs.decidim.org/