Class: FlexibleAdmin::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/flexible_admin/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#adds_jquery_datepickerObject



67
68
69
70
# File 'lib/generators/flexible_admin/install_generator.rb', line 67

def adds_jquery_datepicker
  template "javascripts/jquery-ui-1.8.17.custom.min.js", "app/assets/javascripts/admin/jquery-ui-1.8.17.custom.min.js"
  directory "ui-lightness", "app/assets/stylesheets/ui-lightness"
end

#create_admin_controllerObject



76
77
78
# File 'lib/generators/flexible_admin/install_generator.rb', line 76

def create_admin_controller
  template "admin_controller.rb", "app/controllers/admin_controller.rb"
end

#create_admin_helperObject



36
37
38
# File 'lib/generators/flexible_admin/install_generator.rb', line 36

def create_admin_helper
  template "admin_helper.rb", "app/helpers/admin_helper.rb"
end

#create_admin_layout_viewObject



17
18
19
20
21
# File 'lib/generators/flexible_admin/install_generator.rb', line 17

def create_admin_layout_view
  template "admin_layout.html.erb", "app/views/layouts/admin/base.html.erb"
  template "navigation.html.erb", "app/views/layouts/admin/_navigation.html.erb"
  template "flash.html.erb", "app/views/layouts/admin/_flash.html.erb"
end

#create_admin_viewObject



13
14
15
# File 'lib/generators/flexible_admin/install_generator.rb', line 13

def create_admin_view
  template "admin_index.html.erb", "app/views/admin/index.html.erb"
end

#create_shared_form_filesObject



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/generators/flexible_admin/install_generator.rb', line 23

def create_shared_form_files
  template "forms/text_field.html.erb", "app/views/admin/shared/_text_field.html.erb"
  template "forms/datepicker_text_field.html.erb", "app/views/admin/shared/_datepicker_text_field.html.erb"
  template "forms/text_area_field.html.erb", "app/views/admin/shared/_text_area_field.html.erb"
  template "forms/select_field.html.erb", "app/views/admin/shared/_select_field.html.erb"
  template "forms/file_field.html.erb", "app/views/admin/shared/_file_field.html.erb"
  template "forms/email_field.html.erb", "app/views/admin/shared/_email_field.html.erb"
  template "forms/cktext_area_field.html.erb", "app/views/admin/shared/_cktext_area_field.html.erb"
  template "forms/checkbox_field.html.erb", "app/views/admin/shared/_checkbox_field.html.erb"
  template "forms/error_messages.html.erb", "app/views/admin/shared/_error_messages.html.erb"
  template "forms/password_field.html.erb", "app/views/admin/shared/_password_field.html.erb"
end

#create_stylesheetsObject



40
41
42
43
44
45
46
# File 'lib/generators/flexible_admin/install_generator.rb', line 40

def create_stylesheets
  template "stylesheets/bootstrap.css", "app/assets/stylesheets/admin/bootstrap.css"
  template "stylesheets/application.css", "app/assets/stylesheets/admin/application.css"
  template "stylesheets/demo_table.css", "app/assets/stylesheets/admin/datatables/demo_table.css"
  template "stylesheets/admin.sass", "app/assets/stylesheets/admin/admin.sass"
  template "images/admin-background.png", "app/assets/images/admin/admin-background.png"
end

#creates_datatables_imagesObject



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/generators/flexible_admin/install_generator.rb', line 48

def creates_datatables_images
  template "images/back_disabled.jpg", "app/assets/images/admin/datatables/back_disabled.jpg"
  template "images/back_enabled.jpg", "app/assets/images/admin/datatables/back_enabled.jpg"
  template "images/forward_disabled.jpg", "app/assets/images/admin/datatables/forward_disabled.jpg"
  template "images/forward_enabled.jpg", "app/assets/images/admin/datatables/forward_enabled.jpg"
  
  template "images/sort_asc.png", "app/assets/images/admin/datatables/sort_asc.png"
  template "images/sort_desc.png", "app/assets/images/admin/datatables/sort_desc.png"
  template "images/sort_both.png", "app/assets/images/admin/datatables/sort_both.png"
  template "images/sort_asc_disabled.png", "app/assets/images/admin/datatables/sort_asc_disabled.png"
  template "images/sort_desc_disabled.png", "app/assets/images/admin/datatables/sort_desc_disabled.png"
end

#creates_javascriptsObject



61
62
63
64
65
# File 'lib/generators/flexible_admin/install_generator.rb', line 61

def creates_javascripts
  template "javascripts/application.js", "app/assets/javascripts/admin/application.js"
  template "javascripts/app.js", "app/assets/javascripts/admin/app.js"
  template "javascripts/jquery.dataTables.js", "app/assets/javascripts/admin/jquery.dataTables.js"
end

#inherited_resourcesObject



80
81
82
83
# File 'lib/generators/flexible_admin/install_generator.rb', line 80

def inherited_resources
  append_file "Gemfile", "\n", :force => true
  gem 'inherited_resources'
end

#make_admin_routeObject



72
73
74
# File 'lib/generators/flexible_admin/install_generator.rb', line 72

def make_admin_route
  route("get '/admin' => 'admin#index'")
end