commontator 6.2.0 → 6.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '090fc289133016e2dee74b6443dbb24d87474a147f0af5be10794d1528572f1f'
4
- data.tar.gz: caa26ed1c165afc9dbc133196c0a1bc40c9fb5271835cf5c24195da98eacdb1a
3
+ metadata.gz: 4be189fd8c44438a5fe1717c74bfe09067f16dbaaccda6daf159e70213e2c39a
4
+ data.tar.gz: 6f62579a12c5b207ed9f879e3d473d654915c9fe1ac17dcc51ba0655502793c9
5
5
  SHA512:
6
- metadata.gz: 6b4eb3166f2de162d2a34f1bcc724e14dd538043a90658a87515d6d105509a25570babdca58e25149cfc9aac2d1f496844753f8087923c922a4e1555ec57ad28
7
- data.tar.gz: ddb3662fa3723c0fd27809eaa80e19ac1ffd46d9e80b8c0d9f5909e2e4fa159676ea8fe5fba9a220fb6d555ae20db5da30e1c144a3eec5840c12bf797d591199
6
+ metadata.gz: b15a7623162ca1ff592e8eb3bd4e15e99d6514e744625686aff53a6cf523d4abf43bdbb070a6eafa8f09d1e992332288a8c053a5d2a11c676424f20c89d4a613
7
+ data.tar.gz: e79a8df63ac01a4f837db59f4cb0dd23fec1a633d0045a02825a1562791f161d592f58a68b3aa23231cbe32e3ede2c6a8192a0de45af9186ee684da5b44c61f5
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![Code Climate](https://codeclimate.com/github/lml/commontator/badges/gpa.svg)](https://codeclimate.com/github/lml/commontator)
6
6
  [![Code Coverage](https://codeclimate.com/github/lml/commontator/badges/coverage.svg)](https://codeclimate.com/github/lml/commontator)
7
7
 
8
- Commontator is a Rails engine for comments. It is compatible with Rails 5+.
8
+ Commontator is a Rails engine for comments. It is compatible with Rails 5.2+.
9
9
  Being an engine means it is fully functional as soon as you install and
10
10
  configure the gem, providing models, views and controllers of its own.
11
11
  At the same time, almost anything about it can be configured or customized to suit your needs.
@@ -79,7 +79,9 @@ Follow the steps below to install Commontator:
79
79
 
80
80
  You can change the mount path if you would like a different one.
81
81
 
82
- 5. Javascripts
82
+ ### Assets
83
+
84
+ 1. Javascripts
83
85
 
84
86
  Make sure your application.js requires jquery and rails-ujs or jquery-ujs:
85
87
 
@@ -104,7 +106,7 @@ Follow the steps below to install Commontator:
104
106
  //= require commontator/application
105
107
  ```
106
108
 
107
- 6. Stylesheets
109
+ 2. Stylesheets
108
110
 
109
111
  In order to display comment threads properly, you must
110
112
  require Commontator's application.scss in your `application.[s]css`:
@@ -113,6 +115,18 @@ Follow the steps below to install Commontator:
113
115
  *= require commontator/application
114
116
  ```
115
117
 
118
+ #### Sprockets 4+
119
+
120
+ You must require Commontator's manifest.js in your app's manifest.js for images to work properly:
121
+
122
+ ```js
123
+ //= link commontator/manifest.js
124
+ ```
125
+
126
+ You also need to either add the necessary link tag commands to your layout to load
127
+ commontator/application.js and commontator/application.css or require them in your app's
128
+ application.js and application.css like in Sprockets 3.
129
+
116
130
  ## Usage
117
131
 
118
132
  Follow the steps below to add Commontator to your models and views:
@@ -0,0 +1,3 @@
1
+ //= link_tree ../../images
2
+ //= link_directory ../../javascripts .js
3
+ //= link_directory ../../stylesheets .css
@@ -1,3 +1,7 @@
1
+ require 'will_paginate/view_helpers/link_renderer'
2
+ require 'will_paginate/view_helpers/action_view'
3
+
4
+
1
5
  class Commontator::LinkRenderer < WillPaginate::ActionView::LinkRenderer
2
6
  protected
3
7
 
@@ -36,7 +36,7 @@
36
36
  <% is_deleted = comment.is_deleted? %>
37
37
  <% del_string = is_deleted ? 'undelete' : 'delete' %>
38
38
  <%= link_to t("commontator.comment.actions.#{del_string}"),
39
- commontator.polymorphic_path([del_string, comment]),
39
+ commontator.polymorphic_path([del_string.to_sym, comment]),
40
40
  data: is_deleted ? {} : { confirm: t('commontator.comment.actions.confirm_delete') },
41
41
  method: :put,
42
42
  id: "commontator-comment-#{comment.id}-#{del_string}",
@@ -7,7 +7,7 @@
7
7
  <% is_subscribed = !!thread.subscription_for(user) %>
8
8
  <% sub_string = is_subscribed ? 'unsubscribe' : 'subscribe' %>
9
9
  <%= link_to t("commontator.subscription.actions.#{sub_string}"),
10
- commontator.polymorphic_path([sub_string, thread]),
10
+ commontator.polymorphic_path([sub_string.to_sym, thread]),
11
11
  method: :put,
12
12
  id: "commontator-thread-#{thread.id}-#{sub_string}",
13
13
  class: sub_string,
@@ -54,7 +54,7 @@
54
54
  <% end %>
55
55
 
56
56
  <%= link_to t("commontator.thread.actions.#{close_string}"),
57
- commontator.polymorphic_path([close_string, thread]),
57
+ commontator.polymorphic_path([close_string.to_sym, thread]),
58
58
  data: is_closed ? {} :
59
59
  { confirm: t('commontator.thread.actions.confirm_close') },
60
60
  method: :put,
@@ -17,7 +17,7 @@ module Commontator::ActsAsCommontable
17
17
  cattr_accessor :commontable_config
18
18
  self.commontable_config = Commontator::CommontableConfig.new(options)
19
19
 
20
- has_one :commontator_thread, association_options.merge(
20
+ has_one :commontator_thread, **association_options.merge(
21
21
  as: :commontable, class_name: 'Commontator::Thread'
22
22
  )
23
23
 
@@ -16,10 +16,10 @@ module Commontator::ActsAsCommontator
16
16
  cattr_accessor :commontator_config
17
17
  self.commontator_config = Commontator::CommontatorConfig.new(options)
18
18
 
19
- has_many :commontator_comments, association_options.merge(
19
+ has_many :commontator_comments, **association_options.merge(
20
20
  as: :creator, class_name: 'Commontator::Comment'
21
21
  )
22
- has_many :commontator_subscriptions, association_options.merge(
22
+ has_many :commontator_subscriptions, **association_options.merge(
23
23
  as: :subscriber, class_name: 'Commontator::Subscription'
24
24
  )
25
25
 
@@ -1,10 +1,6 @@
1
1
  require_relative 'shared_helper'
2
2
 
3
3
  module Commontator::Controllers
4
- def self.included(base)
5
- base.helper Commontator::SharedHelper
6
- end
7
-
8
4
  def commontator_set_thread_variables
9
5
  return if @commontator_thread.nil? || !@commontator_thread.can_be_read_by?(@commontator_user)
10
6
 
@@ -59,5 +59,8 @@ end
59
59
 
60
60
  ActiveSupport.on_load :action_controller do
61
61
  include Commontator::SharedHelper
62
+ end
63
+
64
+ ActiveSupport.on_load :action_controller_base do
62
65
  helper Commontator::SharedHelper
63
66
  end
@@ -1 +1 @@
1
- COMMONTATOR_VERSION = '6.2.0'
1
+ COMMONTATOR_VERSION = '6.3.2'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commontator
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.0
4
+ version: 6.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dante Soares
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-02 00:00:00.000000000 Z
11
+ date: 2021-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: '5.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '5.0'
26
+ version: '5.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: will_paginate
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -159,6 +159,7 @@ extra_rdoc_files: []
159
159
  files:
160
160
  - MIT-LICENSE
161
161
  - README.md
162
+ - app/assets/config/commontator/manifest.js
162
163
  - app/assets/images/commontator/downvote.png
163
164
  - app/assets/images/commontator/downvote_active.png
164
165
  - app/assets/images/commontator/downvote_disabled.png
@@ -235,7 +236,7 @@ homepage: https://github.com/lml/commontator
235
236
  licenses:
236
237
  - MIT
237
238
  metadata: {}
238
- post_install_message:
239
+ post_install_message:
239
240
  rdoc_options: []
240
241
  require_paths:
241
242
  - lib
@@ -250,8 +251,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
251
  - !ruby/object:Gem::Version
251
252
  version: '0'
252
253
  requirements: []
253
- rubygems_version: 3.0.4
254
- signing_key:
254
+ rubygems_version: 3.1.4
255
+ signing_key:
255
256
  specification_version: 4
256
257
  summary: Allows users to comment on any model in your application.
257
258
  test_files: []