Permalink
Browse files

removing unused files

  • Loading branch information...
subbarao committed Mar 7, 2013
1 parent 2f387f6 commit 7b3b483f00b73185637958823370c77af36036d4
View
@@ -7,6 +7,7 @@ response.html
tags
pkg
.rvmrc
+admindatademo/
test/rails_root/tmp/**/*
test/rails_root/log/*.*
View
@@ -108,7 +108,7 @@ GEM
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.35)
+ tzinfo (0.3.36)
will_paginate (3.0.4)
PLATFORMS
@@ -1,14 +1,17 @@
module AdminData
-
class ApplicationController < ::ApplicationController
+ layout 'admin_data'
+
before_filter :ensure_is_allowed_to_view
helper_method :is_allowed_to_update?
- layout 'admin_data'
- before_filter :build_klasses, :build_drop_down_for_klasses, :check_page_parameter, :prepare_drop_down_klasses
+ before_filter :build_klasses,
+ :build_drop_down_for_klasses,
+ :check_page_parameter,
+ :prepare_drop_down_klasses
attr_reader :klass
@@ -73,8 +76,8 @@ def get_klass_names(model_names)
end
def build_drop_down_for_klasses
- @drop_down_for_klasses = @klasses.inject([]) do |result, klass|
- result << [klass.name.underscore, admin_data_search_url(:klass => klass.name.underscore)]
+ @drop_down_for_klasses = ModelFinder.models.inject([]) do |result, klass|
+ result << [klass, search_url(:klass => klass)]
end
end
@@ -1,13 +1,8 @@
module AdminData
class HomeController < ApplicationController
-
- layout 'admin_data'
+ respond_to :html
def index
- respond_to do |format|
- format.html
- end
end
-
end
end
@@ -11,7 +11,7 @@ def get_sort_order(column)
def get_sort_title_with_url(column, klass)
order = get_sort_order(column)
- link_to column_title(klass, column), admin_data_search_path(:klass => klass, :query => params[:query], :sortby => order)
+ link_to column_title(klass, column), search_path(:klass => klass, :query => params[:query], :sortby => order)
end
def get_sort_class(column)
@@ -112,7 +112,7 @@ def has_many_data(model, klass)
output = label
if count > 0
has_many_klass_name = ActiveRecordUtil.new(model.class).klass_for_association_type_and_name(:has_many, m).name.underscore
- output = link_to(label, admin_data_search_path( :klass => has_many_klass_name,
+ output = link_to(label, search_path( :klass => has_many_klass_name,
:children => m,
:base => klass.name.underscore,
:model_id => model.id))
@@ -148,7 +148,7 @@ def habtm_data(model, klass)
if count > 0 then
has_many_klass_name = ActiveRecordUtil.new(model.class).klass_for_association_type_and_name(:has_and_belongs_to_many, assoc_name).name.underscore
- output = link_to(label, admin_data_search_path( :klass => has_many_klass_name,
+ output = link_to(label, search_path( :klass => has_many_klass_name,
:children => assoc_name,
:base => klass.name.underscore,
:model_id => model.id))
@@ -1,4 +1,4 @@
-<%= form_tag(admin_data_search_path(:klass => klass), :method => 'get', :class => 'form search_form', :id => 'search') %>
+<%= form_tag(search_path(klass: klass), method: 'get', class: 'form search_form', id: 'search') do %>
<div class='search_box'>
<div id='quick_search'>
@@ -9,7 +9,7 @@
</div>
</div>
-</form>
+<% end %>
<br />
@@ -1,5 +1,4 @@
<select class='drop_down_value_klass' id='drop_down_klasses'>
<option></option>
<%= options_for_select(drop_down_for_klasses, @drop_down_url) %>
- <option value="<%=admin_data_migration_information_path%>">Migration Information</option>
</select>
@@ -1,32 +1,26 @@
<%
quick_search_tab_active = params[:action] == 'quick_search' ? 'active' : ''
advance_search_tab_active = params[:action] == 'advance_search' ? 'active' : ''
- analytics_tab_active = params[:controller] == 'admin_data/analytics' ? 'active' : ''
table_structure_tab_active = params[:controller] == 'admin_data/table_structure' ? 'active' : ''
add_new_record_tab_active = %w(new create).include?(params[:action]) ? 'active' : ''
%>
<ul>
<li class="first <%=quick_search_tab_active%>">
- <%= link_to 'Quick Search', admin_data_search_path(:klass => klass.name.underscore) %>
+ <%= link_to 'Quick Search', search_path(:klass => klass.name.underscore) %>
</li>
<li class="<%=advance_search_tab_active%>">
- <%= link_to 'Advance Search', admin_data_advance_search_path(:klass => klass.name.underscore) %>
- </li>
-
- <li class="<%=analytics_tab_active%>">
- <%= link_to 'Analytics', admin_data_daily_analytics_path(:klass => klass.name.underscore) %>
+ <%= link_to 'Advance Search', advance_search_path(:klass => klass.name.underscore) %>
</li>
<li class="<%=table_structure_tab_active%>">
- <%= link_to 'Table Structure', admin_data_table_structure_path(:klass => klass.name.underscore) %>
+ <%= link_to 'Table Structure', table_structure_path(:klass => klass.name.underscore) %>
</li>
<% if is_allowed_to_update? %>
<li class="<%=add_new_record_tab_active%>">
- <%= link_to '+Add New Record', admin_data_new_path(:klass => klass.name.underscore) %>
+ <%= link_to '+Add New Record', new_path(:klass => klass.name.underscore) %>
</li>
<% end %>
-
</ul>
View
@@ -1,2 +1,35 @@
AdminData::Engine.routes.draw do
+
+ controller "crud" do
+ match '/klass/(:klass)', to: :index, :as => :index, :via => :get
+ match '/klass/(:klass)', to: :create, :as => :index, :via => :post
+ match '/klass/:klass/new', to: :new, :as => :new, :via => :get
+ match '/klass/:klass/:id/del', to: :del, :as => :del, :via => :delete
+ match '/klass/:klass/:id/edit', to: :edit, :as => :edit, :via => :get
+ match '/klass/:klass/:id', to: :show, :via => :get
+ match '/klass/:klass/:id', to: :update, :via => :put
+ match '/klass/:klass/:id', to: :destroy, :via => :delete
+ end
+
+ controller "migration" do
+ match '/migration', to: :index, as: :migration_information
+ match '/jstest', to: :jstest, as: :jstest
+ end
+
+ match '/table_structure/:klass' => "table_structure#index", :as => :table_structure
+
+ match '/quick_search/:klass' => "search#quick_search", :as => :search
+ match '/quick_search' => "search#quick_search"
+
+ match '/advance_search/:klass' => "search#advance_search", :as => :advance_search
+ match '/advance_search' => "search#advance_search"
+
+ match '/analytics/daily/:klass' => "analytics#daily", :as => :daily_analytics
+ match '/analytics/monthly/:klass' => "analytics#monthly", :as => :monthly_analytics
+
+ match '/feed/:klasss' => "feed#index", :defaults => { :format =>'rss' }, :as => :feed
+
+ match '/public/*file' => "public#serve", :as => :public
+
+ root :to => "home#index"
end
View
@@ -1,16 +1,16 @@
require 'admin_data/rails_version_check'
require 'will_paginate'
+require 'admin_data/engine'
+
module AdminData
extend ActiveSupport::Autoload
- LIBPATH = File.dirname(__FILE__)
-
-
class NoCreatedAtColumnException < Exception
- end
+ end
+ LIBPATH = File.dirname(__FILE__)
autoload :Configuration
autoload :Util
@@ -24,7 +24,4 @@ class NoCreatedAtColumnException < Exception
autoload :ModelFinder
include SetupConfig
-
end
-
-require 'admin_data/railtie'
View
@@ -1,5 +1,17 @@
module AdminData
class Engine < ::Rails::Engine
isolate_namespace AdminData
+
+ initializer "admin_data precompile hook" do |app|
+ app.config.assets.precompile += [
+ 'advance_search/*',
+ 'analytics/*',
+ 'misc/*',
+ 'vendor/*',
+ 'vendor/jquery-ui-1.7.2.custom.css',
+ 'admin_data.js',
+ 'admin_data.css'
+ ]
+ end
end
end
View
@@ -1,21 +0,0 @@
-module AdminData
- class Engine < Rails::Engine
-
- initializer "admin_data precompile hook" do |app|
- app.config.assets.precompile += [
- 'advance_search/*',
- 'analytics/*',
- 'misc/*',
- 'vendor/*',
- 'vendor/jquery-ui-1.7.2.custom.css',
- 'admin_data.js',
- 'admin_data.css'
- ]
- end
-
- rake_tasks do
- #
- end
-
- end
-end

0 comments on commit 7b3b483

Please sign in to comment.