decidim-comments 0.11.2 → 0.12.0.pre
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/assets/javascripts/decidim/comments/bundle.js +267 -1
- data/app/assets/javascripts/decidim/comments/bundle.js.map +1 -1
- data/app/commands/decidim/comments/create_comment.rb +1 -3
- data/app/frontend/comments/comment.component.tsx +3 -3
- data/app/frontend/comments/comments.component.tsx +1 -1
- data/app/models/decidim/comments/comment.rb +2 -0
- data/app/types/decidim/comments/commentable_type.rb +1 -1
- data/config/locales/ca.yml +15 -0
- data/config/locales/en.yml +15 -0
- data/config/locales/es.yml +15 -0
- data/config/locales/eu.yml +15 -0
- data/config/locales/fi.yml +15 -0
- data/config/locales/fr.yml +15 -0
- data/config/locales/gl.yml +15 -0
- data/config/locales/it.yml +15 -0
- data/config/locales/nl.yml +15 -0
- data/config/locales/pl.yml +19 -0
- data/config/locales/pt-BR.yml +15 -0
- data/config/locales/pt.yml +15 -0
- data/config/locales/ru.yml +19 -0
- data/config/locales/sv.yml +15 -0
- data/config/locales/uk.yml +19 -0
- data/lib/decidim/comments/admin_engine.rb +0 -10
- data/lib/decidim/comments/api/comment_type.rb +2 -2
- data/lib/decidim/comments/engine.rb +2 -8
- data/lib/decidim/comments/version.rb +1 -1
- metadata +10 -14
- data/app/models/decidim/comments/abilities/admin_ability.rb +0 -19
- data/app/models/decidim/comments/abilities/current_user_ability.rb +0 -24
- data/app/models/decidim/comments/abilities/participatory_process_admin_ability.rb +0 -19
- data/app/models/decidim/comments/abilities/participatory_process_moderator_ability.rb +0 -19
data/config/locales/fr.yml
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
fr:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/comments/comment_by_followed_user_event: Commentaire
|
5
|
+
decidim/comments/comment_created_event: Commentaire
|
6
|
+
decidim/comments/reply_created_event: Réponse à un commentaire
|
7
|
+
decidim/comments/user_mentioned_event: Mention
|
8
|
+
activerecord:
|
9
|
+
models:
|
10
|
+
decidim/comments/comment:
|
11
|
+
one: Commentaire
|
12
|
+
other: Commentaires
|
13
|
+
decidim/comments/comment_vote:
|
14
|
+
one: Vote
|
15
|
+
other: Votes
|
2
16
|
decidim:
|
3
17
|
comments:
|
18
|
+
comments: Commentaires
|
4
19
|
votes:
|
5
20
|
create:
|
6
21
|
error: Une erreur s'est produite lors du soutien du commentaire.
|
data/config/locales/gl.yml
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
gl:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/comments/comment_by_followed_user_event: Comentario
|
5
|
+
decidim/comments/comment_created_event: Comentario
|
6
|
+
decidim/comments/reply_created_event: Comentario de resposta
|
7
|
+
decidim/comments/user_mentioned_event: Mención
|
8
|
+
activerecord:
|
9
|
+
models:
|
10
|
+
decidim/comments/comment:
|
11
|
+
one: Comentario
|
12
|
+
other: Comentarios
|
13
|
+
decidim/comments/comment_vote:
|
14
|
+
one: Vota
|
15
|
+
other: Votos
|
2
16
|
decidim:
|
3
17
|
comments:
|
18
|
+
comments: Comentarios
|
4
19
|
votes:
|
5
20
|
create:
|
6
21
|
error: Houbo erros ao votar o comentario.
|
data/config/locales/it.yml
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
it:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/comments/comment_by_followed_user_event: Commento
|
5
|
+
decidim/comments/comment_created_event: Commento
|
6
|
+
decidim/comments/reply_created_event: Risposta al commento
|
7
|
+
decidim/comments/user_mentioned_event: Citare
|
8
|
+
activerecord:
|
9
|
+
models:
|
10
|
+
decidim/comments/comment:
|
11
|
+
one: Commento
|
12
|
+
other: Commenti
|
13
|
+
decidim/comments/comment_vote:
|
14
|
+
one: Votazione
|
15
|
+
other: voti
|
2
16
|
decidim:
|
3
17
|
comments:
|
18
|
+
comments: Commenti
|
4
19
|
votes:
|
5
20
|
create:
|
6
21
|
error: Ci sono stati errori durante la votazione del commento.
|
data/config/locales/nl.yml
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
nl:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/comments/comment_by_followed_user_event: Commentaar
|
5
|
+
decidim/comments/comment_created_event: Commentaar
|
6
|
+
decidim/comments/reply_created_event: Reactie antwoord
|
7
|
+
decidim/comments/user_mentioned_event: Noemen
|
8
|
+
activerecord:
|
9
|
+
models:
|
10
|
+
decidim/comments/comment:
|
11
|
+
one: Commentaar
|
12
|
+
other: Comments
|
13
|
+
decidim/comments/comment_vote:
|
14
|
+
one: Stemmen
|
15
|
+
other: stemmen
|
2
16
|
decidim:
|
3
17
|
comments:
|
18
|
+
comments: Comments
|
4
19
|
votes:
|
5
20
|
create:
|
6
21
|
error: Er zijn fouten geweest bij het stemmen van de reactie.
|
data/config/locales/pl.yml
CHANGED
@@ -1,6 +1,25 @@
|
|
1
1
|
pl:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/comments/comment_by_followed_user_event: Komentarz
|
5
|
+
decidim/comments/comment_created_event: Komentarz
|
6
|
+
decidim/comments/reply_created_event: Odpowiedź na komentarz
|
7
|
+
decidim/comments/user_mentioned_event: Wzmianka
|
8
|
+
activerecord:
|
9
|
+
models:
|
10
|
+
decidim/comments/comment:
|
11
|
+
one: Komentarz
|
12
|
+
few: Komentarze
|
13
|
+
many: Komentarze
|
14
|
+
other: Komentarze
|
15
|
+
decidim/comments/comment_vote:
|
16
|
+
one: Głosować
|
17
|
+
few: Głosy
|
18
|
+
many: Głosy
|
19
|
+
other: Głosy
|
2
20
|
decidim:
|
3
21
|
comments:
|
22
|
+
comments: Komentarze
|
4
23
|
votes:
|
5
24
|
create:
|
6
25
|
error: Podczas głosowania komentarza wystąpiły błędy.
|
data/config/locales/pt-BR.yml
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
pt-BR:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/comments/comment_by_followed_user_event: Comente
|
5
|
+
decidim/comments/comment_created_event: Comentário
|
6
|
+
decidim/comments/reply_created_event: Resposta
|
7
|
+
decidim/comments/user_mentioned_event: Mencionar
|
8
|
+
activerecord:
|
9
|
+
models:
|
10
|
+
decidim/comments/comment:
|
11
|
+
one: Comentário
|
12
|
+
other: Comentários
|
13
|
+
decidim/comments/comment_vote:
|
14
|
+
one: Voto
|
15
|
+
other: Votos
|
2
16
|
decidim:
|
3
17
|
comments:
|
18
|
+
comments: Comentários
|
4
19
|
votes:
|
5
20
|
create:
|
6
21
|
error: Houve erros ao votar o comentário.
|
data/config/locales/pt.yml
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
pt:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/comments/comment_by_followed_user_event: Comente
|
5
|
+
decidim/comments/comment_created_event: Comente
|
6
|
+
decidim/comments/reply_created_event: Comentário resposta
|
7
|
+
decidim/comments/user_mentioned_event: Menção
|
8
|
+
activerecord:
|
9
|
+
models:
|
10
|
+
decidim/comments/comment:
|
11
|
+
one: Comente
|
12
|
+
other: Comentários
|
13
|
+
decidim/comments/comment_vote:
|
14
|
+
one: Voto
|
15
|
+
other: Votos
|
2
16
|
decidim:
|
3
17
|
comments:
|
18
|
+
comments: Comentários
|
4
19
|
votes:
|
5
20
|
create:
|
6
21
|
error: Houve erros ao votar o comentário.
|
data/config/locales/ru.yml
CHANGED
@@ -1,6 +1,25 @@
|
|
1
1
|
ru:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/comments/comment_by_followed_user_event: Комментарий
|
5
|
+
decidim/comments/comment_created_event: Комментарий
|
6
|
+
decidim/comments/reply_created_event: Ответ на комментарий
|
7
|
+
decidim/comments/user_mentioned_event: Упоминание
|
8
|
+
activerecord:
|
9
|
+
models:
|
10
|
+
decidim/comments/comment:
|
11
|
+
one: Комментарий
|
12
|
+
few: Комментария
|
13
|
+
many: Комментариев
|
14
|
+
other: Комментариев
|
15
|
+
decidim/comments/comment_vote:
|
16
|
+
one: Голос
|
17
|
+
few: Голоса
|
18
|
+
many: Голосов
|
19
|
+
other: Голосов
|
2
20
|
decidim:
|
3
21
|
comments:
|
22
|
+
comments: Комментарии
|
4
23
|
votes:
|
5
24
|
create:
|
6
25
|
error: При голосовании за комментарий произошли ошибки.
|
data/config/locales/sv.yml
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
sv:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/comments/comment_by_followed_user_event: Kommentar
|
5
|
+
decidim/comments/comment_created_event: Kommentar
|
6
|
+
decidim/comments/reply_created_event: Kommentar svar
|
7
|
+
decidim/comments/user_mentioned_event: Nämna
|
8
|
+
activerecord:
|
9
|
+
models:
|
10
|
+
decidim/comments/comment:
|
11
|
+
one: Kommentar
|
12
|
+
other: kommentarer
|
13
|
+
decidim/comments/comment_vote:
|
14
|
+
one: Rösta
|
15
|
+
other: röster
|
2
16
|
decidim:
|
3
17
|
comments:
|
18
|
+
comments: kommentarer
|
4
19
|
votes:
|
5
20
|
create:
|
6
21
|
error: Det har varit fel när du röstar kommentaren.
|
data/config/locales/uk.yml
CHANGED
@@ -1,6 +1,25 @@
|
|
1
1
|
uk:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/comments/comment_by_followed_user_event: Коментар
|
5
|
+
decidim/comments/comment_created_event: Коментар
|
6
|
+
decidim/comments/reply_created_event: Відповідь на коментар
|
7
|
+
decidim/comments/user_mentioned_event: Згадка
|
8
|
+
activerecord:
|
9
|
+
models:
|
10
|
+
decidim/comments/comment:
|
11
|
+
one: Коментар
|
12
|
+
few: Коментаря
|
13
|
+
many: Коментарів
|
14
|
+
other: Коментарів
|
15
|
+
decidim/comments/comment_vote:
|
16
|
+
one: Голос
|
17
|
+
few: Голоси
|
18
|
+
many: Голосів
|
19
|
+
other: Голосів
|
2
20
|
decidim:
|
3
21
|
comments:
|
22
|
+
comments: Коментарі
|
4
23
|
votes:
|
5
24
|
create:
|
6
25
|
error: При голосуванні коментаря сталися помилки.
|
@@ -8,16 +8,6 @@ module Decidim
|
|
8
8
|
|
9
9
|
paths["db/migrate"] = nil
|
10
10
|
|
11
|
-
initializer "decidim_comments.inject_abilities_to_user" do |_app|
|
12
|
-
Decidim.configure do |config|
|
13
|
-
config.admin_abilities += [
|
14
|
-
"Decidim::Comments::Abilities::AdminAbility",
|
15
|
-
"Decidim::Comments::Abilities::ParticipatoryProcessAdminAbility",
|
16
|
-
"Decidim::Comments::Abilities::ParticipatoryProcessModeratorAbility"
|
17
|
-
]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
11
|
def load_seed
|
22
12
|
nil
|
23
13
|
end
|
@@ -8,8 +8,8 @@ module Decidim
|
|
8
8
|
description "A comment"
|
9
9
|
|
10
10
|
interfaces [
|
11
|
-
Decidim::Comments::CommentableInterface,
|
12
|
-
Decidim::Core::AuthorableInterface
|
11
|
+
-> { Decidim::Comments::CommentableInterface },
|
12
|
+
-> { Decidim::Core::AuthorableInterface }
|
13
13
|
]
|
14
14
|
|
15
15
|
field :id, !types.ID, "The Comment's unique ID"
|
@@ -36,18 +36,12 @@ module Decidim
|
|
36
36
|
end
|
37
37
|
|
38
38
|
initializer "decidim.stats" do
|
39
|
-
Decidim.stats.register :comments_count, priority: StatsRegistry::MEDIUM_PRIORITY do |
|
39
|
+
Decidim.stats.register :comments_count, priority: StatsRegistry::MEDIUM_PRIORITY do |organization|
|
40
40
|
Decidim.component_manifests.sum do |component|
|
41
|
-
component.stats.filter(tag: :comments).with_context(
|
41
|
+
component.stats.filter(tag: :comments).with_context(organization.published_components).map { |_name, value| value }.sum
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
45
|
-
|
46
|
-
initializer "decidim_comments.inject_abilities_to_user" do |_app|
|
47
|
-
Decidim.configure do |config|
|
48
|
-
config.abilities += ["Decidim::Comments::Abilities::CurrentUserAbility"]
|
49
|
-
end
|
50
|
-
end
|
51
45
|
end
|
52
46
|
end
|
53
47
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-comments
|
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
|
- Josep Jaume Rey Peroy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-06-
|
13
|
+
date: 2018-06-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: decidim-core
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.12.0.pre
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 0.
|
28
|
+
version: 0.12.0.pre
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: jquery-rails
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -46,28 +46,28 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - '='
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.
|
49
|
+
version: 0.12.0.pre
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - '='
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.
|
56
|
+
version: 0.12.0.pre
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: decidim-dev
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - '='
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 0.
|
63
|
+
version: 0.12.0.pre
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - '='
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 0.
|
70
|
+
version: 0.12.0.pre
|
71
71
|
description: Pluggable comments system for some components.
|
72
72
|
email:
|
73
73
|
- josepjaume@gmail.com
|
@@ -133,10 +133,6 @@ files:
|
|
133
133
|
- app/frontend/support/require_all.ts
|
134
134
|
- app/frontend/support/resolve_graphql_query.ts
|
135
135
|
- app/frontend/support/schema.ts
|
136
|
-
- app/models/decidim/comments/abilities/admin_ability.rb
|
137
|
-
- app/models/decidim/comments/abilities/current_user_ability.rb
|
138
|
-
- app/models/decidim/comments/abilities/participatory_process_admin_ability.rb
|
139
|
-
- app/models/decidim/comments/abilities/participatory_process_moderator_ability.rb
|
140
136
|
- app/models/decidim/comments/application_record.rb
|
141
137
|
- app/models/decidim/comments/comment.rb
|
142
138
|
- app/models/decidim/comments/comment_vote.rb
|
@@ -204,9 +200,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
204
200
|
version: '2.3'
|
205
201
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
202
|
requirements:
|
207
|
-
- - "
|
203
|
+
- - ">"
|
208
204
|
- !ruby/object:Gem::Version
|
209
|
-
version:
|
205
|
+
version: 1.3.1
|
210
206
|
requirements: []
|
211
207
|
rubyforge_project:
|
212
208
|
rubygems_version: 2.7.6
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Comments
|
5
|
-
module Abilities
|
6
|
-
# Defines the abilities related to comments for a logged in admin user.
|
7
|
-
# Intended to be used with `cancancan`.
|
8
|
-
class AdminAbility < Decidim::Abilities::AdminAbility
|
9
|
-
def define_abilities
|
10
|
-
super
|
11
|
-
|
12
|
-
can :manage, Comment
|
13
|
-
can :unreport, Comment
|
14
|
-
can :hide, Comment
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Comments
|
5
|
-
module Abilities
|
6
|
-
# Defines the abilities related to comments for a logged in user.
|
7
|
-
# Intended to be used with `cancancan`.
|
8
|
-
class CurrentUserAbility
|
9
|
-
include CanCan::Ability
|
10
|
-
|
11
|
-
attr_reader :user, :context
|
12
|
-
|
13
|
-
def initialize(user, context)
|
14
|
-
return unless user
|
15
|
-
|
16
|
-
@user = user
|
17
|
-
@context = context
|
18
|
-
|
19
|
-
can :report, Decidim::Comments::Comment
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Comments
|
5
|
-
module Abilities
|
6
|
-
# Defines the abilities related to comments for a logged in process admin user.
|
7
|
-
# Intended to be used with `cancancan`.
|
8
|
-
class ParticipatoryProcessAdminAbility < Decidim::Abilities::ParticipatoryProcessAdminAbility
|
9
|
-
def define_participatory_process_abilities
|
10
|
-
super
|
11
|
-
|
12
|
-
can [:manage, :unreport, :hide], Comment do |comment|
|
13
|
-
can_manage_process?(comment.component.participatory_space)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|