refinerycms-core 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/refinery/admin.js.erb +28 -33
- data/app/assets/javascripts/refinery/modal_dialogs.js.erb +29 -31
- data/app/assets/javascripts/refinery/submit_continue.js.coffee.erb +1 -0
- data/app/assets/javascripts/wymeditor/lang/nl.js +55 -45
- data/app/assets/javascripts/wymeditor/lang/pl.js +12 -1
- data/app/controllers/refinery/admin/core_controller.rb +1 -1
- data/app/controllers/refinery/admin/dialogs_controller.rb +25 -9
- data/app/views/refinery/admin/_form_actions.html.erb +3 -1
- data/lib/generators/refinery/dummy/dummy_generator.rb +2 -2
- data/lib/generators/refinery/dummy/templates/rails/{application.rb → application.rb.erb} +0 -0
- data/lib/generators/refinery/dummy/templates/rails/{boot.rb → boot.rb.erb} +0 -0
- data/lib/generators/refinery/engine/engine_generator.rb +5 -1
- data/lib/generators/refinery/engine/templates/app/controllers/refinery/namespace/admin/{plural_name_controller.rb → plural_name_controller.rb.erb} +0 -0
- data/lib/generators/refinery/engine/templates/app/controllers/refinery/namespace/{plural_name_controller.rb → plural_name_controller.rb.erb} +0 -0
- data/lib/generators/refinery/engine/templates/app/models/refinery/namespace/{singular_name.rb → singular_name.rb.erb} +7 -9
- data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_singular_name.html.erb +1 -1
- data/lib/generators/refinery/engine/templates/config/locales/sk.yml +28 -0
- data/lib/generators/refinery/engine/templates/config/{routes.rb → routes.rb.erb} +0 -0
- data/lib/generators/refinery/engine/templates/db/migrate/{1_create_namespace_plural_name.rb → 1_create_namespace_plural_name.rb.erb} +0 -0
- data/lib/generators/refinery/engine/templates/db/{seeds.rb → seeds.rb.erb} +1 -1
- data/lib/generators/refinery/engine/templates/lib/generators/refinery/{extension_plural_name_generator.rb → extension_plural_name_generator.rb.erb} +0 -0
- data/lib/generators/refinery/engine/templates/lib/refinery/{plural_name.rb → plural_name.rb.erb} +0 -0
- data/lib/generators/refinery/engine/templates/lib/refinery/plural_name/{engine.rb → engine.rb.erb} +0 -0
- data/lib/generators/refinery/engine/templates/lib/{refinerycms-extension_plural_name.rb → refinerycms-extension_plural_name.rb.erb} +0 -0
- data/lib/generators/refinery/engine/templates/spec/models/refinery/namespace/{singular_name_spec.rb → singular_name_spec.rb.erb} +0 -0
- data/lib/generators/refinery/engine/templates/spec/requests/refinery/namespace/admin/{plural_name_spec.rb → plural_name_spec.rb.erb} +6 -6
- data/lib/generators/refinery/engine/templates/spec/spec_helper.rb +0 -2
- data/lib/generators/refinery/engine/templates/spec/support/factories/refinery/{plural_name.rb → plural_name.rb.erb} +0 -0
- data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/admin/{plural_name_controller.rb → plural_name_controller.rb.erb} +4 -4
- data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/admin/settings_controller.rb.erb +45 -0
- data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/{plural_name_controller.rb → plural_name_controller.rb.erb} +0 -0
- data/lib/generators/refinery/form/templates/app/mailers/refinery/namespace/{mailer.rb → mailer.rb.erb} +0 -0
- data/lib/generators/refinery/form/templates/app/models/refinery/namespace/{setting.rb → setting.rb.erb} +0 -0
- data/lib/generators/refinery/form/templates/app/models/refinery/namespace/{singular_name.rb → singular_name.rb.erb} +19 -14
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/_singular_name.html.erb +1 -1
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/settings/_confirmation_email_form.html.erb +1 -1
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/settings/_notification_recipients_form.html.erb +1 -1
- data/lib/generators/refinery/form/templates/app/views/refinery/namespace/plural_name/new.html.erb +4 -4
- data/lib/generators/refinery/form/templates/config/locales/cs.yml +78 -0
- data/lib/generators/refinery/form/templates/config/locales/sk.yml +78 -0
- data/lib/generators/refinery/form/templates/config/{routes.rb → routes.rb.erb} +2 -2
- data/lib/generators/refinery/form/templates/db/migrate/{1_create_plural_name.rb → 1_create_plural_name.rb.erb} +5 -4
- data/lib/generators/refinery/form/templates/db/{seeds.rb → seeds.rb.erb} +1 -1
- data/lib/generators/refinery/form/templates/lib/generators/refinery/{plural_name_generator.rb → plural_name_generator.rb.erb} +0 -0
- data/lib/generators/refinery/form/templates/lib/refinery/{plural_name.rb → plural_name.rb.erb} +0 -0
- data/lib/generators/refinery/form/templates/lib/refinery/plural_name/{engine.rb → engine.rb.erb} +0 -0
- data/lib/generators/refinery/form/templates/lib/{refinerycms-plural_name.rb → refinerycms-plural_name.rb.erb} +0 -0
- data/lib/refinery/cli.rb +73 -111
- data/lib/refinery/core.rb +8 -4
- data/lib/refinery/crud.rb +9 -5
- data/lib/refinery/extension_generation.rb +250 -214
- data/lib/refinery/version.rb +2 -2
- data/spec/helpers/refinery/custom_assets_helper_spec.rb +2 -2
- data/spec/helpers/refinery/pagination_helper_spec.rb +1 -1
- data/spec/lib/generators/refinery/cms/cms_generator_spec.rb +1 -1
- data/spec/lib/generators/refinery/core/core_generator_spec.rb +1 -1
- data/spec/lib/generators/refinery/engine/engine_generator_spec.rb +9 -4
- data/spec/lib/generators/refinery/engine/engine_generator_with_i18n_spec.rb +1 -1
- data/spec/lib/generators/refinery/engine/engine_generator_without_frontend_spec.rb +1 -1
- data/spec/lib/generators/refinery/form/form_generator_spec.rb +1 -1
- data/spec/lib/refinery/application_controller_spec.rb +8 -0
- data/spec/lib/refinery/core_spec.rb +14 -5
- data/spec/lib/refinery/crud_spec.rb +106 -0
- data/spec/lib/refinery/plugin_spec.rb +1 -1
- data/spec/lib/refinery/plugins_spec.rb +1 -1
- data/spec/requests/refinery/admin/custom_assets_spec.rb +2 -2
- data/spec/requests/refinery/admin/dialogs_spec.rb +3 -2
- data/spec/requests/refinery/search_spec.rb +2 -2
- data/spec/support/database_cleaner.rb +8 -2
- data/spec/support/refinery.rb +1 -2
- metadata +37 -32
- data/lib/generators/refinery/form/templates/app/controllers/refinery/namespace/admin/settings_controller.rb +0 -51
@@ -1,51 +0,0 @@
|
|
1
|
-
module Refinery
|
2
|
-
module <%= class_name.pluralize %>
|
3
|
-
module Admin
|
4
|
-
class SettingsController < Refinery::AdminController
|
5
|
-
|
6
|
-
crudify :'refinery/setting',
|
7
|
-
:title_attribute => 'name',
|
8
|
-
:order => 'name ASC',
|
9
|
-
:redirect_to_url => 'refinery.<%= namespacing.underscore %>_admin_<%= plural_name %>_path'
|
10
|
-
|
11
|
-
before_filter :redirect_back_to_<%= plural_name %>?, :only => [:index]
|
12
|
-
before_filter :set_url_override?, :only => [:edit, :update]
|
13
|
-
after_filter :save_subject_for_confirmation?, :only => [:create, :update]
|
14
|
-
around_filter :rewrite_flash?, :only => [:create, :update]
|
15
|
-
|
16
|
-
protected
|
17
|
-
def rewrite_flash?
|
18
|
-
yield
|
19
|
-
|
20
|
-
flash[:notice] = flash[:notice].to_s.gsub(/(\'.*\')/) {|m| m.titleize}.gsub('<%= class_name %> ', '')
|
21
|
-
end
|
22
|
-
|
23
|
-
def save_subject_for_confirmation?
|
24
|
-
Refinery::<%= namespacing %>::Setting.confirmation_subject = params[:subject] if params.keys.include?('subject')
|
25
|
-
end
|
26
|
-
|
27
|
-
def redirect_back_to_<%= plural_name %>?
|
28
|
-
redirect_to refinery.<%= namespacing.underscore %>_admin_<%= plural_name %>_path
|
29
|
-
end
|
30
|
-
|
31
|
-
def set_url_override?
|
32
|
-
@url_override = refinery.<%= namespacing.underscore %>_admin_setting_url(@setting, :dialog => from_dialog?)
|
33
|
-
end
|
34
|
-
|
35
|
-
def find_setting
|
36
|
-
# ensure that we're dealing with the name of the setting, not the id.
|
37
|
-
if params[:id].to_s.to_i.to_s == params[:id]
|
38
|
-
params[:id] = Refinery::Setting.find(params[:id]).name.to_s
|
39
|
-
end
|
40
|
-
|
41
|
-
# prime the setting first, if it's valid.
|
42
|
-
if Refinery::<%= namespacing %>::Setting.methods.map(&:to_sym).include?(params[:id].to_s.gsub('<%= singular_name %>_', '').to_sym)
|
43
|
-
Refinery::<%= namespacing %>::Setting.send(params[:id].to_s.gsub('<%= singular_name %>_', '').to_sym)
|
44
|
-
end
|
45
|
-
@setting = Refinery::Setting.find_by_name(params[:id])
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|