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.
- checksums.yaml +4 -4
- data/app/commands/decidim/blogs/admin/create_post.rb +5 -5
- data/app/forms/decidim/blogs/admin/post_form.rb +1 -1
- data/app/jobs/decidim/blogs/application_job.rb +8 -0
- data/app/jobs/decidim/blogs/publish_post_job.rb +27 -0
- data/app/models/decidim/blogs/post.rb +3 -7
- data/app/views/decidim/blogs/posts/index.html.erb +9 -1
- data/config/locales/ar.yml +3 -1
- data/config/locales/bg.yml +0 -1
- data/config/locales/bn-BD.yml +1 -0
- data/config/locales/bs-BA.yml +9 -0
- data/config/locales/ca-IT.yml +98 -0
- data/config/locales/ca.yml +1 -1
- data/config/locales/cs.yml +1 -1
- data/config/locales/el.yml +0 -1
- data/config/locales/es-MX.yml +1 -1
- data/config/locales/es-PY.yml +1 -1
- data/config/locales/es.yml +1 -1
- data/config/locales/eu.yml +7 -7
- data/config/locales/fr-CA.yml +1 -1
- data/config/locales/fr.yml +1 -1
- data/config/locales/ga-IE.yml +0 -1
- data/config/locales/gl.yml +0 -1
- data/config/locales/hu.yml +0 -1
- data/config/locales/id-ID.yml +0 -2
- data/config/locales/is-IS.yml +0 -2
- data/config/locales/it.yml +0 -2
- data/config/locales/ko.yml +0 -1
- data/config/locales/lb.yml +0 -2
- data/config/locales/lt.yml +0 -1
- data/config/locales/lv.yml +0 -2
- data/config/locales/nl.yml +1 -2
- data/config/locales/no.yml +0 -1
- data/config/locales/pl.yml +0 -1
- data/config/locales/pt-BR.yml +0 -1
- data/config/locales/pt.yml +36 -1
- data/config/locales/ro-RO.yml +37 -25
- data/config/locales/ru.yml +0 -1
- data/config/locales/sk.yml +0 -2
- data/config/locales/sl.yml +0 -5
- data/config/locales/sq-AL.yml +0 -1
- data/config/locales/sv.yml +1 -1
- data/config/locales/tr-TR.yml +0 -2
- data/config/locales/uk.yml +0 -2
- data/config/locales/zh-CN.yml +0 -2
- data/config/locales/zh-TW.yml +0 -1
- data/decidim-blogs.gemspec +1 -1
- data/lib/decidim/api/blogs_type.rb +1 -3
- data/lib/decidim/api/post_type.rb +13 -0
- data/lib/decidim/blogs/test/factories.rb +11 -1
- data/lib/decidim/blogs/version.rb +1 -1
- metadata +22 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb45e1cd9d866ac33dc5c62d1afc787f41fa418ee94551771424b4394c9dd580
|
4
|
+
data.tar.gz: cb1146dbca44d4189e08f4a4ca9f91b7e0bc9776406f0e6fdc9ae3d55e947493
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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,
|
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,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(
|
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
|
-
<%
|
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
|
|
data/config/locales/ar.yml
CHANGED
@@ -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:
|
data/config/locales/bg.yml
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
bn:
|
@@ -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
|
data/config/locales/ca.yml
CHANGED
data/config/locales/cs.yml
CHANGED
data/config/locales/el.yml
CHANGED
data/config/locales/es-MX.yml
CHANGED
data/config/locales/es-PY.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/config/locales/eu.yml
CHANGED
@@ -18,7 +18,7 @@ eu:
|
|
18
18
|
blogs:
|
19
19
|
actions:
|
20
20
|
author_id: Sortu argitalpena hau bezala
|
21
|
-
confirm_destroy: Ziur zaude
|
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}
|
48
|
-
delete: "%{user_name}
|
49
|
-
update: "%{user_name}
|
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}
|
69
|
-
other: "%{count}
|
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>
|
96
|
+
notification_title: <a href="%{resource_path}">%{resource_title}</a> sarrera %{participatory_space_title} argitaratu da
|
97
97
|
statistics:
|
98
98
|
posts_count: Argitalpenak
|
data/config/locales/fr-CA.yml
CHANGED
@@ -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
|
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
|
data/config/locales/fr.yml
CHANGED
@@ -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
|
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
|
data/config/locales/ga-IE.yml
CHANGED
data/config/locales/gl.yml
CHANGED
data/config/locales/hu.yml
CHANGED
data/config/locales/id-ID.yml
CHANGED
data/config/locales/is-IS.yml
CHANGED
data/config/locales/it.yml
CHANGED
data/config/locales/ko.yml
CHANGED
data/config/locales/lb.yml
CHANGED
data/config/locales/lt.yml
CHANGED
data/config/locales/lv.yml
CHANGED
data/config/locales/nl.yml
CHANGED
data/config/locales/no.yml
CHANGED
data/config/locales/pl.yml
CHANGED
data/config/locales/pt-BR.yml
CHANGED
data/config/locales/pt.yml
CHANGED
@@ -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
|
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:
|
data/config/locales/ro-RO.yml
CHANGED
@@ -5,7 +5,7 @@ ro:
|
|
5
5
|
post:
|
6
6
|
body: Conținut
|
7
7
|
decidim_author_id: Autor
|
8
|
-
published_at:
|
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:
|
22
|
-
confirm_destroy:
|
23
|
-
destroy:
|
24
|
-
edit:
|
21
|
+
author_id: Creeați postare ca
|
22
|
+
confirm_destroy: Sunteți sigur că doriți să ș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:
|
36
|
-
title:
|
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:
|
42
|
-
title:
|
41
|
+
create: Creați
|
42
|
+
title: Creați postare nouă
|
43
43
|
update:
|
44
|
-
invalid: A apărut o eroare la
|
45
|
-
success: Postarea a fost
|
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
|
49
|
-
delete: "%{user_name} a șters postarea
|
50
|
-
update: "%{user_name} a actualizat postarea
|
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:
|
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:
|
65
|
-
create:
|
66
|
-
destroy:
|
67
|
-
endorse:
|
68
|
-
update:
|
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:
|
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:
|
88
|
+
announcement: Anunț
|
77
89
|
comments_blocked: Comentarii blocate
|
78
|
-
endorsements_blocked: Susțineri
|
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
|
84
|
-
email_outro:
|
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:
|
data/config/locales/ru.yml
CHANGED
data/config/locales/sk.yml
CHANGED
data/config/locales/sl.yml
CHANGED
data/config/locales/sq-AL.yml
CHANGED
data/config/locales/sv.yml
CHANGED
data/config/locales/tr-TR.yml
CHANGED
data/config/locales/uk.yml
CHANGED
data/config/locales/zh-CN.yml
CHANGED
data/config/locales/zh-TW.yml
CHANGED
data/decidim-blogs.gemspec
CHANGED
@@ -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::
|
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
|
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.
|
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:
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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/
|