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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94998642dc3466c7483b166998e21c4a297ed5af
4
- data.tar.gz: b1ec593416764e283ef3f631088e645da13a9849
3
+ metadata.gz: b37fde637a44126cead4d54ca515ad0d5fb49b1d
4
+ data.tar.gz: c3f4de022f3906cc51a8f3e2368e04386776342e
5
5
  SHA512:
6
- metadata.gz: 7241a5c99a57620fed57585af142c05d2ef615ea16931c5a21e5aca888a849d4f0ed223a6da177871b1802e74cd0f1c44293890da63d41eb5cb415fcfa465ad8
7
- data.tar.gz: dd14b0b239baf29ea56f459f06a00dd40ba28248f952a55359be6fe0776f1ca846d48342f0227c313a4a5cd58ce7ae01d869e2c0452da83a249afb1f4a135879
6
+ metadata.gz: e61ef1d66be404209cbf0867157c85ecda9cf0587e1af2bc71e55394677ad69099e786a67cd279f0a0fff273d0d39610663408f8a70d55f3359b1e14930efbeb
7
+ data.tar.gz: 154268845acd71049b03f6f697fb8cec0f5449584b80e5870af130356e2b580fcd5f36be70b93b9647b0dda6e0c39fc39459a7def34b3169872e6fe925bd2c81
data/.ruby-gemset CHANGED
@@ -1 +1 @@
1
- rails_admin_settings
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/enjoycreative/rails_admin_comments.
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
@@ -13,7 +13,7 @@ module RailsAdminComments
13
13
  end
14
14
 
15
15
  if RailsAdminComments.active_record?
16
- self.table_name = "rails_admin_comments"
16
+ self.table_name = "rails_admin_comments".freeze
17
17
  end
18
18
 
19
19
  end
@@ -13,7 +13,7 @@ module RailsAdminComments
13
13
  end
14
14
 
15
15
  if RailsAdminComments.active_record?
16
- self.table_name = "rails_admin_model_comments"
16
+ self.table_name = "rails_admin_model_comments".freeze
17
17
  end
18
18
 
19
19
  end
@@ -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="#{edit_form_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="#{edit_form_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
- ActionView::Base.send :include, RailsAdminComments::Helper
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) }
@@ -1,3 +1,3 @@
1
1
  module RailsAdminComments
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1".freeze
3
3
  end
@@ -1,4 +1,3 @@
1
-
2
1
  require "rails_admin_comments/version"
3
2
 
4
3
  require 'mongoid'
@@ -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 = ["dev@enjoycreate.ru"]
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/enjoycreative/rails_admin_comments"
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
@@ -2,6 +2,5 @@
2
2
  bundle update
3
3
  git add --all .
4
4
  git commit -am "${*:1}"
5
- git push
6
- git push gh master
7
- rake release
5
+ git push -u origin master
6
+ rake release
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.0
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-05-16 00:00:00.000000000 Z
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: '0'
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: '0'
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: '0'
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: '0'
88
+ version: 0.6.1
89
89
  description: Comments for rails_admin
90
90
  email:
91
- - dev@enjoycreate.ru
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/enjoycreative/rails_admin_comments
126
+ homepage: https://github.com/red-rocks/rails_admin_comments
127
127
  licenses:
128
128
  - MIT
129
129
  metadata: {}