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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/commontator/application.scss +10 -3
  3. data/app/assets/stylesheets/commontator/comments.scss +4 -0
  4. data/app/controllers/commontator/comments_controller.rb +16 -4
  5. data/app/controllers/commontator/threads_controller.rb +1 -0
  6. data/app/helpers/commontator/link_renderer.rb +6 -4
  7. data/app/models/commontator/collection.rb +26 -0
  8. data/app/models/commontator/comment.rb +13 -110
  9. data/app/models/commontator/subscription.rb +2 -2
  10. data/app/models/commontator/thread.rb +102 -16
  11. data/app/views/commontator/comments/_body.html.erb +1 -8
  12. data/app/views/commontator/comments/_form.html.erb +1 -4
  13. data/app/views/commontator/comments/_list.html.erb +9 -5
  14. data/app/views/commontator/comments/_show.html.erb +85 -39
  15. data/app/views/commontator/comments/_show.js.erb +14 -0
  16. data/app/views/commontator/comments/_votes.html.erb +1 -1
  17. data/app/views/commontator/comments/create.js.erb +18 -13
  18. data/app/views/commontator/comments/delete.js.erb +9 -15
  19. data/app/views/commontator/comments/new.js.erb +2 -8
  20. data/app/views/commontator/comments/show.js.erb +30 -0
  21. data/app/views/commontator/comments/update.js.erb +9 -7
  22. data/app/views/commontator/shared/_thread.html.erb +3 -8
  23. data/app/views/commontator/threads/_reply.html.erb +2 -3
  24. data/app/views/commontator/threads/_show.html.erb +39 -42
  25. data/app/views/commontator/threads/_show.js.erb +5 -5
  26. data/app/views/commontator/threads/show.js.erb +3 -2
  27. data/config/initializers/commontator.rb +9 -6
  28. data/config/locales/de.yml +10 -2
  29. data/config/locales/en.yml +10 -2
  30. data/config/locales/pt-BR.yml +10 -2
  31. data/config/locales/ru.yml +10 -2
  32. data/config/locales/zh.yml +12 -4
  33. data/config/routes.rb +9 -9
  34. data/db/migrate/1_add_replying_to_comments.rb +0 -2
  35. data/lib/commontator.rb +1 -0
  36. data/lib/commontator/commontable_config.rb +6 -1
  37. data/lib/commontator/commontator_config.rb +1 -1
  38. data/lib/commontator/config.rb +2 -2
  39. data/lib/commontator/controllers.rb +3 -8
  40. data/lib/commontator/shared_helper.rb +0 -1
  41. data/lib/commontator/version.rb +1 -1
  42. metadata +13 -12
  43. data/app/views/commontator/comments/_actions.html.erb +0 -28
  44. 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 %>