decidim-comments 0.27.5 → 0.28.0.rc4
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/comments/comment/actions.erb +13 -7
- data/app/cells/decidim/comments/comment/alignment_badge.erb +1 -4
- data/app/cells/decidim/comments/comment/deletion_data.erb +9 -1
- data/app/cells/decidim/comments/comment/moderation_data.erb +1 -1
- data/app/cells/decidim/comments/comment/replies.erb +3 -0
- data/app/cells/decidim/comments/comment/show.erb +72 -35
- data/app/cells/decidim/comments/comment/votes.erb +14 -14
- data/app/cells/decidim/comments/comment_activity_cell.rb +11 -7
- data/app/cells/decidim/comments/comment_card_cell.rb +2 -2
- data/app/cells/decidim/comments/comment_cell.rb +5 -15
- data/app/cells/decidim/comments/comment_form/comment_as.erb +3 -3
- data/app/cells/decidim/comments/comment_form/opinion.erb +18 -0
- data/app/cells/decidim/comments/comment_form/show.erb +33 -16
- data/app/cells/decidim/comments/comment_form_cell.rb +9 -1
- data/app/cells/decidim/comments/comment_metadata_cell.rb +27 -0
- data/app/cells/decidim/comments/comment_s_cell.rb +27 -0
- data/app/cells/decidim/comments/comment_thread/show.erb +2 -5
- data/app/cells/decidim/comments/comment_thread_cell.rb +0 -6
- data/app/cells/decidim/comments/comments/add_comment.erb +1 -20
- data/app/cells/decidim/comments/comments/blocked_comments_warning.erb +1 -3
- data/app/cells/decidim/comments/comments/comments_loading.erb +1 -3
- data/app/cells/decidim/comments/comments/order_control.erb +11 -35
- data/app/cells/decidim/comments/comments/show.erb +8 -9
- data/app/cells/decidim/comments/comments/single_comment_warning.erb +6 -9
- data/app/cells/decidim/comments/comments/user_comments_blocked_warning.erb +9 -6
- data/app/cells/decidim/comments/comments_cell.rb +1 -1
- data/app/cells/decidim/comments/edit_comment_modal_form/show.erb +20 -15
- data/app/commands/decidim/comments/create_comment.rb +17 -5
- data/app/commands/decidim/comments/delete_comment.rb +1 -1
- data/app/commands/decidim/comments/update_comment.rb +14 -2
- data/app/commands/decidim/comments/vote_comment.rb +1 -1
- data/app/controllers/decidim/comments/comments_controller.rb +14 -9
- data/app/controllers/decidim/comments/votes_controller.rb +1 -1
- data/app/events/decidim/comments/comment_by_followed_user_event.rb +1 -1
- data/app/events/decidim/comments/comment_by_followed_user_group_event.rb +1 -1
- data/app/events/decidim/comments/comment_event.rb +2 -3
- data/app/events/decidim/comments/reply_created_event.rb +1 -1
- data/app/events/decidim/comments/user_group_mentioned_event.rb +1 -1
- data/app/events/decidim/comments/user_mentioned_event.rb +1 -1
- data/app/helpers/decidim/comments/comment_cells_helper.rb +1 -1
- data/app/jobs/decidim/comments/hide_all_created_by_author_job.rb +13 -0
- data/app/models/decidim/comments/comment.rb +7 -4
- data/app/models/decidim/comments/seed.rb +30 -14
- data/app/packs/entrypoints/decidim_comments.js +5 -0
- data/app/packs/src/decidim/comments/comments.component.js +27 -36
- data/app/packs/src/decidim/comments/comments.component.test.js +218 -240
- data/app/packs/src/decidim/comments/comments.component_for_testing.js +1 -1
- data/app/packs/src/decidim/comments/comments.js +20 -1
- data/app/packs/stylesheets/comments.scss +327 -0
- data/app/queries/decidim/comments/metrics/comments_metric_manage.rb +1 -1
- data/app/queries/decidim/comments/sorted_comments.rb +10 -10
- data/app/services/decidim/comments/comment_creation.rb +1 -1
- data/app/services/decidim/comments/new_comment_notification_creator.rb +8 -8
- data/app/views/decidim/comments/admin/shared/_availability_fields.html.erb +4 -9
- data/app/views/decidim/comments/comments/_comment.html.erb +1 -1
- data/app/views/decidim/comments/comments/_comments.html.erb +1 -1
- data/app/views/decidim/comments/comments/_delete.html.erb +2 -4
- data/app/views/decidim/comments/comments/_moderated.html.erb +2 -4
- data/app/views/decidim/comments/comments/create.js.erb +5 -3
- data/app/views/decidim/comments/comments/delete.js.erb +4 -1
- data/app/views/decidim/comments/comments/index.js.erb +8 -1
- data/app/views/decidim/comments/comments/reload.js.erb +1 -2
- data/app/views/decidim/comments/comments/update.js.erb +5 -4
- data/app/views/decidim/comments/votes/create.js.erb +5 -5
- data/config/assets.rb +3 -0
- data/config/locales/ar.yml +0 -16
- data/config/locales/ca.yml +8 -10
- data/config/locales/cs.yml +8 -10
- data/config/locales/de.yml +7 -9
- data/config/locales/el.yml +3 -11
- data/config/locales/en.yml +10 -12
- data/config/locales/es-MX.yml +10 -12
- data/config/locales/es-PY.yml +10 -12
- data/config/locales/es.yml +9 -11
- data/config/locales/eu.yml +6 -8
- data/config/locales/fi-plain.yml +7 -9
- data/config/locales/fi.yml +7 -9
- data/config/locales/fr-CA.yml +9 -11
- data/config/locales/fr.yml +9 -11
- data/config/locales/ga-IE.yml +0 -4
- data/config/locales/gl.yml +0 -16
- data/config/locales/hu.yml +5 -11
- data/config/locales/id-ID.yml +0 -11
- data/config/locales/is-IS.yml +0 -8
- data/config/locales/it.yml +0 -16
- data/config/locales/ja.yml +6 -8
- data/config/locales/lb.yml +0 -16
- data/config/locales/lt.yml +7 -10
- data/config/locales/lv.yml +0 -11
- data/config/locales/nl.yml +0 -16
- data/config/locales/no.yml +0 -16
- data/config/locales/pl.yml +7 -10
- data/config/locales/pt-BR.yml +0 -18
- data/config/locales/pt.yml +0 -16
- data/config/locales/ro-RO.yml +2 -10
- data/config/locales/ru.yml +0 -11
- data/config/locales/sk.yml +0 -11
- data/config/locales/sv.yml +2 -16
- data/config/locales/tr-TR.yml +1 -13
- data/config/locales/uk.yml +0 -8
- data/config/locales/zh-CN.yml +0 -13
- data/config/locales/zh-TW.yml +1 -9
- data/lib/decidim/api/commentable_interface.rb +1 -1
- data/lib/decidim/comments/comment_serializer.rb +1 -1
- data/lib/decidim/comments/comment_vote_serializer.rb +1 -1
- data/lib/decidim/comments/commentable.rb +1 -1
- data/lib/decidim/comments/comments_helper.rb +6 -3
- data/lib/decidim/comments/engine.rb +31 -1
- data/lib/decidim/comments/export.rb +1 -1
- data/lib/decidim/comments/test/factories.rb +2 -2
- data/lib/decidim/comments/test/shared_examples/comment_event.rb +3 -3
- data/lib/decidim/comments/test/shared_examples/comment_voted_event.rb +3 -3
- data/lib/decidim/comments/test/shared_examples/create_comment_context.rb +5 -5
- data/lib/decidim/comments/test/shared_examples/has_comments_availability_attributes.rb +2 -2
- data/lib/decidim/comments/test/shared_examples/translatable_comment.rb +3 -3
- data/lib/decidim/comments/version.rb +1 -1
- metadata +26 -21
- data/app/cells/decidim/comments/comment/author.erb +0 -1
- data/app/cells/decidim/comments/comment/utilities.erb +0 -41
- data/app/cells/decidim/comments/comment_m/footer.erb +0 -5
- data/app/cells/decidim/comments/comment_m/top.erb +0 -7
- data/app/cells/decidim/comments/comment_m_cell.rb +0 -29
- data/app/cells/decidim/comments/comment_thread/title.erb +0 -3
- data/config/environment.rb +0 -3
@@ -64,7 +64,7 @@ module Decidim
|
|
64
64
|
# rubocop:disable Rails/SkipsModelValidations
|
65
65
|
def update_comments_count
|
66
66
|
comments_count = comments.not_hidden.not_deleted.count
|
67
|
-
update_columns(comments_count
|
67
|
+
update_columns(comments_count:, updated_at: Time.current)
|
68
68
|
end
|
69
69
|
# rubocop:enable Rails/SkipsModelValidations
|
70
70
|
end
|
@@ -10,9 +10,12 @@ module Decidim
|
|
10
10
|
def comments_for(resource, options = {})
|
11
11
|
return unless resource.commentable?
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
append_stylesheet_pack_tag "decidim_comments"
|
14
|
+
# This script cannot be deferred, otherwise the DOMReady and turbo:load listeners are not
|
15
|
+
# executed from a Turbo Frame call
|
16
|
+
append_javascript_pack_tag "decidim_comments", defer: false
|
17
|
+
|
18
|
+
inline_comments_for(resource, options)
|
16
19
|
end
|
17
20
|
|
18
21
|
# Creates a Comments component through the comments cell.
|
@@ -29,7 +29,7 @@ module Decidim
|
|
29
29
|
Decidim::Api::MutationType.include MutationExtensions
|
30
30
|
end
|
31
31
|
|
32
|
-
initializer "
|
32
|
+
initializer "decidim_comments.stats" do
|
33
33
|
Decidim.stats.register :comments_count, priority: StatsRegistry::MEDIUM_PRIORITY do |organization|
|
34
34
|
Decidim.component_manifests.sum do |component|
|
35
35
|
component.stats.filter(tag: :comments).with_context(organization.published_components).map { |_name, value| value }.sum
|
@@ -37,6 +37,19 @@ module Decidim
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
initializer "decidim_comments.register_icons" do
|
41
|
+
common_parameters = { category: "action", engine: :comments }
|
42
|
+
|
43
|
+
Decidim.icons.register(name: "Decidim::Comments::Comment", icon: "chat-1-line", description: "Comment", category: "activity", engine: :comments)
|
44
|
+
Decidim.icons.register(name: "comments_count", icon: "wechat-line", description: "Comments Count", category: "activity", engine: :comments)
|
45
|
+
|
46
|
+
Decidim.icons.register(name: "thumb-up-line", icon: "thumb-up-line", description: "Upvote comment button", **common_parameters)
|
47
|
+
Decidim.icons.register(name: "thumb-up-fill", icon: "thumb-up-fill", description: "User upvoted comment", **common_parameters)
|
48
|
+
Decidim.icons.register(name: "thumb-down-line", icon: "thumb-down-line", description: "Downvote comment button", **common_parameters)
|
49
|
+
Decidim.icons.register(name: "thumb-down-fill", icon: "thumb-down-fill", description: "User downvoted comment", **common_parameters)
|
50
|
+
Decidim.icons.register(name: "edit-line", icon: "edit-line", description: "Edit comment button", **common_parameters)
|
51
|
+
end
|
52
|
+
|
40
53
|
initializer "decidim_comments.register_metrics" do
|
41
54
|
Decidim.metrics_registry.register(:comments) do |metric_registry|
|
42
55
|
metric_registry.manager_class = "Decidim::Comments::Metrics::CommentsMetricManage"
|
@@ -70,6 +83,23 @@ module Decidim
|
|
70
83
|
initializer "decidim_comments.webpacker.assets_path" do
|
71
84
|
Decidim.register_assets_path File.expand_path("app/packs", root)
|
72
85
|
end
|
86
|
+
|
87
|
+
initializer "decidim_comments.authorization_transfer" do
|
88
|
+
config.to_prepare do
|
89
|
+
Decidim::AuthorizationTransfer.register(:comments) do |transfer|
|
90
|
+
transfer.move_records(Decidim::Comments::Comment, :decidim_author_id)
|
91
|
+
transfer.move_records(Decidim::Comments::CommentVote, :decidim_author_id)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
initializer "decidim_comments.moderation_content" do
|
97
|
+
config.to_prepare do
|
98
|
+
ActiveSupport::Notifications.subscribe("decidim.admin.block_user:after") do |_event_name, data|
|
99
|
+
Decidim::Comments::HideAllCreatedByAuthorJob.perform_later(**data)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
73
103
|
end
|
74
104
|
end
|
75
105
|
end
|
@@ -12,9 +12,9 @@ module Decidim
|
|
12
12
|
# Returns an Arel::Relation with all the comments for that component and resource.
|
13
13
|
def comments_for_resource(resource_class, component)
|
14
14
|
Comment
|
15
|
-
.where(decidim_root_commentable_id: resource_class.where(component: component))
|
16
15
|
.not_deleted
|
17
16
|
.not_hidden
|
17
|
+
.where(decidim_root_commentable_id: resource_class.where(component:))
|
18
18
|
.where(decidim_root_commentable_type: resource_class.to_s)
|
19
19
|
end
|
20
20
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
|
-
shared_context "when it
|
5
|
+
shared_context "when it is a comment event" do
|
6
6
|
include Decidim::ComponentPathHelper
|
7
7
|
include Decidim::SanitizeHelper
|
8
8
|
|
@@ -18,8 +18,8 @@ shared_context "when it's a comment event" do
|
|
18
18
|
let(:extra) { { comment_id: comment.id } }
|
19
19
|
let(:resource_title) { decidim_html_escape(translated(resource.title)) }
|
20
20
|
let(:user_group) do
|
21
|
-
user_group = create(:user_group, :verified, organization
|
22
|
-
comment.update!(user_group:
|
21
|
+
user_group = create(:user_group, :verified, organization:, users: [comment_author])
|
22
|
+
comment.update!(user_group:)
|
23
23
|
user_group
|
24
24
|
end
|
25
25
|
end
|
@@ -3,15 +3,15 @@
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
5
|
shared_examples_for "a comment voted event" do
|
6
|
-
include_context "when it
|
6
|
+
include_context "when it is a comment event"
|
7
7
|
|
8
8
|
let(:resource) { comment.commentable }
|
9
9
|
|
10
10
|
let(:comment) { create :comment }
|
11
|
-
let(:comment_vote) { create :comment_vote, comment:
|
11
|
+
let(:comment_vote) { create :comment_vote, comment: }
|
12
12
|
let(:comment_vote_author) { comment_vote.author }
|
13
13
|
|
14
|
-
let(:extra) { { comment_id: comment.id, author_id: comment_vote_author.id, weight
|
14
|
+
let(:extra) { { comment_id: comment.id, author_id: comment_vote_author.id, weight:, downvotes: 100, upvotes: 999 } }
|
15
15
|
let(:resource_title) { decidim_html_escape(translated(resource.title)) }
|
16
16
|
let(:resource_text) { subject.resource_text }
|
17
17
|
|
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
RSpec.shared_context "when creating a comment" do
|
4
4
|
let(:organization) { create(:organization) }
|
5
|
-
let(:participatory_process) { create(:participatory_process, organization:
|
5
|
+
let(:participatory_process) { create(:participatory_process, organization:) }
|
6
6
|
let(:component) { create(:component, participatory_space: participatory_process) }
|
7
|
-
let(:user) { create(:user, organization:
|
8
|
-
let(:author) { create(:user, organization:
|
9
|
-
let(:dummy_resource) { create :dummy_resource, component:
|
7
|
+
let(:user) { create(:user, organization:) }
|
8
|
+
let(:author) { create(:user, organization:) }
|
9
|
+
let(:dummy_resource) { create :dummy_resource, component: }
|
10
10
|
let(:commentable) { dummy_resource }
|
11
|
-
let(:body) {
|
11
|
+
let(:body) { Faker::Lorem.paragraph }
|
12
12
|
let(:alignment) { 1 }
|
13
13
|
let(:user_group_id) { nil }
|
14
14
|
let(:form_params) do
|
@@ -5,11 +5,11 @@ shared_examples_for "has comments availability attributes" do
|
|
5
5
|
let(:comments_start_time) { nil }
|
6
6
|
let(:comments_end_time) { nil }
|
7
7
|
let(:updates) do
|
8
|
-
{ comments_enabled:
|
8
|
+
{ comments_enabled: }.merge(
|
9
9
|
if subject.is_a?(Decidim::Debates::Debate)
|
10
10
|
{ start_time: comments_start_time, end_time: comments_end_time }
|
11
11
|
else
|
12
|
-
{ comments_start_time
|
12
|
+
{ comments_start_time:, comments_end_time: }
|
13
13
|
end
|
14
14
|
)
|
15
15
|
end
|
@@ -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 :participatory_process, organization:
|
9
|
+
let(:participatory_process) { create :participatory_process, organization: }
|
10
10
|
let(:component) { create(:component, participatory_space: participatory_process) }
|
11
|
-
let(:commentable) { create(:dummy_resource, component:
|
12
|
-
let(:comment) { create :comment, body
|
11
|
+
let(:commentable) { create(:dummy_resource, component:) }
|
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.28.0.rc4
|
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: 2023-12-
|
13
|
+
date: 2023-12-11 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.28.0.rc4
|
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.28.0.rc4
|
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.28.0.rc4
|
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.28.0.rc4
|
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.28.0.rc4
|
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.28.0.rc4
|
77
77
|
description: Pluggable comments system for some components.
|
78
78
|
email:
|
79
79
|
- josepjaume@gmail.com
|
@@ -87,23 +87,21 @@ files:
|
|
87
87
|
- Rakefile
|
88
88
|
- app/cells/decidim/comments/comment/actions.erb
|
89
89
|
- app/cells/decidim/comments/comment/alignment_badge.erb
|
90
|
-
- app/cells/decidim/comments/comment/author.erb
|
91
90
|
- app/cells/decidim/comments/comment/deletion_data.erb
|
92
91
|
- app/cells/decidim/comments/comment/moderation_data.erb
|
92
|
+
- app/cells/decidim/comments/comment/replies.erb
|
93
93
|
- app/cells/decidim/comments/comment/show.erb
|
94
|
-
- app/cells/decidim/comments/comment/utilities.erb
|
95
94
|
- app/cells/decidim/comments/comment/votes.erb
|
96
95
|
- app/cells/decidim/comments/comment_activity_cell.rb
|
97
96
|
- app/cells/decidim/comments/comment_card_cell.rb
|
98
97
|
- app/cells/decidim/comments/comment_cell.rb
|
99
98
|
- app/cells/decidim/comments/comment_form/comment_as.erb
|
99
|
+
- app/cells/decidim/comments/comment_form/opinion.erb
|
100
100
|
- app/cells/decidim/comments/comment_form/show.erb
|
101
101
|
- app/cells/decidim/comments/comment_form_cell.rb
|
102
|
-
- app/cells/decidim/comments/
|
103
|
-
- app/cells/decidim/comments/
|
104
|
-
- app/cells/decidim/comments/comment_m_cell.rb
|
102
|
+
- app/cells/decidim/comments/comment_metadata_cell.rb
|
103
|
+
- app/cells/decidim/comments/comment_s_cell.rb
|
105
104
|
- app/cells/decidim/comments/comment_thread/show.erb
|
106
|
-
- app/cells/decidim/comments/comment_thread/title.erb
|
107
105
|
- app/cells/decidim/comments/comment_thread_cell.rb
|
108
106
|
- app/cells/decidim/comments/comments/add_comment.erb
|
109
107
|
- app/cells/decidim/comments/comments/blocked_comments_warning.erb
|
@@ -134,14 +132,17 @@ files:
|
|
134
132
|
- app/events/decidim/comments/user_mentioned_event.rb
|
135
133
|
- app/forms/decidim/comments/comment_form.rb
|
136
134
|
- app/helpers/decidim/comments/comment_cells_helper.rb
|
135
|
+
- app/jobs/decidim/comments/hide_all_created_by_author_job.rb
|
137
136
|
- app/models/decidim/comments/application_record.rb
|
138
137
|
- app/models/decidim/comments/comment.rb
|
139
138
|
- app/models/decidim/comments/comment_vote.rb
|
140
139
|
- app/models/decidim/comments/seed.rb
|
140
|
+
- app/packs/entrypoints/decidim_comments.js
|
141
141
|
- app/packs/src/decidim/comments/comments.component.js
|
142
142
|
- app/packs/src/decidim/comments/comments.component.test.js
|
143
143
|
- app/packs/src/decidim/comments/comments.component_for_testing.js
|
144
144
|
- app/packs/src/decidim/comments/comments.js
|
145
|
+
- app/packs/stylesheets/comments.scss
|
145
146
|
- app/permissions/decidim/comments/permissions.rb
|
146
147
|
- app/queries/decidim/comments/metrics/comment_participants_metric_measure.rb
|
147
148
|
- app/queries/decidim/comments/metrics/comments_metric_manage.rb
|
@@ -167,7 +168,6 @@ files:
|
|
167
168
|
- app/views/decidim/comments/votes/create.js.erb
|
168
169
|
- app/views/decidim/comments/votes/error.js.erb
|
169
170
|
- config/assets.rb
|
170
|
-
- config/environment.rb
|
171
171
|
- config/locales/am-ET.yml
|
172
172
|
- config/locales/ar-SA.yml
|
173
173
|
- config/locales/ar.yml
|
@@ -294,10 +294,15 @@ files:
|
|
294
294
|
- lib/decidim/comments/test/shared_examples/translatable_comment.rb
|
295
295
|
- lib/decidim/comments/version.rb
|
296
296
|
- lib/tasks/decidim_comments.rake
|
297
|
-
homepage: https://
|
297
|
+
homepage: https://decidim.org
|
298
298
|
licenses:
|
299
299
|
- AGPL-3.0
|
300
|
-
metadata:
|
300
|
+
metadata:
|
301
|
+
bug_tracker_uri: https://github.com/decidim/decidim/issues
|
302
|
+
documentation_uri: https://docs.decidim.org/
|
303
|
+
funding_uri: https://opencollective.com/decidim
|
304
|
+
homepage_uri: https://decidim.org
|
305
|
+
source_code_uri: https://github.com/decidim/decidim
|
301
306
|
post_install_message:
|
302
307
|
rdoc_options: []
|
303
308
|
require_paths:
|
@@ -306,14 +311,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
306
311
|
requirements:
|
307
312
|
- - ">="
|
308
313
|
- !ruby/object:Gem::Version
|
309
|
-
version: '3.
|
314
|
+
version: '3.1'
|
310
315
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
311
316
|
requirements:
|
312
|
-
- - "
|
317
|
+
- - ">"
|
313
318
|
- !ruby/object:Gem::Version
|
314
|
-
version:
|
319
|
+
version: 1.3.1
|
315
320
|
requirements: []
|
316
|
-
rubygems_version: 3.4.
|
321
|
+
rubygems_version: 3.4.20
|
317
322
|
signing_key:
|
318
323
|
specification_version: 4
|
319
324
|
summary: Decidim comments module
|
@@ -1 +0,0 @@
|
|
1
|
-
<%== cell("decidim/author", author_presenter).profile %>
|
@@ -1,41 +0,0 @@
|
|
1
|
-
<div class="comment__header__context-menu">
|
2
|
-
<label for="<%= context_menu_id %>" data-toggle="<%= context_menu_id %>">
|
3
|
-
<%= icon "ellipses" %>
|
4
|
-
</label>
|
5
|
-
<ul id="<%= context_menu_id %>" data-dropdown data-close-on-click="true" data-position="left" data-alignment="top" class="card dropdown-pane comment__header__context-menu__content">
|
6
|
-
<li>
|
7
|
-
<button type="button" class="link-alt comment__header__context-menu__content-item" data-open="<%= current_user.present? ? "flagModalComment#{model.id}" : "loginModal" %>" title="<%= t("decidim.components.comment.report.title") %>" aria-controls="<%= current_user.present? ? "flagModalComment#{model.id}" : "loginModal" %>" aria-haspopup="dialog" tabindex="0">
|
8
|
-
<%= icon "flag", class: "icon--small", aria_label: t("decidim.components.comment.report.title") %>
|
9
|
-
<span><%= t("decidim.components.comment.report.action") %></span>
|
10
|
-
</button>
|
11
|
-
</li>
|
12
|
-
<li>
|
13
|
-
<%= link_to "#{commentable_path("commentId" => model.id)}#comment_#{model.id}", target: "_blank", class: "comment__header__context-menu__content-item", title: t("decidim.components.comment.single_comment_link_title") do %>
|
14
|
-
<%= icon "link-intact", class: "icon--small", aria_label: t("decidim.components.comment.single_comment_link_title") %>
|
15
|
-
<span><%= t("decidim.components.comment.single_comment_link_title") %></span>
|
16
|
-
<% end %>
|
17
|
-
</li>
|
18
|
-
<% if model.authored_by?(current_user) %>
|
19
|
-
<li>
|
20
|
-
<button type="button" class="link-alt comment__header__context-menu__content-item" data-open="<%= "editCommentModal#{model.id}" %>" title="<%= t("decidim.components.comment.edit") %>" aria-controls="<%= "editCommentModal#{model.id}" %>" aria-haspopup="dialog" tabindex="0">
|
21
|
-
<%= icon "pencil", class: "icon--small", aria_label: t("decidim.components.comment.edit") %>
|
22
|
-
<span><%= t("decidim.components.comment.edit") %></span>
|
23
|
-
</button>
|
24
|
-
</li>
|
25
|
-
<li>
|
26
|
-
<%= link_to comment_path, remote: true, method: :delete, class: "comment__header__context-menu__content-item", data: { confirm: t("decidim.components.comment.confirm_destroy") } do %>
|
27
|
-
<%= icon "trash", class: "icon--small", aria_label: t("decidim.components.comment.delete") %>
|
28
|
-
<span><%= t("decidim.components.comment.delete") %></span>
|
29
|
-
<% end %>
|
30
|
-
</li>
|
31
|
-
<% end %>
|
32
|
-
</ul>
|
33
|
-
</div>
|
34
|
-
<% unless reloaded? %>
|
35
|
-
<% if current_user.present? %>
|
36
|
-
<%= cell("decidim/flag_modal", model, modal_id: "flagModalComment#{model.id}") %>
|
37
|
-
<% end %>
|
38
|
-
<% if model.authored_by?(current_user) %>
|
39
|
-
<%= cell("decidim/comments/edit_comment_modal_form", model, modal_id: "editCommentModal#{model.id}") %>
|
40
|
-
<% end %>
|
41
|
-
<% end %>
|
@@ -1,7 +0,0 @@
|
|
1
|
-
<div class="card__top">
|
2
|
-
<% if render_space? %>
|
3
|
-
<div class="card__content text-small">
|
4
|
-
<span class="muted"><%= searchable_resource_human_name(model.root_commentable.class, count: 1) %>:</span> <%= link_to root_commentable_title, resource_link_path, class: "card__link text-ellipsis" %>
|
5
|
-
</div>
|
6
|
-
<% end %>
|
7
|
-
</div>
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Comments
|
5
|
-
# This cell renders the Medium (:m) comment card
|
6
|
-
# for an given instance of a Comment
|
7
|
-
class CommentMCell < Decidim::CardMCell
|
8
|
-
include CommentCellsHelper
|
9
|
-
|
10
|
-
def statuses
|
11
|
-
[]
|
12
|
-
end
|
13
|
-
|
14
|
-
def comment
|
15
|
-
model
|
16
|
-
end
|
17
|
-
|
18
|
-
def has_header?
|
19
|
-
false
|
20
|
-
end
|
21
|
-
|
22
|
-
delegate :participatory_space, to: :model
|
23
|
-
|
24
|
-
def description
|
25
|
-
strip_tags(model.formatted_body).truncate(200, separator: /\s/)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
data/config/environment.rb
DELETED