hancock_cms_gallery 1.0.0 → 1.0.2
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/app/controllers/concerns/hancock/gallery/load_gallery.rb +9 -1
- data/app/controllers/concerns/hancock/gallery/load_gallery_images.rb +9 -1
- data/app/controllers/{concerns/rails_admin → rails_admin}/jcrop_controller.rb +34 -1
- data/app/models/concerns/hancock/gallery/active_record_paperclip.rb +59 -17
- data/app/models/concerns/hancock/gallery/auto_crop.rb +6 -2
- data/app/models/concerns/hancock/gallery/decorators/gallery.rb +7 -0
- data/app/models/concerns/hancock/gallery/decorators/image.rb +7 -0
- data/app/models/concerns/hancock/gallery/mongoid_paperclip.rb +62 -18
- data/app/models/concerns/hancock/gallery/watermarkable.rb +113 -34
- data/app/views/rails_admin/jcrop/edit.html.slim +9 -0
- data/app/views/rails_admin/main/_form_hancock_image.html.slim +56 -0
- data/config/initializers/hancock_gallery.rb +0 -20
- data/hancock_cms_gallery.gemspec +2 -2
- data/lib/generators/hancock/gallery/config/{install_generator.rb → config_generator.rb} +0 -0
- data/lib/generators/hancock/gallery/config/templates/hancock_gallery.erb +6 -0
- data/lib/generators/hancock/gallery/migrations/{migration_generator.rb → migrations_generator.rb} +1 -1
- data/lib/generators/hancock/gallery/models/gallery_generator.rb +1 -1
- data/lib/generators/hancock/gallery/models/templates/embedded_image.erb +5 -5
- data/lib/generators/hancock/gallery/models/templates/gallery.erb +12 -5
- data/lib/generators/hancock/gallery/models/templates/image.erb +12 -5
- data/lib/generators/hancock/gallery/models/templates/original_image.erb +5 -5
- data/lib/hancock/gallery/admin.rb +26 -5
- data/lib/hancock/gallery/admin/gallery.rb +5 -0
- data/lib/hancock/gallery/admin/image.rb +4 -1
- data/lib/hancock/gallery/admin/original_image.rb +7 -0
- data/lib/hancock/gallery/configuration.rb +12 -0
- data/lib/hancock/gallery/models/gallery.rb +15 -3
- data/lib/hancock/gallery/models/image.rb +14 -3
- data/lib/hancock/gallery/models/mongoid/gallery.rb +3 -0
- data/lib/hancock/gallery/models/mongoid/image.rb +3 -0
- data/lib/hancock/gallery/models/mongoid/original_image.rb +7 -0
- data/lib/hancock/gallery/models/original_image.rb +55 -5
- data/lib/hancock/gallery/paperclip_patch.rb +34 -0
- data/lib/hancock/gallery/rails_admin_ext/hancock_image.rb +41 -1
- data/lib/hancock/gallery/version.rb +1 -1
- data/lib/hancock_cms_gallery.rb +7 -10
- metadata +13 -11
@@ -4,20 +4,51 @@ module Hancock::Gallery::Watermarkable
|
|
4
4
|
module ClassMethods
|
5
5
|
def paperclip_with_watermark(field = :image, original_image_class_name = "Hancock::Gallery::OriginalImage")
|
6
6
|
|
7
|
-
attr_accessor "#{field}
|
7
|
+
attr_accessor "process_watermark_#{field}".to_sym
|
8
|
+
|
9
|
+
hancock_cms_attached_file field, processors: -> (instance) {
|
10
|
+
_processors = (instance.try("#{field}_default_processors") || []).dup
|
11
|
+
p_o = _processors.delete :paperclip_optimizer
|
12
|
+
if p_o
|
13
|
+
__processors = _processors.dup.uniq
|
14
|
+
_processors.clear
|
15
|
+
# _processors << :thumbnail
|
16
|
+
_processors << p_o
|
17
|
+
__processors.each do |p|
|
18
|
+
_processors << p
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# p_w = _processors.delete :watermark
|
23
|
+
if ['1', 'true', 't', 'yes', 'y', true, 1, :true, :yes].include?(instance.try("process_watermark_#{field}"))
|
24
|
+
_processors << :watermark
|
25
|
+
end
|
26
|
+
_processors.uniq
|
27
|
+
}
|
8
28
|
|
9
|
-
hancock_cms_attached_file field, processors: [:watermark]
|
10
29
|
# field "original_#{field}", type: BSON::Binary
|
11
|
-
has_one "original_#{field}_data", as: :originable, class_name: original_image_class_name
|
30
|
+
has_one "original_#{field}_data", as: :originable, class_name: original_image_class_name, dependent: :destroy
|
12
31
|
|
13
32
|
class_eval %{
|
14
33
|
def #{field}_auto_rails_admin_jcrop
|
34
|
+
self.#{field}_autocropped = false if self.#{field}_autocropped == "0"
|
15
35
|
return if self.#{field}.blank? or !self.#{field}_updated_at_changed? or self.#{field}_autocropped
|
16
36
|
self.#{field}_autocropped = true
|
17
37
|
|
18
38
|
if File.exists?(self.#{field}.path)
|
19
39
|
auto_rails_admin_jcrop(:#{field})
|
20
40
|
|
41
|
+
# original file in object`s original_image as file
|
42
|
+
elsif self.original_#{field}_data and !self.original_#{field}_data.image.blank?
|
43
|
+
_dir = File.dirname(self.#{field}.path)
|
44
|
+
FileUtils.mkdir_p(_dir) unless File.exists?(_dir)
|
45
|
+
File.unlink(self.#{field}.path) if File.symlink?(self.#{field}.path)
|
46
|
+
File.symlink(self.original_#{field}_data.image.path, self.#{field}.path)
|
47
|
+
self.class.skip_callback(:save, :after, "save_original_#{field}".to_sym)
|
48
|
+
self.#{field}.reprocess!
|
49
|
+
self.class.set_callback(:save, :after, "save_original_#{field}".to_sym)
|
50
|
+
File.unlink(self.#{field}.path)
|
51
|
+
|
21
52
|
elsif (_data = self.original_#{field})
|
22
53
|
_old_filename = self.#{field}_file_name
|
23
54
|
if _data
|
@@ -25,6 +56,8 @@ module Hancock::Gallery::Watermarkable
|
|
25
56
|
_temp = Tempfile.new(_old_filename)
|
26
57
|
_temp.binmode
|
27
58
|
_temp.write _data
|
59
|
+
_dir = File.dirname(self.#{field}.path)
|
60
|
+
FileUtils.mkdir_p(_dir) unless File.exists?(_dir)
|
28
61
|
File.unlink(self.#{field}.path) if File.symlink?(self.#{field}.path)
|
29
62
|
File.symlink(_temp.path, self.#{field}.path)
|
30
63
|
# self.#{field} = _temp
|
@@ -32,65 +65,108 @@ module Hancock::Gallery::Watermarkable
|
|
32
65
|
self.class.skip_callback(:save, :after, "original_#{field}_to_db".to_sym)
|
33
66
|
auto_rails_admin_jcrop(:#{field})
|
34
67
|
self.class.set_callback(:save, :after, "original_#{field}_to_db".to_sym)
|
68
|
+
File.unlink(self.#{field}.path)
|
35
69
|
_temp.unlink
|
36
70
|
end
|
37
71
|
end
|
38
72
|
end
|
39
73
|
|
40
|
-
before_#{field}_post_process do
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
end
|
74
|
+
# before_#{field}_post_process do
|
75
|
+
# p_o = self.#{field}.processors.delete :paperclip_optimizer
|
76
|
+
# if p_o
|
77
|
+
# _processors = self.#{field}.processors.dup
|
78
|
+
# self.#{field}.processors.clear
|
79
|
+
# # self.#{field}.processors << :thumbnail
|
80
|
+
# self.#{field}.processors << p_o
|
81
|
+
# _processors.each do |p|
|
82
|
+
# self.#{field}.processors << p
|
83
|
+
# end
|
84
|
+
# end
|
85
|
+
#
|
86
|
+
# p_w = self.#{field}.processors.delete :watermark
|
87
|
+
# if p_w and self.process_watermark_#{field}
|
88
|
+
# self.#{field}.processors << p_w
|
89
|
+
# end
|
90
|
+
# self.#{field}.processors.uniq!
|
91
|
+
#
|
92
|
+
#
|
93
|
+
# true
|
94
|
+
# end
|
56
95
|
|
57
96
|
def original_#{field}
|
58
|
-
original_#{field}_data
|
97
|
+
original_#{field}_data and original_#{field}_data.original
|
59
98
|
end
|
60
99
|
def original_#{field}_base64
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
else
|
66
|
-
_data = ''
|
67
|
-
_content_type = 'jpg'
|
68
|
-
end
|
69
|
-
"data:\#{_content_type};base64,\#{_data}"
|
100
|
+
original_#{field}_data and original_#{field}_data.original_as_base64(self.#{field}_content_type)
|
101
|
+
end
|
102
|
+
def original_#{field}_image
|
103
|
+
original_#{field}_data and original_#{field}_data.original_as_image(self.#{field}_content_type)
|
70
104
|
end
|
71
105
|
|
72
|
-
after_save :original_#{field}_to_db
|
106
|
+
# after_save :original_#{field}_to_db
|
73
107
|
def original_#{field}_to_db
|
74
|
-
|
108
|
+
unless self.#{field}.blank?
|
75
109
|
if File.exists?(self.#{field}.path)
|
76
110
|
_original = self.original_#{field}_data
|
77
111
|
unless _original
|
78
112
|
_original = #{original_image_class_name}.new
|
79
113
|
_original.originable = self
|
80
114
|
end
|
115
|
+
_original.image = nil
|
81
116
|
_original.original = BSON::Binary.new(File.binread(self.#{field}.path))
|
82
117
|
if _original.save
|
83
118
|
File.unlink(self.#{field}.path)
|
84
119
|
end
|
85
120
|
end
|
121
|
+
else
|
122
|
+
self.original_#{field}_data and self.original_#{field}_data.delete
|
86
123
|
end
|
87
124
|
end
|
88
125
|
|
126
|
+
after_save :save_original_#{field}
|
127
|
+
def save_original_#{field}
|
128
|
+
unless self.#{field}.blank?
|
129
|
+
if File.exists?(self.#{field}.path)
|
130
|
+
_original = self.original_#{field}_data
|
131
|
+
unless _original
|
132
|
+
_original = #{original_image_class_name}.new
|
133
|
+
_original.originable = self
|
134
|
+
end
|
135
|
+
_original.image = self.#{field}
|
136
|
+
_original.original = nil
|
137
|
+
if _original.save
|
138
|
+
File.unlink(self.#{field}.path) if File.exists?(self.#{field}.path)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
else
|
142
|
+
self.original_#{field}_data and self.original_#{field}_data.delete
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
def reprocess_#{field}_with_watermark
|
147
|
+
self.process_watermark_#{field} = true
|
148
|
+
self.reprocess_#{field}
|
149
|
+
end
|
150
|
+
|
89
151
|
def reprocess_#{field}
|
90
152
|
return if self.#{field}.blank?
|
91
153
|
|
154
|
+
# original file in object
|
92
155
|
if File.exists?(self.#{field}.path)
|
93
156
|
self.#{field}.reprocess!
|
157
|
+
|
158
|
+
# original file in object`s original_image as file
|
159
|
+
elsif self.original_#{field}_data and !self.original_#{field}_data.image.blank?
|
160
|
+
_dir = File.dirname(self.#{field}.path)
|
161
|
+
FileUtils.mkdir_p(_dir) unless File.exists?(_dir)
|
162
|
+
File.unlink(self.#{field}.path) if File.symlink?(self.#{field}.path)
|
163
|
+
File.symlink(self.original_#{field}_data.image.path, self.#{field}.path)
|
164
|
+
self.class.skip_callback(:save, :after, "save_original_#{field}".to_sym)
|
165
|
+
self.#{field}.reprocess!
|
166
|
+
self.class.set_callback(:save, :after, "save_original_#{field}".to_sym)
|
167
|
+
File.unlink(self.#{field}.path)
|
168
|
+
|
169
|
+
# original file in object`s original_image as db field
|
94
170
|
elsif (_data = self.original_#{field})
|
95
171
|
_old_filename = self.#{field}_file_name
|
96
172
|
if _data
|
@@ -98,15 +174,18 @@ module Hancock::Gallery::Watermarkable
|
|
98
174
|
_temp = Tempfile.new(_old_filename)
|
99
175
|
_temp.binmode
|
100
176
|
_temp.write _data
|
177
|
+
_dir = File.dirname(self.#{field}.path)
|
178
|
+
FileUtils.mkdir_p(_dir) unless File.exists?(_dir)
|
101
179
|
File.unlink(self.#{field}.path) if File.symlink?(self.#{field}.path)
|
102
180
|
File.symlink(_temp.path, self.#{field}.path)
|
103
|
-
self.#{field} = _temp
|
104
|
-
self.#{field}.instance_write(:file_name, "\#{SecureRandom.hex}\#{File.extname(_old_filename)}")
|
181
|
+
# self.#{field} = _temp
|
182
|
+
# self.#{field}.instance_write(:file_name, "\#{SecureRandom.hex}\#{File.extname(_old_filename)}")
|
105
183
|
self.class.skip_callback(:save, :after, "original_#{field}_to_db".to_sym)
|
106
184
|
self.#{field}.reprocess!
|
107
185
|
self.class.set_callback(:save, :after, "original_#{field}_to_db".to_sym)
|
108
186
|
_temp.unlink
|
109
|
-
self.
|
187
|
+
File.unlink(self.#{field}.path)
|
188
|
+
# self.save
|
110
189
|
end
|
111
190
|
end
|
112
191
|
end
|
@@ -7,9 +7,18 @@
|
|
7
7
|
= form_tag nil, @form_options.merge({class: "form-horizontal denser"}) do
|
8
8
|
- if File.exists?(@object.send(@field).path)
|
9
9
|
= image_tag @object.send(@field).url, @image_tag_options
|
10
|
+
- elsif @object.respond_to?("original_#{@field}_data") and !@object.send("original_#{@field}_data").image.blank?
|
11
|
+
= image_tag @object.send("original_#{@field}_data").image.url, @image_tag_options
|
10
12
|
- elsif @object.respond_to?("original_#{@field}_base64".to_sym)
|
11
13
|
= image_tag @object.send("original_#{@field}_base64".to_sym), @image_tag_options
|
12
14
|
|
15
|
+
|
16
|
+
- if @object.respond_to?("process_watermark_#{@field}")
|
17
|
+
label{style='display: block; line-height: 40px;'}
|
18
|
+
- _html_attributes = {class: 'form-control'}
|
19
|
+
span{style='float: left'}= check_box_tag "process_watermark_#{@field}", true, _html_attributes
|
20
|
+
div{style='margin-left: 15px; '} Добавлять водяной знак?
|
21
|
+
|
13
22
|
= hidden_field_tag :crop_x
|
14
23
|
= hidden_field_tag :crop_y
|
15
24
|
= hidden_field_tag :crop_w
|
@@ -0,0 +1,56 @@
|
|
1
|
+
- if field.jcrop_options.is_a?(Hash)
|
2
|
+
- rails_admin_jcrop_options = field.jcrop_options.to_json
|
3
|
+
- else
|
4
|
+
- _method = field.jcrop_options.to_sym
|
5
|
+
- if form.object.respond_to?(_method)
|
6
|
+
- rails_admin_jcrop_options = form.object.send(field.jcrop_options.to_sym).to_json
|
7
|
+
- else
|
8
|
+
- rails_admin_jcrop_options = {}
|
9
|
+
|
10
|
+
= stylesheet_link_tag 'rails_admin/jquery.Jcrop'
|
11
|
+
= stylesheet_link_tag 'rails_admin/ra.jcrop'
|
12
|
+
= javascript_include_tag 'rails_admin/jquery.Jcrop'
|
13
|
+
= javascript_include_tag 'rails_admin/ra.jcrop'
|
14
|
+
|
15
|
+
- file = form.object.send(field.method_name).presence
|
16
|
+
|
17
|
+
- _add_class = (field.pretty_value and !field.svg? ? "jcrop_data_value" : "")
|
18
|
+
.toggle{class="#{_add_class}" style=('display:none;' if file and field.delete_method and form.object.send(field.delete_method) == '1')}
|
19
|
+
- if value = field.pretty_value
|
20
|
+
.preview
|
21
|
+
- unless field.svg?
|
22
|
+
.title_link_hint= "Обрезать"
|
23
|
+
.image_block
|
24
|
+
= value
|
25
|
+
= form.file_field(field.name, field.html_attributes.reverse_merge({data: {fileupload: true, rails_admin_jcrop_options: rails_admin_jcrop_options } }))
|
26
|
+
|
27
|
+
- model_name = form.object.class.to_param.gsub("::", "~").underscore
|
28
|
+
- url = jcrop_path(model_name: model_name, modal: true, id: form.object.id, field: field.name, fit_image: field.fit_image)
|
29
|
+
- link_data = {link: url, thumb: field.thumb_method || "original"}
|
30
|
+
= link_to 'Edit Image', '#', data: link_data, style: 'display:none', class: "jcrop_handle"
|
31
|
+
|
32
|
+
- if field.try(:process_watermark_toggler)
|
33
|
+
label{style='display: block;'}
|
34
|
+
- _html_attributes = {checked: field.process_watermark_default, class: 'form-control'}
|
35
|
+
span{style='float: left'}= form.check_box field.process_watermark_toggler_method, _html_attributes
|
36
|
+
div{style='margin-left: 35px; line-height: 40px;'} Добавлять водяной знак?
|
37
|
+
|
38
|
+
|
39
|
+
- if field.cancel_perform_autocrop_method
|
40
|
+
label{style='display: block;'}
|
41
|
+
- _html_attributes = {class: 'form-control'}
|
42
|
+
span{style='float: left'}= form.check_box field.cancel_perform_autocrop_method, _html_attributes
|
43
|
+
div{style='margin-left: 35px; line-height: 40px;'} Отменить автоматическую обрезку
|
44
|
+
|
45
|
+
|
46
|
+
- if field.optional? and field.errors.blank? and file and field.delete_method
|
47
|
+
- onclick = "$(this).siblings('[type=checkbox]').click(); $(this).siblings('.toggle').toggle('slow'); jQuery(this).toggleClass('btn-danger btn-info'); return false;"
|
48
|
+
br
|
49
|
+
= link_to "#", data: {toggle:'button'}, onclick: onclick, class: "btn btn-info" do
|
50
|
+
i.icon-white.icon-trash
|
51
|
+
= "#{I18n.t('admin.actions.delete.menu').capitalize} #{field.method_name}"
|
52
|
+
|
53
|
+
= form.check_box field.delete_method, style: 'display:none;'
|
54
|
+
br
|
55
|
+
- if field.cache_method
|
56
|
+
= form.hidden_field field.cache_method
|
@@ -1,23 +1,3 @@
|
|
1
|
-
Hancock.rails_admin_configure do |config|
|
2
|
-
config.action_visible_for :nested_set, 'Hancock::Gallery::Gallery'
|
3
|
-
config.action_visible_for :nested_set, 'Hancock::Gallery::Image'
|
4
|
-
|
5
|
-
if defined?(RailsAdminComments)
|
6
|
-
config.action_visible_for :comments, 'Hancock::Gallery::Gallery'
|
7
|
-
config.action_visible_for :comments, 'Hancock::Gallery::Image'
|
8
|
-
|
9
|
-
config.action_visible_for :model_comments, 'Hancock::Gallery::Gallery'
|
10
|
-
config.action_visible_for :model_comments, 'Hancock::Gallery::Image'
|
11
|
-
end
|
12
|
-
|
13
|
-
if defined?(RailsAdminMultipleFileUpload)
|
14
|
-
if true or Hancock::Catalog.active_record?
|
15
|
-
config.action_visible_for :multiple_file_upload, 'Hancock::Gallery::Gallery'
|
16
|
-
config.action_visible_for :multiple_file_upload_collection, 'Hancock::Gallery::Image'
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
1
|
if defined?(RailsAdmin)
|
22
2
|
RailsAdmin.config do |config|
|
23
3
|
config.excluded_models ||= []
|
data/hancock_cms_gallery.gemspec
CHANGED
@@ -30,8 +30,8 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_development_dependency "bundler", "~> 1.10"
|
31
31
|
spec.add_development_dependency "rake", "~> 10.0"
|
32
32
|
|
33
|
-
spec.add_dependency 'hancock_cms', [">=1.0", "
|
34
|
-
# spec.add_dependency 'hancock_cms', ["~> 1.0", "~> 2.
|
33
|
+
spec.add_dependency 'hancock_cms', [">=1.0.2", "<2.1.x"]
|
34
|
+
# spec.add_dependency 'hancock_cms', ["~> 1.0.2", "~> 2.1.x"]
|
35
35
|
|
36
36
|
spec.add_dependency 'ack_rails_admin_jcrop', '~> 0.2.0'
|
37
37
|
end
|
File without changes
|
@@ -2,8 +2,14 @@ Hancock::Gallery.configure do |config|
|
|
2
2
|
##### defaults #####
|
3
3
|
# config.localize = Hancock.config.localize
|
4
4
|
#
|
5
|
+
# config.cache_support = defined?(Hancock::Cache)
|
6
|
+
#
|
5
7
|
# config.model_settings_support = defined?(RailsAdminModelSettings)
|
6
8
|
# config.user_abilities_support = defined?(RailsAdminUserAbilities)
|
7
9
|
# config.ra_comments_support = defined?(RailsAdminComments)
|
8
10
|
# config.watermark_support = defined?(PaperclipWatermark)
|
11
|
+
#
|
12
|
+
# config.original_image_hash_secret = Rails.application.secrets.secret_key_base
|
13
|
+
#
|
14
|
+
# config.default_convert_options = {all: ["-quality", "75", "-strip"]}
|
9
15
|
end
|
data/lib/generators/hancock/gallery/migrations/{migration_generator.rb → migrations_generator.rb}
RENAMED
@@ -2,7 +2,7 @@ require 'rails/generators'
|
|
2
2
|
require 'rails/generators/active_record'
|
3
3
|
|
4
4
|
module Hancock::Gallery
|
5
|
-
class
|
5
|
+
class MigrationsGenerator < Rails::Generators::Base
|
6
6
|
include ActiveRecord::Generators::Migration
|
7
7
|
source_root File.expand_path('../templates', __FILE__)
|
8
8
|
|
@@ -28,19 +28,19 @@ class <%= camelcased_class_name %> < Hancock::Gallery::EmbeddedImage
|
|
28
28
|
super(config)
|
29
29
|
end
|
30
30
|
|
31
|
-
def admin_can_user_defined_actions
|
31
|
+
def self.admin_can_user_defined_actions
|
32
32
|
[].freeze
|
33
33
|
end
|
34
|
-
def admin_cannot_user_defined_actions
|
34
|
+
def self.admin_cannot_user_defined_actions
|
35
35
|
[].freeze
|
36
36
|
end
|
37
|
-
def manager_can_user_defined_actions
|
37
|
+
def self.manager_can_user_defined_actions
|
38
38
|
[].freeze
|
39
39
|
end
|
40
|
-
def manager_cannot_user_defined_actions
|
40
|
+
def self.manager_cannot_user_defined_actions
|
41
41
|
[].freeze
|
42
42
|
end
|
43
|
-
def rails_admin_user_defined_visible_actions
|
43
|
+
def self.rails_admin_user_defined_visible_actions
|
44
44
|
[].freeze
|
45
45
|
end
|
46
46
|
|
@@ -17,6 +17,13 @@ class <%= camelcased_class_name %> < Hancock::Gallery::Gallery
|
|
17
17
|
# end
|
18
18
|
|
19
19
|
############# rails_admin ##############
|
20
|
+
# def self.rails_admin_name_synonyms
|
21
|
+
# super
|
22
|
+
# end
|
23
|
+
# def self.rails_admin_navigation_icon
|
24
|
+
# ''.freeze
|
25
|
+
# end
|
26
|
+
|
20
27
|
def self.rails_admin_add_fields
|
21
28
|
super
|
22
29
|
end
|
@@ -25,19 +32,19 @@ class <%= camelcased_class_name %> < Hancock::Gallery::Gallery
|
|
25
32
|
super(config)
|
26
33
|
end
|
27
34
|
|
28
|
-
def admin_can_user_defined_actions
|
35
|
+
def self.admin_can_user_defined_actions
|
29
36
|
[].freeze
|
30
37
|
end
|
31
|
-
def admin_cannot_user_defined_actions
|
38
|
+
def self.admin_cannot_user_defined_actions
|
32
39
|
[].freeze
|
33
40
|
end
|
34
|
-
def manager_can_user_defined_actions
|
41
|
+
def self.manager_can_user_defined_actions
|
35
42
|
[].freeze
|
36
43
|
end
|
37
|
-
def manager_cannot_user_defined_actions
|
44
|
+
def self.manager_cannot_user_defined_actions
|
38
45
|
[].freeze
|
39
46
|
end
|
40
|
-
def rails_admin_user_defined_visible_actions
|
47
|
+
def self.rails_admin_user_defined_visible_actions
|
41
48
|
[].freeze
|
42
49
|
end
|
43
50
|
|
@@ -17,6 +17,13 @@ class <%= camelcased_class_name %> < Hancock::Gallery::Image
|
|
17
17
|
# end
|
18
18
|
|
19
19
|
############# rails_admin ##############
|
20
|
+
# def self.rails_admin_name_synonyms
|
21
|
+
# super
|
22
|
+
# end
|
23
|
+
# def self.rails_admin_navigation_icon
|
24
|
+
# 'icon-picture'.freeze
|
25
|
+
# end
|
26
|
+
|
20
27
|
def self.rails_admin_add_fields
|
21
28
|
super
|
22
29
|
end
|
@@ -25,19 +32,19 @@ class <%= camelcased_class_name %> < Hancock::Gallery::Image
|
|
25
32
|
super(config)
|
26
33
|
end
|
27
34
|
|
28
|
-
def admin_can_user_defined_actions
|
35
|
+
def self.admin_can_user_defined_actions
|
29
36
|
[].freeze
|
30
37
|
end
|
31
|
-
def admin_cannot_user_defined_actions
|
38
|
+
def self.admin_cannot_user_defined_actions
|
32
39
|
[].freeze
|
33
40
|
end
|
34
|
-
def manager_can_user_defined_actions
|
41
|
+
def self.manager_can_user_defined_actions
|
35
42
|
[].freeze
|
36
43
|
end
|
37
|
-
def manager_cannot_user_defined_actions
|
44
|
+
def self.manager_cannot_user_defined_actions
|
38
45
|
[].freeze
|
39
46
|
end
|
40
|
-
def rails_admin_user_defined_visible_actions
|
47
|
+
def self.rails_admin_user_defined_visible_actions
|
41
48
|
[].freeze
|
42
49
|
end
|
43
50
|
|