hancock_cms 2.0.0.2 → 2.0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitattributes +4 -0
- data/app/assets/images/{devices → hancock/devise}/login-bg.jpg +0 -0
- data/app/assets/images/{rails-admin → hancock/rails_admin}/hancock_logo.svg +0 -0
- data/app/assets/javascripts/hancock/cms.coffee +1 -1
- data/app/assets/javascripts/hancock/rails_admin/cms.ui.coffee +11 -37
- data/app/assets/javascripts/hancock/rails_admin/en_ru_switcher.coffee +90 -0
- data/app/assets/javascripts/hancock/rails_admin/enum_with_custom.coffee +42 -0
- data/app/assets/javascripts/hancock/rails_admin/form_controls_fixed.coffee +44 -0
- data/app/assets/javascripts/hancock/rails_admin/leftside_hider.coffee +106 -0
- data/app/assets/javascripts/hancock/rails_admin/multiselect.coffee +8 -0
- data/app/assets/javascripts/hancock/rails_admin/navigation_dropdown.coffee +25 -0
- data/app/assets/javascripts/hancock/rails_admin/navigation_filter.coffee +108 -0
- data/app/assets/javascripts/hancock/rails_admin/navigation_scroll.coffee +12 -0
- data/app/assets/javascripts/hancock/rails_admin/plugins.coffee.erb +16 -0
- data/app/assets/javascripts/jquery.placeholder.js +3 -2
- data/app/assets/javascripts/rails_admin/custom/ui.coffee +1 -0
- data/app/assets/stylesheets/hancock/cms/devise.sass +4 -1
- data/app/assets/stylesheets/hancock/rails_admin/cms.theming.sass +354 -147
- data/app/assets/stylesheets/hancock/rails_admin/fieldsets.sass +198 -0
- data/app/assets/stylesheets/hancock/rails_admin/plugins.sass.erb +6 -0
- data/app/assets/stylesheets/rails_admin/custom/theming.sass +1 -1
- data/app/controllers/concerns/hancock/decorators/home.rb +1 -1
- data/app/controllers/concerns/hancock/errors.rb +5 -7
- data/app/controllers/hancock/registrations_controller.rb +2 -7
- data/app/controllers/hancock/sessions_controller.rb +3 -7
- data/app/helpers/hancock/powered_helper.rb +3 -3
- data/app/helpers/hancock/settings_helper.rb +44 -0
- data/app/helpers/rails_admin/application/hancock_helper.rb +19 -0
- data/app/helpers/rails_admin/hancock/form_builder.rb +44 -0
- data/app/helpers/rails_admin/main/hancock_helper.rb +51 -0
- data/app/models/concerns/hancock/boolean_field.rb +7 -2
- data/app/models/concerns/hancock/decorators/embedded_element.rb +1 -9
- data/app/models/concerns/hancock/enableable.rb +1 -0
- data/app/models/concerns/hancock/hash_field.rb +9 -8
- data/app/models/concerns/hancock/html_field.rb +6 -3
- data/app/models/concerns/hancock/insertion_field.rb +115 -0
- data/app/models/concerns/hancock/mappable.rb +1 -0
- data/app/models/concerns/hancock/master_collection.rb +31 -0
- data/app/models/concerns/hancock/model_localizeable.rb +4 -1
- data/app/models/concerns/hancock/rails_admin_patch.rb +22 -3
- data/app/models/concerns/hancock/sort_field.rb +26 -3
- data/app/models/concerns/hancock/sortable.rb +3 -0
- data/app/models/concerns/hancock/user_defined.rb +53 -0
- data/app/views/blocks/_footer.html.slim +1 -1
- data/app/views/devise/passwords/edit.html.slim +0 -2
- data/app/views/devise/passwords/new.html.slim +0 -2
- data/app/views/devise/registrations/edit.html.slim +0 -2
- data/app/views/devise/registrations/new.html.slim +0 -2
- data/app/views/devise/sessions/new.html.slim +0 -2
- data/app/views/hancock/home/index.html.slim +4 -1
- data/app/views/layouts/application.html.slim +1 -11
- data/app/views/layouts/hancock/_assets.html.slim +15 -0
- data/app/views/layouts/hancock/devise/confirmations.html.slim +7 -4
- data/app/views/layouts/hancock/devise/passwords.html.slim +7 -4
- data/app/views/layouts/hancock/devise/registrations.html.slim +7 -4
- data/app/views/layouts/hancock/devise/sessions.html.slim +7 -4
- data/app/views/layouts/hancock/devise/unlocks.html.slim +7 -4
- data/app/views/layouts/rails_admin/_footer.html.slim +2 -2
- data/app/views/layouts/rails_admin/_footer_navigation.html.slim +20 -4
- data/app/views/layouts/rails_admin/_navigation.html.slim +13 -47
- data/app/views/layouts/rails_admin/_secondary_navigation.html.slim +5 -12
- data/app/views/layouts/rails_admin/_sidebar_navigation.html.slim +2 -0
- data/app/views/layouts/rails_admin/_sidebar_navigation_filter.html.slim +3 -0
- data/app/views/layouts/rails_admin/application.html.haml +3 -38
- data/app/views/rails_admin/main/_enum_for_settings_kinds.html.slim +24 -0
- data/app/views/rails_admin/main/_form_hancock_enum.html.slim +18 -0
- data/app/views/rails_admin/main/_form_hancock_enum_with_custom.slim +20 -0
- data/app/views/rails_admin/main/_hancock_html.html.slim +2 -2
- data/app/views/rails_admin/main/_hancock_html_ml.html.slim +31 -34
- data/app/views/rails_admin/main/edit.html.haml +18 -0
- data/app/views/rails_admin/main/new.html.haml +17 -0
- data/app/views/shared/_admin_link.html.slim +4 -2
- data/config/initializers/nested_set_patch.rb +76 -73
- data/config/initializers/rails_admin_mongoid_patch.rb +27 -0
- data/config/initializers/sprockets_patch.rb +159 -0
- data/config/locales/en.hancock.yml +1 -0
- data/config/locales/ru.devise.yml +22 -18
- data/config/locales/ru.hancock.yml +5 -5
- data/config/locales/ru.rails_admin.yml +3 -0
- data/hancock_cms.gemspec +7 -2
- data/lib/filename_to_slug.rb +0 -20
- data/lib/generators/hancock/cms/ability_generator.rb +1 -0
- data/lib/generators/hancock/cms/admin_generator.rb +1 -0
- data/lib/generators/hancock/cms/application_generator.rb +1 -0
- data/lib/generators/hancock/cms/assets_generator.rb +1 -0
- data/lib/generators/hancock/cms/layout_generator.rb +1 -0
- data/lib/generators/hancock/cms/model_generator.rb +1 -0
- data/lib/generators/hancock/cms/models/templates/embedded_element.erb +2 -2
- data/lib/generators/hancock/cms/rack_generator.rb +1 -0
- data/lib/generators/hancock/cms/raven_generator.rb +13 -0
- data/lib/generators/hancock/cms/robots_generator.rb +1 -0
- data/lib/generators/hancock/cms/scripts_generator.rb +1 -0
- data/lib/generators/hancock/cms/setup_generator.rb +146 -33
- data/lib/generators/hancock/cms/templates/Gemfile.erb +4 -5
- data/lib/generators/hancock/cms/templates/ability.erb +1 -1
- data/lib/generators/hancock/cms/templates/admin.erb +12 -4
- data/lib/generators/hancock/cms/templates/hancock_cms.erb +6 -3
- data/lib/generators/hancock/cms/templates/model.erb +5 -6
- data/lib/generators/hancock/cms/templates/raven.erb +13 -0
- data/lib/generators/hancock/cms/templates/robots.txt.erb +6 -2
- data/lib/generators/hancock/cms/templates/scripts/db_dump.sh.erb +1 -1
- data/lib/generators/hancock/cms/unicorn_god_generator.rb +1 -0
- data/lib/generators/hancock/cms/utils.rb +2 -0
- data/lib/hancock/admin.rb +153 -21
- data/lib/hancock/admin/embedded_element.rb +7 -2
- data/lib/hancock/configuration.rb +49 -4
- data/lib/hancock/controller.rb +1 -1
- data/lib/hancock/engine.rb +32 -36
- data/lib/hancock/model.rb +10 -0
- data/lib/hancock/models/embedded_element.rb +2 -0
- data/lib/hancock/models/mongoid/embedded_element.rb +17 -0
- data/lib/hancock/plugin_configuration.rb +1 -1
- data/lib/hancock/rails_admin_ext/config.rb +21 -4
- data/lib/hancock/rails_admin_ext/hancock_array.rb +19 -0
- data/lib/hancock/rails_admin_ext/hancock_enum.rb +33 -0
- data/lib/hancock/rails_admin_ext/hancock_enum_with_custom.rb +34 -0
- data/lib/hancock/rails_admin_ext/hancock_hash.rb +8 -1
- data/lib/hancock/rails_admin_ext/hancock_html.rb +17 -2
- data/lib/hancock/rails_admin_ext/hancock_multiselect.rb +1 -5
- data/lib/hancock/rails_admin_ext/hancock_slugs.rb +2 -6
- data/lib/hancock/rails_admin_ext/patches/field_patch.rb +2 -1
- data/lib/hancock/rails_admin_ext/patches/fieldset_patch.rb +14 -0
- data/lib/hancock/rails_admin_ext/patches/group_patch.rb +9 -0
- data/lib/hancock/rails_admin_ext/patches/hancock_cms_group.rb +2 -0
- data/lib/hancock/rails_admin_ext/patches/has_fields.rb +27 -0
- data/lib/hancock/rails_admin_ext/patches/navigation_patch.rb +25 -0
- data/lib/hancock/rails_admin_settings_patch.rb +219 -0
- data/lib/hancock/version.rb +1 -1
- data/lib/hancock_cms.rb +12 -9
- data/lib/manual_slug/active_record.rb +8 -8
- data/lib/manual_slug/mongoid.rb +6 -1
- data/lib/rails_admin/custom_show_in_app.rb +21 -32
- data/template.rb +19 -20
- metadata +104 -12
- data/app/controllers/concerns/hancock/no_cache.rb +0 -12
- data/app/models/concerns/hancock/cacheable.rb +0 -51
@@ -1,17 +1,13 @@
|
|
1
|
-
require '
|
1
|
+
require 'hancock/rails_admin_ext/hancock_enum'
|
2
2
|
|
3
3
|
module RailsAdmin
|
4
4
|
module Config
|
5
5
|
module Fields
|
6
6
|
module Types
|
7
|
-
class HancockSlugs < RailsAdmin::Config::Fields::Types::
|
7
|
+
class HancockSlugs < RailsAdmin::Config::Fields::Types::HancockEnum
|
8
8
|
# Register field type for the type loader
|
9
9
|
RailsAdmin::Config::Fields::Types::register(self)
|
10
10
|
|
11
|
-
register_instance_option :searchable do
|
12
|
-
true
|
13
|
-
end
|
14
|
-
|
15
11
|
register_instance_option :enum_method do
|
16
12
|
:slugs
|
17
13
|
end
|
@@ -15,6 +15,15 @@ module RailsAdmin
|
|
15
15
|
a.weight <=> b.weight
|
16
16
|
end
|
17
17
|
end
|
18
|
+
|
19
|
+
def group(name, &block)
|
20
|
+
_groups = parent.groups rescue root.groups
|
21
|
+
group = _groups.detect { |g| name == g.name }
|
22
|
+
group ||= (parent.groups << RailsAdmin::Config::Fields::Group.new(self, name)).last
|
23
|
+
group.tap { |g| g.section = self }.instance_eval(&block) if block
|
24
|
+
group
|
25
|
+
end
|
26
|
+
|
18
27
|
end
|
19
28
|
|
20
29
|
end
|
@@ -27,6 +27,7 @@ module Hancock::RailsAdminGroupPatch
|
|
27
27
|
end
|
28
28
|
|
29
29
|
_group_fields.each_pair do |name, type|
|
30
|
+
next if type == false
|
30
31
|
if type.blank?
|
31
32
|
field name
|
32
33
|
else
|
@@ -44,6 +45,7 @@ module Hancock::RailsAdminGroupPatch
|
|
44
45
|
|
45
46
|
else
|
46
47
|
fields.each_pair do |name, type|
|
48
|
+
next if type == false
|
47
49
|
if type.nil?
|
48
50
|
config.field name
|
49
51
|
else
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'rails_admin'
|
2
|
+
module RailsAdmin
|
3
|
+
module Config
|
4
|
+
# Provides accessors and autoregistering of model's fields.
|
5
|
+
module HasFields
|
6
|
+
|
7
|
+
protected
|
8
|
+
|
9
|
+
# Raw fields.
|
10
|
+
# Recursively returns parent section's raw fields
|
11
|
+
# Duping it if accessed for modification.
|
12
|
+
def _fields(readonly = false)
|
13
|
+
return @_fields if @_fields
|
14
|
+
return @_ro_fields if readonly && @_ro_fields
|
15
|
+
|
16
|
+
if self.class == RailsAdmin::Config::Sections::Base
|
17
|
+
@_ro_fields = @_fields = RailsAdmin::Config::Fields.factory(self)
|
18
|
+
else
|
19
|
+
# parent is RailsAdmin::Config::Model, recursion is on Section's classes
|
20
|
+
@_ro_fields ||= parent.send(self.class.superclass.to_s.underscore.split('/').last)._fields(true)
|
21
|
+
@_ro_fields.freeze if Rails.env.production? or Rails.env.staging?
|
22
|
+
end
|
23
|
+
readonly ? @_ro_fields : (@_fields ||= @_ro_fields.collect(&:clone))
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'rails_admin'
|
2
|
+
module RailsAdmin
|
3
|
+
module Config
|
4
|
+
|
5
|
+
class Model
|
6
|
+
register_instance_option :navigation_icon do
|
7
|
+
abstract_model.model.try('rails_admin_navigation_icon')
|
8
|
+
end
|
9
|
+
|
10
|
+
register_instance_option :name_synonyms do
|
11
|
+
if name_synonyms_method
|
12
|
+
ret = abstract_model.model.try(name_synonyms_method)
|
13
|
+
ret = ret.join(" ") if ret.is_a?(Array)
|
14
|
+
else
|
15
|
+
ret = ''
|
16
|
+
end
|
17
|
+
ret.freeze
|
18
|
+
end
|
19
|
+
register_instance_option :name_synonyms_method do
|
20
|
+
:rails_admin_name_synonyms
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,219 @@
|
|
1
|
+
module Hancock
|
2
|
+
module RailsAdminSettingsPatch
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
included do
|
6
|
+
::Hancock.register_model(self)
|
7
|
+
|
8
|
+
include ::Hancock::RailsAdminPatch
|
9
|
+
if ::Hancock.config.mongoid_single_collection
|
10
|
+
include ::Hancock::MasterCollection
|
11
|
+
end
|
12
|
+
|
13
|
+
# t = {_all: 'Все'}
|
14
|
+
::RailsAdminSettings::Setting.distinct(:ns).each do |c|
|
15
|
+
s = "ns_#{c.gsub('-', '_')}".to_sym
|
16
|
+
scope s, -> { where(ns: c) }
|
17
|
+
# t[s] = c
|
18
|
+
end
|
19
|
+
# I18n.backend.store_translations(:ru, {admin: {scopes: {'rails_admin_settings/setting': t}}})
|
20
|
+
|
21
|
+
field :for_admin, type: Boolean, default: -> {
|
22
|
+
!!(self.ns == "admin" or self.ns =~ /\Aadmin(\.\w+)*\z/)
|
23
|
+
}
|
24
|
+
def for_admin?
|
25
|
+
self.for_admin
|
26
|
+
end
|
27
|
+
|
28
|
+
# def self.manager_can_default_actions
|
29
|
+
# # [:index, :show, :read, :edit, :update]
|
30
|
+
# super - [:new, :create]
|
31
|
+
# end
|
32
|
+
# def self.manager_can_default_actions
|
33
|
+
# ret = []
|
34
|
+
# # ret << :model_accesses if ::Hancock::Goto.config.user_abilities_support
|
35
|
+
# ret
|
36
|
+
# end
|
37
|
+
def self.manager_can_add_actions
|
38
|
+
ret = []
|
39
|
+
# ret << :model_accesses if defined?(::RailsAdminUserAbilities)
|
40
|
+
ret += [:comments, :model_comments] if defined?(::RailsAdminComments)
|
41
|
+
ret << :hancock_touch if defined?(::Hancock::Cache::Cacheable)
|
42
|
+
ret.freeze
|
43
|
+
end
|
44
|
+
def self.manager_cannot_add_actions
|
45
|
+
[:new, :create, :delete, :destroy]
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.rails_admin_add_visible_actions
|
49
|
+
ret = manager_can_actions.dup
|
50
|
+
ret << :model_accesses if defined?(::RailsAdminUserAbilities)
|
51
|
+
ret += [:comments, :model_comments] if defined?(::RailsAdminComments)
|
52
|
+
ret << :hancock_touch if defined?(::Hancock::Cache::Cacheable)
|
53
|
+
ret.freeze
|
54
|
+
end
|
55
|
+
|
56
|
+
rails_admin do
|
57
|
+
navigation_label I18n.t('admin.settings.label')
|
58
|
+
|
59
|
+
list do
|
60
|
+
field :label do
|
61
|
+
visible false
|
62
|
+
searchable true
|
63
|
+
weight 1
|
64
|
+
end
|
65
|
+
field :enabled, :toggle do
|
66
|
+
weight 2
|
67
|
+
end
|
68
|
+
field :loadable, :toggle do
|
69
|
+
weight 3
|
70
|
+
end
|
71
|
+
field :ns do
|
72
|
+
searchable true
|
73
|
+
weight 4
|
74
|
+
end
|
75
|
+
field :key do
|
76
|
+
searchable true
|
77
|
+
weight 5
|
78
|
+
end
|
79
|
+
field :name do
|
80
|
+
weight 6
|
81
|
+
end
|
82
|
+
field :kind do
|
83
|
+
searchable true
|
84
|
+
weight 7
|
85
|
+
end
|
86
|
+
field :raw do
|
87
|
+
weight 8
|
88
|
+
searchable true
|
89
|
+
pretty_value do
|
90
|
+
if bindings[:object].file_kind?
|
91
|
+
"<a href='#{CGI::escapeHTML(bindings[:object].file.url)}'>#{CGI::escapeHTML(bindings[:object].to_path)}</a>".html_safe.freeze
|
92
|
+
elsif bindings[:object].image_kind?
|
93
|
+
"<a href='#{CGI::escapeHTML(bindings[:object].file.url)}'><img src='#{CGI::escapeHTML(bindings[:object].file.url)}' /></a>".html_safe.freeze
|
94
|
+
else
|
95
|
+
value
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
field :cache_keys_str, :text do
|
100
|
+
weight 10
|
101
|
+
searchable true
|
102
|
+
end
|
103
|
+
if ::Settings.table_exists?
|
104
|
+
nss = ::RailsAdminSettings::Setting.distinct(:ns).map { |c| "ns_#{c.gsub('-', '_')}".to_sym }
|
105
|
+
scopes([nil] + nss)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
edit do
|
110
|
+
field :enabled, :toggle do
|
111
|
+
weight 1
|
112
|
+
visible do
|
113
|
+
if bindings[:object].for_admin?
|
114
|
+
render_object = (bindings[:controller] || bindings[:view])
|
115
|
+
render_object and (render_object.current_user.admin?)
|
116
|
+
else
|
117
|
+
true
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
field :loadable, :toggle do
|
122
|
+
weight 2
|
123
|
+
visible do
|
124
|
+
render_object = (bindings[:controller] || bindings[:view])
|
125
|
+
render_object and (render_object.current_user.admin?)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
field :for_admin, :toggle do
|
129
|
+
weight 3
|
130
|
+
visible do
|
131
|
+
render_object = (bindings[:controller] || bindings[:view])
|
132
|
+
render_object and (render_object.current_user.admin?)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
field :ns do
|
136
|
+
weight 4
|
137
|
+
read_only true
|
138
|
+
help false
|
139
|
+
visible do
|
140
|
+
render_object = (bindings[:controller] || bindings[:view])
|
141
|
+
render_object and (render_object.current_user.admin?)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
field :key do
|
145
|
+
weight 5
|
146
|
+
read_only true
|
147
|
+
help false
|
148
|
+
visible do
|
149
|
+
render_object = (bindings[:controller] || bindings[:view])
|
150
|
+
render_object and (render_object.current_user.admin?)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
field :label, :string do
|
154
|
+
weight 6
|
155
|
+
read_only do
|
156
|
+
render_object = (bindings[:controller] || bindings[:view])
|
157
|
+
!render_object or !(render_object.current_user.admin?)
|
158
|
+
end
|
159
|
+
help false
|
160
|
+
end
|
161
|
+
field :kind, :enum do
|
162
|
+
weight 7
|
163
|
+
read_only do
|
164
|
+
render_object = (bindings[:controller] || bindings[:view])
|
165
|
+
!render_object or !(render_object.current_user.admin?)
|
166
|
+
end
|
167
|
+
enum do
|
168
|
+
RailsAdminSettings.kinds
|
169
|
+
end
|
170
|
+
partial "enum_for_settings_kinds".freeze
|
171
|
+
help false
|
172
|
+
end
|
173
|
+
field :raw do
|
174
|
+
weight 8
|
175
|
+
partial "setting_value".freeze
|
176
|
+
visible do
|
177
|
+
!bindings[:object].upload_kind?
|
178
|
+
end
|
179
|
+
read_only do
|
180
|
+
if bindings[:object].for_admin?
|
181
|
+
render_object = (bindings[:controller] || bindings[:view])
|
182
|
+
!(render_object and (render_object.current_user.admin?))
|
183
|
+
else
|
184
|
+
false
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
if Settings.file_uploads_supported
|
189
|
+
field :file, Settings.file_uploads_engine do
|
190
|
+
weight 9
|
191
|
+
visible do
|
192
|
+
bindings[:object].upload_kind?
|
193
|
+
end
|
194
|
+
read_only do
|
195
|
+
if bindings[:object].for_admin?
|
196
|
+
render_object = (bindings[:controller] || bindings[:view])
|
197
|
+
!(render_object and (render_object.current_user.admin?))
|
198
|
+
else
|
199
|
+
false
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
field :cache_keys_str, :text do
|
206
|
+
weight 10
|
207
|
+
visible do
|
208
|
+
render_object = (bindings[:controller] || bindings[:view])
|
209
|
+
render_object and render_object.current_user.admin?
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
end
|
217
|
+
|
218
|
+
end
|
219
|
+
end
|
data/lib/hancock/version.rb
CHANGED
data/lib/hancock_cms.rb
CHANGED
@@ -15,8 +15,6 @@ require 'hancock/simple_form_patch'
|
|
15
15
|
|
16
16
|
require 'geocoder'
|
17
17
|
|
18
|
-
# require 'simple_captcha'
|
19
|
-
# require 'validates_email_format_of'
|
20
18
|
require 'filename_to_slug'
|
21
19
|
|
22
20
|
require 'codemirror-rails'
|
@@ -25,29 +23,34 @@ require 'codemirror-rails'
|
|
25
23
|
require 'rails_admin'
|
26
24
|
require 'hancock/rails_admin_ext/config'
|
27
25
|
|
26
|
+
require 'hancock/rails_admin_ext/hancock_enum'
|
27
|
+
require 'hancock/rails_admin_ext/hancock_enum_with_custom'
|
28
|
+
require 'hancock/rails_admin_ext/hancock_array'
|
28
29
|
require 'hancock/rails_admin_ext/hancock_hash'
|
29
30
|
require 'hancock/rails_admin_ext/hancock_html'
|
30
31
|
require 'hancock/rails_admin_ext/hancock_slugs'
|
31
32
|
require 'hancock/rails_admin_ext/hancock_multiselect'
|
32
33
|
|
34
|
+
require 'hancock/rails_admin_ext/patches/navigation_patch'
|
33
35
|
require 'hancock/rails_admin_ext/patches/field_patch'
|
36
|
+
require 'hancock/rails_admin_ext/patches/fieldset_patch'
|
34
37
|
require 'hancock/rails_admin_ext/patches/new_controller_patch'
|
35
38
|
require 'hancock/rails_admin_ext/patches/group_patch'
|
36
39
|
require 'hancock/rails_admin_ext/patches/hancock_cms_group'
|
40
|
+
require 'hancock/rails_admin_ext/patches/has_fields'
|
37
41
|
|
38
42
|
|
39
43
|
require 'rails_admin_nested_set'
|
40
44
|
require 'rails_admin_toggleable'
|
41
45
|
|
42
46
|
require 'ack_rails_admin_settings'
|
43
|
-
|
44
|
-
# require 'x-real-ip'
|
47
|
+
require 'hancock/rails_admin_settings_patch'
|
45
48
|
|
46
49
|
require 'ckeditor'
|
47
50
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
+
require 'kaminari/actionview'
|
52
|
+
|
53
|
+
require 'stickykit/rails'
|
51
54
|
|
52
55
|
require 'hancock/model'
|
53
56
|
require 'hancock/engine'
|
@@ -89,11 +92,11 @@ module Hancock
|
|
89
92
|
end
|
90
93
|
rescue
|
91
94
|
end
|
92
|
-
end
|
95
|
+
end if defined?(::HistoryTracker)
|
93
96
|
end
|
94
97
|
|
95
98
|
def clear_history!
|
96
|
-
::HistoryTracker.delete_all
|
99
|
+
::HistoryTracker.delete_all if defined?(::HistoryTracker)
|
97
100
|
end
|
98
101
|
|
99
102
|
end
|
@@ -3,16 +3,16 @@ module ManualSlug::ActiveRecord
|
|
3
3
|
|
4
4
|
included do
|
5
5
|
extend FriendlyId
|
6
|
-
end
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
def text_slug
|
8
|
+
slug
|
9
|
+
end
|
10
|
+
def text_slug=(s)
|
11
|
+
self.slug = s
|
12
|
+
end
|
13
13
|
end
|
14
14
|
|
15
|
-
|
15
|
+
class_methods do
|
16
16
|
def manual_slug(field, options = {}, callback = true)
|
17
17
|
friendly_id field, use: [:slugged, :finders]
|
18
18
|
define_method(:should_generate_new_friendly_id?) do
|
@@ -28,5 +28,5 @@ module ManualSlug::ActiveRecord
|
|
28
28
|
end if callback
|
29
29
|
end
|
30
30
|
end
|
31
|
+
|
31
32
|
end
|
32
|
-
|