decidim-comments 0.30.0 → 0.30.1
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/comments/inline.erb +28 -0
- data/app/cells/decidim/comments/comments/show.erb +1 -28
- data/app/cells/decidim/comments/comments_cell.rb +4 -0
- data/app/packs/src/decidim/comments/comments.component.js +1 -0
- data/app/views/decidim/comments/comments/index.js.erb +3 -0
- data/app/views/decidim/comments/comments/reload.js.erb +3 -7
- data/app/views/decidim/comments/comments/update.js.erb +1 -3
- data/config/locales/cs.yml +2 -0
- data/lib/decidim/comments/comments_helper.rb +1 -1
- data/lib/decidim/comments/version.rb +1 -1
- metadata +9 -9
- data/app/views/decidim/comments/comments/_comments.html.erb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e6746750957ec0abd1071747249f9950e9e05230a27a6a88d3cabfbd65a71ae
|
4
|
+
data.tar.gz: 9d4719e73c257aa75357d5829eaad1436a144f8f25a1002307a99726596880a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbd914f9f24ff0a9a9ab9161d83bb66ecffe1f6e4b4369f6eda8d5d005424462ae6961b0adc4ac80e17fe73f9494e478367fa00eb37d13b1fcb2b6abc0f5df7b
|
7
|
+
data.tar.gz: a01577c7c2a8a288f1b9835fbc0fd988ba6d9aa7ec1cad7b54f1b78d8008e6be44d207f09a7c569d6eef1d47c9135fb00cc7719d5f4211d5ad7c05ea5864ea48
|
@@ -0,0 +1,28 @@
|
|
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 unless two_columns_layout? %>
|
15
|
+
</div>
|
16
|
+
<%= single_comment_warning %>
|
17
|
+
<%= blocked_comments_warning %>
|
18
|
+
<%= render_comments %>
|
19
|
+
<% if user_signed_in? %>
|
20
|
+
<button class="button button__lg button__secondary flex md:hidden w-full h-9 text-sm add-comment-mobile">
|
21
|
+
<%= t("add_comment", scope: "decidim.components.add_comment_form") %>
|
22
|
+
</button>
|
23
|
+
<% end %>
|
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>
|
@@ -1,30 +1,3 @@
|
|
1
1
|
<%= content_tag :div, id: node_id, data: { decidim_comments: comments_data } do %>
|
2
|
-
|
3
|
-
<div class="comments">
|
4
|
-
<div class="comments__header">
|
5
|
-
<h2 class="h4">
|
6
|
-
<% if single_comment? %>
|
7
|
-
<%= t("decidim.components.comments.comment_details_title") %>
|
8
|
-
<% else %>
|
9
|
-
<%= icon "chat-1-line", class: "fill-tertiary w-6 h-6 inline-block align-middle" %>
|
10
|
-
<span class="comments-count inline-block align-middle">
|
11
|
-
<%= t("decidim.components.comments.title", count: comments_count) %>
|
12
|
-
</span>
|
13
|
-
<% end %>
|
14
|
-
</h2>
|
15
|
-
<%= render :order_control unless two_columns_layout? %>
|
16
|
-
</div>
|
17
|
-
<%= single_comment_warning %>
|
18
|
-
<%= blocked_comments_warning %>
|
19
|
-
<%= render_comments %>
|
20
|
-
<% if user_signed_in? %>
|
21
|
-
<button class="button button__lg button__secondary flex md:hidden w-full h-9 text-sm add-comment-mobile">
|
22
|
-
<%= t("add_comment", scope: "decidim.components.add_comment_form") %>
|
23
|
-
</button>
|
24
|
-
<% end %>
|
25
|
-
<%= add_comment %>
|
26
|
-
<%= user_comments_blocked_warning %>
|
27
|
-
</div>
|
28
|
-
<%= cell("decidim/announcement", t("decidim.components.comments.loading"), callout_class: "primary loading-comments hidden") %>
|
29
|
-
</div>
|
2
|
+
<%= render :inline %>
|
30
3
|
<% end %>
|
@@ -61,6 +61,7 @@ export default class CommentsComponent {
|
|
61
61
|
if (this.mounted) {
|
62
62
|
this.mounted = false;
|
63
63
|
this._stopPolling();
|
64
|
+
this.lastCommentId = null;
|
64
65
|
|
65
66
|
$(".add-comment [data-opinion-toggle] button", this.$element).off("click.decidim-comments");
|
66
67
|
$(".add-comment textarea", this.$element).off("input.decidim-comments");
|
@@ -5,6 +5,7 @@
|
|
5
5
|
var component = $comments.data("comments");
|
6
6
|
|
7
7
|
$(".loading-comments").addClass("hidden");
|
8
|
+
|
8
9
|
var commentsIds = [];
|
9
10
|
<% @comments.each do |comment| %>
|
10
11
|
var commentId = <%= comment.id.to_json %>;
|
@@ -22,6 +23,8 @@
|
|
22
23
|
}
|
23
24
|
<% end %>
|
24
25
|
if (commentsIds.length) {
|
26
|
+
component.lastCommentId = <%= @comments.last&.id || 0 %>;
|
27
|
+
|
25
28
|
Rails.fire(document, "comments:loaded", {
|
26
29
|
commentsIds: commentsIds
|
27
30
|
});
|
@@ -5,16 +5,12 @@
|
|
5
5
|
var component = $comments.data("comments");
|
6
6
|
component.unmountComponent();
|
7
7
|
|
8
|
-
var commentsHtml = '<%== j(
|
8
|
+
var commentsHtml = '<%== j(inline_comments_for(commentable, order:).inline).strip %>';
|
9
9
|
$(".loading-comments").addClass("hidden");
|
10
|
-
$comments.
|
10
|
+
$comments.html(commentsHtml);
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
// Re-create the component
|
15
|
-
component = new Decidim.CommentsComponent($comments, $comments.data("decidim-comments"));
|
12
|
+
// Re-mount the component
|
16
13
|
component.mountComponent();
|
17
|
-
$comments.data("comments", component);
|
18
14
|
|
19
15
|
// Update the comments count
|
20
16
|
$(".comments-count", $comments).text(<%== t("decidim.components.comments.title", count: @comments_count).to_json %>);
|
@@ -2,8 +2,8 @@ $(() => {
|
|
2
2
|
var rootCommentableId = <%== "comments-for-#{@commentable.class.name.demodulize}-#{@commentable.id}".to_json %>;
|
3
3
|
var $comments = $("#" + rootCommentableId);
|
4
4
|
var config = $comments.data("decidim-comments");
|
5
|
+
var component = $comments.data("comments");
|
5
6
|
|
6
|
-
component = new Decidim.CommentsComponent($comments, config);
|
7
7
|
component.unmountComponent();
|
8
8
|
|
9
9
|
var commentHtml = '<%== j(render partial: "edited_comment", locals: { comment: @comment }).strip %>';
|
@@ -19,9 +19,7 @@ $(() => {
|
|
19
19
|
$comment.replaceWith(commentHtml);
|
20
20
|
|
21
21
|
// Re-create the component
|
22
|
-
component = new Decidim.CommentsComponent($comments, $comments.data("decidim-comments"));
|
23
22
|
component.mountComponent();
|
24
|
-
$comments.data("comments", component);
|
25
23
|
|
26
24
|
Rails.fire(document, "comments:loaded", {
|
27
25
|
commentsIds: [commentId]
|
data/config/locales/cs.yml
CHANGED
@@ -32,6 +32,8 @@ cs:
|
|
32
32
|
enabled: Komentáře povoleny
|
33
33
|
end_time: Komentáře povoleny do
|
34
34
|
start_time: Komentáře povoleny od
|
35
|
+
comment_thread:
|
36
|
+
accessibility_label: Komentář začal %{full_name} na %{date}
|
35
37
|
comments:
|
36
38
|
create:
|
37
39
|
error: Při vytváření komentáře došlo k chybě.
|
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.30.
|
4
|
+
version: 0.30.1
|
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-06-17 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.30.
|
21
|
+
version: 0.30.1
|
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.30.
|
28
|
+
version: 0.30.1
|
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.30.
|
55
|
+
version: 0.30.1
|
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.30.
|
62
|
+
version: 0.30.1
|
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.30.
|
69
|
+
version: 0.30.1
|
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.30.
|
76
|
+
version: 0.30.1
|
77
77
|
description: Pluggable comments system for some components.
|
78
78
|
email:
|
79
79
|
- josepjaume@gmail.com
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- app/cells/decidim/comments/comments/blocked_comments_warning.erb
|
108
108
|
- app/cells/decidim/comments/comments/comments_in_single_column.erb
|
109
109
|
- app/cells/decidim/comments/comments/comments_loading.erb
|
110
|
+
- app/cells/decidim/comments/comments/inline.erb
|
110
111
|
- app/cells/decidim/comments/comments/order_control.erb
|
111
112
|
- app/cells/decidim/comments/comments/show.erb
|
112
113
|
- app/cells/decidim/comments/comments/single_comment_warning.erb
|
@@ -159,7 +160,6 @@ files:
|
|
159
160
|
- app/services/decidim/comments/new_comment_notification_creator.rb
|
160
161
|
- app/views/decidim/comments/admin/shared/_availability_fields.html.erb
|
161
162
|
- app/views/decidim/comments/comments/_comment.html.erb
|
162
|
-
- app/views/decidim/comments/comments/_comments.html.erb
|
163
163
|
- app/views/decidim/comments/comments/_delete.html.erb
|
164
164
|
- app/views/decidim/comments/comments/_edited_comment.html.erb
|
165
165
|
- app/views/decidim/comments/comments/_moderated.html.erb
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= inline_comments_for(commentable, order:) %>
|