diff --git a/lib/patchfile/engine.rb b/lib/patchfile/engine.rb index afda71d..a3ea3a7 100644 --- a/lib/patchfile/engine.rb +++ b/lib/patchfile/engine.rb @@ -2,29 +2,31 @@ require "yaml" module Patchfile class Engine < ::Rails::Engine initializer "patchfile" do - OrbitApp.registration "Patchfile", :type => "ModuleApp" do - base_url File.expand_path File.dirname(__FILE__) - # taggable "patchfilefield" - # categorizable - # authorizable - side_bar do - # head_label_i18n 'patchfile.patchfile', icon_class: "icons-megaphone" - # available_for "users" - # active_for_controllers (['admin/patchfiles']) - # head_link_path "admin_patchfiles_path" + Rails.application.config.to_prepare do + OrbitApp.registration "Patchfile", :type => "ModuleApp" do + base_url File.expand_path File.dirname(__FILE__) + # taggable "patchfilefield" + # categorizable + # authorizable + side_bar do + # head_label_i18n 'patchfile.patchfile', icon_class: "icons-megaphone" + # available_for "users" + # active_for_controllers (['admin/patchfiles']) + # head_link_path "admin_patchfiles_path" - # context_link 'patchfile.patchfile', - # :link_path=>"admin_patchfiles_path" , - # :priority=>1, - # :active_for_action=>{'admin/patchfiles'=>'index'}, - # :available_for => 'users' - # context_link 'CKEDITOR', - # :link_path=>"admin_patchfiles_showckeditor_path" , - # #:link_to=>"admin_patchfiles_path"+"/showckeditor" , - # :priority=>2, - # :active_for_action=>{'admin/patchfiles'=>'showckeditor'}, - # :available_for => 'users' + # context_link 'patchfile.patchfile', + # :link_path=>"admin_patchfiles_path" , + # :priority=>1, + # :active_for_action=>{'admin/patchfiles'=>'index'}, + # :available_for => 'users' + # context_link 'CKEDITOR', + # :link_path=>"admin_patchfiles_showckeditor_path" , + # #:link_to=>"admin_patchfiles_path"+"/showckeditor" , + # :priority=>2, + # :active_for_action=>{'admin/patchfiles'=>'showckeditor'}, + # :available_for => 'users' + end end end end diff --git a/updatefiles/application_helper.rb b/updatefiles/application_helper.rb index 4318966..8559c51 100644 --- a/updatefiles/application_helper.rb +++ b/updatefiles/application_helper.rb @@ -710,9 +710,9 @@ module ApplicationHelper filename = overridehtml.nil? ? File.basename(params[:layout_type]) : overridehtml module_name = File.basename(params[:target_controller]).singularize f = File.join(Rails.root, 'app', 'templates', "#{@key}", 'modules', module_name, "#{filename}.html.erb") - if !File.exists?f + if !File.exist?(f) f = File.join(Rails.root, 'app', 'templates', "#{@key}", 'modules', module_name, "index.html.erb") - if !File.exists?f + if !File.exist?(f) return "