Class: Adminlte::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Adminlte::Generators::InstallGenerator
- Defined in:
- lib/generators/adminlte/install/install_generator.rb
Instance Method Summary collapse
- #copy_form_builder ⇒ Object
- #copy_images ⇒ Object
- #copy_lib ⇒ Object
- #copy_nav_helper ⇒ Object
- #create_layout ⇒ Object
- #create_stylesheets ⇒ Object
- #inject_adminlte ⇒ Object
Instance Method Details
#copy_form_builder ⇒ Object
23 24 25 |
# File 'lib/generators/adminlte/install/install_generator.rb', line 23 def copy_form_builder copy_file "form_builder/_form.html.#{[:template_engine]}", "lib/templates/#{[:template_engine]}/scaffold/_form.html.#{[:template_engine]}" end |
#copy_images ⇒ Object
19 20 21 |
# File 'lib/generators/adminlte/install/install_generator.rb', line 19 def copy_images directory "img/", "public/img" end |
#copy_lib ⇒ Object
15 16 17 |
# File 'lib/generators/adminlte/install/install_generator.rb', line 15 def copy_lib directory "lib/templates/#{[:template_engine]}" end |
#copy_nav_helper ⇒ Object
27 28 29 |
# File 'lib/generators/adminlte/install/install_generator.rb', line 27 def copy_nav_helper copy_file "helpers/navigation_helper.rb", "app/helpers/nav_helper.rb" end |
#create_layout ⇒ Object
31 32 33 34 35 |
# File 'lib/generators/adminlte/install/install_generator.rb', line 31 def create_layout template "layouts/dashboard.html.#{[:template_engine]}", "app/views/layouts/#{[:layout_name]}.html.#{[:template_engine]}" template "layouts/_header.html.#{[:template_engine]}", "app/views/layouts/_#{[:layout_name]}_header.html.#{[:template_engine]}" template "layouts/_sidebar.html.#{[:template_engine]}", "app/views/layouts/_#{[:layout_name]}_sidebar.html.#{[:template_engine]}" end |
#create_stylesheets ⇒ Object
37 38 39 |
# File 'lib/generators/adminlte/install/install_generator.rb', line 37 def create_stylesheets copy_file "assets/stylesheets/adminlte_overrides.#{[:stylesheet_engine]}", "app/assets/stylesheets/adminlte_overrides.#{[:stylesheet_engine]}" end |
#inject_adminlte ⇒ Object
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/generators/adminlte/install/install_generator.rb', line 41 def inject_adminlte application_js_path = "app/assets/javascripts/#{[:layout_name]}.js" if ::File.exists?(::File.join(destination_root, application_js_path)) inject_into_file application_js_path, before: '//= require_tree' do "//= require bootstrap\n"+ "//= require adminlte\n" end end end |