decidim-blogs 0.20.1 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/types/decidim/blogs/blogs_type.rb +32 -0
- data/app/types/decidim/blogs/post_type.rb +23 -0
- data/config/locales/el.yml +1 -0
- data/db/migrate/20191212162606_add_user_group_author_to_blogs.rb +7 -0
- data/lib/decidim/blogs/component.rb +2 -0
- data/lib/decidim/blogs/version.rb +1 -1
- metadata +20 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ffb146f8393d89cf23c01f44b51d8e5caec159b6ba0147179a105b1a81f1a3c
|
4
|
+
data.tar.gz: c2ca7c30f1c2af6405abd47df267138634f87f4537405b6a07e4a49b6e6cb7e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd6f92894919716ded583a58d7e177c4e64edc2a0c2692e6d3712b300e4286ebef99af5ea74db64b3d8c35505829aa126d3849bd581126a8e2a1b94893edeacc
|
7
|
+
data.tar.gz: abd58ef1553ed0f47e541fd8301d963687f868da57ea029cf1b691e78ccc5dc96ca0a0acd2c67f1b15391b58f9878009780f5d0377a195394e8f3718958cf1fb
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Blogs
|
5
|
+
BlogsType = GraphQL::ObjectType.define do
|
6
|
+
interfaces [-> { Decidim::Core::ComponentInterface }]
|
7
|
+
|
8
|
+
name "Blogs"
|
9
|
+
description "A blogs component of a participatory space."
|
10
|
+
|
11
|
+
connection :posts, PostType.connection_type do
|
12
|
+
resolve ->(component, _args, _ctx) {
|
13
|
+
PostsTypeHelper.base_scope(component).includes(:component)
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
field(:post, PostType) do
|
18
|
+
argument :id, !types.ID
|
19
|
+
|
20
|
+
resolve ->(component, args, _ctx) {
|
21
|
+
PostsTypeHelper.base_scope(component).find_by(id: args[:id])
|
22
|
+
}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
module PostsTypeHelper
|
27
|
+
def self.base_scope(component)
|
28
|
+
Post.where(component: component)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Blogs
|
5
|
+
# This type represents a Post.
|
6
|
+
PostType = GraphQL::ObjectType.define do
|
7
|
+
interfaces [
|
8
|
+
-> { Decidim::Comments::CommentableInterface },
|
9
|
+
-> { Decidim::Core::AttachableInterface },
|
10
|
+
-> { Decidim::Core::AuthorableInterface }
|
11
|
+
]
|
12
|
+
|
13
|
+
name "Post"
|
14
|
+
description "A post"
|
15
|
+
|
16
|
+
field :id, !types.ID, "The internal ID of this post"
|
17
|
+
field :title, Decidim::Core::TranslatedFieldType, "The title for this post"
|
18
|
+
field :body, Decidim::Core::TranslatedFieldType, "The body of this post"
|
19
|
+
field :createdAt, Decidim::Core::DateTimeType, "The time this post was created", property: :created_at
|
20
|
+
field :updatedAt, Decidim::Core::DateTimeType, "The time this post was updated", property: :updated_at
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
el:
|
@@ -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
|
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.21.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Isaac Massot Gil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: decidim-admin
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.21.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.21.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: decidim-comments
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.21.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.21.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: decidim-core
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.21.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.21.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: httparty
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,56 +100,56 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - '='
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.
|
103
|
+
version: 0.21.0
|
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.21.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: decidim-assemblies
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - '='
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
117
|
+
version: 0.21.0
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - '='
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.
|
124
|
+
version: 0.21.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: decidim-dev
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - '='
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.
|
131
|
+
version: 0.21.0
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - '='
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0.
|
138
|
+
version: 0.21.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: decidim-participatory_processes
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - '='
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.
|
145
|
+
version: 0.21.0
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - '='
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
152
|
+
version: 0.21.0
|
153
153
|
description: A Blog component for decidim's participatory spaces.
|
154
154
|
email:
|
155
155
|
- isaac.mg@coditramuntana.com
|
@@ -181,6 +181,8 @@ files:
|
|
181
181
|
- app/models/decidim/blogs/post.rb
|
182
182
|
- app/permissions/decidim/blog/permissions.rb
|
183
183
|
- app/presenters/decidim/blogs/post_presenter.rb
|
184
|
+
- app/types/decidim/blogs/blogs_type.rb
|
185
|
+
- app/types/decidim/blogs/post_type.rb
|
184
186
|
- app/views/decidim/blogs/admin/posts/_form.html.erb
|
185
187
|
- app/views/decidim/blogs/admin/posts/edit.html.erb
|
186
188
|
- app/views/decidim/blogs/admin/posts/index.html.erb
|
@@ -197,6 +199,7 @@ files:
|
|
197
199
|
- config/locales/cs.yml
|
198
200
|
- config/locales/de.yml
|
199
201
|
- config/locales/el-GR.yml
|
202
|
+
- config/locales/el.yml
|
200
203
|
- config/locales/en.yml
|
201
204
|
- config/locales/eo-UY.yml
|
202
205
|
- config/locales/es-MX.yml
|
@@ -224,6 +227,7 @@ files:
|
|
224
227
|
- db/migrate/20171129131353_create_decidim_blogs_posts.rb
|
225
228
|
- db/migrate/20171211084630_add_author_to_decidim_blogs_posts.rb
|
226
229
|
- db/migrate/20181017084519_make_blogposts_authors_polymorphics.rb
|
230
|
+
- db/migrate/20191212162606_add_user_group_author_to_blogs.rb
|
227
231
|
- lib/decidim/blogs.rb
|
228
232
|
- lib/decidim/blogs/admin.rb
|
229
233
|
- lib/decidim/blogs/admin_engine.rb
|