Skip to content
This repository
Browse code

removing unused files

  • Loading branch information...
commit 7b3b483f00b73185637958823370c77af36036d4 1 parent 2f387f6
Subba Rao Pasupuleti authored March 06, 2013
1  .gitignore
@@ -7,6 +7,7 @@ response.html
7 7
 tags
8 8
 pkg
9 9
 .rvmrc
  10
+admindatademo/
10 11
 
11 12
 test/rails_root/tmp/**/*
12 13
 test/rails_root/log/*.*
2  Gemfile.lock
@@ -108,7 +108,7 @@ GEM
108 108
     treetop (1.4.12)
109 109
       polyglot
110 110
       polyglot (>= 0.3.1)
111  
-    tzinfo (0.3.35)
  111
+    tzinfo (0.3.36)
112 112
     will_paginate (3.0.4)
113 113
 
114 114
 PLATFORMS
13  app/controllers/admin_data/application_controller.rb
... ...
@@ -1,14 +1,17 @@
1 1
 module AdminData
2  
-
3 2
   class ApplicationController < ::ApplicationController
4 3
 
  4
+    layout 'admin_data'
  5
+
5 6
     before_filter :ensure_is_allowed_to_view
6 7
 
7 8
     helper_method :is_allowed_to_update?
8 9
 
9  
-    layout 'admin_data'
10 10
 
11  
-    before_filter :build_klasses, :build_drop_down_for_klasses, :check_page_parameter, :prepare_drop_down_klasses
  11
+    before_filter :build_klasses, 
  12
+      :build_drop_down_for_klasses, 
  13
+      :check_page_parameter, 
  14
+      :prepare_drop_down_klasses
12 15
 
13 16
     attr_reader :klass
14 17
 
@@ -73,8 +76,8 @@ def get_klass_names(model_names)
73 76
     end
74 77
 
75 78
     def build_drop_down_for_klasses
76  
-      @drop_down_for_klasses = @klasses.inject([]) do |result, klass|
77  
-        result << [klass.name.underscore, admin_data_search_url(:klass => klass.name.underscore)]
  79
+      @drop_down_for_klasses = ModelFinder.models.inject([]) do |result, klass|
  80
+        result << [klass, search_url(:klass => klass)]
78 81
       end
79 82
     end
80 83
 
7  app/controllers/admin_data/home_controller.rb
... ...
@@ -1,13 +1,8 @@
1 1
 module AdminData
2 2
   class HomeController < ApplicationController
3  
-
4  
-    layout 'admin_data'
  3
+    respond_to :html
5 4
 
6 5
     def index
7  
-      respond_to do |format|
8  
-        format.html
9  
-      end
10 6
     end
11  
-
12 7
   end
13 8
 end
6  app/helpers/admin_data/application_helper.rb
@@ -11,7 +11,7 @@ def get_sort_order(column)
11 11
 
12 12
     def get_sort_title_with_url(column, klass)
13 13
       order = get_sort_order(column)
14  
-      link_to column_title(klass, column), admin_data_search_path(:klass => klass, :query => params[:query], :sortby => order)
  14
+      link_to column_title(klass, column), search_path(:klass => klass, :query => params[:query], :sortby => order)
15 15
     end
16 16
 
17 17
     def get_sort_class(column)
@@ -112,7 +112,7 @@ def has_many_data(model, klass)
112 112
           output = label
113 113
           if count > 0
114 114
             has_many_klass_name = ActiveRecordUtil.new(model.class).klass_for_association_type_and_name(:has_many, m).name.underscore
115  
-            output = link_to(label, admin_data_search_path(  :klass => has_many_klass_name,
  115
+            output = link_to(label, search_path(  :klass => has_many_klass_name,
116 116
             :children => m,
117 117
             :base => klass.name.underscore,
118 118
             :model_id => model.id))
@@ -148,7 +148,7 @@ def habtm_data(model, klass)
148 148
 
149 149
           if count > 0 then
150 150
             has_many_klass_name = ActiveRecordUtil.new(model.class).klass_for_association_type_and_name(:has_and_belongs_to_many, assoc_name).name.underscore
151  
-            output = link_to(label, admin_data_search_path(  :klass => has_many_klass_name,
  151
+            output = link_to(label, search_path(  :klass => has_many_klass_name,
152 152
             :children => assoc_name,
153 153
             :base => klass.name.underscore,
154 154
             :model_id => model.id))
4  app/views/admin_data/search/search/_search_form.html.erb
... ...
@@ -1,4 +1,4 @@
1  
-<%= form_tag(admin_data_search_path(:klass => klass),  :method => 'get', :class => 'form search_form', :id => 'search') %>
  1
+<%= form_tag(search_path(klass: klass),  method: 'get', class: 'form search_form', id: 'search')  do %>
2 2
 
3 3
   <div class='search_box'>
4 4
     <div id='quick_search'>
@@ -9,7 +9,7 @@
9 9
     </div>
10 10
   </div>
11 11
 
12  
-</form>
  12
+<% end %>
13 13
 
14 14
 <br />
15 15
 
1  app/views/admin_data/shared/_drop_down_klasses.html.erb
... ...
@@ -1,5 +1,4 @@
1 1
 <select class='drop_down_value_klass' id='drop_down_klasses'> 
2 2
   <option></option>
3 3
   <%= options_for_select(drop_down_for_klasses, @drop_down_url) %> 
4  
-  <option value="<%=admin_data_migration_information_path%>">Migration Information</option>
5 4
 </select>
14  app/views/admin_data/shared/_secondary_navigation.html.erb
... ...
@@ -1,32 +1,26 @@
1 1
 <%
2 2
   quick_search_tab_active = params[:action] == 'quick_search' ? 'active' : ''
3 3
   advance_search_tab_active = params[:action] == 'advance_search' ? 'active' : ''
4  
-  analytics_tab_active = params[:controller] == 'admin_data/analytics' ? 'active' : ''
5 4
   table_structure_tab_active = params[:controller] == 'admin_data/table_structure' ? 'active' : ''
6 5
   add_new_record_tab_active = %w(new create).include?(params[:action]) ? 'active' : ''
7 6
 %>
8 7
 <ul>
9 8
 
10 9
   <li class="first <%=quick_search_tab_active%>">
11  
-    <%= link_to 'Quick Search', admin_data_search_path(:klass => klass.name.underscore) %>
  10
+    <%= link_to 'Quick Search', search_path(:klass => klass.name.underscore) %>
12 11
   </li>
13 12
 
14 13
   <li class="<%=advance_search_tab_active%>">
15  
-    <%= link_to 'Advance Search', admin_data_advance_search_path(:klass => klass.name.underscore)  %>
16  
-  </li>
17  
-
18  
-  <li class="<%=analytics_tab_active%>">
19  
-    <%= link_to 'Analytics', admin_data_daily_analytics_path(:klass => klass.name.underscore)  %>
  14
+    <%= link_to 'Advance Search', advance_search_path(:klass => klass.name.underscore)  %>
20 15
   </li>
21 16
 
22 17
   <li class="<%=table_structure_tab_active%>">
23  
-    <%= link_to 'Table Structure', admin_data_table_structure_path(:klass => klass.name.underscore) %>
  18
+    <%= link_to 'Table Structure', table_structure_path(:klass => klass.name.underscore) %>
24 19
   </li>
25 20
 
26 21
   <% if is_allowed_to_update? %>
27 22
     <li class="<%=add_new_record_tab_active%>">
28  
-      <%= link_to '+Add New Record', admin_data_new_path(:klass => klass.name.underscore) %>
  23
+      <%= link_to '+Add New Record', new_path(:klass => klass.name.underscore) %>
29 24
     </li>
30 25
   <% end %>
31  
-
32 26
 </ul>
33  config/routes.rb
... ...
@@ -1,2 +1,35 @@
1 1
 AdminData::Engine.routes.draw do
  2
+
  3
+  controller "crud" do
  4
+    match '/klass/(:klass)',        to: :index,            :as => :index,   :via => :get
  5
+    match '/klass/(:klass)',        to: :create,           :as => :index,   :via => :post
  6
+    match '/klass/:klass/new',      to: :new,              :as => :new,     :via => :get
  7
+    match '/klass/:klass/:id/del',  to: :del,              :as => :del,     :via => :delete
  8
+    match '/klass/:klass/:id/edit', to: :edit,             :as => :edit,    :via => :get
  9
+    match '/klass/:klass/:id',      to: :show,             :via => :get
  10
+    match '/klass/:klass/:id',      to: :update,           :via => :put
  11
+    match '/klass/:klass/:id',      to: :destroy,          :via => :delete
  12
+  end
  13
+
  14
+  controller "migration" do
  15
+    match '/migration', to: :index,  as: :migration_information
  16
+    match '/jstest',    to: :jstest, as: :jstest
  17
+  end
  18
+
  19
+  match '/table_structure/:klass' => "table_structure#index",  :as => :table_structure
  20
+
  21
+  match '/quick_search/:klass'  => "search#quick_search",    :as => :search
  22
+  match '/quick_search'           => "search#quick_search"
  23
+
  24
+  match '/advance_search/:klass'  => "search#advance_search",  :as => :advance_search
  25
+  match '/advance_search'         => "search#advance_search"
  26
+
  27
+  match '/analytics/daily/:klass'       => "analytics#daily",        :as => :daily_analytics
  28
+  match '/analytics/monthly/:klass'     => "analytics#monthly",      :as => :monthly_analytics
  29
+
  30
+  match '/feed/:klasss'           => "feed#index", :defaults => { :format =>'rss' }, :as => :feed
  31
+
  32
+  match '/public/*file'           => "public#serve", :as => :public
  33
+
  34
+  root :to => "home#index"
2 35
 end
11  lib/admin_data.rb
... ...
@@ -1,16 +1,16 @@
1 1
 require 'admin_data/rails_version_check'
2 2
 require 'will_paginate'
3 3
 
  4
+require 'admin_data/engine'
  5
+
4 6
 module AdminData
5 7
   extend ActiveSupport::Autoload
6 8
 
7  
-  LIBPATH = File.dirname(__FILE__)
8  
-
9  
-
10 9
   class NoCreatedAtColumnException < Exception 
11  
-  end
12 10
 
  11
+  end
13 12
 
  13
+  LIBPATH = File.dirname(__FILE__)
14 14
 
15 15
   autoload :Configuration
16 16
   autoload :Util
@@ -24,7 +24,4 @@ class NoCreatedAtColumnException < Exception
24 24
   autoload :ModelFinder
25 25
 
26 26
   include SetupConfig
27  
-
28 27
 end
29  
-
30  
-require 'admin_data/railtie'
12  lib/admin_data/engine.rb
... ...
@@ -1,5 +1,17 @@
1 1
 module AdminData
2 2
   class Engine < ::Rails::Engine
3 3
     isolate_namespace AdminData
  4
+
  5
+    initializer "admin_data precompile hook" do |app|
  6
+      app.config.assets.precompile += [
  7
+        'advance_search/*',
  8
+        'analytics/*',
  9
+        'misc/*',
  10
+        'vendor/*',
  11
+        'vendor/jquery-ui-1.7.2.custom.css',
  12
+        'admin_data.js',
  13
+        'admin_data.css'
  14
+      ]
  15
+    end
4 16
   end
5 17
 end
21  lib/admin_data/railtie.rb
... ...
@@ -1,21 +0,0 @@
1  
-module AdminData
2  
-  class Engine < Rails::Engine
3  
-
4  
-    initializer "admin_data precompile hook" do |app|
5  
-      app.config.assets.precompile += [
6  
-        'advance_search/*',
7  
-        'analytics/*',
8  
-        'misc/*',
9  
-        'vendor/*',
10  
-        'vendor/jquery-ui-1.7.2.custom.css',
11  
-        'admin_data.js',
12  
-        'admin_data.css'
13  
-      ]
14  
-    end
15  
-
16  
-    rake_tasks do
17  
-      #
18  
-    end
19  
-
20  
-  end
21  
-end

0 notes on commit 7b3b483

Please sign in to comment.
Something went wrong with that request. Please try again.