rails_admin_cms 0.0.6 → 0.0.7
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/README.md +41 -6
- data/app/assets/javascripts/rails_admin_cms/cms.js.coffee +8 -8
- data/app/controllers/cms/pages_controller.rb +8 -0
- data/app/controllers/concerns/cms/logger.rb +7 -2
- data/app/controllers/concerns/cms/rescue.rb +20 -0
- data/app/helpers/cms/javascript_helper.rb +5 -1
- data/app/helpers/cms/locale_helper.rb +6 -2
- data/app/helpers/cms/view_helper.rb +2 -2
- data/app/helpers/cms/viewable_helper.rb +10 -10
- data/app/helpers/rails_admin/navigation_helper.rb +1 -0
- data/app/models/viewable/field/url.rb +1 -1
- data/app/models/viewable/field/uuid.rb +1 -1
- data/app/models/viewable.rb +1 -2
- data/app/presenters/viewable_list_presenter.rb +3 -3
- data/app/presenters/viewable_presenter.rb +1 -1
- data/config/routes.rb +6 -12
- data/lib/generators/cms/install/templates/app/controllers/application_controller.rb +1 -0
- data/lib/generators/cms/install/templates/config/initializers/rails_admin_cms.rb +11 -0
- data/lib/generators/cms/install/templates/config/routes.rb +3 -1
- data/lib/rails_admin_cms/config.rb +15 -1
- data/lib/rails_admin_cms/utils.rb +4 -0
- data/lib/rails_admin_cms/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cc83df591531fab36fe6ae31d019ef6b21c5619f
|
|
4
|
+
data.tar.gz: 4af4e3c05fa7fa5c73b50f71931d43a7fa908285
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eaa33d3396a9fab4069fc6b76c6c8c7b6d118208342a86d59de150c068c56717c88f007da0db4f018ca062e2b4ab4e4fd8a927f014a40fbe81ccdbb51e6aa9bd
|
|
7
|
+
data.tar.gz: eebcb2e4f4c0a78dc50d3000f13bf2ab2ce83078b24ab3079538517135e5e5989947697dc48851d1878655f5ac8651952a0b52593f6c084c8aaf20c25d5312a5
|
data/README.md
CHANGED
|
@@ -8,25 +8,60 @@ RailsAdmin...
|
|
|
8
8
|
|
|
9
9
|
## View helpers
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
There is an example of a common template using some of the cms view helpers:
|
|
12
12
|
|
|
13
13
|
```ruby
|
|
14
|
-
|
|
14
|
+
<!DOCTYPE html>
|
|
15
|
+
<html>
|
|
16
|
+
<head>
|
|
17
|
+
<title><%= title = cms_title('AppRailsAdminCMS') %></title>
|
|
18
|
+
<%= cms_meta_data_tags %>
|
|
19
|
+
<%= cms_meta_og_tags(title) %>
|
|
20
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
|
21
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
|
22
|
+
<%= csrf_meta_tags %>
|
|
15
23
|
</head>
|
|
16
|
-
<body class="<%= cms_body_class
|
|
17
|
-
|
|
24
|
+
<body class="<%= cms_body_class('shop', 'cart') %>">
|
|
25
|
+
|
|
26
|
+
<%= cms_flash_messages %>
|
|
27
|
+
<div>
|
|
28
|
+
<%= cms_locale_selector %>
|
|
29
|
+
</div>
|
|
30
|
+
<div>
|
|
31
|
+
<%= cms_link_to_edit_mode if current_admin? %>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<%= yield %>
|
|
35
|
+
|
|
18
36
|
</body>
|
|
19
37
|
</html>
|
|
20
38
|
```
|
|
21
39
|
|
|
40
|
+
What's going on:
|
|
41
|
+
|
|
42
|
+
1. `cms_title` outputs a title tag defined by either a view element or a default one passed as argument
|
|
43
|
+
1. `cms_meta_data_tags` outputs the meta keywords + description tags defined by either a page/form object or a complete default one passed as argument
|
|
44
|
+
1. `cms_body_class` outputs
|
|
45
|
+
1. `cms_flash_messages`
|
|
46
|
+
1. `cms_locale_selector`
|
|
47
|
+
1. `cms_link_to_edit_mode`
|
|
48
|
+
1. `current_admin?`
|
|
49
|
+
|
|
22
50
|
## TODO
|
|
23
51
|
|
|
24
52
|
* Documentation
|
|
25
53
|
* Generators
|
|
26
|
-
* Setup
|
|
54
|
+
* Setup CanCanCan
|
|
27
55
|
* Setup Globalize on Form::Field and Form::Email
|
|
56
|
+
* Improve breadcrumbs functionality
|
|
57
|
+
* Link to image edit in edit form (for cropping)
|
|
58
|
+
* Confirmation email for forms
|
|
28
59
|
* Published Pages/Forms
|
|
29
60
|
* Mailchimp integration
|
|
61
|
+
* Redirector
|
|
62
|
+
* Setting fetched from Yaml file
|
|
63
|
+
* Pretty Url for Viewable::LinkPresenter#url as file_url
|
|
64
|
+
* Fetch image size based on Screen size
|
|
30
65
|
* More Specs
|
|
31
66
|
|
|
32
67
|
## Notes
|
|
@@ -34,4 +69,4 @@ Seamlessly adds some useful classes to the body tag within your layout in order
|
|
|
34
69
|
gem 'dalli-delete-matched' needed if Memcached is used
|
|
35
70
|
|
|
36
71
|
|
|
37
|
-
This project rocks and uses MIT-LICENSE.
|
|
72
|
+
This project rocks and uses MIT-LICENSE.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
$.fn.extend
|
|
2
|
-
|
|
2
|
+
data_js: (name = null) ->
|
|
3
3
|
if name?
|
|
4
4
|
$(this).data("js-#{ name }")
|
|
5
5
|
else
|
|
@@ -17,13 +17,13 @@ class CMS
|
|
|
17
17
|
@validate()
|
|
18
18
|
|
|
19
19
|
@ready_with_scope 'cms-edit-mode', =>
|
|
20
|
-
@
|
|
20
|
+
@data_js('cms-sortable').each ->
|
|
21
21
|
$(this).sortable
|
|
22
22
|
update: (event, ui) ->
|
|
23
|
-
url = $(this).
|
|
23
|
+
url = $(this).data_js()['url']
|
|
24
24
|
|
|
25
25
|
target = $(ui.item)
|
|
26
|
-
id = target.
|
|
26
|
+
id = target.data_js('cms-sortable-id')
|
|
27
27
|
unique_key = { position: target.index() + 1 }
|
|
28
28
|
payload = $.param(id: id, unique_key: unique_key)
|
|
29
29
|
|
|
@@ -40,7 +40,7 @@ class CMS
|
|
|
40
40
|
$(element).off event, handler.handler
|
|
41
41
|
|
|
42
42
|
@flash_messages: =>
|
|
43
|
-
@
|
|
43
|
+
@data_js('cms-flash').fadeIn().delay(3500).fadeOut(800)
|
|
44
44
|
|
|
45
45
|
@validate: =>
|
|
46
46
|
$.validate(validateOnBlur: false)
|
|
@@ -88,13 +88,13 @@ class CMS
|
|
|
88
88
|
@with_scope(body_class, handler)
|
|
89
89
|
|
|
90
90
|
@ready: (handler) =>
|
|
91
|
-
$(document).on 'ready page:change', ->
|
|
91
|
+
$(document).on 'ready, page:change', ->
|
|
92
92
|
handler()
|
|
93
93
|
|
|
94
|
-
@
|
|
94
|
+
@data_js_on: (name, events, handler) =>
|
|
95
95
|
$(document).on(events, "[data-js-#{ name }]", handler)
|
|
96
96
|
|
|
97
|
-
@
|
|
97
|
+
@data_js: (name) =>
|
|
98
98
|
$("[data-js-#{ name }]")
|
|
99
99
|
|
|
100
100
|
window.CMS = CMS
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
module CMS
|
|
2
2
|
class PagesController < RailsAdminCMS::Config.parent_controller
|
|
3
|
+
after_action :allow_iframe, if: RailsAdminCMS::Config.allow_iframe_from
|
|
4
|
+
|
|
3
5
|
def show
|
|
4
6
|
@cms_view = Viewable::Page.find(params[:id]) if params[:id].present?
|
|
5
7
|
|
|
@@ -9,5 +11,11 @@ module CMS
|
|
|
9
11
|
render "cms/pages/#{params[:cms_view_type]}"
|
|
10
12
|
end
|
|
11
13
|
end
|
|
14
|
+
|
|
15
|
+
private
|
|
16
|
+
|
|
17
|
+
def allow_iframe
|
|
18
|
+
response.headers['X-FRAME-OPTIONS'] = RailsAdminCMS::Config.allow_iframe_from
|
|
19
|
+
end
|
|
12
20
|
end
|
|
13
21
|
end
|
|
@@ -6,11 +6,16 @@ module CMS
|
|
|
6
6
|
|
|
7
7
|
def cms_logger(exception, log_name = nil)
|
|
8
8
|
current_logger = log_name ? ::Logger.new("#{Rails.root}/log/#{log_name}.log") : logger
|
|
9
|
-
current_logger.error
|
|
9
|
+
current_logger.error ''
|
|
10
|
+
current_logger.error "[EXCEPTION][#{request.remote_ip}][#{request.method}][#{request.original_url}]"
|
|
10
11
|
if exception
|
|
11
12
|
current_logger.error exception.message
|
|
12
|
-
exception.backtrace.each
|
|
13
|
+
exception.backtrace.first(RailsAdminCMS::Config.exception_backtrace_size).each do |line|
|
|
14
|
+
current_logger.error line
|
|
15
|
+
end
|
|
13
16
|
end
|
|
17
|
+
current_logger.error '[END]'
|
|
18
|
+
current_logger.error ''
|
|
14
19
|
end
|
|
15
20
|
end
|
|
16
21
|
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module CMS
|
|
2
|
+
module Rescue
|
|
3
|
+
extend ActiveSupport::Concern
|
|
4
|
+
|
|
5
|
+
included do
|
|
6
|
+
skip_filter *_process_action_callbacks.map(&:filter), only: [:render_404, :render_500]
|
|
7
|
+
|
|
8
|
+
rescue_from Exception, with: :render_500 unless Rails.env.development?
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def render_404
|
|
12
|
+
render file: 'public/404.html', status: 404, layout: false
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def render_500(exception = nil)
|
|
16
|
+
cms_logger exception
|
|
17
|
+
render file: 'public/500.html', status: 500, layout: false
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
module CMS
|
|
2
2
|
module JavascriptHelper
|
|
3
|
-
def
|
|
3
|
+
def cms_data_js(name, data = true, options = {})
|
|
4
4
|
{ "data-js-#{name}" => data.to_json }.merge(options)
|
|
5
5
|
end
|
|
6
|
+
|
|
7
|
+
def cms_data_js_html(name, data = true, options = {})
|
|
8
|
+
CMS.options_to_html cms_data_js(name, data, options)
|
|
9
|
+
end
|
|
6
10
|
end
|
|
7
11
|
end
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
module CMS
|
|
2
2
|
module LocaleHelper
|
|
3
3
|
def cms_locale_selector
|
|
4
|
-
|
|
4
|
+
if RailsAdminCMS::Config.hide_current_locale?
|
|
5
|
+
links = []
|
|
6
|
+
else
|
|
7
|
+
links = [ link_to(t('cms.locale_selector.language'), '#', class: 'active') ]
|
|
8
|
+
end
|
|
5
9
|
|
|
6
10
|
I18n.available_locales.reject{ |l| l == locale }.each do |locale|
|
|
7
11
|
path = current_url_for(locale)
|
|
8
12
|
links << link_to(t('cms.locale_selector.language', locale: locale), path)
|
|
9
13
|
end
|
|
10
14
|
|
|
11
|
-
content_tag(:ul) do
|
|
15
|
+
content_tag(:ul, class: 'cms-locale-selector') do
|
|
12
16
|
links.each do |link|
|
|
13
17
|
concat content_tag(:li, link)
|
|
14
18
|
end
|
|
@@ -3,7 +3,7 @@ module CMS
|
|
|
3
3
|
def cms_body_class(*args)
|
|
4
4
|
controller_name = controller_path.gsub('/','-')
|
|
5
5
|
classes = [
|
|
6
|
-
params[:
|
|
6
|
+
params[:cms_view_type],
|
|
7
7
|
controller_name,
|
|
8
8
|
"#{controller_name}-#{action_name}",
|
|
9
9
|
I18n.locale,
|
|
@@ -14,7 +14,7 @@ module CMS
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def cms_flash_messages(*args)
|
|
17
|
-
content_tag :div,
|
|
17
|
+
content_tag :div, cms_data_js('cms-flash', true, class: 'cms-flash-messages') do
|
|
18
18
|
flash_messages(*args)
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -8,7 +8,7 @@ module CMS
|
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
Naming::Viewable::Block.names.each do |type|
|
|
11
|
+
::Naming::Viewable::Block.names.each do |type|
|
|
12
12
|
define_cms_view_helper(type)
|
|
13
13
|
|
|
14
14
|
define_method "cms_#{type}" do |name = 'cms', min = 1, max = nil| # max = FLOAT::INFINITY
|
|
@@ -18,7 +18,7 @@ module CMS
|
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
Naming::Viewable.names.each do |type|
|
|
21
|
+
::Naming::Viewable.names.each do |type|
|
|
22
22
|
define_cms_view_helper(type)
|
|
23
23
|
|
|
24
24
|
define_method "cms_#{type}" do |name = 'cms', min = 1, max = nil| # max = FLOAT::INFINITY
|
|
@@ -103,11 +103,11 @@ module CMS
|
|
|
103
103
|
case type
|
|
104
104
|
when 'page'
|
|
105
105
|
if @cms_view
|
|
106
|
-
presenter = Viewable::PagePresenter.new(@cms_view, self)
|
|
106
|
+
presenter = ::Viewable::PagePresenter.new(@cms_view, self)
|
|
107
107
|
end
|
|
108
108
|
when 'form'
|
|
109
109
|
if @cms_view
|
|
110
|
-
presenter = Viewable::FormPresenter.new(@cms_view, self)
|
|
110
|
+
presenter = ::Viewable::FormPresenter.new(@cms_view, self)
|
|
111
111
|
end
|
|
112
112
|
else
|
|
113
113
|
if @cms_view_partial
|
|
@@ -119,32 +119,32 @@ module CMS
|
|
|
119
119
|
|
|
120
120
|
def find_presenter(type, name, position)
|
|
121
121
|
unique_key = to_unique_key(type, name, position)
|
|
122
|
-
if (viewable = UniqueKey.find_viewable(unique_key))
|
|
122
|
+
if (viewable = ::UniqueKey.find_viewable(unique_key))
|
|
123
123
|
build_presenter(unique_key, viewable)
|
|
124
124
|
end
|
|
125
125
|
end
|
|
126
126
|
|
|
127
127
|
def find_or_create_presenter(type, name, position)
|
|
128
128
|
unique_key = to_unique_key(type, name, position)
|
|
129
|
-
viewable = UniqueKey.find_or_create_viewable!(unique_key)
|
|
129
|
+
viewable = ::UniqueKey.find_or_create_viewable!(unique_key)
|
|
130
130
|
build_presenter(unique_key, viewable)
|
|
131
131
|
end
|
|
132
132
|
|
|
133
133
|
def build_presenter(unique_key, viewable)
|
|
134
|
-
presenter_class = "
|
|
134
|
+
presenter_class = "::#{unique_key[:viewable_type]}Presenter".safe_constantize
|
|
135
135
|
if presenter_class
|
|
136
136
|
presenter_class.new(viewable, self)
|
|
137
137
|
else
|
|
138
|
-
ViewablePresenter.new(viewable, self)
|
|
138
|
+
::ViewablePresenter.new(viewable, self)
|
|
139
139
|
end
|
|
140
140
|
end
|
|
141
141
|
|
|
142
142
|
def build_list_presenter(viewables, list_key, max)
|
|
143
|
-
list_presenter_class = "
|
|
143
|
+
list_presenter_class = "::#{list_key[:viewable_type]}ListPresenter".safe_constantize
|
|
144
144
|
if list_presenter_class
|
|
145
145
|
list_presenter_class.new(viewables, self, list_key, max)
|
|
146
146
|
else
|
|
147
|
-
ViewableListPresenter.new(viewables, self, list_key, max)
|
|
147
|
+
::ViewableListPresenter.new(viewables, self, list_key, max)
|
|
148
148
|
end
|
|
149
149
|
end
|
|
150
150
|
|
data/app/models/viewable.rb
CHANGED
|
@@ -18,8 +18,7 @@ module Viewable
|
|
|
18
18
|
after_update :expire_cache
|
|
19
19
|
after_touch :expire_cache
|
|
20
20
|
|
|
21
|
-
scope :localized, -> { includes(:unique_key).where(unique_keys: { locale:
|
|
22
|
-
scope :other_locale, ->(locale) { includes(:unique_key).where(unique_keys: { locale: locale }) }
|
|
21
|
+
scope :localized, ->(locale = I18n.locale) { includes(:unique_key).where(unique_keys: { locale: locale }) }
|
|
23
22
|
|
|
24
23
|
delegate :has_unlocalized_fields?, :unlocalized_fields, :viewable_type, to: :class
|
|
25
24
|
end
|
|
@@ -11,7 +11,7 @@ class ViewableListPresenter < BaseListPresenter
|
|
|
11
11
|
h.content_tag(:ul, sortable(class: "cms-wrapped-edit")) do
|
|
12
12
|
list.each.with_index(1) do |m, i|
|
|
13
13
|
name = method_name ? m.__send__(method_name) : i
|
|
14
|
-
h.concat(h.content_tag(:li, h.
|
|
14
|
+
h.concat(h.content_tag(:li, h.cms_data_js('cms-sortable-id', m.unique_key.id)) do
|
|
15
15
|
m.edit_link(name)
|
|
16
16
|
end)
|
|
17
17
|
end
|
|
@@ -30,14 +30,14 @@ class ViewableListPresenter < BaseListPresenter
|
|
|
30
30
|
|
|
31
31
|
def sortable(options = {})
|
|
32
32
|
if h.cms_edit_mode?
|
|
33
|
-
h.
|
|
33
|
+
h.cms_data_js('cms-sortable', { url: h.main_app.edit_viewable_url(format: :js) }, options)
|
|
34
34
|
else
|
|
35
35
|
options
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
def sortable_html(options = {})
|
|
40
|
-
sortable(options)
|
|
40
|
+
CMS.options_to_html sortable(options)
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
def ul_sortable_tag(options = {})
|
|
@@ -12,7 +12,7 @@ class ViewablePresenter < BasePresenter
|
|
|
12
12
|
def li_sortable_tag(options = nil)
|
|
13
13
|
options ||= {}
|
|
14
14
|
if h.cms_edit_mode?
|
|
15
|
-
options = h.
|
|
15
|
+
options = h.cms_data_js('cms-sortable-id', m.unique_key.id, options)
|
|
16
16
|
end
|
|
17
17
|
h.content_tag :li, options do
|
|
18
18
|
yield
|
data/config/routes.rb
CHANGED
|
@@ -6,30 +6,24 @@ Rails.application.routes.draw do
|
|
|
6
6
|
get 'attachments/*directory/:file' => 'attachments#show', format: true
|
|
7
7
|
|
|
8
8
|
Viewable::Page.with_url.each do |page|
|
|
9
|
-
get page.url => "pages#show", format: false
|
|
10
|
-
defaults: { id: page.id, cms_view_type: page.view_name, cms_body_class: page.view_name, locale: page.locale }
|
|
9
|
+
get page.url => "pages#show", defaults: { id: page.id, cms_view_type: page.view_name, locale: page.locale }, format: false
|
|
11
10
|
end if ActiveRecord::Base.connection.table_exists? 'viewable_pages'
|
|
12
11
|
|
|
13
12
|
Viewable::Form.with_url.each do |form|
|
|
14
|
-
get form.url => "forms#new", format: false
|
|
15
|
-
|
|
16
|
-
post form.url => 'forms#create',
|
|
17
|
-
defaults: { id: form.id, cms_view_type: form.form_name, cms_body_class: form.form_name, locale: form.locale }
|
|
13
|
+
get form.url => "forms#new", defaults: { id: form.id, cms_view_type: form.form_name, locale: form.locale }, format: false
|
|
14
|
+
post form.url => 'forms#create', defaults: { id: form.id, cms_view_type: form.form_name, locale: form.locale }
|
|
18
15
|
end if ActiveRecord::Base.connection.table_exists? 'viewable_forms'
|
|
19
16
|
|
|
20
17
|
localized do
|
|
21
18
|
resources :files, format: false, only: [:show]
|
|
22
19
|
|
|
23
20
|
Naming::Viewable::Page.names.each do |name|
|
|
24
|
-
get name => 'pages#show', format: false
|
|
25
|
-
defaults: { cms_view_type: name, cms_body_class: name }
|
|
21
|
+
get name => 'pages#show', defaults: { cms_view_type: name }, format: false
|
|
26
22
|
end
|
|
27
23
|
|
|
28
24
|
Naming::Viewable::Form.names.each do |name|
|
|
29
|
-
get name => 'forms#new', format: false
|
|
30
|
-
|
|
31
|
-
post name => 'forms#create',
|
|
32
|
-
defaults: { cms_view_type: name, cms_body_class: name }
|
|
25
|
+
get name => 'forms#new', defaults: { cms_view_type: name }, format: false
|
|
26
|
+
post name => 'forms#create', defaults: { cms_view_type: name }
|
|
33
27
|
end
|
|
34
28
|
end
|
|
35
29
|
end
|
|
@@ -11,4 +11,15 @@ RailsAdminCMS.config do |config|
|
|
|
11
11
|
|
|
12
12
|
# Defines if Forms defined admin side need their body to be editable
|
|
13
13
|
# config.with_email_body = false
|
|
14
|
+
|
|
15
|
+
# Defines if there is the current locale in the locale selector
|
|
16
|
+
# config.hide_current_locale = false
|
|
17
|
+
|
|
18
|
+
# Defines iframe permissions: same host, different host or all
|
|
19
|
+
# config.allow_iframe_from = 'SAMEORIGIN'
|
|
20
|
+
# config.allow_iframe_from = 'ALLOW-FROM https://www.google.com'
|
|
21
|
+
# config.allow_iframe_from = 'ALLOWALL'
|
|
22
|
+
|
|
23
|
+
# Defines the number of lines picked from exception backtrace in 'cms_logger'
|
|
24
|
+
# config.exception_backtrace_size = 10
|
|
14
25
|
end
|
|
@@ -2,7 +2,7 @@ Rails.application.routes.draw do
|
|
|
2
2
|
mount Rich::Engine => '/rich', :as => 'rich'
|
|
3
3
|
mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
|
|
4
4
|
|
|
5
|
-
root to: "cms/pages#show",
|
|
5
|
+
root to: "cms/pages#show", defaults: { cms_view_type: 'page', locale: I18n.default_locale }, format: false
|
|
6
6
|
|
|
7
7
|
# The priority is based upon order of creation: first created -> highest priority.
|
|
8
8
|
# See how all your routes lay out with "rake routes".
|
|
@@ -58,4 +58,6 @@ Rails.application.routes.draw do
|
|
|
58
58
|
# # (app/controllers/admin/products_controller.rb)
|
|
59
59
|
# resources :products
|
|
60
60
|
# end
|
|
61
|
+
|
|
62
|
+
match '*not_found', via: :all, to: 'application#render_404'
|
|
61
63
|
end
|
|
@@ -14,7 +14,13 @@ module RailsAdminCMS
|
|
|
14
14
|
:parent_controller,
|
|
15
15
|
:parent_mailer,
|
|
16
16
|
:custom_form_max_size,
|
|
17
|
-
:with_email_body
|
|
17
|
+
:with_email_body,
|
|
18
|
+
:hide_current_locale,
|
|
19
|
+
:exception_backtrace_size
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
attr_accessor(
|
|
23
|
+
:allow_iframe_from,
|
|
18
24
|
)
|
|
19
25
|
|
|
20
26
|
def parent_controller
|
|
@@ -32,5 +38,13 @@ module RailsAdminCMS
|
|
|
32
38
|
def with_email_body?
|
|
33
39
|
@with_email_body
|
|
34
40
|
end
|
|
41
|
+
|
|
42
|
+
def hide_current_locale?
|
|
43
|
+
@hide_current_locale
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def exception_backtrace_size
|
|
47
|
+
@exception_backtrace_size || 10
|
|
48
|
+
end
|
|
35
49
|
end
|
|
36
50
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails_admin_cms
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Patrice Lebel
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-01
|
|
11
|
+
date: 2016-02-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -665,6 +665,7 @@ files:
|
|
|
665
665
|
- app/controllers/concerns/cms/editing.rb
|
|
666
666
|
- app/controllers/concerns/cms/localize.rb
|
|
667
667
|
- app/controllers/concerns/cms/logger.rb
|
|
668
|
+
- app/controllers/concerns/cms/rescue.rb
|
|
668
669
|
- app/helpers/cms/cache_helper.rb
|
|
669
670
|
- app/helpers/cms/form_helper.rb
|
|
670
671
|
- app/helpers/cms/javascript_helper.rb
|
|
@@ -828,9 +829,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
828
829
|
version: '0'
|
|
829
830
|
requirements: []
|
|
830
831
|
rubyforge_project:
|
|
831
|
-
rubygems_version: 2.
|
|
832
|
+
rubygems_version: 2.2.2
|
|
832
833
|
signing_key:
|
|
833
834
|
specification_version: 4
|
|
834
835
|
summary: Flexible Content Management Framework for RailsAdmin
|
|
835
836
|
test_files: []
|
|
836
|
-
has_rdoc:
|