admin_data 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. data/History.txt +221 -0
  2. data/README.textile +21 -0
  3. data/Rakefile +46 -0
  4. data/app/controllers/admin_data/base_controller.rb +114 -0
  5. data/app/controllers/admin_data/diagnostic_controller.rb +28 -0
  6. data/app/controllers/admin_data/feed_controller.rb +17 -0
  7. data/app/controllers/admin_data/main_controller.rb +132 -0
  8. data/app/controllers/admin_data/migration_controller.rb +19 -0
  9. data/app/controllers/admin_data/search_controller.rb +125 -0
  10. data/app/controllers/admin_data/validate_model_controller.rb +106 -0
  11. data/app/views/admin_data/diagnostic/index.html.erb +17 -0
  12. data/app/views/admin_data/diagnostic/missing_index.html.erb +26 -0
  13. data/app/views/admin_data/feed/index.rss.builder +24 -0
  14. data/app/views/admin_data/main/all_models.html.erb +22 -0
  15. data/app/views/admin_data/main/association/_association_info.html.erb +10 -0
  16. data/app/views/admin_data/main/association/_belongs_to_info.html.erb +7 -0
  17. data/app/views/admin_data/main/association/_has_many_info.html.erb +7 -0
  18. data/app/views/admin_data/main/association/_has_one_info.html.erb +6 -0
  19. data/app/views/admin_data/main/edit.html.erb +38 -0
  20. data/app/views/admin_data/main/misc/_form.html.erb +25 -0
  21. data/app/views/admin_data/main/misc/_modify_record.html.erb +22 -0
  22. data/app/views/admin_data/main/new.html.erb +23 -0
  23. data/app/views/admin_data/main/show.html.erb +41 -0
  24. data/app/views/admin_data/main/table_structure.html.erb +55 -0
  25. data/app/views/admin_data/migration/index.html.erb +18 -0
  26. data/app/views/admin_data/migration/jstest.html.erb +51 -0
  27. data/app/views/admin_data/search/_search_base.html.erb +34 -0
  28. data/app/views/admin_data/search/advance_search.html.erb +3 -0
  29. data/app/views/admin_data/search/quick_search.html.erb +6 -0
  30. data/app/views/admin_data/search/search/_advance_search_form.html.erb +48 -0
  31. data/app/views/admin_data/search/search/_errors.html.erb +5 -0
  32. data/app/views/admin_data/search/search/_listing.html.erb +40 -0
  33. data/app/views/admin_data/search/search/_search_form.html.erb +28 -0
  34. data/app/views/admin_data/search/search/_sortby.html.erb +18 -0
  35. data/app/views/admin_data/search/search/_title.html.erb +34 -0
  36. data/app/views/admin_data/shared/_breadcrum.html.erb +10 -0
  37. data/app/views/admin_data/shared/_drop_down_klasses.html.erb +4 -0
  38. data/app/views/admin_data/shared/_flash_message.html.erb +13 -0
  39. data/app/views/admin_data/shared/_header.html.erb +23 -0
  40. data/app/views/admin_data/shared/_powered_by.html.erb +23 -0
  41. data/app/views/admin_data/shared/_secondary_navigation.html.erb +28 -0
  42. data/app/views/admin_data/validate_model/_bad.html.erb +1 -0
  43. data/app/views/admin_data/validate_model/tid.html.erb +2 -0
  44. data/app/views/admin_data/validate_model/validate.html.erb +67 -0
  45. data/app/views/layouts/admin_data.html.erb +60 -0
  46. data/config/routes.rb +34 -0
  47. data/init.rb +1 -0
  48. data/lib/admin_data.rb +34 -0
  49. data/lib/admin_data/chelper.rb +37 -0
  50. data/lib/admin_data/compatibility.rb +7 -0
  51. data/lib/admin_data/helpers.rb +222 -0
  52. data/lib/admin_data/railtie.rb +21 -0
  53. data/lib/admin_data/search.rb +186 -0
  54. data/lib/admin_data/settings.rb +72 -0
  55. data/lib/admin_data/util.rb +237 -0
  56. data/lib/admin_data/version.rb +3 -0
  57. data/lib/admin_data_date_validation.rb +79 -0
  58. data/lib/css/app.css +224 -0
  59. data/lib/css/base.css +1071 -0
  60. data/lib/css/header.css +65 -0
  61. data/lib/css/rounded.css +18 -0
  62. data/lib/css/themes/drastic-dark/style.css +374 -0
  63. data/lib/css/umbrella.css +34 -0
  64. data/lib/css/vendor/images/ui-bg_diagonals-thick_75_f3d8d8_40x40.png +0 -0
  65. data/lib/css/vendor/images/ui-bg_dots-small_65_a6a6a6_2x2.png +0 -0
  66. data/lib/css/vendor/images/ui-bg_flat_0_333333_40x100.png +0 -0
  67. data/lib/css/vendor/images/ui-bg_flat_65_ffffff_40x100.png +0 -0
  68. data/lib/css/vendor/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  69. data/lib/css/vendor/images/ui-bg_glass_55_fbf8ee_1x400.png +0 -0
  70. data/lib/css/vendor/images/ui-bg_highlight-hard_100_eeeeee_1x100.png +0 -0
  71. data/lib/css/vendor/images/ui-bg_highlight-hard_100_f6f6f6_1x100.png +0 -0
  72. data/lib/css/vendor/images/ui-bg_highlight-soft_15_cc0000_1x100.png +0 -0
  73. data/lib/css/vendor/images/ui-icons_004276_256x240.png +0 -0
  74. data/lib/css/vendor/images/ui-icons_cc0000_256x240.png +0 -0
  75. data/lib/css/vendor/images/ui-icons_ffffff_256x240.png +0 -0
  76. data/lib/css/vendor/jquery-ui-1.7.2.custom.css +406 -0
  77. data/lib/css/vendor/qunit.css +119 -0
  78. data/lib/js/advance_search/act_on_result.js +47 -0
  79. data/lib/js/advance_search/adv_search.js +46 -0
  80. data/lib/js/advance_search/advance_search.js +60 -0
  81. data/lib/js/advance_search/advance_search_structure.js +79 -0
  82. data/lib/js/advance_search/ajaxify_advance_search.js +28 -0
  83. data/lib/js/advance_search/build_first_row.js +12 -0
  84. data/lib/js/advance_search/event_bindings.js +87 -0
  85. data/lib/js/advance_search/global_ajax_setting.js +10 -0
  86. data/lib/js/advance_search/trigger_submit_on_domready.js +6 -0
  87. data/lib/js/misc/drop_down_change.js +8 -0
  88. data/lib/js/misc/js_util.js +42 -0
  89. data/lib/js/misc/quick_search_input_focus.js +6 -0
  90. data/lib/js/test/act_on_result.js +120 -0
  91. data/lib/js/test/advance_search.js +80 -0
  92. data/lib/js/test/ajaxify_advance_search.js +29 -0
  93. data/lib/js/test/build_first_row.js +10 -0
  94. data/lib/js/test/event_bindings.js +100 -0
  95. data/lib/js/validate_model/ajaxify_form.js +66 -0
  96. data/lib/js/validate_model/select_all.js +15 -0
  97. data/lib/js/vendor/jack.js +903 -0
  98. data/lib/js/vendor/jquery-1.4.1.js +6078 -0
  99. data/lib/js/vendor/jquery-ui-1.7.2.custom.min.js +298 -0
  100. data/lib/js/vendor/jquery.ba-isjquery.js +21 -0
  101. data/lib/js/vendor/jquery.form.js +814 -0
  102. data/lib/js/vendor/jquery.lint.js +604 -0
  103. data/lib/js/vendor/log.js +9 -0
  104. data/lib/js/vendor/qunit.js +1043 -0
  105. data/lib/tasks/admin_data_tasks.rake +7 -0
  106. data/lib/tasks/validate_models_bg.rake +23 -0
  107. data/test/factories/article.rb +9 -0
  108. data/test/factories/car.rb +4 -0
  109. data/test/factories/city.rb +4 -0
  110. data/test/factories/comment.rb +6 -0
  111. data/test/factories/door.rb +4 -0
  112. data/test/factories/engine.rb +4 -0
  113. data/test/functional/base_controller_test.rb +5 -0
  114. data/test/functional/feed_controller_test.rb +34 -0
  115. data/test/functional/main_controller_test.rb +421 -0
  116. data/test/functional/migration_controller_test.rb +30 -0
  117. data/test/functional/routes_test.rb +61 -0
  118. data/test/functional/search_controller_test.rb +814 -0
  119. data/test/helper/view_helper_test.rb +177 -0
  120. data/test/misc_tests/date_validation_test.rb +32 -0
  121. data/test/misc_tests/settings_test.rb +29 -0
  122. data/test/misc_tests/util_test.rb +83 -0
  123. data/test/rails_root/Gemfile +22 -0
  124. data/test/rails_root/Gemfile.lock +101 -0
  125. data/test/rails_root/Rakefile +7 -0
  126. data/test/rails_root/app/controllers/application_controller.rb +3 -0
  127. data/test/rails_root/app/helpers/application_helper.rb +2 -0
  128. data/test/rails_root/app/models/article.rb +25 -0
  129. data/test/rails_root/app/models/city.rb +15 -0
  130. data/test/rails_root/app/models/comment.rb +13 -0
  131. data/test/rails_root/app/models/tech_magazine.rb +2 -0
  132. data/test/rails_root/app/models/vehicle/car.rb +4 -0
  133. data/test/rails_root/app/models/vehicle/door.rb +3 -0
  134. data/test/rails_root/app/models/vehicle/engine.rb +3 -0
  135. data/test/rails_root/app/views/layouts/application.html.erb +14 -0
  136. data/test/rails_root/config.ru +4 -0
  137. data/test/rails_root/config/application.rb +42 -0
  138. data/test/rails_root/config/boot.rb +13 -0
  139. data/test/rails_root/config/database.yml +22 -0
  140. data/test/rails_root/config/environment.rb +5 -0
  141. data/test/rails_root/config/environments/development.rb +22 -0
  142. data/test/rails_root/config/environments/production.rb +49 -0
  143. data/test/rails_root/config/environments/test.rb +35 -0
  144. data/test/rails_root/config/initializers/backtrace_silencers.rb +7 -0
  145. data/test/rails_root/config/initializers/inflections.rb +10 -0
  146. data/test/rails_root/config/initializers/mime_types.rb +5 -0
  147. data/test/rails_root/config/initializers/secret_token.rb +7 -0
  148. data/test/rails_root/config/initializers/session_store.rb +8 -0
  149. data/test/rails_root/config/locales/en.yml +5 -0
  150. data/test/rails_root/config/routes.rb +58 -0
  151. data/test/rails_root/db/migrate/20090809061114_create_tables.rb +70 -0
  152. data/test/rails_root/db/schema.rb +74 -0
  153. data/test/rails_root/db/seeds.rb +7 -0
  154. data/test/rails_root/script/rails +6 -0
  155. data/test/rails_root/test/performance/browsing_test.rb +0 -0
  156. data/test/rails_root/test/test_helper.rb +13 -0
  157. data/test/support/assertions.rb +20 -0
  158. data/test/test_helper.rb +74 -0
  159. metadata +321 -0
