commontator 6.0.0.pre.1 → 6.0.0.pre.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/commontator/application.scss +10 -3
- data/app/assets/stylesheets/commontator/comments.scss +4 -0
- data/app/controllers/commontator/comments_controller.rb +16 -4
- data/app/controllers/commontator/threads_controller.rb +1 -0
- data/app/helpers/commontator/link_renderer.rb +6 -4
- data/app/models/commontator/collection.rb +26 -0
- data/app/models/commontator/comment.rb +13 -110
- data/app/models/commontator/subscription.rb +2 -2
- data/app/models/commontator/thread.rb +102 -16
- data/app/views/commontator/comments/_body.html.erb +1 -8
- data/app/views/commontator/comments/_form.html.erb +1 -4
- data/app/views/commontator/comments/_list.html.erb +9 -5
- data/app/views/commontator/comments/_show.html.erb +85 -39
- data/app/views/commontator/comments/_show.js.erb +14 -0
- data/app/views/commontator/comments/_votes.html.erb +1 -1
- data/app/views/commontator/comments/create.js.erb +18 -13
- data/app/views/commontator/comments/delete.js.erb +9 -15
- data/app/views/commontator/comments/new.js.erb +2 -8
- data/app/views/commontator/comments/show.js.erb +30 -0
- data/app/views/commontator/comments/update.js.erb +9 -7
- data/app/views/commontator/shared/_thread.html.erb +3 -8
- data/app/views/commontator/threads/_reply.html.erb +2 -3
- data/app/views/commontator/threads/_show.html.erb +39 -42
- data/app/views/commontator/threads/_show.js.erb +5 -5
- data/app/views/commontator/threads/show.js.erb +3 -2
- data/config/initializers/commontator.rb +9 -6
- data/config/locales/de.yml +10 -2
- data/config/locales/en.yml +10 -2
- data/config/locales/pt-BR.yml +10 -2
- data/config/locales/ru.yml +10 -2
- data/config/locales/zh.yml +12 -4
- data/config/routes.rb +9 -9
- data/db/migrate/1_add_replying_to_comments.rb +0 -2
- data/lib/commontator.rb +1 -0
- data/lib/commontator/commontable_config.rb +6 -1
- data/lib/commontator/commontator_config.rb +1 -1
- data/lib/commontator/config.rb +2 -2
- data/lib/commontator/controllers.rb +3 -8
- data/lib/commontator/shared_helper.rb +0 -1
- data/lib/commontator/version.rb +1 -1
- metadata +13 -12
- data/app/views/commontator/comments/_actions.html.erb +0 -28
- data/app/views/commontator/comments/_reply.html.erb +0 -15
@@ -1,28 +0,0 @@
|
|
1
|
-
<%#
|
2
|
-
Views that use this partial must supply the following variables:
|
3
|
-
comment
|
4
|
-
user
|
5
|
-
%>
|
6
|
-
|
7
|
-
<% can_edit = comment.can_be_edited_by?(user)
|
8
|
-
can_delete = comment.can_be_deleted_by?(user) %>
|
9
|
-
|
10
|
-
<% if can_edit %>
|
11
|
-
<%= link_to t('commontator.comment.actions.edit'),
|
12
|
-
commontator.edit_comment_path(comment),
|
13
|
-
id: "commontator-comment-#{comment.id}-edit",
|
14
|
-
class: 'edit',
|
15
|
-
remote: true %>
|
16
|
-
<% end %>
|
17
|
-
|
18
|
-
<% if can_delete %>
|
19
|
-
<% is_deleted = comment.is_deleted? %>
|
20
|
-
<% del_string = is_deleted ? 'undelete' : 'delete' %>
|
21
|
-
<%= link_to t("commontator.comment.actions.#{del_string}"),
|
22
|
-
commontator.polymorphic_path([del_string, comment]),
|
23
|
-
data: is_deleted ? {} : { confirm: t('commontator.comment.actions.confirm_delete') },
|
24
|
-
method: :put,
|
25
|
-
id: "commontator-comment-#{comment.id}-#{del_string}",
|
26
|
-
class: del_string,
|
27
|
-
remote: true %>
|
28
|
-
<% end %>
|
@@ -1,15 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
# Controllers that use this partial must supply the following variables:
|
3
|
-
# comment
|
4
|
-
# user
|
5
|
-
|
6
|
-
thread = comment.thread
|
7
|
-
%>
|
8
|
-
|
9
|
-
<% if thread.config.comment_reply_style != :n && !thread.is_closed? && user %>
|
10
|
-
<%=
|
11
|
-
link_to t('commontator.comment.actions.reply'), commontator.new_thread_comment_path(
|
12
|
-
thread, comment: { parent_id: comment.id }, per_page: per_page
|
13
|
-
), remote: true
|
14
|
-
%>
|
15
|
-
<% end %>
|