rails_admin_comments 0.2.0 → 0.2.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/.ruby-gemset +1 -1
- data/README.md +1 -1
- data/app/models/rails_admin_comments/comment.rb +1 -1
- data/app/models/rails_admin_comments/model_comment.rb +1 -1
- data/app/views/rails_admin/main/comments.html.slim +6 -6
- data/app/views/rails_admin/main/model_comments.html.slim +7 -7
- data/lib/rails_admin_comments/action.rb +14 -14
- data/lib/rails_admin_comments/configuration.rb +0 -8
- data/lib/rails_admin_comments/engine.rb +3 -3
- data/lib/rails_admin_comments/models/mongoid/comments.rb +1 -1
- data/lib/rails_admin_comments/version.rb +1 -1
- data/lib/rails_admin_comments.rb +0 -1
- data/rails_admin_comments.gemspec +5 -5
- data/release.sh +2 -3
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b37fde637a44126cead4d54ca515ad0d5fb49b1d
|
4
|
+
data.tar.gz: c3f4de022f3906cc51a8f3e2368e04386776342e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e61ef1d66be404209cbf0867157c85ecda9cf0587e1af2bc71e55394677ad69099e786a67cd279f0a0fff273d0d39610663408f8a70d55f3359b1e14930efbeb
|
7
|
+
data.tar.gz: 154268845acd71049b03f6f697fb8cec0f5449584b80e5870af130356e2b580fcd5f36be70b93b9647b0dda6e0c39fc39459a7def34b3169872e6fe925bd2c81
|
data/.ruby-gemset
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
rails_admin_comments
|
data/README.md
CHANGED
@@ -69,7 +69,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
69
69
|
|
70
70
|
## Contributing
|
71
71
|
|
72
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
72
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/red-rocks/rails_admin_comments.
|
73
73
|
|
74
74
|
|
75
75
|
## License
|
@@ -11,21 +11,21 @@
|
|
11
11
|
.controls
|
12
12
|
- @comments.each do |c|
|
13
13
|
.comment_block
|
14
|
-
- edit_form_id = "comment_#{c.id}_edit"
|
14
|
+
- edit_form_id = "comment_#{c.id}_edit".freeze
|
15
15
|
p
|
16
16
|
- creator = c.creator
|
17
17
|
- if creator
|
18
|
-
- model_name = creator.class.to_param.gsub("::", "~").underscore
|
18
|
+
- model_name = creator.class.to_param.gsub("::", "~").underscore.freeze
|
19
19
|
= link_to creator.name_for_rails_admin_comments, show_path(model_name: model_name, id: creator._id), class: "creator_link"
|
20
20
|
span.created_at= Russian::strftime c.c_at, "%d.%m.%Y в %H:%M:%S"
|
21
|
-
span.updated_at= " (изм. #{Russian::strftime c.u_at, "%d.%m.%Y в %H:%M:%S"})" if Russian::strftime c.u_at
|
21
|
+
span.updated_at= " (изм. #{Russian::strftime c.u_at, "%d.%m.%Y в %H:%M:%S"})".freeze if Russian::strftime c.u_at
|
22
22
|
- if creator == current_user or (current_user.respond_to?(:admin?) and current_user.admin?)
|
23
|
-
= link_to 'изменить', "##{edit_form_id}", class: 'comment_edit_form_link'
|
23
|
+
= link_to 'изменить'.freeze, "##{edit_form_id}".freeze, class: 'comment_edit_form_link'.freeze
|
24
24
|
= " | "
|
25
|
-
= link_to 'удалить', "##{edit_form_id}", class: 'comment_delete_form_link'
|
25
|
+
= link_to 'удалить'.freeze, "##{edit_form_id}".freeze, class: 'comment_delete_form_link'.freeze
|
26
26
|
p.content_block= c.content
|
27
27
|
p
|
28
|
-
.comment_edit_form.hidden{id=
|
28
|
+
.comment_edit_form.hidden{id=edit_form_id.freeze}
|
29
29
|
- if @comment and @comment._id == c._id
|
30
30
|
- c = @comment
|
31
31
|
- unless @message.blank?
|
@@ -11,21 +11,21 @@
|
|
11
11
|
.controls
|
12
12
|
- @comments.each do |c|
|
13
13
|
.comment_block
|
14
|
-
- edit_form_id = "comment_#{c.id}_edit"
|
14
|
+
- edit_form_id = "comment_#{c.id}_edit".freeze
|
15
15
|
p
|
16
16
|
- creator = c.creator
|
17
17
|
- if creator
|
18
|
-
- model_name = creator.class.to_param.gsub("::", "~").underscore
|
18
|
+
- model_name = creator.class.to_param.gsub("::", "~").underscore.freeze
|
19
19
|
= link_to creator.name_for_rails_admin_comments, show_path(model_name: model_name, id: creator._id), class: "creator_link"
|
20
|
-
span.created_at= Russian::strftime c.c_at, "%d.%m.%Y в %H:%M:%S"
|
21
|
-
span.updated_at= " (изм. #{Russian::strftime c.u_at, "%d.%m.%Y в %H:%M:%S"})" if Russian::strftime c.u_at
|
20
|
+
span.created_at= Russian::strftime c.c_at, "%d.%m.%Y в %H:%M:%S".freeze
|
21
|
+
span.updated_at= " (изм. #{Russian::strftime c.u_at, "%d.%m.%Y в %H:%M:%S"})".freeze if Russian::strftime c.u_at
|
22
22
|
- if creator == current_user or (current_user.respond_to?(:admin?) and current_user.admin?)
|
23
|
-
= link_to 'изменить', "##{edit_form_id}", class: 'comment_edit_form_link'
|
23
|
+
= link_to 'изменить', "##{edit_form_id}".freeze, class: 'comment_edit_form_link'.freeze
|
24
24
|
= " | "
|
25
|
-
= link_to 'удалить', "##{edit_form_id}", class: 'comment_delete_form_link'
|
25
|
+
= link_to 'удалить', "##{edit_form_id}".freeze, class: 'comment_delete_form_link'.freeze
|
26
26
|
p.content_block= c.content
|
27
27
|
p
|
28
|
-
.comment_edit_form.hidden{id=
|
28
|
+
.comment_edit_form.hidden{id=edit_form_id}
|
29
29
|
- if @comment and @comment._id == c._id
|
30
30
|
- c = @comment
|
31
31
|
- unless @message.blank?
|
@@ -43,22 +43,22 @@ module RailsAdmin
|
|
43
43
|
|
44
44
|
if @comment.save
|
45
45
|
@comment = nil
|
46
|
-
@message = "<strong class='success'>#{I18n.t('admin.actions.comments.success')}!</strong>"
|
46
|
+
@message = "<strong class='success'>#{I18n.t('admin.actions.comments.success')}!</strong>".freeze
|
47
47
|
|
48
48
|
else
|
49
49
|
@message = []
|
50
|
-
@message << "<strong class='error'>#{I18n.t('admin.actions.comments.error')}!</strong>"
|
50
|
+
@message << "<strong class='error'>#{I18n.t('admin.actions.comments.error')}!</strong>".freeze
|
51
51
|
@comment.errors.each do |e|
|
52
|
-
@message << "<p>#{e.message}</p>"
|
52
|
+
@message << "<p>#{e.message}</p>".freeze
|
53
53
|
end
|
54
|
-
@message = @message.join
|
54
|
+
@message = @message.join.html_safe.freeze
|
55
55
|
end
|
56
56
|
else
|
57
|
-
@message = "<strong class='error'>#{I18n.t('admin.actions.comments.error')}</strong>:<p>#{I18n.t('admin.actions.comments.error_no_data')}</p>"
|
57
|
+
@message = "<strong class='error'>#{I18n.t('admin.actions.comments.error')}</strong>:<p>#{I18n.t('admin.actions.comments.error_no_data')}</p>".freeze
|
58
58
|
end
|
59
59
|
|
60
60
|
rescue Exception => e
|
61
|
-
@message = "<strong class='error'>#{I18n.t('admin.actions.comments.error')}</strong>: #{e}"
|
61
|
+
@message = "<strong class='error'>#{I18n.t('admin.actions.comments.error')}</strong>: #{e}".freeze
|
62
62
|
end
|
63
63
|
|
64
64
|
render action: @action.template_name
|
@@ -120,22 +120,22 @@ module RailsAdmin
|
|
120
120
|
|
121
121
|
if @comment.save
|
122
122
|
@comment = nil
|
123
|
-
@message = "<strong class='success'>#{I18n.t('admin.actions.model_comments.success')}!</strong>"
|
123
|
+
@message = "<strong class='success'>#{I18n.t('admin.actions.model_comments.success')}!</strong>".freeze
|
124
124
|
|
125
125
|
else
|
126
126
|
@message = []
|
127
|
-
@message << "<strong class='error'>#{I18n.t('admin.actions.model_comments.error')}!</strong>"
|
127
|
+
@message << "<strong class='error'>#{I18n.t('admin.actions.model_comments.error')}!</strong>".freeze
|
128
128
|
@comment.errors.each do |e|
|
129
|
-
@message << "<p>#{e.message}</p>"
|
129
|
+
@message << "<p>#{e.message}</p>".freeze
|
130
130
|
end
|
131
|
-
@message = @message.join
|
131
|
+
@message = @message.join.html_safe.freeze
|
132
132
|
end
|
133
133
|
else
|
134
|
-
@message = "<strong class='error'>#{I18n.t('admin.actions.model_comments.error')}</strong>:<p>#{I18n.t('admin.actions.model_comments.error_no_data')}</p>"
|
134
|
+
@message = "<strong class='error'>#{I18n.t('admin.actions.model_comments.error')}</strong>:<p>#{I18n.t('admin.actions.model_comments.error_no_data')}</p>".freeze
|
135
135
|
end
|
136
136
|
|
137
137
|
rescue Exception => e
|
138
|
-
@message = "<strong class='error'>#{I18n.t('admin.actions.comments.error')}</strong>: #{e}"
|
138
|
+
@message = "<strong class='error'>#{I18n.t('admin.actions.comments.error')}</strong>: #{e}".freeze
|
139
139
|
end
|
140
140
|
|
141
141
|
render action: @action.template_name
|
@@ -146,9 +146,9 @@ module RailsAdmin
|
|
146
146
|
end
|
147
147
|
if @comment and @comment.destroy
|
148
148
|
@comment = nil
|
149
|
-
@message = "Удалено"
|
149
|
+
@message = "Удалено".freeze
|
150
150
|
else
|
151
|
-
@message = "Удаление не удалось"
|
151
|
+
@message = "Удаление не удалось".freeze
|
152
152
|
end
|
153
153
|
render action: @action.template_name
|
154
154
|
end
|
@@ -5,14 +5,6 @@ module RailsAdminComments
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def options
|
8
|
-
# @options ||= {
|
9
|
-
# fields: [{}],
|
10
|
-
# thumbnail_fields: [:image, :cover],
|
11
|
-
# label_methods: [:name, :label],
|
12
|
-
# hint_fields: [],
|
13
|
-
# thumbnail_size: :thumb,
|
14
|
-
# thumbnail_gem: :paperclip,
|
15
|
-
# }.merge(config || {})
|
16
8
|
@options ||= {}
|
17
9
|
end
|
18
10
|
|
@@ -5,8 +5,8 @@ module RailsAdminComments
|
|
5
5
|
app.config.assets.precompile += %w(rails_admin/rails_admin_comments.js rails_admin/rails_admin_comments.css)
|
6
6
|
end
|
7
7
|
|
8
|
-
initializer 'Include RailsAdminComments::Helper' do |app|
|
9
|
-
|
10
|
-
end
|
8
|
+
# initializer 'Include RailsAdminComments::Helper' do |app|
|
9
|
+
# ActionView::Base.send :include, RailsAdminComments::Helper
|
10
|
+
# end
|
11
11
|
end
|
12
12
|
end
|
@@ -9,7 +9,7 @@ module RailsAdminComments
|
|
9
9
|
|
10
10
|
belongs_to :rails_admin_commentable, polymorphic: true
|
11
11
|
|
12
|
-
store_in collection: "rails_admin_comments"
|
12
|
+
store_in collection: "rails_admin_comments".freeze
|
13
13
|
|
14
14
|
field :enabled, type: ::Mongoid::VERSION.to_i < 4 ? Boolean : ::Mongoid::Boolean, default: true
|
15
15
|
scope :enabled, -> { where(enabled: true) }
|
data/lib/rails_admin_comments.rb
CHANGED
@@ -7,11 +7,11 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "rails_admin_comments"
|
8
8
|
spec.version = RailsAdminComments::VERSION
|
9
9
|
spec.authors = ["Alexander Kiseliev"]
|
10
|
-
spec.email = ["
|
10
|
+
spec.email = ["i43ack@gmail.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{Comments for rails_admin}
|
13
13
|
spec.description = %q{Comments for rails_admin}
|
14
|
-
spec.homepage = "https://github.com/
|
14
|
+
spec.homepage = "https://github.com/red-rocks/rails_admin_comments"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.add_development_dependency "bundler", "~> 1.10"
|
31
31
|
spec.add_development_dependency "rake", "~> 10.0"
|
32
|
-
|
33
|
-
spec.add_dependency "rails_admin"
|
32
|
+
|
33
|
+
spec.add_dependency "rails_admin", '~> 0.8.1'
|
34
34
|
spec.add_dependency "mongoid", [">= 5.0", "< 6.0"]
|
35
|
-
spec.add_dependency "glebtv_mongoid_userstamp"
|
35
|
+
spec.add_dependency "glebtv_mongoid_userstamp", '~> 0.6.1'
|
36
36
|
end
|
data/release.sh
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_admin_comments
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Kiseliev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: rails_admin
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.8.1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.8.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: mongoid
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -76,19 +76,19 @@ dependencies:
|
|
76
76
|
name: glebtv_mongoid_userstamp
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- - "
|
79
|
+
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
81
|
+
version: 0.6.1
|
82
82
|
type: :runtime
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- - "
|
86
|
+
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
88
|
+
version: 0.6.1
|
89
89
|
description: Comments for rails_admin
|
90
90
|
email:
|
91
|
-
-
|
91
|
+
- i43ack@gmail.com
|
92
92
|
executables: []
|
93
93
|
extensions: []
|
94
94
|
extra_rdoc_files: []
|
@@ -123,7 +123,7 @@ files:
|
|
123
123
|
- lib/rails_admin_comments/version.rb
|
124
124
|
- rails_admin_comments.gemspec
|
125
125
|
- release.sh
|
126
|
-
homepage: https://github.com/
|
126
|
+
homepage: https://github.com/red-rocks/rails_admin_comments
|
127
127
|
licenses:
|
128
128
|
- MIT
|
129
129
|
metadata: {}
|