decidim-blogs 0.30.2 → 0.31.0.rc1
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/cells/decidim/blogs/post_metadata_cell.rb +1 -1
- data/app/commands/decidim/blogs/admin/create_post.rb +1 -1
- data/app/commands/decidim/blogs/admin/update_post.rb +1 -1
- data/app/commands/decidim/blogs/create_post.rb +26 -3
- data/app/commands/decidim/blogs/update_post.rb +26 -1
- data/app/controllers/decidim/blogs/admin/posts_controller.rb +2 -3
- data/app/controllers/decidim/blogs/posts_controller.rb +2 -3
- data/app/forms/decidim/blogs/admin/post_form.rb +5 -3
- data/app/forms/decidim/blogs/post_form.rb +10 -3
- data/app/helpers/decidim/blogs/admin/posts_helper.rb +2 -4
- data/app/helpers/decidim/blogs/application_helper.rb +1 -1
- data/app/helpers/decidim/blogs/posts_select_helper.rb +0 -9
- data/app/models/decidim/blogs/post.rb +9 -6
- data/app/packs/stylesheets/blogs.scss +1 -1
- data/app/permissions/decidim/blog/permissions.rb +1 -3
- data/app/presenters/decidim/blogs/post_presenter.rb +10 -6
- data/app/views/decidim/blogs/admin/posts/_actions.html.erb +84 -21
- data/app/views/decidim/blogs/admin/posts/_form.html.erb +7 -0
- data/app/views/decidim/blogs/admin/posts/_post-tr.html.erb +11 -8
- data/app/views/decidim/blogs/admin/posts/_posts-thead.html.erb +1 -0
- data/app/views/decidim/blogs/admin/posts/index.html.erb +2 -2
- data/app/views/decidim/blogs/admin/posts/manage_trash.html.erb +2 -1
- data/app/views/decidim/blogs/posts/_actions.html.erb +2 -2
- data/app/views/decidim/blogs/posts/_form.html.erb +23 -2
- data/app/views/decidim/blogs/posts/_menu_actions.html.erb +4 -4
- data/config/assets.rb +2 -2
- data/config/locales/ar.yml +0 -3
- data/config/locales/bg.yml +0 -3
- data/config/locales/bs-BA.yml +0 -8
- data/config/locales/ca-IT.yml +16 -5
- data/config/locales/ca.yml +16 -5
- data/config/locales/cs.yml +16 -5
- data/config/locales/de.yml +16 -5
- data/config/locales/el.yml +0 -3
- data/config/locales/en.yml +16 -5
- data/config/locales/es-MX.yml +16 -5
- data/config/locales/es-PY.yml +16 -5
- data/config/locales/es.yml +16 -5
- data/config/locales/eu.yml +16 -5
- data/config/locales/fi-plain.yml +16 -5
- data/config/locales/fi.yml +16 -5
- data/config/locales/fr-CA.yml +12 -4
- data/config/locales/fr.yml +12 -4
- data/config/locales/ga-IE.yml +0 -5
- data/config/locales/gl.yml +0 -2
- data/config/locales/hu.yml +0 -3
- data/config/locales/it.yml +0 -3
- data/config/locales/ja.yml +16 -5
- data/config/locales/lb.yml +0 -3
- data/config/locales/lt.yml +0 -3
- data/config/locales/lv.yml +0 -2
- data/config/locales/nl.yml +0 -2
- data/config/locales/no.yml +0 -2
- data/config/locales/pl.yml +0 -3
- data/config/locales/pt-BR.yml +0 -3
- data/config/locales/pt.yml +0 -4
- data/config/locales/ro-RO.yml +10 -5
- data/config/locales/ru.yml +0 -3
- data/config/locales/sk.yml +0 -2
- data/config/locales/sq-AL.yml +0 -3
- data/config/locales/sr-CS.yml +0 -8
- data/config/locales/sv.yml +16 -5
- data/config/locales/tr-TR.yml +0 -2
- data/config/locales/zh-CN.yml +0 -2
- data/config/locales/zh-TW.yml +0 -3
- data/db/migrate/20250515133229_rename_blog_posts_endorsements_count_to_likes.rb +7 -0
- data/lib/decidim/api/post_input_sort.rb +1 -1
- data/lib/decidim/api/post_type.rb +7 -1
- data/lib/decidim/blogs/component.rb +19 -5
- data/lib/decidim/blogs/engine.rb +1 -1
- data/lib/decidim/blogs/post_serializer.rb +2 -2
- data/lib/decidim/blogs/schema_org_blog_posting_post_serializer.rb +0 -10
- data/lib/decidim/blogs/seeds.rb +2 -4
- data/lib/decidim/blogs/test/factories.rb +15 -6
- data/lib/decidim/blogs/version.rb +1 -1
- metadata +17 -16
data/config/locales/pt.yml
CHANGED
@@ -100,7 +100,6 @@ pt:
|
|
100
100
|
comment: Comentar
|
101
101
|
create: Criar
|
102
102
|
destroy: Eliminar
|
103
|
-
endorse: Apoiar
|
104
103
|
update: Atualizar
|
105
104
|
name: Blog
|
106
105
|
settings:
|
@@ -112,8 +111,6 @@ pt:
|
|
112
111
|
step:
|
113
112
|
announcement: Anúncio
|
114
113
|
comments_blocked: Comentários bloqueados
|
115
|
-
endorsements_blocked: Endossamentos bloqueados
|
116
|
-
endorsements_enabled: Endossamentos ativados
|
117
114
|
events:
|
118
115
|
blogs:
|
119
116
|
post_created:
|
@@ -140,7 +137,6 @@ pt:
|
|
140
137
|
comments_count: O número de comentários que esta publicação tem
|
141
138
|
component: O componente a que a publicação pertence
|
142
139
|
created_at: A data em que esta publicação foi criada
|
143
|
-
endorsements_count: O número de recomendações que esta publicação tem
|
144
140
|
follows_count: O número de seguidores que esta publicação tem
|
145
141
|
id: O identificador único desta publicação
|
146
142
|
participatory_space: A que espaço (por exemplo, Processo Participativo ou Assembleia) pertence esta publicação
|
data/config/locales/ro-RO.yml
CHANGED
@@ -71,11 +71,15 @@ ro:
|
|
71
71
|
body: Conținut
|
72
72
|
official_blog_post: Postare oficială
|
73
73
|
published_at: Dată publicare
|
74
|
+
taxonomies: Taxonomii
|
74
75
|
title: Titlu
|
75
76
|
posts:
|
76
77
|
edit:
|
78
|
+
add_attachments: Adaugați atașamente
|
79
|
+
attachment_legend: Adăugați un document sau o imagine
|
77
80
|
back: Înapoi la postare
|
78
81
|
button: Actualizați
|
82
|
+
edit_attachments: Actualizați atașamente
|
79
83
|
title: Modificați postarea
|
80
84
|
form:
|
81
85
|
author_id: Autor
|
@@ -102,20 +106,22 @@ ro:
|
|
102
106
|
comment: Comentați
|
103
107
|
create: Creați
|
104
108
|
destroy: Ștergeți
|
105
|
-
endorse: Susțineți
|
106
109
|
update: Actualizați
|
107
110
|
name: Blog
|
108
111
|
settings:
|
109
112
|
global:
|
110
113
|
announcement: Anunț
|
114
|
+
attachments_allowed: Permiteți atașamente
|
111
115
|
comments_enabled: Comentarii activate
|
112
116
|
comments_max_length: Lungimea maximă a comentariilor (lăsați 0 pentru valoarea implicită)
|
113
117
|
creation_enabled_for_participants: Participanții pot crea postări
|
118
|
+
define_taxonomy_filters: Vă rugăm să definiți niște filtre pentru acest spațiu participativ înainte de a utiliza această setare.
|
119
|
+
no_taxonomy_filters_found: Nici un filtru de taxonomie găsit.
|
120
|
+
taxonomy_filters: Selectați filtrele pentru componentă
|
121
|
+
taxonomy_filters_add: Adaugați filtru
|
114
122
|
step:
|
115
123
|
announcement: Anunț
|
116
124
|
comments_blocked: Comentarii blocate
|
117
|
-
endorsements_blocked: Susțineri dezactivate
|
118
|
-
endorsements_enabled: Susțineri activate
|
119
125
|
events:
|
120
126
|
blogs:
|
121
127
|
post_created:
|
@@ -136,14 +142,12 @@ ro:
|
|
136
142
|
id: Id-ul unic al comentariului
|
137
143
|
locale: Localizarea (limba) pe care participantul a folosit-o atunci când a lăsat acest comentariu
|
138
144
|
root_commentable_url: URL-ul resursei care se leagă de acest comentariu
|
139
|
-
user_group: Numele grupului de utilizatori care a făcut acest comentariu (dacă există)
|
140
145
|
posts:
|
141
146
|
author: Informațiile autorului
|
142
147
|
body: Conținutul postării
|
143
148
|
comments_count: Numărul de comentarii pe care le are această postare
|
144
149
|
component: Componenta căreia îi aparține postarea
|
145
150
|
created_at: Data la care acestă postare a fost creată
|
146
|
-
endorsements_count: Numărul de aprobări pe care această postare le-a primit
|
147
151
|
follows_count: Numărul de urmăritori al acestei postări
|
148
152
|
id: Identificatorul unic al acestei postări
|
149
153
|
participatory_space: Cărui spațiu (de exemplu, proces participativ sau adunare) aparține această postare
|
@@ -153,3 +157,4 @@ ro:
|
|
153
157
|
url: URL-ul pentru această postare
|
154
158
|
statistics:
|
155
159
|
posts_count: Postări
|
160
|
+
posts_count_tooltip: Numărul de actualizări publicate sau postări de blog.
|
data/config/locales/ru.yml
CHANGED
@@ -65,7 +65,6 @@ ru:
|
|
65
65
|
comment: Комментарий
|
66
66
|
create: Создать
|
67
67
|
destroy: Удалить
|
68
|
-
endorse: Поддержать
|
69
68
|
update: Обновить
|
70
69
|
name: Блог
|
71
70
|
settings:
|
@@ -76,8 +75,6 @@ ru:
|
|
76
75
|
step:
|
77
76
|
announcement: Объявление
|
78
77
|
comments_blocked: Комментарии отключены
|
79
|
-
endorsements_blocked: Возможность выразить поддержку отключена
|
80
|
-
endorsements_enabled: Возможность выразить поддержку включена
|
81
78
|
events:
|
82
79
|
blogs:
|
83
80
|
post_created:
|
data/config/locales/sk.yml
CHANGED
data/config/locales/sq-AL.yml
CHANGED
@@ -70,7 +70,6 @@ sq:
|
|
70
70
|
comment: Koment
|
71
71
|
create: Krijo
|
72
72
|
destroy: Fshij
|
73
|
-
endorse: Mirato
|
74
73
|
update: Përditëso
|
75
74
|
name: Blog
|
76
75
|
settings:
|
@@ -81,8 +80,6 @@ sq:
|
|
81
80
|
step:
|
82
81
|
announcement: Njoftim
|
83
82
|
comments_blocked: Komentet të bllokuara
|
84
|
-
endorsements_blocked: Mbështetjet të bllokuara
|
85
|
-
endorsements_enabled: Mbështetjet të aktivizuara
|
86
83
|
events:
|
87
84
|
blogs:
|
88
85
|
post_created:
|
data/config/locales/sr-CS.yml
CHANGED
data/config/locales/sv.yml
CHANGED
@@ -19,6 +19,8 @@ sv:
|
|
19
19
|
admin_log:
|
20
20
|
changeset:
|
21
21
|
posts: Inlägg
|
22
|
+
tooltips:
|
23
|
+
deleted_posts_info: Kan inte ta bort detta inlägg
|
22
24
|
blogs:
|
23
25
|
actions:
|
24
26
|
author_id: Skapa inlägg som
|
@@ -70,11 +72,15 @@ sv:
|
|
70
72
|
body: Innehåll
|
71
73
|
official_blog_post: Officiellt inlägg
|
72
74
|
published_at: Publicerad
|
75
|
+
taxonomies: Kategorier
|
73
76
|
title: Titel
|
74
77
|
posts:
|
75
78
|
edit:
|
79
|
+
add_attachments: Lägg till bilagor
|
80
|
+
attachment_legend: Lägg till ett dokument eller en bild
|
76
81
|
back: Tillbaka till inlägget
|
77
82
|
button: Uppdatera
|
83
|
+
edit_attachments: Redigera bilagor
|
78
84
|
title: Redigera inlägg
|
79
85
|
form:
|
80
86
|
author_id: Författare
|
@@ -100,20 +106,25 @@ sv:
|
|
100
106
|
comment: Kommentera
|
101
107
|
create: Skapa
|
102
108
|
destroy: Radera
|
103
|
-
|
109
|
+
like: Gilla
|
104
110
|
update: Uppdatera
|
105
111
|
name: Blogg
|
106
112
|
settings:
|
107
113
|
global:
|
108
114
|
announcement: Meddelande
|
115
|
+
attachments_allowed: Tillåt bilagor
|
109
116
|
comments_enabled: Aktivera kommentarer
|
110
117
|
comments_max_length: Maximal kommentarslängd (ange 0 för att använda standardvärdet)
|
111
118
|
creation_enabled_for_participants: Deltagarna kan skapa inlägg
|
119
|
+
define_taxonomy_filters: Vänligen definiera några filter för deltagarutrymmet innan du använder den här inställningen.
|
120
|
+
no_taxonomy_filters_found: Inga filter för kategorier hittades.
|
121
|
+
taxonomy_filters: Välj filter för komponenten
|
122
|
+
taxonomy_filters_add: Lägg till filter
|
112
123
|
step:
|
113
124
|
announcement: Meddelande
|
114
125
|
comments_blocked: Stäng av kommentarer
|
115
|
-
|
116
|
-
|
126
|
+
likes_blocked: Stäng av gilla-markeringar
|
127
|
+
likes_enabled: Aktivera gilla-markeringar
|
117
128
|
events:
|
118
129
|
blogs:
|
119
130
|
post_created:
|
@@ -134,16 +145,15 @@ sv:
|
|
134
145
|
id: Id för kommentaren
|
135
146
|
locale: Kommentarförfattarens språk
|
136
147
|
root_commentable_url: URL till innehållet som är relaterat till kommentaren
|
137
|
-
user_group: Namn på gruppen som kommenterat (om det var en grupp)
|
138
148
|
posts:
|
139
149
|
author: Uppgifter om författaren
|
140
150
|
body: Inläggets text
|
141
151
|
comments_count: Antalet kommentarer till inlägget
|
142
152
|
component: Komponenten som inlägget tillhör
|
143
153
|
created_at: Datum för inlägget
|
144
|
-
endorsements_count: Antal gilla-markeringar för inlägget
|
145
154
|
follows_count: Antal följare för inlägget
|
146
155
|
id: Unikt id för inlägget
|
156
|
+
likes_count: Antal gilla-markeringar för inlägget
|
147
157
|
participatory_space: Vilket utrymme (deltagandeprocess eller samråd) inlägget tillhör
|
148
158
|
published_at: Publiceringsdatum för inlägget
|
149
159
|
title: Titeln på inlägget
|
@@ -151,3 +161,4 @@ sv:
|
|
151
161
|
url: URL för inlägget
|
152
162
|
statistics:
|
153
163
|
posts_count: Inlägg
|
164
|
+
posts_count_tooltip: Antal publicerade uppdateringar eller blogginlägg.
|
data/config/locales/tr-TR.yml
CHANGED
data/config/locales/zh-CN.yml
CHANGED
data/config/locales/zh-TW.yml
CHANGED
@@ -58,7 +58,6 @@ zh-TW:
|
|
58
58
|
comment: 評論
|
59
59
|
create: 建立
|
60
60
|
destroy: 刪除
|
61
|
-
endorse: 支持
|
62
61
|
update: 更新
|
63
62
|
name: 部落格
|
64
63
|
settings:
|
@@ -69,8 +68,6 @@ zh-TW:
|
|
69
68
|
step:
|
70
69
|
announcement: 公告
|
71
70
|
comments_blocked: 留言已封鎖
|
72
|
-
endorsements_blocked: 背書已封鎖
|
73
|
-
endorsements_enabled: 背書已啟用
|
74
71
|
events:
|
75
72
|
blogs:
|
76
73
|
post_created:
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Blogs
|
5
5
|
class PostInputSort < Decidim::Core::BaseInputSort
|
6
6
|
include Decidim::Core::HasTimestampInputSort
|
7
|
-
include Decidim::Core::
|
7
|
+
include Decidim::Core::HasLikeableInputSort
|
8
8
|
|
9
9
|
graphql_name "PostSort"
|
10
10
|
description "A type used for sorting blog posts"
|
@@ -7,8 +7,9 @@ module Decidim
|
|
7
7
|
implements Decidim::Comments::CommentableInterface
|
8
8
|
implements Decidim::Core::AttachableInterface
|
9
9
|
implements Decidim::Core::AuthorableInterface
|
10
|
+
implements Decidim::Core::FollowableInterface
|
10
11
|
implements Decidim::Core::TraceableInterface
|
11
|
-
implements Decidim::Core::
|
12
|
+
implements Decidim::Core::LikeableInterface
|
12
13
|
implements Decidim::Core::TimestampsInterface
|
13
14
|
|
14
15
|
description "A post"
|
@@ -17,6 +18,11 @@ module Decidim
|
|
17
18
|
field :id, GraphQL::Types::ID, "The internal ID of this post", null: false
|
18
19
|
field :published_at, Decidim::Core::DateTimeType, "The time this page was published", null: false
|
19
20
|
field :title, Decidim::Core::TranslatedFieldType, "The title for this post", null: true
|
21
|
+
field :url, String, "The URL for this post", null: false
|
22
|
+
|
23
|
+
def url
|
24
|
+
Decidim::ResourceLocatorPresenter.new(object).url
|
25
|
+
end
|
20
26
|
|
21
27
|
def self.authorized?(object, context)
|
22
28
|
context[:post] = object
|
@@ -13,30 +13,44 @@ Decidim.register_component(:blogs) do |component|
|
|
13
13
|
raise StandardError, "Cannot remove this component" if Decidim::Blogs::Post.where(component: instance).any?
|
14
14
|
end
|
15
15
|
|
16
|
-
component.register_stat :posts_count,
|
16
|
+
component.register_stat :posts_count,
|
17
|
+
primary: true,
|
18
|
+
priority: Decidim::StatsRegistry::MEDIUM_PRIORITY,
|
19
|
+
icon_name: "pen-nib-line",
|
20
|
+
tooltip_key: "posts_count_tooltip" do |components, _start_at, _end_at|
|
21
|
+
Decidim::Blogs::Post.where(component: components).count
|
22
|
+
end
|
23
|
+
|
24
|
+
component.register_stat :comments_count,
|
25
|
+
priority: Decidim::StatsRegistry::HIGH_PRIORITY,
|
26
|
+
icon_name: "chat-1-line",
|
27
|
+
tooltip_key: "comments_count",
|
28
|
+
tag: :comments do |components, _start_at, _end_at|
|
17
29
|
Decidim::Blogs::Post.where(component: components).count
|
18
30
|
end
|
19
31
|
|
20
32
|
component.actions = %w(create update destroy)
|
21
33
|
|
22
34
|
component.settings(:global) do |settings|
|
35
|
+
settings.attribute :taxonomy_filters, type: :taxonomy_filters
|
23
36
|
settings.attribute :announcement, type: :text, translated: true, editor: true
|
24
37
|
settings.attribute :comments_enabled, type: :boolean, default: true
|
25
38
|
settings.attribute :comments_max_length, type: :integer, required: true
|
26
39
|
settings.attribute :creation_enabled_for_participants, type: :boolean, default: false
|
40
|
+
settings.attribute :attachments_allowed, type: :boolean, default: false
|
27
41
|
end
|
28
42
|
|
29
43
|
component.settings(:step) do |settings|
|
30
44
|
settings.attribute :announcement, type: :text, translated: true, editor: true
|
31
45
|
settings.attribute :comments_blocked, type: :boolean, default: false
|
32
|
-
settings.attribute :
|
33
|
-
settings.attribute :
|
46
|
+
settings.attribute :likes_enabled, type: :boolean, default: true
|
47
|
+
settings.attribute :likes_blocked, type: :boolean
|
34
48
|
end
|
35
49
|
|
36
50
|
component.register_resource(:blogpost) do |resource|
|
37
51
|
resource.model_class_name = "Decidim::Blogs::Post"
|
38
52
|
resource.card = "decidim/blogs/post"
|
39
|
-
resource.actions = %w(
|
53
|
+
resource.actions = %w(like comment)
|
40
54
|
resource.searchable = true
|
41
55
|
end
|
42
56
|
|
@@ -58,7 +72,7 @@ Decidim.register_component(:blogs) do |component|
|
|
58
72
|
exports.collection do |component_instance|
|
59
73
|
Decidim::Comments::Export.comments_for_resource(
|
60
74
|
Decidim::Blogs::Post, component_instance
|
61
|
-
).includes(:author,
|
75
|
+
).includes(:author, root_commentable: { component: { participatory_space: :organization } })
|
62
76
|
end
|
63
77
|
|
64
78
|
exports.include_in_open_data = true
|
data/lib/decidim/blogs/engine.rb
CHANGED
@@ -30,7 +30,7 @@ module Decidim
|
|
30
30
|
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Blogs::Engine.root}/app/views") # for partials
|
31
31
|
end
|
32
32
|
|
33
|
-
initializer "decidim_blogs.
|
33
|
+
initializer "decidim_blogs.shakapacker.assets_path" do
|
34
34
|
Decidim.register_assets_path File.expand_path("app/packs", root)
|
35
35
|
end
|
36
36
|
|
@@ -25,7 +25,7 @@ module Decidim
|
|
25
25
|
created_at: post.created_at,
|
26
26
|
updated_at: post.updated_at,
|
27
27
|
published_at: post.published_at,
|
28
|
-
|
28
|
+
likes_count: post.likes_count,
|
29
29
|
comments_count: post.comments_count,
|
30
30
|
follows_count: post.follows_count,
|
31
31
|
participatory_space: {
|
@@ -60,7 +60,7 @@ module Decidim
|
|
60
60
|
|
61
61
|
def author_url(author)
|
62
62
|
if author.respond_to?(:nickname)
|
63
|
-
profile_url(author) # is a Decidim::User
|
63
|
+
profile_url(author) # is a Decidim::User
|
64
64
|
else
|
65
65
|
root_url # is a Decidim::Organization
|
66
66
|
end
|
@@ -38,21 +38,11 @@ module Decidim
|
|
38
38
|
case post.author.class.name
|
39
39
|
when "Decidim::Organization"
|
40
40
|
author_organization
|
41
|
-
when "Decidim::UserGroup"
|
42
|
-
author_user_group
|
43
41
|
when "Decidim::User"
|
44
42
|
author_user
|
45
43
|
end
|
46
44
|
end
|
47
45
|
|
48
|
-
def author_user_group
|
49
|
-
{
|
50
|
-
"@type": "Organization",
|
51
|
-
name: post.author.name,
|
52
|
-
url: profile_url(post.author)
|
53
|
-
}
|
54
|
-
end
|
55
|
-
|
56
46
|
def author_organization
|
57
47
|
{
|
58
48
|
"@type": "Organization",
|
data/lib/decidim/blogs/seeds.rb
CHANGED
@@ -4,7 +4,7 @@ require "decidim/components/namer"
|
|
4
4
|
|
5
5
|
module Decidim
|
6
6
|
module Blogs
|
7
|
-
class Seeds
|
7
|
+
class Seeds < Decidim::Seeds
|
8
8
|
attr_reader :participatory_space
|
9
9
|
|
10
10
|
def initialize(participatory_space:)
|
@@ -43,11 +43,9 @@ module Decidim
|
|
43
43
|
Decidim::Component.create!(params)
|
44
44
|
end
|
45
45
|
|
46
|
-
|
46
|
+
number_of_records.times do |n|
|
47
47
|
author = if n >= 3
|
48
48
|
Decidim::User.where(organization: component.organization).sample
|
49
|
-
elsif n <= 1
|
50
|
-
Decidim::UserGroup.where(organization: component.organization).sample
|
51
49
|
else
|
52
50
|
component.organization
|
53
51
|
end
|
@@ -15,18 +15,18 @@ FactoryBot.define do
|
|
15
15
|
manifest_name { :blogs }
|
16
16
|
participatory_space { create(:participatory_process, :with_steps, skip_injection:, organization:) }
|
17
17
|
|
18
|
-
trait :
|
18
|
+
trait :with_likes_enabled do
|
19
19
|
step_settings do
|
20
20
|
{
|
21
|
-
participatory_space.active_step.id => {
|
21
|
+
participatory_space.active_step.id => { likes_enabled: true }
|
22
22
|
}
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
trait :
|
26
|
+
trait :with_likes_disabled do
|
27
27
|
step_settings do
|
28
28
|
{
|
29
|
-
participatory_space.active_step.id => {
|
29
|
+
participatory_space.active_step.id => { likes_enabled: false }
|
30
30
|
}
|
31
31
|
end
|
32
32
|
end
|
@@ -38,6 +38,15 @@ FactoryBot.define do
|
|
38
38
|
}
|
39
39
|
end
|
40
40
|
end
|
41
|
+
|
42
|
+
trait :with_attachments_allowed_and_creation_enabled do
|
43
|
+
settings do
|
44
|
+
{
|
45
|
+
attachments_allowed: true,
|
46
|
+
creation_enabled_for_participants: true
|
47
|
+
}
|
48
|
+
end
|
49
|
+
end
|
41
50
|
end
|
42
51
|
|
43
52
|
factory :post, class: "Decidim::Blogs::Post" do
|
@@ -55,10 +64,10 @@ FactoryBot.define do
|
|
55
64
|
published_at { 2.minutes.ago }
|
56
65
|
end
|
57
66
|
|
58
|
-
trait :
|
67
|
+
trait :with_likes do
|
59
68
|
after :create do |post, evaluator|
|
60
69
|
5.times.collect do
|
61
|
-
create(:
|
70
|
+
create(:like,
|
62
71
|
resource: post,
|
63
72
|
skip_injection: evaluator.skip_injection,
|
64
73
|
author: build(:user, :confirmed, skip_injection: evaluator.skip_injection, organization: post.participatory_space.organization))
|
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.
|
4
|
+
version: 0.31.0.rc1
|
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: 2025-09-
|
11
|
+
date: 2025-09-25 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.
|
19
|
+
version: 0.31.0.rc1
|
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.
|
26
|
+
version: 0.31.0.rc1
|
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.
|
33
|
+
version: 0.31.0.rc1
|
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.
|
40
|
+
version: 0.31.0.rc1
|
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.
|
47
|
+
version: 0.31.0.rc1
|
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.
|
54
|
+
version: 0.31.0.rc1
|
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.
|
61
|
+
version: 0.31.0.rc1
|
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.
|
68
|
+
version: 0.31.0.rc1
|
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.
|
75
|
+
version: 0.31.0.rc1
|
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.
|
82
|
+
version: 0.31.0.rc1
|
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.
|
89
|
+
version: 0.31.0.rc1
|
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.
|
96
|
+
version: 0.31.0.rc1
|
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.
|
103
|
+
version: 0.31.0.rc1
|
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.
|
110
|
+
version: 0.31.0.rc1
|
111
111
|
description: A Blog component for decidim's participatory spaces.
|
112
112
|
email:
|
113
113
|
- isaac.mg@coditramuntana.com
|
@@ -264,6 +264,7 @@ files:
|
|
264
264
|
- db/migrate/20210310120514_add_followable_counter_cache_to_blogs.rb
|
265
265
|
- db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb
|
266
266
|
- db/migrate/20240828103324_add_deleted_at_to_decidim_blogs_posts.rb
|
267
|
+
- db/migrate/20250515133229_rename_blog_posts_endorsements_count_to_likes.rb
|
267
268
|
- decidim-blogs.gemspec
|
268
269
|
- lib/decidim/api/blogs_type.rb
|
269
270
|
- lib/decidim/api/post_input_filter.rb
|