decidim-blogs 0.11.2 → 0.12.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/blogs/post_cell.rb +19 -0
- data/app/cells/decidim/blogs/post_m/footer.erb +5 -0
- data/app/cells/decidim/blogs/post_m_cell.rb +15 -0
- data/app/controllers/decidim/blogs/admin/posts_controller.rb +5 -0
- data/app/permissions/decidim/blog/permissions.rb +21 -0
- data/app/presenters/decidim/{module/blogs → blogs}/post_presenter.rb +0 -0
- data/app/views/decidim/blogs/admin/posts/index.html.erb +3 -3
- data/app/views/decidim/blogs/posts/_posts.html.erb +1 -1
- data/app/views/decidim/blogs/posts/show.html.erb +1 -1
- data/config/locales/ca.yml +14 -6
- data/config/locales/en.yml +14 -6
- data/config/locales/es.yml +14 -6
- data/config/locales/eu.yml +14 -6
- data/config/locales/fi.yml +14 -6
- data/config/locales/fr.yml +14 -6
- data/config/locales/gl.yml +14 -6
- data/config/locales/it.yml +14 -6
- data/config/locales/nl.yml +14 -6
- data/config/locales/pl.yml +16 -6
- data/config/locales/pt-BR.yml +14 -6
- data/config/locales/pt.yml +14 -6
- data/config/locales/ru.yml +3 -0
- data/config/locales/sv.yml +14 -6
- data/config/locales/uk.yml +16 -6
- data/lib/decidim/blogs/component.rb +3 -1
- data/lib/decidim/blogs/engine.rb +5 -0
- data/lib/decidim/blogs/version.rb +1 -1
- metadata +23 -20
- data/app/views/decidim/blogs/posts/_author_data.html.erb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba1edd55ab92f50f43fb55ec07509195bcfd78fe4c17ebd3d45fd3cc7f2d6283
|
4
|
+
data.tar.gz: 217b3b9ab458f70a6ff632fa3fb7adb80dbe1c38054d1b3b753eb757a1e7be47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d30e1dc107e5d923fc309c2d0876f02f95b2b3203e704f5f8883851cfbfea4d772313a2a5e616eaadeac34f6067bd40f76364bd0f30dc8bbcdfa5cd8faba6a5
|
7
|
+
data.tar.gz: 214ff956450139af15c35cd16335e2095bff58e579facae6cade0dbad4a4b741e2cc95bf5e280d0b0e5f9eeb534033a69da4a116d3d1c9039908d953f4003f46
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Blogs
|
5
|
+
# This cell renders the card for an instance of a Post
|
6
|
+
# the default size is the Medium Card (:m)
|
7
|
+
class PostCell < Decidim::ViewModel
|
8
|
+
def show
|
9
|
+
cell card_size, model
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def card_size
|
15
|
+
"decidim/blogs/post_m"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Blogs
|
5
|
+
# This cell renders the Medium (:m) post card
|
6
|
+
# for an given instance of a Post
|
7
|
+
class PostMCell < Decidim::CardMCell
|
8
|
+
private
|
9
|
+
|
10
|
+
def has_actions?
|
11
|
+
false
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -6,10 +6,12 @@ module Decidim
|
|
6
6
|
# This controller allows the create or update a blog.
|
7
7
|
class PostsController < Admin::ApplicationController
|
8
8
|
def new
|
9
|
+
enforce_permission_to :create, :blogpost
|
9
10
|
@form = form(PostForm).instance
|
10
11
|
end
|
11
12
|
|
12
13
|
def create
|
14
|
+
enforce_permission_to :create, :blogpost
|
13
15
|
@form = form(PostForm).from_params(params, current_component: current_component)
|
14
16
|
|
15
17
|
CreatePost.call(@form, current_user) do
|
@@ -26,10 +28,12 @@ module Decidim
|
|
26
28
|
end
|
27
29
|
|
28
30
|
def edit
|
31
|
+
enforce_permission_to :update, :blogpost, blogpost: post
|
29
32
|
@form = form(PostForm).from_model(post)
|
30
33
|
end
|
31
34
|
|
32
35
|
def update
|
36
|
+
enforce_permission_to :update, :blogpost, blogpost: post
|
33
37
|
@form = form(PostForm).from_params(params, current_component: current_component)
|
34
38
|
|
35
39
|
UpdatePost.call(@form, post) do
|
@@ -46,6 +50,7 @@ module Decidim
|
|
46
50
|
end
|
47
51
|
|
48
52
|
def destroy
|
53
|
+
enforce_permission_to :destroy, :blogpost, blogpost: post
|
49
54
|
post.destroy!
|
50
55
|
|
51
56
|
flash[:notice] = I18n.t("posts.destroy.success", scope: "decidim.blogs.admin")
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Blog
|
5
|
+
class Permissions < Decidim::DefaultPermissions
|
6
|
+
def permissions
|
7
|
+
return permission_action unless permission_action.subject == :blogpost
|
8
|
+
|
9
|
+
if permission_action.scope == :public
|
10
|
+
allow!
|
11
|
+
return permission_action
|
12
|
+
end
|
13
|
+
|
14
|
+
return permission_action if permission_action.scope != :admin
|
15
|
+
|
16
|
+
allow!
|
17
|
+
permission_action
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
File without changes
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<div class="card-divider">
|
3
3
|
<h2 class="card-title">
|
4
4
|
<%= t(".title") %>
|
5
|
-
<%= link_to t("actions.new", scope: "decidim.blogs", name: t("models.post.name", scope: "decidim.blogs.admin")), new_post_path, class: "button tiny button--title" if
|
5
|
+
<%= link_to t("actions.new", scope: "decidim.blogs", name: t("models.post.name", scope: "decidim.blogs.admin")), new_post_path, class: "button tiny button--title" if allowed_to? :create, :blogpost %>
|
6
6
|
</h2>
|
7
7
|
</div>
|
8
8
|
|
@@ -35,11 +35,11 @@
|
|
35
35
|
<%= l post.created_at, format: "%d/%m/%Y - %H:%M" %>
|
36
36
|
</td>
|
37
37
|
<td class="table-list__actions">
|
38
|
-
<% if
|
38
|
+
<% if allowed_to? :update, :blogpost, blog_post: post %>
|
39
39
|
<%= icon_link_to "pencil", edit_post_path(post), t("actions.edit", scope: "decidim.blogs"), class: "action-icon--edit" %>
|
40
40
|
<% end %>
|
41
41
|
|
42
|
-
<% if
|
42
|
+
<% if allowed_to? :destroy, :blogpost, blog_post: post %>
|
43
43
|
<%= icon_link_to "circle-x", post_path(post), t("actions.destroy", scope: "decidim.blogs"), method: :delete, class: "action-icon--remove", data: { confirm: t("actions.confirm_destroy", scope: "decidim.blogs") } %>
|
44
44
|
<% end %>
|
45
45
|
</td>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<div class="columns medium-7 mediumlarge-8">
|
10
10
|
<div class="row column view-header">
|
11
11
|
<h2 class="heading2"><%= translated_attribute post.title %></h2>
|
12
|
-
<%=
|
12
|
+
<%= cell "decidim/author", present(post.author), from: post %>
|
13
13
|
</div>
|
14
14
|
<div class="section">
|
15
15
|
<p><%= sanitize translated_attribute post.body %></p>
|
data/config/locales/ca.yml
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
ca:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/blogs/create_post_event: Nova publicació del bloc
|
5
|
+
activerecord:
|
6
|
+
models:
|
7
|
+
decidim/blogs/post:
|
8
|
+
one: Publicació
|
9
|
+
other: Publicacions
|
2
10
|
decidim:
|
3
11
|
blogs:
|
4
12
|
actions:
|
@@ -37,8 +45,8 @@ ca:
|
|
37
45
|
created_at: Creat el
|
38
46
|
title: títol
|
39
47
|
posts:
|
40
|
-
|
41
|
-
|
48
|
+
show:
|
49
|
+
view: Veure
|
42
50
|
sidebar_blog:
|
43
51
|
comments: comentaris
|
44
52
|
most_commented_posts: Publicacions més comentades
|
@@ -60,10 +68,10 @@ ca:
|
|
60
68
|
email_outro: Has rebut aquesta notificació perquè estàs seguint "%{participatory_space_title}". Pots deixar de seguir-lo des de l'enllaç anterior.
|
61
69
|
email_subject: Nova publicació publicada a %{participatory_space_title}
|
62
70
|
notification_title: La publicació <a href="%{resource_path}">%{resource_title}</a> ha estat publicada a %{participatory_space_title}
|
71
|
+
pages:
|
72
|
+
home:
|
73
|
+
statistics:
|
74
|
+
posts_count: Publicacions
|
63
75
|
participatory_processes:
|
64
76
|
statistics:
|
65
77
|
posts_count: Publicacions
|
66
|
-
pages:
|
67
|
-
home:
|
68
|
-
statistics:
|
69
|
-
posts_count: Publicacions
|
data/config/locales/en.yml
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
---
|
2
2
|
en:
|
3
|
+
activemodel:
|
4
|
+
models:
|
5
|
+
decidim/blogs/create_post_event: New blog post
|
6
|
+
activerecord:
|
7
|
+
models:
|
8
|
+
decidim/blogs/post:
|
9
|
+
one: Post
|
10
|
+
other: Posts
|
3
11
|
decidim:
|
4
12
|
blogs:
|
5
13
|
actions:
|
@@ -38,8 +46,8 @@ en:
|
|
38
46
|
created_at: Created at
|
39
47
|
title: title
|
40
48
|
posts:
|
41
|
-
|
42
|
-
|
49
|
+
show:
|
50
|
+
view: View
|
43
51
|
sidebar_blog:
|
44
52
|
comments: comments
|
45
53
|
most_commented_posts: Most commented posts
|
@@ -61,10 +69,10 @@ en:
|
|
61
69
|
email_outro: You have received this notification because you are following "%{participatory_space_title}". You can unfollow it from the previous link.
|
62
70
|
email_subject: New post published in %{participatory_space_title}
|
63
71
|
notification_title: The post <a href="%{resource_path}">%{resource_title}</a> has been published in %{participatory_space_title}
|
72
|
+
pages:
|
73
|
+
home:
|
74
|
+
statistics:
|
75
|
+
posts_count: Posts
|
64
76
|
participatory_processes:
|
65
77
|
statistics:
|
66
78
|
posts_count: Posts
|
67
|
-
pages:
|
68
|
-
home:
|
69
|
-
statistics:
|
70
|
-
posts_count: Posts
|
data/config/locales/es.yml
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
es:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/blogs/create_post_event: Nueva publicación del blog
|
5
|
+
activerecord:
|
6
|
+
models:
|
7
|
+
decidim/blogs/post:
|
8
|
+
one: Publicación
|
9
|
+
other: Publicaciones
|
2
10
|
decidim:
|
3
11
|
blogs:
|
4
12
|
actions:
|
@@ -37,8 +45,8 @@ es:
|
|
37
45
|
created_at: Creado en
|
38
46
|
title: título
|
39
47
|
posts:
|
40
|
-
|
41
|
-
|
48
|
+
show:
|
49
|
+
view: Ver
|
42
50
|
sidebar_blog:
|
43
51
|
comments: comentarios
|
44
52
|
most_commented_posts: Publicaciones más comentadas
|
@@ -60,10 +68,10 @@ es:
|
|
60
68
|
email_outro: Recibió esta notificación porque está siguiendo "%{participatory_space_title}". Puedes dejar de seguirlo desde el enlace anterior.
|
61
69
|
email_subject: Nueva publicación publicada en %{participatory_space_title}
|
62
70
|
notification_title: La publicación <a href="%{resource_path}">%{resource_title}</a> se publicó en %{participatory_space_title}.
|
71
|
+
pages:
|
72
|
+
home:
|
73
|
+
statistics:
|
74
|
+
posts_count: Publicaciones
|
63
75
|
participatory_processes:
|
64
76
|
statistics:
|
65
77
|
posts_count: Publicaciones
|
66
|
-
pages:
|
67
|
-
home:
|
68
|
-
statistics:
|
69
|
-
posts_count: Publicaciones
|
data/config/locales/eu.yml
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
eu:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/blogs/create_post_event: Blogeko post berria
|
5
|
+
activerecord:
|
6
|
+
models:
|
7
|
+
decidim/blogs/post:
|
8
|
+
one: Post
|
9
|
+
other: Mezuak
|
2
10
|
decidim:
|
3
11
|
blogs:
|
4
12
|
actions:
|
@@ -37,8 +45,8 @@ eu:
|
|
37
45
|
created_at: Sortutako at
|
38
46
|
title: Izenburua
|
39
47
|
posts:
|
40
|
-
|
41
|
-
|
48
|
+
show:
|
49
|
+
view: ikusi
|
42
50
|
sidebar_blog:
|
43
51
|
comments: iruzkinak
|
44
52
|
most_commented_posts: Gehien iruzkinatutako mezu
|
@@ -60,10 +68,10 @@ eu:
|
|
60
68
|
email_outro: Jakinarazpena jaso duzu "%{participatory_space_title}" jarraitzen ari zarenagatik. Aurreko esteka estekan jarrai dezakezu.
|
61
69
|
email_subject: '%{participatory_space_title} urtean argitaratutako mezu berria'
|
62
70
|
notification_title: <a href="%{resource_path}">%{resource_title}</a> post %{participatory_space_title} argitaratu da
|
71
|
+
pages:
|
72
|
+
home:
|
73
|
+
statistics:
|
74
|
+
posts_count: Mezuak
|
63
75
|
participatory_processes:
|
64
76
|
statistics:
|
65
77
|
posts_count: Mezuak
|
66
|
-
pages:
|
67
|
-
home:
|
68
|
-
statistics:
|
69
|
-
posts_count: Mezuak
|
data/config/locales/fi.yml
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
fi:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/blogs/create_post_event: Uusi blogikirja
|
5
|
+
activerecord:
|
6
|
+
models:
|
7
|
+
decidim/blogs/post:
|
8
|
+
one: Lähettää
|
9
|
+
other: Viestejä
|
2
10
|
decidim:
|
3
11
|
blogs:
|
4
12
|
actions:
|
@@ -37,8 +45,8 @@ fi:
|
|
37
45
|
created_at: Luotu osoitteessa
|
38
46
|
title: otsikko
|
39
47
|
posts:
|
40
|
-
|
41
|
-
|
48
|
+
show:
|
49
|
+
view: näkymä
|
42
50
|
sidebar_blog:
|
43
51
|
comments: kommentit
|
44
52
|
most_commented_posts: Eniten kommentoituja viestejä
|
@@ -60,10 +68,10 @@ fi:
|
|
60
68
|
email_outro: Olet saanut tämän ilmoituksen, koska seuraat "%{participatory_space_title}". Voit purkaa sen edellisestä linkistä.
|
61
69
|
email_subject: Uusi viesti julkaistiin %{participatory_space_title}
|
62
70
|
notification_title: Viesti <a href="%{resource_path}">%{resource_title}</a> on julkaistu %{participatory_space_title}
|
71
|
+
pages:
|
72
|
+
home:
|
73
|
+
statistics:
|
74
|
+
posts_count: Viestejä
|
63
75
|
participatory_processes:
|
64
76
|
statistics:
|
65
77
|
posts_count: Viestejä
|
66
|
-
pages:
|
67
|
-
home:
|
68
|
-
statistics:
|
69
|
-
posts_count: Viestejä
|
data/config/locales/fr.yml
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
fr:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/blogs/create_post_event: Nouvel article
|
5
|
+
activerecord:
|
6
|
+
models:
|
7
|
+
decidim/blogs/post:
|
8
|
+
one: Article
|
9
|
+
other: Articles
|
2
10
|
decidim:
|
3
11
|
blogs:
|
4
12
|
actions:
|
@@ -37,8 +45,8 @@ fr:
|
|
37
45
|
created_at: Créé à
|
38
46
|
title: titre
|
39
47
|
posts:
|
40
|
-
|
41
|
-
|
48
|
+
show:
|
49
|
+
view: Vue
|
42
50
|
sidebar_blog:
|
43
51
|
comments: commentaires
|
44
52
|
most_commented_posts: Articles les plus commentés
|
@@ -60,10 +68,10 @@ fr:
|
|
60
68
|
email_outro: Vous avez reçu cette notification parce que vous suivez "%{participatory_space_title}". Vous pouvez le retirer du lien précédent.
|
61
69
|
email_subject: Nouvel article publié dans %{participatory_space_title}
|
62
70
|
notification_title: Le message <a href="%{resource_path}">%{resource_title}</a> a été publié dans %{participatory_space_title}
|
71
|
+
pages:
|
72
|
+
home:
|
73
|
+
statistics:
|
74
|
+
posts_count: Articles
|
63
75
|
participatory_processes:
|
64
76
|
statistics:
|
65
77
|
posts_count: Articles
|
66
|
-
pages:
|
67
|
-
home:
|
68
|
-
statistics:
|
69
|
-
posts_count: Articles
|
data/config/locales/gl.yml
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
gl:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/blogs/create_post_event: Nova publicación no blog
|
5
|
+
activerecord:
|
6
|
+
models:
|
7
|
+
decidim/blogs/post:
|
8
|
+
one: Publicar
|
9
|
+
other: Publicacións
|
2
10
|
decidim:
|
3
11
|
blogs:
|
4
12
|
actions:
|
@@ -37,8 +45,8 @@ gl:
|
|
37
45
|
created_at: Creado en
|
38
46
|
title: título
|
39
47
|
posts:
|
40
|
-
|
41
|
-
|
48
|
+
show:
|
49
|
+
view: Ver
|
42
50
|
sidebar_blog:
|
43
51
|
comments: comentarios
|
44
52
|
most_commented_posts: A maioría das publicacións comentadas
|
@@ -60,10 +68,10 @@ gl:
|
|
60
68
|
email_outro: Recibiches esta notificación porque estás seguindo "%{participatory_space_title}". Podes deixar de seguir desde a ligazón anterior.
|
61
69
|
email_subject: Nova publicación publicada en %{participatory_space_title}
|
62
70
|
notification_title: A publicación <a href="%{resource_path}">%{resource_title}</a> publicouse en %{participatory_space_title}
|
71
|
+
pages:
|
72
|
+
home:
|
73
|
+
statistics:
|
74
|
+
posts_count: Publicacións
|
63
75
|
participatory_processes:
|
64
76
|
statistics:
|
65
77
|
posts_count: Publicacións
|
66
|
-
pages:
|
67
|
-
home:
|
68
|
-
statistics:
|
69
|
-
posts_count: Publicacións
|
data/config/locales/it.yml
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
it:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/blogs/create_post_event: Nuovo post sul blog
|
5
|
+
activerecord:
|
6
|
+
models:
|
7
|
+
decidim/blogs/post:
|
8
|
+
one: Inviare
|
9
|
+
other: Messaggi
|
2
10
|
decidim:
|
3
11
|
blogs:
|
4
12
|
actions:
|
@@ -37,8 +45,8 @@ it:
|
|
37
45
|
created_at: Creato a
|
38
46
|
title: titolo
|
39
47
|
posts:
|
40
|
-
|
41
|
-
|
48
|
+
show:
|
49
|
+
view: vista
|
42
50
|
sidebar_blog:
|
43
51
|
comments: Commenti
|
44
52
|
most_commented_posts: La maggior parte dei post commentati
|
@@ -60,10 +68,10 @@ it:
|
|
60
68
|
email_outro: Hai ricevuto questa notifica perché stai seguendo "%{participatory_space_title}". Puoi smettere di seguirlo dal link precedente.
|
61
69
|
email_subject: Nuovo post pubblicato su %{participatory_space_title}
|
62
70
|
notification_title: Il post <a href="%{resource_path}">%{resource_title}</a> è stato pubblicato su %{participatory_space_title}
|
71
|
+
pages:
|
72
|
+
home:
|
73
|
+
statistics:
|
74
|
+
posts_count: Messaggi
|
63
75
|
participatory_processes:
|
64
76
|
statistics:
|
65
77
|
posts_count: Messaggi
|
66
|
-
pages:
|
67
|
-
home:
|
68
|
-
statistics:
|
69
|
-
posts_count: Messaggi
|
data/config/locales/nl.yml
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
nl:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/blogs/create_post_event: Nieuwe blogpost
|
5
|
+
activerecord:
|
6
|
+
models:
|
7
|
+
decidim/blogs/post:
|
8
|
+
one: Post
|
9
|
+
other: berichten
|
2
10
|
decidim:
|
3
11
|
blogs:
|
4
12
|
actions:
|
@@ -37,8 +45,8 @@ nl:
|
|
37
45
|
created_at: Aangemaakt op
|
38
46
|
title: titel
|
39
47
|
posts:
|
40
|
-
|
41
|
-
|
48
|
+
show:
|
49
|
+
view: Uitzicht
|
42
50
|
sidebar_blog:
|
43
51
|
comments: reacties
|
44
52
|
most_commented_posts: Bericht met meeste reacties
|
@@ -60,10 +68,10 @@ nl:
|
|
60
68
|
email_outro: Je hebt deze melding ontvangen omdat je "%{participatory_space_title}" volgt. Ontvolgen kan door te klikken op de voorgaande link.
|
61
69
|
email_subject: Nieuw bericht gepubliceerd in %{participatory_space_title}
|
62
70
|
notification_title: Het bericht <a href="%{resource_path}">%{resource_title}</a> is gepubliceerd in %{participatory_space_title}
|
71
|
+
pages:
|
72
|
+
home:
|
73
|
+
statistics:
|
74
|
+
posts_count: berichten
|
63
75
|
participatory_processes:
|
64
76
|
statistics:
|
65
77
|
posts_count: berichten
|
66
|
-
pages:
|
67
|
-
home:
|
68
|
-
statistics:
|
69
|
-
posts_count: berichten
|
data/config/locales/pl.yml
CHANGED
@@ -1,4 +1,14 @@
|
|
1
1
|
pl:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/blogs/create_post_event: Nowy wpis na blogu
|
5
|
+
activerecord:
|
6
|
+
models:
|
7
|
+
decidim/blogs/post:
|
8
|
+
one: Stanowisko
|
9
|
+
few: Posty
|
10
|
+
many: Posty
|
11
|
+
other: Posty
|
2
12
|
decidim:
|
3
13
|
blogs:
|
4
14
|
actions:
|
@@ -37,8 +47,8 @@ pl:
|
|
37
47
|
created_at: Utworzono w
|
38
48
|
title: tytuł
|
39
49
|
posts:
|
40
|
-
|
41
|
-
|
50
|
+
show:
|
51
|
+
view: Widok
|
42
52
|
sidebar_blog:
|
43
53
|
comments: komentarze
|
44
54
|
most_commented_posts: Najczęściej komentowane posty
|
@@ -60,10 +70,10 @@ pl:
|
|
60
70
|
email_outro: Otrzymałeś to powiadomienie, ponieważ obserwujesz "%{participatory_space_title}". Możesz przestać go obserwować z poprzedniego linku.
|
61
71
|
email_subject: Nowy wpis opublikowany w %{participatory_space_title}
|
62
72
|
notification_title: Post <a href="%{resource_path}">%{resource_title}</a> został opublikowany w %{participatory_space_title}
|
73
|
+
pages:
|
74
|
+
home:
|
75
|
+
statistics:
|
76
|
+
posts_count: Posty
|
63
77
|
participatory_processes:
|
64
78
|
statistics:
|
65
79
|
posts_count: Posty
|
66
|
-
pages:
|
67
|
-
home:
|
68
|
-
statistics:
|
69
|
-
posts_count: Posty
|
data/config/locales/pt-BR.yml
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
pt-BR:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/blogs/create_post_event: Novo post de blog
|
5
|
+
activerecord:
|
6
|
+
models:
|
7
|
+
decidim/blogs/post:
|
8
|
+
one: Postagem
|
9
|
+
other: Postagens
|
2
10
|
decidim:
|
3
11
|
blogs:
|
4
12
|
actions:
|
@@ -37,8 +45,8 @@ pt-BR:
|
|
37
45
|
created_at: Criado em
|
38
46
|
title: título
|
39
47
|
posts:
|
40
|
-
|
41
|
-
|
48
|
+
show:
|
49
|
+
view: Visualizar
|
42
50
|
sidebar_blog:
|
43
51
|
comments: comentários
|
44
52
|
most_commented_posts: Posts mais comentados
|
@@ -60,10 +68,10 @@ pt-BR:
|
|
60
68
|
email_outro: Você recebeu esta notificação porque está seguindo "%{participatory_space_title}". Você pode deixar de segui-lo no link anterior.
|
61
69
|
email_subject: Nova postagem publicada em %{participatory_space_title}
|
62
70
|
notification_title: A postagem <a href="%{resource_path}">%{resource_title}</a> foi publicada em %{participatory_space_title}
|
71
|
+
pages:
|
72
|
+
home:
|
73
|
+
statistics:
|
74
|
+
posts_count: Postagens
|
63
75
|
participatory_processes:
|
64
76
|
statistics:
|
65
77
|
posts_count: Postagens
|
66
|
-
pages:
|
67
|
-
home:
|
68
|
-
statistics:
|
69
|
-
posts_count: Postagens
|
data/config/locales/pt.yml
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
pt:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/blogs/create_post_event: Nova postagem no blog
|
5
|
+
activerecord:
|
6
|
+
models:
|
7
|
+
decidim/blogs/post:
|
8
|
+
one: Postar
|
9
|
+
other: Postagens
|
2
10
|
decidim:
|
3
11
|
blogs:
|
4
12
|
actions:
|
@@ -37,8 +45,8 @@ pt:
|
|
37
45
|
created_at: Criado em
|
38
46
|
title: título
|
39
47
|
posts:
|
40
|
-
|
41
|
-
|
48
|
+
show:
|
49
|
+
view: Visão
|
42
50
|
sidebar_blog:
|
43
51
|
comments: comentários
|
44
52
|
most_commented_posts: Posts mais comentados
|
@@ -60,10 +68,10 @@ pt:
|
|
60
68
|
email_outro: Você recebeu esta notificação porque está seguindo "%{participatory_space_title}". Você pode deixar de segui-lo no link anterior.
|
61
69
|
email_subject: Nova postagem publicada em %{participatory_space_title}
|
62
70
|
notification_title: A postagem <a href="%{resource_path}">%{resource_title}</a> foi publicada em %{participatory_space_title}
|
71
|
+
pages:
|
72
|
+
home:
|
73
|
+
statistics:
|
74
|
+
posts_count: Postagens
|
63
75
|
participatory_processes:
|
64
76
|
statistics:
|
65
77
|
posts_count: Postagens
|
66
|
-
pages:
|
67
|
-
home:
|
68
|
-
statistics:
|
69
|
-
posts_count: Postagens
|
data/config/locales/ru.yml
CHANGED
data/config/locales/sv.yml
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
sv:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/blogs/create_post_event: Nytt blogginlägg
|
5
|
+
activerecord:
|
6
|
+
models:
|
7
|
+
decidim/blogs/post:
|
8
|
+
one: Posta
|
9
|
+
other: inlägg
|
2
10
|
decidim:
|
3
11
|
blogs:
|
4
12
|
actions:
|
@@ -37,8 +45,8 @@ sv:
|
|
37
45
|
created_at: Skapad vid
|
38
46
|
title: titel
|
39
47
|
posts:
|
40
|
-
|
41
|
-
|
48
|
+
show:
|
49
|
+
view: Se
|
42
50
|
sidebar_blog:
|
43
51
|
comments: kommentarer
|
44
52
|
most_commented_posts: Mest kommenterade inlägg
|
@@ -60,10 +68,10 @@ sv:
|
|
60
68
|
email_outro: Du har fått den här meddelandet eftersom du följer "%{participatory_space_title}". Du kan följa det från föregående länk.
|
61
69
|
email_subject: Nytt inlägg publicerat i %{participatory_space_title}
|
62
70
|
notification_title: Posten <a href="%{resource_path}">%{resource_title}</a> har publicerats i %{participatory_space_title}
|
71
|
+
pages:
|
72
|
+
home:
|
73
|
+
statistics:
|
74
|
+
posts_count: inlägg
|
63
75
|
participatory_processes:
|
64
76
|
statistics:
|
65
77
|
posts_count: inlägg
|
66
|
-
pages:
|
67
|
-
home:
|
68
|
-
statistics:
|
69
|
-
posts_count: inlägg
|
data/config/locales/uk.yml
CHANGED
@@ -1,4 +1,14 @@
|
|
1
1
|
uk:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/blogs/create_post_event: Створити допис у блозі
|
5
|
+
activerecord:
|
6
|
+
models:
|
7
|
+
decidim/blogs/post:
|
8
|
+
one: Допис
|
9
|
+
few: Дописи
|
10
|
+
many: Дописів
|
11
|
+
other: Дописів
|
2
12
|
decidim:
|
3
13
|
blogs:
|
4
14
|
actions:
|
@@ -37,8 +47,8 @@ uk:
|
|
37
47
|
created_at: 'Створено:'
|
38
48
|
title: заголовок
|
39
49
|
posts:
|
40
|
-
|
41
|
-
|
50
|
+
show:
|
51
|
+
view: Переглянути
|
42
52
|
sidebar_blog:
|
43
53
|
comments: коментарі
|
44
54
|
most_commented_posts: Найбільш коментовані дописи
|
@@ -60,10 +70,10 @@ uk:
|
|
60
70
|
email_outro: Ви отримали це сповіщення, тому що ви стежите за "%{participatory_space_title}". Ви можете припинити стежити за ним, перейшовши за наведеним вище посиланням.
|
61
71
|
email_subject: В %{participatory_space_title} оприлюднено новий допис
|
62
72
|
notification_title: В %{participatory_space_title} було оприлюднено допис <a href="%{resource_path}">%{resource_title}</a>
|
73
|
+
pages:
|
74
|
+
home:
|
75
|
+
statistics:
|
76
|
+
posts_count: Дописи
|
63
77
|
participatory_processes:
|
64
78
|
statistics:
|
65
79
|
posts_count: Дописи
|
66
|
-
pages:
|
67
|
-
home:
|
68
|
-
statistics:
|
69
|
-
posts_count: Дописи
|
@@ -6,6 +6,7 @@ Decidim.register_component(:blogs) do |component|
|
|
6
6
|
component.engine = Decidim::Blogs::Engine
|
7
7
|
component.admin_engine = Decidim::Blogs::AdminEngine
|
8
8
|
component.icon = "decidim/blogs/icon.svg"
|
9
|
+
component.permissions_class_name = "Decidim::Blog::Permissions"
|
9
10
|
|
10
11
|
component.on(:before_destroy) do |instance|
|
11
12
|
raise StandardError, "Can't remove this component" if Decidim::Blogs::Post.where(component: instance).any?
|
@@ -25,8 +26,9 @@ Decidim.register_component(:blogs) do |component|
|
|
25
26
|
settings.attribute :comments_blocked, type: :boolean, default: false
|
26
27
|
end
|
27
28
|
|
28
|
-
component.register_resource do |resource|
|
29
|
+
component.register_resource(:blogpost) do |resource|
|
29
30
|
resource.model_class_name = "Decidim::Blogs::Post"
|
31
|
+
resource.card = "decidim/blogs/post"
|
30
32
|
end
|
31
33
|
|
32
34
|
component.seeds do |participatory_space|
|
data/lib/decidim/blogs/engine.rb
CHANGED
@@ -19,6 +19,11 @@ module Decidim
|
|
19
19
|
resources :posts, only: [:index, :show]
|
20
20
|
root to: "posts#index"
|
21
21
|
end
|
22
|
+
|
23
|
+
initializer "decidim_blogs.add_cells_view_paths" do
|
24
|
+
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Blogs::Engine.root}/app/cells")
|
25
|
+
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Blogs::Engine.root}/app/views") # for partials
|
26
|
+
end
|
22
27
|
end
|
23
28
|
end
|
24
29
|
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.12.0.pre
|
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: 2018-06-
|
11
|
+
date: 2018-06-06 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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
153
153
|
description: A Blog component for decidim's participatory spaces.
|
154
154
|
email:
|
155
155
|
- isaac.mg@coditramuntana.com
|
@@ -160,6 +160,9 @@ files:
|
|
160
160
|
- README.md
|
161
161
|
- Rakefile
|
162
162
|
- app/assets/images/decidim/blogs/icon.svg
|
163
|
+
- app/cells/decidim/blogs/post_cell.rb
|
164
|
+
- app/cells/decidim/blogs/post_m/footer.erb
|
165
|
+
- app/cells/decidim/blogs/post_m_cell.rb
|
163
166
|
- app/commands/decidim/blogs/admin/create_post.rb
|
164
167
|
- app/commands/decidim/blogs/admin/update_post.rb
|
165
168
|
- app/controllers/decidim/blogs/admin/application_controller.rb
|
@@ -173,12 +176,12 @@ files:
|
|
173
176
|
- app/helpers/decidim/blogs/posts_helper.rb
|
174
177
|
- app/models/decidim/blogs/application_record.rb
|
175
178
|
- app/models/decidim/blogs/post.rb
|
176
|
-
- app/
|
179
|
+
- app/permissions/decidim/blog/permissions.rb
|
180
|
+
- app/presenters/decidim/blogs/post_presenter.rb
|
177
181
|
- app/views/decidim/blogs/admin/posts/_form.html.erb
|
178
182
|
- app/views/decidim/blogs/admin/posts/edit.html.erb
|
179
183
|
- app/views/decidim/blogs/admin/posts/index.html.erb
|
180
184
|
- app/views/decidim/blogs/admin/posts/new.html.erb
|
181
|
-
- app/views/decidim/blogs/posts/_author_data.html.erb
|
182
185
|
- app/views/decidim/blogs/posts/_datetime.html.erb
|
183
186
|
- app/views/decidim/blogs/posts/_posts.html.erb
|
184
187
|
- app/views/decidim/blogs/posts/_sidebar_blog.html.erb
|
@@ -223,9 +226,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
223
226
|
version: 2.3.1
|
224
227
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
225
228
|
requirements:
|
226
|
-
- - "
|
229
|
+
- - ">"
|
227
230
|
- !ruby/object:Gem::Version
|
228
|
-
version:
|
231
|
+
version: 1.3.1
|
229
232
|
requirements: []
|
230
233
|
rubyforge_project:
|
231
234
|
rubygems_version: 2.7.6
|
@@ -1,7 +0,0 @@
|
|
1
|
-
<%= cell "decidim/author_box", present(post.author), extra: (capture do %>
|
2
|
-
<%= render partial: "datetime", locals: { post: post } %> ·
|
3
|
-
<%= link_to "#{post_path(post)}#comments", title: t(".comments") do %>
|
4
|
-
<%= icon "comment-square", class: "icon--small", aria_label: "#{t(".comments")}", role: "img" %>
|
5
|
-
<%= post.comments.count %> <%= t(".comments") %>
|
6
|
-
<% end %>
|
7
|
-
<% end) %>
|