@@ -0,0 +1,5 @@
1
+ <div>
2
+ <% errors.each do |error| %>
3
+ <p class='error'><%= error %></p>
4
+ <% end %>
5
+ </div>
@@ -0,0 +1,40 @@
1
+ <%= render :partial => 'admin_data/search/search/title', :locals => {
2
+ :records => records,
3
+ :total_num_of_children => @total_num_of_children } %>
4
+
5
+ <div class="pagination">
6
+ <%= will_paginate @records, :container => false, :params => {:klass => klass.name} %>
7
+ </div>
8
+ <div class='clear'></div>
9
+
10
+ <table cellspacing="3" cellpadding="3" id="view_table" class='table colorize'>
11
+
12
+ <thead>
13
+ <tr>
14
+ <% AdminData::Util.columns_order(klass.name).each do |column| %>
15
+ <th> <%= column %> </th>
16
+ <% end %>
17
+ </tr>
18
+ </thead>
19
+
20
+ <% @records.each do |record| %>
21
+ <tr>
22
+ <% AdminData::Util.columns_order(klass.name).each do |column| %>
23
+ <td>
24
+ <% if (column == klass.primary_key) %>
25
+ <%= link_to(record.send(column), admin_data_on_k_path(:klass => klass.name.underscore, :id => record)) %>
26
+ <% else %>
27
+ <%=h admin_data_get_value_for_column(admin_data_column_native(klass, column), record) %>
28
+ <% end %>
29
+ </td>
30
+ <% end %>
31
+ </tr>
32
+ <% end %>
33
+ </table>
34
+
35
+ <div class="pagination">
36
+ <%= will_paginate records, :container => false, :params => {:klass => klass.name.underscore} %>
37
+ </div>
38
+
39
+ <div class='clear'></div>
40
+
@@ -0,0 +1,28 @@
1
+ <%= form_tag(admin_data_search_path(:klass=>klass), :method => 'get', :class => 'form search_form', :id => 'search') %>
2
+
3
+ <div class='search_box'>
4
+ <div id='quick_search'>
5
+ <label class='label keyword_label'>search keyword</label>
6
+ <input type="text" id="quick_search_input" name="query" value="<%=params[:query]%>" />
7
+ <%= render :partial => 'admin_data/search/search/sortby', :locals => {:klass => klass} %>
8
+ <div class='clear'></div>
9
+ <%= submit_tag 'Search', :name => nil, :disable_with => 'searching ...', :class => 'submit_search' %>
10
+ </div>
11
+ </div>
12
+
13
+ </form>
14
+
15
+ <br />
16
+
17
+ <style>
18
+ .keyword_label {
19
+ float: left;
20
+ padding-right: 10px;
21
+ margin-right: 10px;
22
+ }
23
+ #quick_search_input {
24
+ float: left;
25
+ margin-left: 10px;
26
+ margin-right: 20px;
27
+ }
28
+ </style>
@@ -0,0 +1,18 @@
1
+ <label class='label sortby_label'>sort by</label>
2
+ <select name='sortby' id='sortby'>
3
+ <%= AdminData::Util.build_sort_options(klass, params[:sortby]).html_safe %>
4
+ </select>
5
+
6
+ <style>
7
+ .sortby_label {
8
+ float: left;
9
+ vertical-align: bottom;
10
+ margin-left: 40px;
11
+ width: 70px;
12
+ }
13
+ #sortyby {
14
+ width: 200px;
15
+ float: left;
16
+ }
17
+ </style>
18
+
@@ -0,0 +1,34 @@
1
+ <div>
2
+ <h2 class='title' id='search_result_title'>
3
+ <%=search_result_title(total_num_of_children, records)%>
4
+ </h2>
5
+
6
+ <% if admin_data_is_allowed_to_update? && params[:action] == 'advance_search' %>
7
+ <div class='delete_destroy_box'>
8
+ <span style=''>
9
+ <%= link_to 'Delete All', '#', :id => 'advance_search_delete_all' %>
10
+ </span>
11
+ |
12
+ <span>
13
+ <%= link_to 'Destroy All', '#', :id => 'advance_search_destroy_all' %>
14
+ </span>
15
+ </div>
16
+ <% end %>
17
+
18
+ <div class='clear'></div>
19
+
20
+ </div>
21
+
22
+ <style>
23
+ #search_result_title {
24
+ float: left;
25
+ margin-top: 5px;
26
+ padding-top: 5px;
27
+ }
28
+ .delete_destroy_box {
29
+ float: left;
30
+ margin-top: 6px;
31
+ padding-top: 6px;
32
+ margin-left: 20px;
33
+ }
34
+ </style>
@@ -0,0 +1,10 @@
1
+ <div class='breadcrum rounded'>
2
+ <%= link_to 'Home',admin_data_index_path %>
3
+ >
4
+ <%= data %>
5
+ <% if params[:klass] && !(params[:action] == 'show') %>
6
+ <span class='description'>
7
+ (<%= pluralize(@klass.count, 'record') %> )
8
+ </span>
9
+ <% end %>
10
+ </div>
@@ -0,0 +1,4 @@
1
+ <select class='drop_down_value_klass'>
2
+ <option></option>
3
+ <%= options_for_select(drop_down_for_klasses, @drop_down_url) %>
4
+ </select>
@@ -0,0 +1,13 @@
1
+ <% if model && model.errors.any? %>
2
+ <div class='flash rounded'>
3
+ <div class='message error'>
4
+ <% model.errors.full_messages.each do |message| %>
5
+ <p><%=message%></p>
6
+ <% end %>
7
+ </div>
8
+ </div>
9
+ <% end %>
10
+
11
+ <% if flash[:success] %>
12
+ <div class='flash rounded'><div class='message warning'><p><%= flash[:success] %></p></div></div>
13
+ <% end %>
@@ -0,0 +1,23 @@
1
+ <div id="header">
2
+ <h1>
3
+ <%= link_to 'admin_data', admin_data_index_path %>
4
+ </h1>
5
+
6
+ <ul id='subnav'>
7
+ <li>
8
+ <%= link_to 'Home', admin_data_index_path %>
9
+ </li>
10
+
11
+ <li>
12
+ <%= link_to 'Migration Information', admin_data_migration_information_path %>
13
+ </li>
14
+
15
+ </ul>
16
+
17
+ <div id='model_drop_down'>
18
+ <%= render '/admin_data/shared/drop_down_klasses', :drop_down_for_klasses => drop_down_for_klasses %>
19
+ </div>
20
+
21
+ <div class='clear'></div>
22
+
23
+ </div>
@@ -0,0 +1,23 @@
1
+ <div id="footer">
2
+ <p>
3
+ Powered by
4
+ <a href='http://github.com/neerajdotname/admin_data/tree/master' class='powered_by'>
5
+ admin_data
6
+ </a>
7
+ </p>
8
+
9
+ <p>
10
+ <a href='http://github.com/neerajdotname/admin_data/issues' class='powered_by'>
11
+ Report Bug
12
+ </a>
13
+ </p>
14
+
15
+ <p>
16
+ <a href='http://neerajdotname.github.com/admin_data' class='powered_by'>
17
+ Documentation
18
+ </a>
19
+ </p>
20
+
21
+ <div class='clear'></div>
22
+
23
+ </div>
@@ -0,0 +1,28 @@
1
+ <%
2
+ @quick_search_tab_active = params[:action] == 'quick_search' ? 'active' : ''
3
+ @advance_search_tab_active = params[:action] == 'advance_search' ? 'active' : ''
4
+ @table_structure_tab_active = params[:action] == 'table_structure' ? 'active' : ''
5
+ @add_new_record_tab_active = %w(new create).include?(params[:action]) ? 'active' : ''
6
+ %>
7
+
8
+ <ul>
9
+
10
+ <li class="first <%=@quick_search_tab_active%>">
11
+ <%= link_to 'Quick Search', admin_data_search_path(:klass => klass.name.underscore) %>
12
+ </li>
13
+
14
+ <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="<%=@table_structure_tab_active%>">
19
+ <%= link_to 'Table Structure', table_structure_admin_data_on_k_path(:klass => klass.name.underscore) %>
20
+ </li>
21
+
22
+ <% if admin_data_is_allowed_to_update? %>
23
+ <li class="<%=@add_new_record_tab_active%>">
24
+ <%= link_to '+Add New Record', new_admin_data_on_k_path(:klass => klass.name.underscore) %>
25
+ </li>
26
+ <% end %>
27
+
28
+ </ul>
@@ -0,0 +1 @@
1
+ <%=admin_data_invalid_record_link(klassu, id, error)%>
@@ -0,0 +1,2 @@
1
+ <%= AdminData::Util.read_validation_file(params[:tid], 'processing.txt') %>
2
+ <%=@data%>
@@ -0,0 +1,67 @@
1
+ <div id="main">
2
+ <div class="block" id="block-tables">
3
+
4
+ <div class="content rounded">
5
+ <div class='validate_model_umbrella'>
6
+
7
+ <div class='lhs'>
8
+ <h2 class="title">Validate model</h2>
9
+ <div id='error'></div>
10
+
11
+ <div id='tid' style='display:none'><%=@tid%></div>
12
+
13
+
14
+ <% form_tag "/admin_data/diagnostic/validate_model?tid=#{@tid}", :method => "post", :id => "validate_model_form" do |f| %>
15
+ <%= check_box_tag 'validate_model_select_all' %>
16
+ <strong>
17
+ <%= label_tag 'Select all models', nil, :for => 'validate_model_select_all' %>
18
+ </strong>
19
+ <% $admin_data_klasses.each do |klass| %>
20
+ <p>
21
+ <%= check_box_tag klass.name, '1', false, :name => "model[#{klass.name}]" %>
22
+ <%= label_tag klass.name, nil, :id => klass.name.downcase.underscore %>
23
+ </p>
24
+ <% end %>
25
+ <%= submit_tag('Start validation', :id => 'submit') %>
26
+ <% end %>
27
+
28
+ <h3>Previous runs</h3>
29
+ <%@tids.each do |tid| %>
30
+ <p><%= link_to tid, "/admin_data/diagnostic/tid/#{tid}" %></p>
31
+ <% end %>
32
+
33
+ </div>
34
+
35
+ <div class='rhs'>
36
+ <h2 id='validation_result'>
37
+ Validation result
38
+ </h2>
39
+ <div id='validate_model_rhs_data'></div>
40
+ </div>
41
+
42
+ <div class='clear'></div>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ </div>
47
+
48
+ <style>
49
+ .lhs {
50
+ float: left;
51
+ width: 300px;
52
+ }
53
+ .rhs {
54
+ float: left;
55
+ }
56
+ #error {
57
+ color: red;
58
+ font-size: 120%;
59
+ }
60
+ #validate_model_form {
61
+ padding: 10px;
62
+ }
63
+ #validation_result {
64
+ display: none;
65
+ margin-left: 0;
66
+ }
67
+ </style>
@@ -0,0 +1,60 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <title>
6
+ <%= @page_title.blank? ? 'admin_data' : "#{@page_title} - admin_data" %>
7
+ </title>
8
+
9
+ <%= AdminData::Util.google_hosted_jquery_ui_css(self).html_safe %>
10
+
11
+ <%= AdminData::Util.stylesheet_link_tag('base').html_safe %>
12
+
13
+ <%= AdminData::Util.google_hosted_jquery(self).html_safe %>
14
+
15
+ <!-- It is breaking the html markup and test is full of messages
16
+ like ignoring attempt to close string with script Hence not including jquery.form in test -->
17
+ <%= AdminData::Util.javascript_include_tag('vendor/jquery.form').html_safe unless Rails.env.test? %>
18
+
19
+ <%= AdminData::Util.javascript_include_tag('vendor/log',
20
+ 'misc/drop_down_change',
21
+ 'misc/quick_search_input_focus',
22
+ 'advance_search/global_ajax_setting',
23
+ 'misc/js_util').html_safe %>
24
+
25
+ <!-- assert_tag is throwing a lot of warning with these inline javascripts.
26
+ no need of these javascripts in test mode -->
27
+ <% if params[:action] == 'advance_search' && !Rails.env.test? %>
28
+ <%= AdminData::Util.javascript_include_tag(
29
+ 'advance_search/advance_search',
30
+ 'advance_search/advance_search_structure',
31
+ 'advance_search/ajaxify_advance_search',
32
+ 'advance_search/act_on_result',
33
+ 'advance_search/build_first_row',
34
+ 'advance_search/event_bindings',
35
+ 'advance_search/trigger_submit_on_domready'
36
+ ).html_safe %>
37
+ <% end %>
38
+
39
+ </head>
40
+
41
+ <body>
42
+ <noscript>
43
+ <div id="noscript-warning">JavaScript is disabled. A few things might not work properly.</div>
44
+ <br />
45
+ <br />
46
+ </noscript>
47
+ <div>
48
+ <%= render 'admin_data/shared/header', :drop_down_for_klasses => @drop_down_for_klasses %>
49
+ <div class='clear'></div>
50
+ </div>
51
+ <div id="container">
52
+ <div id="wrapper">
53
+ <%= yield %>
54
+ <div class="clear"></div>
55
+ </div>
56
+ <%= render :partial => 'admin_data/shared/powered_by' %>
57
+ </div>
58
+ </body>
59
+
60
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,34 @@
1
+ ActionController::Routing::Routes.draw do |map|
2
+
3
+ map.namespace(:admin_data) do |admin_data|
4
+
5
+ admin_data.with_options :controller => 'main' do |m|
6
+ m.index '/', :action => 'all_models'
7
+ end
8
+
9
+ admin_data.with_options :controller => 'migration' do |m|
10
+ m.migration_information '/migration', :action => 'index'
11
+ m.jstest '/jstest', :action => 'jstest'
12
+ end
13
+
14
+ admin_data.with_options :controller => 'feed' do |m|
15
+ m.feed '/feed/:klasss', :action => 'index',
16
+ :format => :rss
17
+ end
18
+
19
+ admin_data.with_options :controller => 'search' do |m|
20
+ m.search '/quick_search/:klass', :action => 'quick_search'
21
+ m.advance_search '/advance_search/:klass', :action => 'advance_search'
22
+ end
23
+
24
+
25
+ admin_data.resources :on_k,
26
+ :as => ':klass',
27
+ :path_prefix => 'admin_data/klass',
28
+ :controller => 'main',
29
+ :member => {:del => :delete},
30
+ :collection => {:table_structure => :get}
31
+
32
+ end
33
+
34
+ end
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require 'admin_data'
data/lib/admin_data.rb ADDED
@@ -0,0 +1,34 @@
1
+ begin
2
+ require 'will_paginate'
3
+ rescue LoadError => e
4
+ $stderr.puts %(
5
+ *************************************************************************************************
6
+ * *
7
+ * gem will_paginate is missing *
8
+ * plugin admin_data depends on will_paginate *
9
+ * Please install will_paginate by adding following line to Gemfile *
10
+ * gem 'will_paginate', :git => 'git://github.com/mislav/will_paginate.git', :branch => 'rails3' *
11
+ * *
12
+ *************************************************************************************************
13
+ )
14
+ end
15
+
16
+ module AdminData
17
+ end
18
+
19
+
20
+ if Rails.version >= '3.0'
21
+ require 'admin_data/railtie'
22
+ else
23
+ raise "Please see documentation at http://neerajdotname.github.com/admin_data to find out how to use this plugin with rails 2.3"
24
+ end
25
+
26
+ require 'admin_data_date_validation'
27
+ require 'admin_data/helpers'
28
+ require 'admin_data/chelper'
29
+ require 'admin_data/compatibility'
30
+ require 'admin_data/settings'
31
+ require 'admin_data/util'
32
+
33
+ AdminData::Config.initialize_defaults
34
+ ActionView::Base.send :include, AdminData::Helpers