customize_admin 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.
@@ -7,5 +7,4 @@
7
7
  //= require jquery
8
8
  //= require jquery_ujs
9
9
  //= require twitter/bootstrap
10
- //= require ckeditor/ckeditor
11
10
  //= require_tree .
@@ -1,3 +1,3 @@
1
1
  // Place all the behaviors and hooks related to the matching controller here.
2
2
  // All this logic will automatically be available in application.js.
3
- //= require ckeditor/ckeditor
3
+
@@ -1,5 +1,5 @@
1
1
  CustomizeAdmin::Engine.routes.draw do
2
- mount Ckeditor::Engine => '/ckeditor'
2
+ #mount Ckeditor::Engine => '/ckeditor'
3
3
 
4
4
  #root :to => 'dashboard#index'
5
5
  #get "dashboard/index"
@@ -1,3 +1,3 @@
1
1
  module CustomizeAdmin
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -2,7 +2,7 @@ class CustomizeAdmin::InstallGenerator < Rails::Generators::Base
2
2
  source_root File.expand_path('../templates', __FILE__)
3
3
  def add_gems
4
4
  insert_into_file "Gemfile", :after => "source 'http://rubygems.org'\n" do
5
- "# CustomizeAdmin gems:\n gem 'inherited_resources'\n gem 'has_scope'\n gem 'formtastic'\n gem 'will_paginate'\n gem 'devise'\n gem 'twitter-bootstrap-rails'\n \n"
5
+ "# CustomizeAdmin gems:\n gem 'inherited_resources'\n gem 'has_scope'\n gem 'formtastic'\n gem 'will_paginate'\n gem 'devise'\n gem 'twitter-bootstrap-rails', '1.4.3' \n \n"
6
6
  end
7
7
 
8
8
  end
@@ -10,13 +10,13 @@ class CustomizeAdmin::InstallGenerator < Rails::Generators::Base
10
10
  def add_routes
11
11
  insert_into_file "config/routes.rb", :after => "draw do\n" do
12
12
  @name_space = ask("Tell me the admin namespace?")
13
- " mount CustomizeAdmin::Engine => '/admin'\n namespace :#{@name_space} do\n #customize_admin:\n end\n"
13
+ " mount CustomizeAdmin::Engine => '/admin', :as => 'customize_admin'\n namespace :#{@name_space} do\n #customize_admin:\n match '/' => 'dashboard#index' \n \n end\n"
14
14
  end
15
15
  end
16
16
 
17
- def create_manu_file
17
+ def create_menu_file
18
18
  create_file "app/views/customize_admin/application/_admin_menu.html.erb" do
19
- "customize_admin\n"
19
+ "<%= link_to 'Dashboard', #{@name_space}_path, :class => 'brand' %> \n"
20
20
  end
21
21
  end
22
22
 
@@ -44,8 +44,28 @@ class CustomizeAdmin::InstallGenerator < Rails::Generators::Base
44
44
  end
45
45
 
46
46
  def add_dashboard
47
+ s = ""
48
+ @name_space.to_s.split("_").each do |n|
49
+ s += n[0].capitalize + n.slice(1..-1)
50
+ end
51
+ @name_space_class = s
47
52
  template "dashboard_controller.rb", "app/controllers/#{@name_space}/dashboard_controller.rb"
48
- template "dashboard_controller.rb", "app/views/#{@name_space}/dashboard/index.html.erb"
53
+ template "index.html.erb", "app/views/#{@name_space}/dashboard/index.html.erb"
54
+ end
55
+
56
+ def add_devise_layout
57
+ template "devise_admin.html.erb", "app/views/layouts/devise_admin.html.erb"
58
+ inject_into_file Dir["app/controllers/application_controller.rb"].first,
59
+ "\n layout :layout_by_resource
60
+ def layout_by_resource
61
+ if devise_controller? && resource_name == :admin_user
62
+ 'devise_admin'
63
+ else
64
+ 'application'
65
+ end
66
+ end ",
67
+ :after => "class ApplicationController < ActionController::Base"
68
+
49
69
  end
50
70
 
51
71
  end
@@ -1,4 +1,4 @@
1
- class Admin::DashboardController < CustomizeAdmin::BaseController
1
+ class <%= @name_space_class%>::DashboardController < CustomizeAdmin::BaseController
2
2
  before_filter :authenticate_admin_user!
3
3
  def index
4
4
  end
@@ -0,0 +1,31 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>CustomizeAdmin</title>
5
+ <%%= stylesheet_link_tag "customize_admin/application" %>
6
+ <%%= javascript_include_tag "customize_admin/application" %>
7
+ <%%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <div class="topbar">
12
+ <div class="fill">
13
+ <div class="container">
14
+ <%%= link_to 'Created by CustomizeAdmin', '', :class => 'brand'%>
15
+ <div class="pull-right">
16
+ <%%= link_to 'Application'%>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ </div>
21
+
22
+
23
+ <div class="page">
24
+ <div class="container" >
25
+ <div class="content">
26
+ <%%= yield %>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ </body>
31
+ </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: customize_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-18 00:00:00.000000000 Z
12
+ date: 2012-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &13317000 !ruby/object:Gem::Requirement
16
+ requirement: &12403680 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 3.1.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *13317000
24
+ version_requirements: *12403680
25
25
  description: CustomizeAdmin.
26
26
  email:
27
27
  - cieslar.jakub@gmail.com
@@ -46,8 +46,8 @@ files:
46
46
  - app/controllers/customize_admin/application_controller.rb
47
47
  - app/controllers/customize_admin/base_controller.rb
48
48
  - app/assets/javascripts/customize_admin/bootstrap.js.coffee
49
+ - app/assets/javascripts/customize_admin/base.js
49
50
  - app/assets/javascripts/customize_admin/application.js
50
- - app/assets/javascripts/customize_admin/admin/base.js
51
51
  - app/assets/javascripts/customize_admin/admin/application.js
52
52
  - app/assets/images/customize_admin/down_arrow.gif
53
53
  - app/assets/images/customize_admin/up_arrow.gif
@@ -61,6 +61,7 @@ files:
61
61
  - lib/generators/customize_admin/scaffold/scaffold_generator.rb
62
62
  - lib/generators/customize_admin/scaffold/templates/controller_template.rb
63
63
  - lib/generators/customize_admin/scaffold/USAGE
64
+ - lib/generators/customize_admin/install/templates/devise_admin.html.erb
64
65
  - lib/generators/customize_admin/install/templates/dashboard_controller.rb
65
66
  - lib/generators/customize_admin/install/templates/index.html.erb
66
67
  - lib/generators/customize_admin/install/USAGE