decidim-comments 0.29.4 → 0.30.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/comments/comment/actions.erb +0 -8
- data/app/cells/decidim/comments/comment/show.erb +41 -5
- data/app/cells/decidim/comments/comment_cell.rb +37 -1
- data/app/cells/decidim/comments/comment_form/comment_as.erb +24 -6
- data/app/cells/decidim/comments/comment_form/opinion.erb +0 -4
- data/app/cells/decidim/comments/comment_form/show.erb +31 -29
- data/app/cells/decidim/comments/comment_form_cell.rb +7 -2
- data/app/cells/decidim/comments/comment_thread/show.erb +2 -2
- data/app/cells/decidim/comments/comments/add_comment.erb +12 -14
- data/app/cells/decidim/comments/comments/comments_in_single_column.erb +6 -0
- data/app/cells/decidim/comments/comments/order_control.erb +32 -9
- data/app/cells/decidim/comments/comments/show.erb +28 -1
- data/app/cells/decidim/comments/comments_cell.rb +53 -14
- data/app/cells/decidim/comments/edit_comment_modal_form_cell.rb +1 -1
- data/app/cells/decidim/comments/two_columns_comments/column.erb +20 -0
- data/app/cells/decidim/comments/two_columns_comments/show.erb +11 -0
- data/app/cells/decidim/comments/two_columns_comments_cell.rb +86 -0
- data/app/controllers/decidim/comments/comments_controller.rb +1 -2
- data/app/forms/decidim/comments/comment_form.rb +14 -0
- data/app/models/decidim/comments/comment.rb +10 -8
- data/app/packs/entrypoints/decidim_comments.js +1 -0
- data/app/packs/src/decidim/comments/comments.component.js +151 -25
- data/app/packs/src/decidim/comments/comments.component.test.js +2 -1
- data/app/packs/src/decidim/comments/comments.js +95 -12
- data/app/packs/src/decidim/comments/comments_dropdown.js +57 -0
- data/app/packs/src/decidim/comments/comments_mobile_modal.js +46 -0
- data/app/packs/stylesheets/comments.scss +203 -50
- data/app/queries/decidim/comments/metrics/comment_participants_metric_measure.rb +1 -1
- data/app/queries/decidim/comments/metrics/comments_metric_manage.rb +22 -17
- data/app/views/decidim/comments/comments/_comments.html.erb +1 -0
- data/app/views/decidim/comments/comments/create.js.erb +9 -1
- data/app/views/decidim/comments/comments/index.js.erb +0 -3
- data/app/views/decidim/comments/comments/reload.js.erb +7 -3
- data/app/views/decidim/comments/comments/update.js.erb +3 -1
- data/config/locales/ar.yml +0 -1
- data/config/locales/bg.yml +0 -1
- data/config/locales/ca.yml +35 -4
- data/config/locales/cs.yml +37 -4
- data/config/locales/de.yml +35 -4
- data/config/locales/el.yml +0 -1
- data/config/locales/en.yml +35 -4
- data/config/locales/es-MX.yml +35 -4
- data/config/locales/es-PY.yml +35 -4
- data/config/locales/es.yml +35 -4
- data/config/locales/eu.yml +55 -24
- data/config/locales/fi-plain.yml +35 -2
- data/config/locales/fi.yml +36 -3
- data/config/locales/fr-CA.yml +8 -4
- data/config/locales/fr.yml +8 -4
- data/config/locales/gl.yml +0 -1
- data/config/locales/hu.yml +0 -1
- data/config/locales/id-ID.yml +0 -1
- data/config/locales/is-IS.yml +0 -1
- data/config/locales/it.yml +1 -2
- data/config/locales/ja.yml +34 -4
- data/config/locales/lb.yml +0 -1
- data/config/locales/lt.yml +1 -2
- data/config/locales/lv.yml +0 -1
- data/config/locales/nl.yml +0 -1
- data/config/locales/no.yml +0 -1
- data/config/locales/pl.yml +1 -3
- data/config/locales/pt-BR.yml +0 -1
- data/config/locales/pt.yml +0 -1
- data/config/locales/ro-RO.yml +57 -60
- data/config/locales/ru.yml +0 -1
- data/config/locales/sk.yml +0 -1
- data/config/locales/sv.yml +19 -4
- data/config/locales/tr-TR.yml +1 -2
- data/config/locales/uk.yml +0 -1
- data/config/locales/zh-CN.yml +0 -1
- data/config/locales/zh-TW.yml +0 -1
- data/decidim-comments.gemspec +1 -1
- data/lib/decidim/api/comment_mutation_type.rb +2 -2
- data/lib/decidim/api/comment_type.rb +12 -45
- data/lib/decidim/api/commentable_interface.rb +4 -16
- data/lib/decidim/api/commentable_mutation_type.rb +2 -3
- data/lib/decidim/comments/commentable.rb +11 -0
- data/lib/decidim/comments/comments_helper.rb +1 -1
- data/lib/decidim/comments/engine.rb +7 -1
- data/lib/decidim/comments/test/factories.rb +8 -0
- data/lib/decidim/comments/test/shared_examples/comment_event.rb +1 -1
- data/lib/decidim/comments/test/shared_examples/comment_voted_event.rb +2 -2
- data/lib/decidim/comments/test/shared_examples/create_comment_context.rb +1 -1
- data/lib/decidim/comments/test/shared_examples/translatable_comment.rb +2 -2
- data/lib/decidim/comments/version.rb +1 -1
- metadata +17 -12
- data/app/cells/decidim/comments/comments/inline.erb +0 -28
- data/config/locales/ca-IT.yml +0 -178
@@ -4,37 +4,24 @@ module Decidim
|
|
4
4
|
module Comments
|
5
5
|
# This type represents a comment on a commentable object.
|
6
6
|
class CommentType < Decidim::Api::Types::BaseObject
|
7
|
-
|
8
|
-
|
7
|
+
implements Decidim::Core::TimestampsInterface
|
9
8
|
implements Decidim::Comments::CommentableInterface
|
10
|
-
field :author, Decidim::Core::AuthorInterface, "The resource author", null: false
|
11
|
-
|
12
|
-
field :id, GraphQL::Types::ID, "The Comment's unique ID", null: false
|
13
|
-
|
14
|
-
field :sgid, GraphQL::Types::String, "The Comment's signed global id", null: false
|
15
|
-
|
16
|
-
field :body, GraphQL::Types::String, "The comment message", null: false
|
17
|
-
|
18
|
-
field :formatted_body, GraphQL::Types::String, "The comment message ready to display (it is expected to include HTML)", null: false
|
19
9
|
|
20
|
-
|
21
|
-
|
22
|
-
field :formatted_created_at, GraphQL::Types::String, "The creation date of the comment in relative format", null: false
|
10
|
+
description "A comment"
|
23
11
|
|
24
12
|
field :alignment, GraphQL::Types::Int, "The comment's alignment. Can be 0 (neutral), 1 (in favor) or -1 (against)'", null: true
|
25
|
-
|
26
|
-
field :
|
27
|
-
|
28
|
-
field :up_voted, GraphQL::Types::Boolean, "Check if the current user has upvoted the comment", null: false
|
29
|
-
|
30
|
-
field :down_votes, GraphQL::Types::Int, "The number of comment's downVotes", null: false
|
31
|
-
|
13
|
+
field :already_reported, GraphQL::Types::Boolean, "Check if the current user has reported the comment", null: false
|
14
|
+
field :author, Decidim::Core::AuthorInterface, "The resource author", null: false
|
15
|
+
field :body, GraphQL::Types::String, "The comment message", null: false, method: :translated_body
|
32
16
|
field :down_voted, GraphQL::Types::Boolean, "Check if the current user has downvoted the comment", null: false
|
33
|
-
|
17
|
+
field :down_votes, GraphQL::Types::Int, "The number of comment's downVotes", null: false, method: :down_votes_count
|
18
|
+
field :formatted_body, GraphQL::Types::String, "The comment message ready to display (it is expected to include HTML)", null: false
|
19
|
+
field :formatted_created_at, GraphQL::Types::String, "The creation date of the comment in relative format", null: false, method: :friendly_created_at
|
34
20
|
field :has_comments, GraphQL::Types::Boolean, "Check if the commentable has comments", method: :has_comments?, null: false
|
35
|
-
|
36
|
-
field :
|
37
|
-
|
21
|
+
field :id, GraphQL::Types::ID, "The Comment's unique ID", null: false
|
22
|
+
field :sgid, GraphQL::Types::String, "The Comment's signed global id", null: false
|
23
|
+
field :up_voted, GraphQL::Types::Boolean, "Check if the current user has upvoted the comment", null: false
|
24
|
+
field :up_votes, GraphQL::Types::Int, "The number of comment's upVotes", null: false, method: :up_votes_count
|
38
25
|
field :user_allowed_to_comment, GraphQL::Types::Boolean, "Check if the current user can comment", null: false
|
39
26
|
|
40
27
|
def author
|
@@ -45,30 +32,10 @@ module Decidim
|
|
45
32
|
object.to_sgid.to_s
|
46
33
|
end
|
47
34
|
|
48
|
-
def body
|
49
|
-
object.translated_body
|
50
|
-
end
|
51
|
-
|
52
|
-
def created_at
|
53
|
-
object.created_at.iso8601
|
54
|
-
end
|
55
|
-
|
56
|
-
def formatted_created_at
|
57
|
-
object.friendly_created_at
|
58
|
-
end
|
59
|
-
|
60
|
-
def up_votes
|
61
|
-
object.up_votes_count
|
62
|
-
end
|
63
|
-
|
64
35
|
def up_voted
|
65
36
|
object.up_voted_by?(context[:current_user])
|
66
37
|
end
|
67
38
|
|
68
|
-
def down_votes
|
69
|
-
object.down_votes_count
|
70
|
-
end
|
71
|
-
|
72
39
|
def down_voted
|
73
40
|
object.down_voted_by?(context[:current_user])
|
74
41
|
end
|
@@ -8,40 +8,28 @@ module Decidim
|
|
8
8
|
description "A commentable interface"
|
9
9
|
|
10
10
|
field :id, GraphQL::Types::ID, "The commentable's ID", null: false
|
11
|
-
|
12
11
|
field :type, GraphQL::Types::String, "The commentable's class name. i.e. `Decidim::ParticipatoryProcess`", method: :commentable_type, null: false
|
13
|
-
|
14
12
|
field :accepts_new_comments, GraphQL::Types::Boolean, "Whether the object can have new comments or not", method: :accepts_new_comments?, null: false
|
15
|
-
|
16
13
|
field :comments_have_alignment, GraphQL::Types::Boolean, "Whether the object comments have alignment or not", method: :comments_have_alignment?, null: false
|
17
|
-
|
18
14
|
field :comments_have_votes, GraphQL::Types::Boolean, "Whether the object comments have votes or not", method: :comments_have_votes?, null: false
|
19
|
-
|
20
|
-
field :
|
15
|
+
field :total_comments_count, GraphQL::Types::Int, description: "The number of comments in all levels this resource holds", method: :comments_count, null: false
|
16
|
+
field :has_comments, GraphQL::Types::Boolean, "Check if the commentable has comments", null: false
|
17
|
+
field :user_allowed_to_comment, GraphQL::Types::Boolean, "Check if the current user can comment", null: false
|
18
|
+
field :comments, [Decidim::Comments::CommentType, { null: false }], "The list of replies in this comment", null: false do
|
21
19
|
argument :order_by, GraphQL::Types::String, "Order the comments", required: false
|
22
20
|
argument :single_comment_id, GraphQL::Types::String, "ID of the single comment to look at", required: false
|
23
21
|
end
|
24
22
|
|
25
|
-
field :total_comments_count, GraphQL::Types::Int, description: "The number of comments in all levels this resource holds", null: false
|
26
|
-
|
27
23
|
def comments(order_by: nil, single_comment_id: nil)
|
28
24
|
SortedComments.for(object, order_by:, id: single_comment_id).not_hidden
|
29
25
|
end
|
30
26
|
|
31
|
-
def total_comments_count
|
32
|
-
object.comments_count
|
33
|
-
end
|
34
|
-
|
35
|
-
field :has_comments, GraphQL::Types::Boolean, "Check if the commentable has comments", null: false
|
36
|
-
|
37
27
|
# rubocop:disable Naming/PredicateName
|
38
28
|
def has_comments
|
39
29
|
object.comment_threads.not_hidden.size.positive?
|
40
30
|
end
|
41
31
|
# rubocop:enable Naming/PredicateName
|
42
32
|
|
43
|
-
field :user_allowed_to_comment, GraphQL::Types::Boolean, "Check if the current user can comment", null: false
|
44
|
-
|
45
33
|
def user_allowed_to_comment
|
46
34
|
object.commentable? && object.user_allowed_to_comment?(context[:current_user])
|
47
35
|
end
|
@@ -5,13 +5,12 @@ module Decidim
|
|
5
5
|
class CommentableMutationType < Decidim::Api::Types::BaseObject
|
6
6
|
description "A commentable which includes its available mutations"
|
7
7
|
|
8
|
-
field :id, GraphQL::Types::ID, "The Commentable's unique ID", null: false
|
9
|
-
|
10
8
|
field :add_comment, Decidim::Comments::CommentType, description: "Add a new comment to a commentable", null: true do
|
11
|
-
argument :body, GraphQL::Types::String, "The comments's body", required: true
|
12
9
|
argument :alignment, GraphQL::Types::Int, "The comment's alignment. Can be 0 (neutral), 1 (in favor) or -1 (against)'", default_value: 0, required: false
|
10
|
+
argument :body, GraphQL::Types::String, "The comments's body", required: true
|
13
11
|
argument :user_group_id, GraphQL::Types::ID, "The comment's user group id. Replaces the author.", required: false
|
14
12
|
end
|
13
|
+
field :id, GraphQL::Types::ID, "The Commentable's unique ID", null: false
|
15
14
|
|
16
15
|
def add_comment(body:, alignment: nil, user_group_id: nil)
|
17
16
|
params = { "comment" => { "body" => body, "alignment" => alignment, "user_group_id" => user_group_id, "commentable" => object } }
|
@@ -67,6 +67,17 @@ module Decidim
|
|
67
67
|
update_columns(comments_count:, updated_at: Time.current)
|
68
68
|
end
|
69
69
|
# rubocop:enable Rails/SkipsModelValidations
|
70
|
+
|
71
|
+
# Public: Returns an array with extra actions available for a comment and a user.
|
72
|
+
# Returns an array of hashes with the following keys:
|
73
|
+
# - label: The label to be displayed in the UI.
|
74
|
+
# - url: The action to be performed when the user clicks the label.
|
75
|
+
# - method: The HTTP method to be used when performing the action (optional).
|
76
|
+
# - icon: The icon to be displayed next to the label (optional).
|
77
|
+
# - data: Any "data-*" attributes to be included in the link (optional).
|
78
|
+
def actions_for_comment(_comment, _current_user)
|
79
|
+
[]
|
80
|
+
end
|
70
81
|
end
|
71
82
|
end
|
72
83
|
end
|
@@ -4,7 +4,6 @@ require "rails"
|
|
4
4
|
require "active_support/all"
|
5
5
|
|
6
6
|
require "decidim/core"
|
7
|
-
require "foundation_rails_helper"
|
8
7
|
|
9
8
|
require "decidim/comments/query_extensions"
|
10
9
|
require "decidim/comments/mutation_extensions"
|
@@ -21,6 +20,12 @@ module Decidim
|
|
21
20
|
end
|
22
21
|
end
|
23
22
|
|
23
|
+
initializer "decidim_comments.mount_routes" do
|
24
|
+
Decidim::Core::Engine.routes do
|
25
|
+
mount Decidim::Comments::Engine, at: "/", as: "decidim_comments"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
24
29
|
initializer "decidim_comments.query_extensions" do
|
25
30
|
Decidim::Api::QueryType.include QueryExtensions
|
26
31
|
end
|
@@ -42,6 +47,7 @@ module Decidim
|
|
42
47
|
|
43
48
|
Decidim.icons.register(name: "Decidim::Comments::Comment", icon: "chat-1-line", description: "Comment", category: "activity", engine: :comments)
|
44
49
|
Decidim.icons.register(name: "comments_count", icon: "wechat-line", description: "Comments Count", category: "activity", engine: :comments)
|
50
|
+
Decidim.icons.register(name: "star-s-line", icon: "star-s-line", description: "Most upvoted comment", category: "activity", engine: :comments)
|
45
51
|
|
46
52
|
Decidim.icons.register(name: "thumb-up-line", icon: "thumb-up-line", description: "Upvote comment button", **common_parameters)
|
47
53
|
Decidim.icons.register(name: "thumb-up-fill", icon: "thumb-up-fill", description: "User upvoted comment", **common_parameters)
|
@@ -46,6 +46,14 @@ FactoryBot.define do
|
|
46
46
|
create(:moderation, reportable: comment, hidden_at: 2.days.ago, skip_injection: evaluator.skip_injection)
|
47
47
|
end
|
48
48
|
end
|
49
|
+
|
50
|
+
trait :in_favor do
|
51
|
+
alignment { 1 }
|
52
|
+
end
|
53
|
+
|
54
|
+
trait :against do
|
55
|
+
alignment { -1 }
|
56
|
+
end
|
49
57
|
end
|
50
58
|
|
51
59
|
factory :comment_vote, class: "Decidim::Comments::CommentVote" do
|
@@ -10,7 +10,7 @@ shared_context "when it is a comment event" do
|
|
10
10
|
|
11
11
|
let(:resource) { comment.commentable }
|
12
12
|
|
13
|
-
let(:comment) { create
|
13
|
+
let(:comment) { create(:comment) }
|
14
14
|
let(:comment_author) { comment.author }
|
15
15
|
let(:normalized_comment_author) { comment.author }
|
16
16
|
let(:comment_author_name) { decidim_html_escape comment.author.name }
|
@@ -7,8 +7,8 @@ shared_examples_for "a comment voted event" do
|
|
7
7
|
|
8
8
|
let(:resource) { comment.commentable }
|
9
9
|
|
10
|
-
let(:comment) { create
|
11
|
-
let(:comment_vote) { create
|
10
|
+
let(:comment) { create(:comment) }
|
11
|
+
let(:comment_vote) { create(:comment_vote, comment:) }
|
12
12
|
let(:comment_vote_author) { comment_vote.author }
|
13
13
|
|
14
14
|
let(:extra) { { comment_id: comment.id, author_id: comment_vote_author.id, weight:, downvotes: 100, upvotes: 999 } }
|
@@ -7,7 +7,7 @@ RSpec.shared_context "when creating a comment" do
|
|
7
7
|
let(:user) { create(:user, organization:) }
|
8
8
|
let(:author) { create(:user, organization:) }
|
9
9
|
let(:current_user) { author }
|
10
|
-
let(:dummy_resource) { create
|
10
|
+
let(:dummy_resource) { create(:dummy_resource, component:) }
|
11
11
|
let(:commentable) { dummy_resource }
|
12
12
|
let(:body) { Faker::Lorem.paragraph }
|
13
13
|
let(:alignment) { 1 }
|
@@ -6,10 +6,10 @@ shared_examples_for "a translated comment event" do
|
|
6
6
|
describe "translated notifications" do
|
7
7
|
let(:en_body) { "This is Sparta!" }
|
8
8
|
let(:body) { { en: en_body, machine_translations: { ca: "C'est Sparta!" } } }
|
9
|
-
let(:participatory_process) { create
|
9
|
+
let(:participatory_process) { create(:participatory_process, organization:) }
|
10
10
|
let(:component) { create(:component, participatory_space: participatory_process) }
|
11
11
|
let(:commentable) { create(:dummy_resource, component:) }
|
12
|
-
let(:comment) { create
|
12
|
+
let(:comment) { create(:comment, body:, commentable:) }
|
13
13
|
let(:en_version) { "<div><p>#{comment.body["en"]}</p></div>" }
|
14
14
|
let(:machine_translated) { "<div><p>#{comment.body["machine_translations"]["ca"]}</p></div>" }
|
15
15
|
|
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.30.0.rc1
|
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: 2025-
|
13
|
+
date: 2025-02-18 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.30.0.rc1
|
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.30.0.rc1
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: redcarpet
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,28 +52,28 @@ dependencies:
|
|
52
52
|
requirements:
|
53
53
|
- - '='
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 0.
|
55
|
+
version: 0.30.0.rc1
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
58
|
version_requirements: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - '='
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 0.
|
62
|
+
version: 0.30.0.rc1
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
name: decidim-dev
|
65
65
|
requirement: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - '='
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.
|
69
|
+
version: 0.30.0.rc1
|
70
70
|
type: :development
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - '='
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 0.
|
76
|
+
version: 0.30.0.rc1
|
77
77
|
description: Pluggable comments system for some components.
|
78
78
|
email:
|
79
79
|
- josepjaume@gmail.com
|
@@ -105,8 +105,8 @@ files:
|
|
105
105
|
- app/cells/decidim/comments/comment_thread_cell.rb
|
106
106
|
- app/cells/decidim/comments/comments/add_comment.erb
|
107
107
|
- app/cells/decidim/comments/comments/blocked_comments_warning.erb
|
108
|
+
- app/cells/decidim/comments/comments/comments_in_single_column.erb
|
108
109
|
- app/cells/decidim/comments/comments/comments_loading.erb
|
109
|
-
- app/cells/decidim/comments/comments/inline.erb
|
110
110
|
- app/cells/decidim/comments/comments/order_control.erb
|
111
111
|
- app/cells/decidim/comments/comments/show.erb
|
112
112
|
- app/cells/decidim/comments/comments/single_comment_warning.erb
|
@@ -114,6 +114,9 @@ files:
|
|
114
114
|
- app/cells/decidim/comments/comments_cell.rb
|
115
115
|
- app/cells/decidim/comments/edit_comment_modal_form/show.erb
|
116
116
|
- app/cells/decidim/comments/edit_comment_modal_form_cell.rb
|
117
|
+
- app/cells/decidim/comments/two_columns_comments/column.erb
|
118
|
+
- app/cells/decidim/comments/two_columns_comments/show.erb
|
119
|
+
- app/cells/decidim/comments/two_columns_comments_cell.rb
|
117
120
|
- app/commands/decidim/comments/create_comment.rb
|
118
121
|
- app/commands/decidim/comments/delete_comment.rb
|
119
122
|
- app/commands/decidim/comments/update_comment.rb
|
@@ -143,6 +146,8 @@ files:
|
|
143
146
|
- app/packs/src/decidim/comments/comments.component.test.js
|
144
147
|
- app/packs/src/decidim/comments/comments.component_for_testing.js
|
145
148
|
- app/packs/src/decidim/comments/comments.js
|
149
|
+
- app/packs/src/decidim/comments/comments_dropdown.js
|
150
|
+
- app/packs/src/decidim/comments/comments_mobile_modal.js
|
146
151
|
- app/packs/stylesheets/comments.scss
|
147
152
|
- app/permissions/decidim/comments/permissions.rb
|
148
153
|
- app/queries/decidim/comments/metrics/comment_participants_metric_measure.rb
|
@@ -154,6 +159,7 @@ files:
|
|
154
159
|
- app/services/decidim/comments/new_comment_notification_creator.rb
|
155
160
|
- app/views/decidim/comments/admin/shared/_availability_fields.html.erb
|
156
161
|
- app/views/decidim/comments/comments/_comment.html.erb
|
162
|
+
- app/views/decidim/comments/comments/_comments.html.erb
|
157
163
|
- app/views/decidim/comments/comments/_delete.html.erb
|
158
164
|
- app/views/decidim/comments/comments/_edited_comment.html.erb
|
159
165
|
- app/views/decidim/comments/comments/_moderated.html.erb
|
@@ -175,7 +181,6 @@ files:
|
|
175
181
|
- config/locales/bg.yml
|
176
182
|
- config/locales/bn-BD.yml
|
177
183
|
- config/locales/bs-BA.yml
|
178
|
-
- config/locales/ca-IT.yml
|
179
184
|
- config/locales/ca.yml
|
180
185
|
- config/locales/cs-CZ.yml
|
181
186
|
- config/locales/cs.yml
|
@@ -317,14 +322,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
317
322
|
requirements:
|
318
323
|
- - "~>"
|
319
324
|
- !ruby/object:Gem::Version
|
320
|
-
version: 3.
|
325
|
+
version: 3.3.0
|
321
326
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
322
327
|
requirements:
|
323
328
|
- - ">="
|
324
329
|
- !ruby/object:Gem::Version
|
325
330
|
version: '0'
|
326
331
|
requirements: []
|
327
|
-
rubygems_version: 3.
|
332
|
+
rubygems_version: 3.5.11
|
328
333
|
signing_key:
|
329
334
|
specification_version: 4
|
330
335
|
summary: Decidim comments module
|
@@ -1,28 +0,0 @@
|
|
1
|
-
<div id="comments">
|
2
|
-
<div class="comments">
|
3
|
-
<div class="comments__header">
|
4
|
-
<h2 class="h4">
|
5
|
-
<% if single_comment? %>
|
6
|
-
<%= t("decidim.components.comments.comment_details_title") %>
|
7
|
-
<% else %>
|
8
|
-
<%= icon "chat-1-line", class: "fill-tertiary w-6 h-6 inline-block align-middle" %>
|
9
|
-
<span class="comments-count inline-block align-middle">
|
10
|
-
<%= t("decidim.components.comments.title", count: comments_count) %>
|
11
|
-
</span>
|
12
|
-
<% end %>
|
13
|
-
</h2>
|
14
|
-
<%= render :order_control %>
|
15
|
-
</div>
|
16
|
-
<%= single_comment_warning %>
|
17
|
-
<%= blocked_comments_warning %>
|
18
|
-
<div class="comment-threads" id="<%= threads_node_id %>" aria-live="polite">
|
19
|
-
<%= comments_loading %>
|
20
|
-
<% comments.each do |comment| %>
|
21
|
-
<%= cell("decidim/comments/comment_thread", comment, order:) %>
|
22
|
-
<% end %>
|
23
|
-
</div>
|
24
|
-
<%= add_comment %>
|
25
|
-
<%= user_comments_blocked_warning %>
|
26
|
-
</div>
|
27
|
-
<%= cell("decidim/announcement", t("decidim.components.comments.loading"), callout_class: "primary loading-comments hidden") %>
|
28
|
-
</div>
|
data/config/locales/ca-IT.yml
DELETED
@@ -1,178 +0,0 @@
|
|
1
|
-
---
|
2
|
-
ca-IT:
|
3
|
-
activemodel:
|
4
|
-
models:
|
5
|
-
decidim/comments/comment_by_followed_user_event: Comentari
|
6
|
-
decidim/comments/comment_created_event: Comentari
|
7
|
-
decidim/comments/comment_upvoted_event: Comentari valorat positivament
|
8
|
-
decidim/comments/reply_created_event: Resposta al comentari
|
9
|
-
decidim/comments/user_group_mentioned_event: Mencionar
|
10
|
-
decidim/comments/user_mentioned_event: Mencionar
|
11
|
-
activerecord:
|
12
|
-
models:
|
13
|
-
decidim/comments/comment:
|
14
|
-
one: Comentari
|
15
|
-
other: Comentaris
|
16
|
-
decidim/comments/comment_vote:
|
17
|
-
one: Vot
|
18
|
-
other: Vots
|
19
|
-
decidim:
|
20
|
-
comments:
|
21
|
-
admin:
|
22
|
-
shared:
|
23
|
-
availability_fields:
|
24
|
-
enabled: Comentaris habilitats
|
25
|
-
end_time: Comentaris habilitats fins al
|
26
|
-
start_time: Comentaris habilitats des de
|
27
|
-
comment_thread:
|
28
|
-
accessibility_label: Fil de comentaris iniciat per %{full_name} el %{date}
|
29
|
-
comments:
|
30
|
-
create:
|
31
|
-
error: S'ha produït un error en crear el comentari.
|
32
|
-
delete:
|
33
|
-
error: El comentari no s'ha pogut eliminar.
|
34
|
-
update:
|
35
|
-
error: S'ha produït un error en actualitzar el comentari.
|
36
|
-
comments_title: Comentari
|
37
|
-
last_activity:
|
38
|
-
new_comment: 'Nou comentari:'
|
39
|
-
votes:
|
40
|
-
create:
|
41
|
-
error: S'ha produït un error en votar el comentari.
|
42
|
-
components:
|
43
|
-
add_comment_form:
|
44
|
-
account_message: <a href="%{sign_in_url}">Inicia sessió</a> o <a href="%{sign_up_url}">crea un compte</a> per afegir el teu comentari.
|
45
|
-
form:
|
46
|
-
body:
|
47
|
-
label: Comentari
|
48
|
-
placeholder: Què en penses d'això?
|
49
|
-
form_error: El text és necessari i no pot ser més llarg de %{length}.
|
50
|
-
submit_reply: Publicar resposta
|
51
|
-
submit_root_comment: Publicar comentari
|
52
|
-
user_group_id:
|
53
|
-
label: Comentar com a
|
54
|
-
opinion:
|
55
|
-
label: La teva opinió sobre aquest tema
|
56
|
-
negative: Negativa
|
57
|
-
negative_selected: La teva opinió sobre aquest tema és negativa
|
58
|
-
neutral: Neutral
|
59
|
-
neutral_selected: La teva opinió sobre aquest tema és neutral
|
60
|
-
positive: Positiva
|
61
|
-
positive_selected: La teva opinió sobre aquest tema és positiva
|
62
|
-
remaining_characters: "Queden %{count} caràcters"
|
63
|
-
remaining_characters_1: "Queda %{count} caràcter"
|
64
|
-
title: Deixa el teu comentari
|
65
|
-
comment:
|
66
|
-
alignment:
|
67
|
-
against: En contra
|
68
|
-
in_favor: A favor
|
69
|
-
cancel_reply: Cancel·lar resposta
|
70
|
-
comment_label: Comentari %{comment_id}
|
71
|
-
comment_label_reply: Comentari %{comment_id} (respon al comentari %{parent_comment_id})
|
72
|
-
confirm_destroy: Segur que vols esborrar aquest comentari?
|
73
|
-
controls_label: Controls de comentaris
|
74
|
-
delete: Esborrar
|
75
|
-
deleted_at: Comentari esborrat el %{date}
|
76
|
-
deleted_user: Participant eliminada
|
77
|
-
edit: Editar
|
78
|
-
edited: Editat
|
79
|
-
hide_replies:
|
80
|
-
one: Amagar resposta
|
81
|
-
other: Amagar %{count} respostes
|
82
|
-
moderated_at: Comentari moderat el %{date}
|
83
|
-
reply: Respondre
|
84
|
-
report:
|
85
|
-
action: Denúncia
|
86
|
-
already_reported: Aquest contingut ja ha estat denunciat i serà revisat per una administradora.
|
87
|
-
close: Tancar
|
88
|
-
description: Aquest contingut és inapropiat?
|
89
|
-
details: Comentaris addicionals
|
90
|
-
reasons:
|
91
|
-
does_not_belong: Conté activitat il·legal, amenaces de suïcidi, informació personal, o qualsevol altra cosa que creguis que no pertany a %{organization_name}.
|
92
|
-
offensive: Conté racisme, sexisme, insults, atacs personals, amenaces de mort, peticions de suïcidi o qualsevol forma de discurs d'odi.
|
93
|
-
spam: Conté "clickbait", publicitat o estafes.
|
94
|
-
title: Notificar contingut inapropiat
|
95
|
-
show_replies:
|
96
|
-
one: Mostra la resposta
|
97
|
-
other: Mostra les %{count} respostes
|
98
|
-
single_comment_link_title: Obtenir enllaç
|
99
|
-
comment_order_selector:
|
100
|
-
order:
|
101
|
-
best_rated: Més ben valorats
|
102
|
-
most_discussed: Més discutit
|
103
|
-
older: Més antic
|
104
|
-
recent: Recent
|
105
|
-
title: 'Ordenar per:'
|
106
|
-
comments:
|
107
|
-
blocked_comments_for_unauthorized_user_warning: Has d'estar verificat abans de poder fer comentaris, però pots llegir els comentaris anteriors.
|
108
|
-
blocked_comments_for_user_warning: No pots fer comentaris en aquest moment, però pots llegir els anteriors.
|
109
|
-
blocked_comments_warning: Els comentaris estan desactivats en aquest moment, però pots llegir els anteriors.
|
110
|
-
comment_details_title: Detalls del comentari
|
111
|
-
loading: Carregant els comentaris ...
|
112
|
-
single_comment_warning: <a href="%{url}">Mostra tots els comentaris</a>
|
113
|
-
single_comment_warning_title: Estàs veient un sol comentari
|
114
|
-
title:
|
115
|
-
one: "%{count} comentari"
|
116
|
-
other: "%{count} comentaris"
|
117
|
-
down_vote_button:
|
118
|
-
text: No estic d'acord amb aquest comentari
|
119
|
-
edit_comment_modal_form:
|
120
|
-
close: Tancar
|
121
|
-
form:
|
122
|
-
body:
|
123
|
-
label: Comentar
|
124
|
-
placeholder: Què opines sobre això?
|
125
|
-
submit: Enviar
|
126
|
-
title: Edita el teu comentari
|
127
|
-
up_vote_button:
|
128
|
-
text: Estic d'acord amb aquest comentari
|
129
|
-
events:
|
130
|
-
comments:
|
131
|
-
comment_by_followed_user:
|
132
|
-
email_intro: "%{author_name} ha deixat un comentari a %{resource_title}. Podeu llegir-lo en aquesta pàgina:"
|
133
|
-
email_outro: Has rebut aquesta notificació perquè estàs seguint el comentari "%{author_name}". Pots deixar de seguir a aquesta participant des de la seva pàgina de perfil.
|
134
|
-
email_subject: Hi ha un nou comentari de %{author_name} en %{resource_title}
|
135
|
-
notification_title: Hi ha un nou comentari per <a href="%{author_path}">%{author_name} %{author_nickname}</a> a <a href="%{resource_path}">%{resource_title}</a>.
|
136
|
-
comment_by_followed_user_group:
|
137
|
-
email_intro: '%{author_name} ha deixat un comentari a%{resource_title}. Pots llegir-lo en aquesta pàgina:'
|
138
|
-
email_outro: Reps aquesta notificació perquè segueixes a "%{author_name}". Pots deixar de seguir aquest grup des de la seva pàgina de perfil.
|
139
|
-
email_subject: Hi ha un nou comentari de %{author_name} en %{resource_title}
|
140
|
-
notification_title: Hi ha un nou comentari per <a href="%{author_path}">%{author_name} %{author_nickname}</a> a <a href="%{resource_path}">%{resource_title}</a>.
|
141
|
-
comment_created:
|
142
|
-
email_intro: "Algú ha deixat un comentari a \"%{resource_title}\". Pots llegir el comentari a través del següent enllaç:"
|
143
|
-
email_outro: Has rebut aquesta notificació perquè estàs seguint el comentari "%{resource_title}" o la seva autora. Pots deixar de seguir-la des de l'enllaç anterior.
|
144
|
-
email_subject: Hi ha un nou comentari de %{author_name} a %{resource_title}
|
145
|
-
notification_title: Hi ha un nou comentari de <a href="%{author_path}">%{author_name} %{author_nickname}</a> en <a href="%{resource_path}">%{resource_title}</a>
|
146
|
-
comment_downvoted:
|
147
|
-
email_intro: El teu comentari a "%{resource_title}" ha rebut un vot negatiu. Ara té un total de %{upvotes} vots positius i %{downvotes} vots negatius.
|
148
|
-
email_outro: Has rebut aquesta notificació perquè vas fer aquest comentari.
|
149
|
-
email_subject: El teu comentari a "%{resource_title}" ha rebut un vot negatiu.
|
150
|
-
notification_title: El teu <a href="%{resource_path}">comentari</a> a "%{resource_title}" ha rebut un vot negatiu. Ara té un total de %{upvotes} vots positius i %{downvotes} vots negatius.
|
151
|
-
comment_upvoted:
|
152
|
-
email_intro: El teu comentari a "%{resource_title}" ha rebut un vot positiu. Ara té un total de %{upvotes} vots positius i %{downvotes} vots negatius.
|
153
|
-
email_outro: Has rebut aquesta notificació perquè vas fer aquest comentari.
|
154
|
-
email_subject: El teu comentari a "%{resource_title}" ha rebut un vot positiu.
|
155
|
-
notification_title: El teu <a href="%{resource_path}">comentari</a> a "%{resource_title}" ha rebut un vot positiu. Ara té un total de %{upvotes} vots positius i %{downvotes} vots negatius.
|
156
|
-
reply_created:
|
157
|
-
email_intro: "%{author_name} ha respost el teu comentari a %{resource_title}. Pots llegir-lo en aquesta pàgina:"
|
158
|
-
email_outro: Has rebut aquesta notificació perquè s'ha respost el teu comentari.
|
159
|
-
email_subject: "%{author_name} ha respost el teu comentari a %{resource_title}"
|
160
|
-
notification_title: <a href="%{author_path}">%{author_name} %{author_nickname}</a> ha respost el teu comentari a <a href="%{resource_path}">%{resource_title}</a>
|
161
|
-
user_group_mentioned:
|
162
|
-
email_intro: Un grup al qual pertanys ha estat esmentat
|
163
|
-
email_outro: Has rebut aquesta notificació perquè formes part del grup "%{group_name}" que ha estat esmentat a %{resource_title}.
|
164
|
-
email_subject: T'han esmentat a %{resource_title} com a membre de %{group_name}
|
165
|
-
notification_title: <a href="%{author_path}">%{author_name} %{author_nickname}</a> t'ha esmentat com a membre de <a href="%{group_path}">%{group_name} %{group_nickname}</a> a <a href="%{resource_path}">%{resource_title}</a>
|
166
|
-
user_mentioned:
|
167
|
-
email_intro: Has estat esmentada
|
168
|
-
email_outro: Has rebut aquesta notificació perquè t'han esmentat al comentari "%{resource_title}".
|
169
|
-
email_subject: Has estat esmentada a %{resource_title}
|
170
|
-
notification_title: Has estat esmentada a <a href="%{resource_path}">%{resource_title}</a> per <a href="%{author_path}">%{author_name} %{author_nickname}</a>
|
171
|
-
metrics:
|
172
|
-
comments:
|
173
|
-
description: Nombre de comentaris generats per les participants
|
174
|
-
object: comentaris
|
175
|
-
title: Comentaris
|
176
|
-
errors:
|
177
|
-
messages:
|
178
|
-
cannot_have_comments: no es poden fer comentaris
|