decidim-comments 0.27.6 → 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 +9 -21
- 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 +9 -7
- data/app/models/decidim/comments/comment_vote.rb +0 -10
- 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/bg.yml +0 -23
- data/config/locales/ca.yml +15 -17
- 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 +16 -18
- 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 +3 -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 -11
- data/config/locales/pt-BR.yml +0 -18
- data/config/locales/pt.yml +0 -16
- data/config/locales/ro-RO.yml +6 -14
- data/config/locales/ru.yml +0 -11
- data/config/locales/sk.yml +0 -11
- data/config/locales/sq-AL.yml +0 -38
- 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/comment_type.rb +2 -2
- 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 +9 -16
- data/lib/decidim/comments/test/shared_examples/comment_event.rb +4 -4
- data/lib/decidim/comments/test/shared_examples/comment_voted_event.rb +4 -4
- 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 +30 -27
- 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/locales/he-IL.yml +0 -1
- data/db/migrate/20240304092558_add_comment_vote_counter_cache_to_comments.rb +0 -21
- data/decidim-comments.gemspec +0 -33
@@ -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/locales/he-IL.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
he:
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class AddCommentVoteCounterCacheToComments < ActiveRecord::Migration[6.1]
|
4
|
-
def change
|
5
|
-
add_column :decidim_comments_comments, :up_votes_count, :integer, null: false, default: 0, index: true
|
6
|
-
add_column :decidim_comments_comments, :down_votes_count, :integer, null: false, default: 0, index: true
|
7
|
-
|
8
|
-
# We cannot use the reset_counters as up_votes and down_votes are scoped associationws
|
9
|
-
reversible do |dir|
|
10
|
-
dir.up do
|
11
|
-
Decidim::Comments::Comment.reset_column_information
|
12
|
-
Decidim::Comments::Comment.find_each do |record|
|
13
|
-
# rubocop:disable Rails/SkipsModelValidations
|
14
|
-
record.class.update_counters(record.id, up_votes_count: record.up_votes.length)
|
15
|
-
record.class.update_counters(record.id, down_votes_count: record.down_votes.length)
|
16
|
-
# rubocop:enable Rails/SkipsModelValidations
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
data/decidim-comments.gemspec
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
$LOAD_PATH.push File.expand_path("lib", __dir__)
|
4
|
-
|
5
|
-
# Maintain your gem's version:
|
6
|
-
require "decidim/comments/version"
|
7
|
-
|
8
|
-
# Describe your gem and declare its dependencies:
|
9
|
-
Gem::Specification.new do |s|
|
10
|
-
s.version = Decidim::Comments.version
|
11
|
-
s.authors = ["Josep Jaume Rey Peroy", "Marc Riera Casals", "Oriol Gual Oliva"]
|
12
|
-
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
|
13
|
-
s.license = "AGPL-3.0"
|
14
|
-
s.homepage = "https://github.com/decidim/decidim"
|
15
|
-
s.required_ruby_version = "~> 3.0.0"
|
16
|
-
|
17
|
-
s.name = "decidim-comments"
|
18
|
-
s.summary = "Decidim comments module"
|
19
|
-
s.description = "Pluggable comments system for some components."
|
20
|
-
|
21
|
-
s.files = Dir.chdir(__dir__) do
|
22
|
-
`git ls-files -z`.split("\x0").select do |f|
|
23
|
-
(File.expand_path(f) == __FILE__) ||
|
24
|
-
f.start_with?(*%w(app/ config/ db/ lib/ Rakefile README.md))
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
s.add_dependency "decidim-core", Decidim::Comments.version
|
29
|
-
s.add_dependency "redcarpet", "~> 3.5", ">= 3.5.1"
|
30
|
-
|
31
|
-
s.add_development_dependency "decidim-admin", Decidim::Comments.version
|
32
|
-
s.add_development_dependency "decidim-dev", Decidim::Comments.version
|
33
|
-
end
|