the_jobbook_admin_data 1.3.0a
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +19 -0
- data/CHANGELOG.rdoc +284 -0
- data/Gemfile +22 -0
- data/Gemfile.lock +121 -0
- data/Guardfile +14 -0
- data/MIT-LICENSE +20 -0
- data/README.md +37 -0
- data/README.rdoc +3 -0
- data/Rakefile +40 -0
- data/admin_data.gemspec +23 -0
- data/app/assets/images/add.png +0 -0
- data/app/assets/images/admin_data/.gitkeep +0 -0
- data/app/assets/images/no.png +0 -0
- data/app/assets/images/site.png +0 -0
- data/app/assets/images/sort_by_asc.jpg +0 -0
- data/app/assets/images/sort_by_desc.jpg +0 -0
- data/app/assets/images/sort_by_nothing.jpg +0 -0
- data/app/assets/javascripts/admin_data.js +18 -0
- data/app/assets/javascripts/admin_data/application.js +15 -0
- data/app/assets/javascripts/advance_search/act_on_result.js +45 -0
- data/app/assets/javascripts/advance_search/advance_search.js +83 -0
- data/app/assets/javascripts/advance_search/advance_search_structure.js +79 -0
- data/app/assets/javascripts/advance_search/ajaxify_advance_search.js +28 -0
- data/app/assets/javascripts/advance_search/build_first_row.js +8 -0
- data/app/assets/javascripts/advance_search/event_bindings.js +76 -0
- data/app/assets/javascripts/advance_search/global_ajax_setting.js +10 -0
- data/app/assets/javascripts/advance_search/sortby.js +14 -0
- data/app/assets/javascripts/advance_search/trigger_submit_on_domready.js +6 -0
- data/app/assets/javascripts/analytics/report.js +7 -0
- data/app/assets/javascripts/misc/drop_down_change.js +8 -0
- data/app/assets/javascripts/misc/js_util.js +58 -0
- data/app/assets/javascripts/misc/quick_search_input_focus.js +6 -0
- data/app/assets/javascripts/vendor/jquery-1.4.2.js +6240 -0
- data/app/assets/javascripts/vendor/jquery-ui-1.7.2.custom.min.js +298 -0
- data/app/assets/javascripts/vendor/jquery.ba-isjquery.js +21 -0
- data/app/assets/javascripts/vendor/jquery_form.js +814 -0
- data/app/assets/javascripts/vendor/log.js +9 -0
- data/app/assets/javascripts/vendor/rails.js +132 -0
- data/app/assets/stylesheets/admin_data.css +1141 -0
- data/app/assets/stylesheets/admin_data/application.css +13 -0
- data/app/assets/stylesheets/vendor/jquery-ui-1.7.2.custom.css +406 -0
- data/app/controllers/admin_data/application_controller.rb +107 -0
- data/app/controllers/admin_data/crud_controller.rb +100 -0
- data/app/controllers/admin_data/feed_controller.rb +48 -0
- data/app/controllers/admin_data/home_controller.rb +8 -0
- data/app/controllers/admin_data/migration_controller.rb +18 -0
- data/app/controllers/admin_data/public_controller.rb +28 -0
- data/app/controllers/admin_data/search_controller.rb +143 -0
- data/app/controllers/admin_data/table_structure_controller.rb +25 -0
- data/app/helpers/admin_data/application_helper.rb +320 -0
- data/app/views/admin_data/crud/association/_association_info.html.erb +11 -0
- data/app/views/admin_data/crud/association/_belongs_to_info.html.erb +7 -0
- data/app/views/admin_data/crud/association/_habtm_info.html.erb +7 -0
- data/app/views/admin_data/crud/association/_has_many_info.html.erb +7 -0
- data/app/views/admin_data/crud/association/_has_one_info.html.erb +6 -0
- data/app/views/admin_data/crud/edit.html.erb +36 -0
- data/app/views/admin_data/crud/misc/_form.html.erb +38 -0
- data/app/views/admin_data/crud/misc/_modify_record.html.erb +18 -0
- data/app/views/admin_data/crud/new.html.erb +25 -0
- data/app/views/admin_data/crud/show.html.erb +42 -0
- data/app/views/admin_data/feed/index.rss.builder +25 -0
- data/app/views/admin_data/home/index.html.erb +21 -0
- data/app/views/admin_data/migration/index.html.erb +18 -0
- data/app/views/admin_data/migration/jstest.html.erb +51 -0
- data/app/views/admin_data/search/advance_search.html.erb +1 -0
- data/app/views/admin_data/search/quick_search.html.erb +1 -0
- data/app/views/admin_data/search/search/_advance_search_form.html.erb +52 -0
- data/app/views/admin_data/search/search/_errors.html.erb +5 -0
- data/app/views/admin_data/search/search/_listing.html.erb +43 -0
- data/app/views/admin_data/search/search/_search_form.html.erb +27 -0
- data/app/views/admin_data/search/search/_title.html.erb +34 -0
- data/app/views/admin_data/shared/_breadcrum.html.erb +16 -0
- data/app/views/admin_data/shared/_drop_down_klasses.html.erb +4 -0
- data/app/views/admin_data/shared/_flash_message.html.erb +13 -0
- data/app/views/admin_data/shared/_header.html.erb +20 -0
- data/app/views/admin_data/shared/_powered_by.html.erb +6 -0
- data/app/views/admin_data/shared/_secondary_navigation.html.erb +26 -0
- data/app/views/admin_data/table_structure/index.html.erb +54 -0
- data/app/views/layouts/admin_data.html.erb +34 -0
- data/app/views/layouts/admin_data/application.html.erb +14 -0
- data/app/views/layouts/search.html.erb +71 -0
- data/config/routes.rb +32 -0
- data/lib/admin_data.rb +27 -0
- data/lib/admin_data/active_record_util.rb +102 -0
- data/lib/admin_data/analytics.rb +176 -0
- data/lib/admin_data/authenticator.rb +15 -0
- data/lib/admin_data/config.rb +38 -0
- data/lib/admin_data/configuration.rb +127 -0
- data/lib/admin_data/date_util.rb +58 -0
- data/lib/admin_data/engine.rb +17 -0
- data/lib/admin_data/model_finder.rb +15 -0
- data/lib/admin_data/rails_version_check.rb +8 -0
- data/lib/admin_data/search.rb +188 -0
- data/lib/admin_data/setup_config.rb +24 -0
- data/lib/admin_data/util.rb +102 -0
- data/lib/admin_data/version.rb +3 -0
- data/lib/tasks/admin_data_tasks.rake +4 -0
- data/script/rails +8 -0
- data/test/admin_data_test.rb +7 -0
- data/test/dummy/README.md +19 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +5 -0
- data/test/dummy/app/models/user.rb +3 -0
- data/test/dummy/app/models/user/student.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +15 -0
- data/test/dummy/config/boot.rb +13 -0
- data/test/dummy/config/cucumber.yml +9 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/database.yml.mysql +22 -0
- data/test/dummy/config/database.yml.pg +15 -0
- data/test/dummy/config/database.yml.sqlite3 +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +22 -0
- data/test/dummy/config/environments/production.rb +49 -0
- data/test/dummy/config/environments/test.rb +35 -0
- data/test/dummy/config/initializers/admin_data.rb +15 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/empty_spaces_to_nil.rb +10 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +9 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20091030202259_create_tables.rb +72 -0
- data/test/dummy/db/production.sqlite3 +1 -0
- data/test/dummy/db/schema.rb +23 -0
- data/test/dummy/db/seeds.rb +40 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/features/advance_search/boolean.feature +74 -0
- data/test/dummy/features/advance_search/datetime.feature +101 -0
- data/test/dummy/features/advance_search/delete_all.feature +20 -0
- data/test/dummy/features/advance_search/destroy_all.feature +20 -0
- data/test/dummy/features/advance_search/integer.feature +69 -0
- data/test/dummy/features/advance_search/multiple_rows.feature +87 -0
- data/test/dummy/features/advance_search/string.feature +130 -0
- data/test/dummy/features/crud.feature +50 -0
- data/test/dummy/features/crud_show.feature +56 -0
- data/test/dummy/features/feed.feature +13 -0
- data/test/dummy/features/home.feature +42 -0
- data/test/dummy/features/migration.feature +7 -0
- data/test/dummy/features/quick_search.feature +113 -0
- data/test/dummy/features/step_definitions/advance_search_steps.rb +13 -0
- data/test/dummy/features/step_definitions/app_steps.rb +36 -0
- data/test/dummy/features/step_definitions/async.rb +18 -0
- data/test/dummy/features/step_definitions/configuration_steps.rb +61 -0
- data/test/dummy/features/step_definitions/crud_show_steps.rb +37 -0
- data/test/dummy/features/step_definitions/feed_steps.rb +24 -0
- data/test/dummy/features/step_definitions/quick_search_steps.rb +68 -0
- data/test/dummy/features/step_definitions/util.rb +90 -0
- data/test/dummy/features/step_definitions/web_steps.rb +219 -0
- data/test/dummy/features/support/env.rb +66 -0
- data/test/dummy/features/support/hooks.rb +9 -0
- data/test/dummy/features/support/paths.rb +33 -0
- data/test/dummy/features/table_structure.feature +18 -0
- data/test/dummy/lib/tasks/.gitkeep +0 -0
- data/test/dummy/lib/tasks/cucumber.rake +53 -0
- data/test/dummy/lib/tasks/dbs.rake +30 -0
- data/test/dummy/lib/tasks/sample_cars.rake +18 -0
- data/test/dummy/public/.gitkeep +0 -0
- data/test/dummy/script/cucumber +10 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/factories.rb +30 -0
- data/test/dummy/test/test_helper.rb +7 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/test_helper.rb +15 -0
- data/test/unit/admin_data/model_finder_test.rb +16 -0
- data/test/unit/car_test.rb +96 -0
- data/test/unit/user_phone_test.rb +19 -0
- metadata +253 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
<div class="block rounded">
|
2
|
+
<h3>Association Information</h3>
|
3
|
+
<div class='content association_info'>
|
4
|
+
<% if AdminData::ActiveRecordUtil.new(klass).has_association_info? %>
|
5
|
+
<%= render 'admin_data/crud/association/belongs_to_info' , :klass => klass, :model => model %>
|
6
|
+
<%= render 'admin_data/crud/association/has_one_info', :klass => klass, :model => model %>
|
7
|
+
<%= render 'admin_data/crud/association/has_many_info' , :klass => klass, :model => model %>
|
8
|
+
<%= render 'admin_data/crud/association/habtm_info' , :klass => klass, :model => model %>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
11
|
+
</div>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<div id="main">
|
2
|
+
<div>
|
3
|
+
<h1 class='search_path'>
|
4
|
+
<%= link_to @klass, search_path(:klass => @klass.name) %>
|
5
|
+
>
|
6
|
+
<%= link_to "ID #{@model.id}", ''%>
|
7
|
+
</h1>
|
8
|
+
<div class='clear'></div>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="block" id="block-tables">
|
12
|
+
|
13
|
+
<div class="content rounded">
|
14
|
+
<div class="inner umbrella">
|
15
|
+
<% url = admin_data_path(:klass => @klass.name, :id => @model.id)
|
16
|
+
html_options = {:class => 'form', :method => :put} %>
|
17
|
+
<%= form_for @model, :as => @klass.name.underscore.to_sym, :url => url, :html=> html_options do |f| %>
|
18
|
+
<%= render 'admin_data/shared/flash_message', :model => @model %>
|
19
|
+
<%= render 'admin_data/crud/misc/form', :klass => @klass, :f => f %>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div id="sidebar">
|
28
|
+
<%= render 'admin_data/crud/association/association_info', :klass => @klass, :model => @model %>
|
29
|
+
<%= render 'admin_data/crud/misc/modify_record', :model => @model, :klass => @klass %>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<style type="text/css">
|
33
|
+
#main {
|
34
|
+
width:70%;
|
35
|
+
}
|
36
|
+
</style>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<% @columns.each do |col| %>
|
2
|
+
<div class='col_box'>
|
3
|
+
<span class='col_name'><%= col.name %></span>
|
4
|
+
<span class='col_type'>[<%= col.type.to_s %>]</span>
|
5
|
+
</div>
|
6
|
+
<div class='data'>
|
7
|
+
<%= form_field(klass, @model, col, f).html_safe %>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<% if AdminData::ActiveRecordUtil.new(klass).declared_habtm_association_names.any? %>
|
12
|
+
<div class='data'>
|
13
|
+
<%= form_field_for_habtm_records(klass, @model, f, '').html_safe %>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<div class='group navform' style='padding-top:10px;'>
|
18
|
+
<% if params[:action] == 'edit' || params[:action] == 'update' %>
|
19
|
+
<% label = 'Update' %>
|
20
|
+
<% else %>
|
21
|
+
<% label = 'Create' %>
|
22
|
+
<% end %>
|
23
|
+
<%= f.submit(label, :class => 'button', :disable_with => 'Please wait ...') %>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<style>
|
27
|
+
.col_name {
|
28
|
+
color: #222;
|
29
|
+
font-size: 15px;
|
30
|
+
}
|
31
|
+
.col_type {
|
32
|
+
color: dimgray;
|
33
|
+
}
|
34
|
+
.col_box {
|
35
|
+
margin-top: 20px;
|
36
|
+
padding-bottom: 4px;
|
37
|
+
}
|
38
|
+
</style>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% if controller.send(:is_allowed_to_update?) %>
|
2
|
+
<div class="block rounded">
|
3
|
+
<h3>Modify Record</h3>
|
4
|
+
<div style='padding-left:15px'>
|
5
|
+
<p>
|
6
|
+
<%= link_to 'Edit', edit_path(:klass => klass.name.underscore, :id => model.id) %>
|
7
|
+
</p>
|
8
|
+
<p>
|
9
|
+
<%= link_to 'Delete', del_path(:klass => klass.name.underscore, :id => model.id) ,
|
10
|
+
{ :confirm => ' You are deleting (not destroying) a record. Are you sure?', :method => :delete} %>
|
11
|
+
</p>
|
12
|
+
<p>
|
13
|
+
<%= link_to "Destroy", admin_data_path(:klass => klass.name.underscore, :id => model.id),
|
14
|
+
{ :confirm => 'You are destroying a record. Are you sure?', :method => :delete} %>
|
15
|
+
</p>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<div id="main">
|
2
|
+
|
3
|
+
<%= breadcrum do %>
|
4
|
+
<%= link_to @klass, search_path(:klass => @klass.name) %>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<div class="block" id="block-tables">
|
8
|
+
<div class="secondary-navigation">
|
9
|
+
<%= render 'admin_data/shared/secondary_navigation', :klass => @klass %>
|
10
|
+
<div class="clear"></div>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="content rounded">
|
14
|
+
<div class="inner umbrella">
|
15
|
+
<h1>Create a new record</h1>
|
16
|
+
<%= form_for @model, :as => @klass.name.underscore.to_sym,
|
17
|
+
:url => index_path(:klass => @klass.name),
|
18
|
+
:html => {:class => 'form', :method => :post} do |f| %>
|
19
|
+
<%= render 'admin_data/shared/flash_message', :model => @model %>
|
20
|
+
<%= render 'admin_data/crud/misc/form', :klass => @klass, :f => f %>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<div id="main">
|
2
|
+
|
3
|
+
<div>
|
4
|
+
<h1 class='search_path'>
|
5
|
+
<%= link_to @klass, search_path(:klass => @klass.name) %>
|
6
|
+
>
|
7
|
+
<%= link_to "ID #{@model.id}", ''%>
|
8
|
+
</h1>
|
9
|
+
<div class='clear'></div>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<%= render 'admin_data/shared/flash_message', :model => @model %>
|
13
|
+
|
14
|
+
<div class="block" id="block-tables">
|
15
|
+
<div class="content rounded">
|
16
|
+
<div class="inner">
|
17
|
+
<table class="table with_border" cellspacing="3" cellpadding="3">
|
18
|
+
<% AdminData::Util.label_values_pair_for(@model, self).each do |pair| %>
|
19
|
+
<tr>
|
20
|
+
<td><%=pair[0]%></td>
|
21
|
+
<td class='smaller'><%=pair[1]%></td>
|
22
|
+
</tr>
|
23
|
+
<% end %>
|
24
|
+
</table>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<div id="sidebar">
|
31
|
+
<%= render 'admin_data/crud/association/association_info', :klass => @klass, :model => @model %>
|
32
|
+
<%= render 'admin_data/crud/misc/modify_record', :model => @model, :klass => @klass %>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<style>
|
36
|
+
#main {
|
37
|
+
width:70%;
|
38
|
+
}
|
39
|
+
table.with_border td.smaller {
|
40
|
+
font-size: 120%;
|
41
|
+
}
|
42
|
+
</style>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
xml.instruct! :xml, :version => "1.0"
|
2
|
+
xml.rss(:version => "2.0" ){
|
3
|
+
xml.channel{
|
4
|
+
xml.title(@title)
|
5
|
+
xml.link(request.host_with_port)
|
6
|
+
xml.description(@description)
|
7
|
+
xml.language('en-us')
|
8
|
+
h = {:order => "#{@klass.primary_key} desc", :limit => 100}
|
9
|
+
@records.each do |record|
|
10
|
+
xml.item do
|
11
|
+
xml.title("#{@klasss} id: #{record.id}")
|
12
|
+
|
13
|
+
desc = AdminData::Util.label_values_pair_for(record, self).inject([]) do |sum, a|
|
14
|
+
sum << "<p>#{a[0]}: #{a[1]}</p>"
|
15
|
+
end.join
|
16
|
+
|
17
|
+
xml.description(desc)
|
18
|
+
d = record.respond_to?(:created_at) ? record.created_at : Time.now
|
19
|
+
xml.pubDate(d.strftime("%a, %d %b %Y %H:%M:%S %z"))
|
20
|
+
xml.link(admin_data_url(:id => record, :klass => @klass.name))
|
21
|
+
xml.guid(admin_data_url(:id => record, :klass => @klass.name))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<div id="main">
|
2
|
+
<div class="block" id="block-tables">
|
3
|
+
<div class="content rounded select_box">
|
4
|
+
<h2 id='main_page_label'>Select from the drop down menu above</h2>
|
5
|
+
<div class="clear"></div>
|
6
|
+
</div>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<style>
|
11
|
+
#main_page_label {
|
12
|
+
margin-left: 0;
|
13
|
+
}
|
14
|
+
.select_box {
|
15
|
+
padding: 15px;
|
16
|
+
}
|
17
|
+
p.notice {
|
18
|
+
color: dimgray;
|
19
|
+
font-size:15px;
|
20
|
+
}
|
21
|
+
</style>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<div id="main">
|
2
|
+
<div class="block" id="block-tables">
|
3
|
+
<div class="content rounded">
|
4
|
+
<h2 class="title">Migration Information from schema_migrations table</h2>
|
5
|
+
<div class="inner">
|
6
|
+
<table class="table colorize">
|
7
|
+
<tr>
|
8
|
+
<th class='first last'>version</th>
|
9
|
+
</tr>
|
10
|
+
<% @data.each do |record| %>
|
11
|
+
<tr><td><%=record.values.first%></td></tr>
|
12
|
+
<% end %>
|
13
|
+
</table>
|
14
|
+
</div>
|
15
|
+
<div class="clear"></div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
</div>
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html id="html">
|
3
|
+
<head>
|
4
|
+
<title>admin_data JavaScript test</title>
|
5
|
+
<%= AdminData::Util.stylesheet_link_tag('vendor/qunit') %>
|
6
|
+
<%= AdminData::Util.javascript_include_tag( 'vendor/jquery-1.4.1',
|
7
|
+
'vendor/jquery-ui-1.7.2.custom.min',
|
8
|
+
'vendor/log',
|
9
|
+
'vendor/jquery.form',
|
10
|
+
'vendor/jquery.ba-isjquery',
|
11
|
+
'vendor/jack',
|
12
|
+
'misc/drop_down_change',
|
13
|
+
'misc/quick_search_input_focus',
|
14
|
+
'misc/js_util',
|
15
|
+
'advance_search/global_ajax_setting',
|
16
|
+
'advance_search/advance_search',
|
17
|
+
'advance_search/advance_search_structure',
|
18
|
+
'advance_search/ajaxify_advance_search',
|
19
|
+
'advance_search/act_on_result',
|
20
|
+
'advance_search/build_first_row',
|
21
|
+
'advance_search/event_bindings',
|
22
|
+
'advance_search/trigger_submit_on_domready',
|
23
|
+
'vendor/qunit',
|
24
|
+
'test/ajaxify_advance_search',
|
25
|
+
'test/act_on_result',
|
26
|
+
'test/build_first_row',
|
27
|
+
'test/event_bindings',
|
28
|
+
'test/advance_search'
|
29
|
+
) %>
|
30
|
+
</head>
|
31
|
+
|
32
|
+
<body id="body">
|
33
|
+
|
34
|
+
<h1 id="qunit-header">admin_data JavaScript test</h1>
|
35
|
+
<h2 id="qunit-banner"></h2>
|
36
|
+
<h2 id="qunit-userAgent"></h2>
|
37
|
+
<ol id="qunit-tests">
|
38
|
+
</ol>
|
39
|
+
|
40
|
+
<div id='advance_search' class='search_box' style='display:none;'>
|
41
|
+
<table id='advance_search_table' class='advtable'>
|
42
|
+
</table>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div style='display:none;' id='admin_data_table_structure_data'>
|
46
|
+
[{id:'integer',first_name:'string',last_name:'string',age:'integer',active:'booleant',description:'text',society_type:'string',society_id:'integer',created_at:'datetime',updated_at:'datetime',birth_date:'datetime'}]
|
47
|
+
</div>
|
48
|
+
|
49
|
+
</body>
|
50
|
+
|
51
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render 'admin_data/search/search/advance_search_form', :klass => @klass %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render 'admin_data/search/search/search_form', :klass => @klass %>
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<%= form_tag(advance_search_path(:klass => klass),
|
2
|
+
:method => 'get',
|
3
|
+
:class => 'form search_form',
|
4
|
+
:id => 'advance_search_form') %>
|
5
|
+
|
6
|
+
<div id='advance_search' class='search_box'>
|
7
|
+
<table id='advance_search_table' class='advtable'>
|
8
|
+
</table>
|
9
|
+
<input type="hidden" id="advance_search_sortby" name="sortby" value="<%=params[:sortby]%>" />
|
10
|
+
|
11
|
+
<div class='sortby_umbrella'>
|
12
|
+
<div class='clear'></div>
|
13
|
+
<input type="submit" value="Search" class='submit_search' />
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
</form>
|
18
|
+
|
19
|
+
<div style='display:none;' id='primary_column_type_info'>
|
20
|
+
<%=@column_type_info%>
|
21
|
+
</div>
|
22
|
+
<div style='display:none;' id='association_info'>
|
23
|
+
<%=@association_info%>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<style>
|
27
|
+
.sortby_umbrella {
|
28
|
+
margin-top: 6px;
|
29
|
+
}
|
30
|
+
.sortby_umbrella .group {
|
31
|
+
padding-left: 20px;
|
32
|
+
}
|
33
|
+
.sortby_umbrella .sortby_text {
|
34
|
+
font-size: 16px;
|
35
|
+
}
|
36
|
+
.submit_search {
|
37
|
+
margin-left: 15px;
|
38
|
+
margin-right: 20px;
|
39
|
+
}
|
40
|
+
.sortby_umbrella .group {
|
41
|
+
float: left;
|
42
|
+
}
|
43
|
+
.sortby_text {
|
44
|
+
float: left;
|
45
|
+
margin-right: 5px;
|
46
|
+
}
|
47
|
+
#sortby {
|
48
|
+
width: 200px;
|
49
|
+
float: left;
|
50
|
+
}
|
51
|
+
</style>
|
52
|
+
|
@@ -0,0 +1,43 @@
|
|
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.underscore} %>
|
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 class='thead'>
|
14
|
+
<% columns_order(klass).each do |column| %>
|
15
|
+
<th class='<%=get_sort_class(column)%>' data-sortby='<%=get_sort_order(column)%>'>
|
16
|
+
<%= get_sort_title_with_url(column, klass) %>
|
17
|
+
</th>
|
18
|
+
<% end %>
|
19
|
+
</tr>
|
20
|
+
</thead>
|
21
|
+
|
22
|
+
<tbody>
|
23
|
+
<% @records.each do |record| %>
|
24
|
+
<tr>
|
25
|
+
<% columns_order(klass).each do |column| %>
|
26
|
+
<td>
|
27
|
+
<% if (column == klass.primary_key) %>
|
28
|
+
<%= link_to(record.send(column), admin_data_path(:klass => klass.name.underscore, :id => record_id(record))) %>
|
29
|
+
<% else %>
|
30
|
+
<%=h get_value_for_column(column_native(klass, column), record) %>
|
31
|
+
<% end %>
|
32
|
+
</td>
|
33
|
+
<% end %>
|
34
|
+
</tr>
|
35
|
+
<% end %>
|
36
|
+
</tbody>
|
37
|
+
</table>
|
38
|
+
|
39
|
+
<div class="pagination">
|
40
|
+
<%= will_paginate @records, :container => false, :params => {:klass => klass.name.underscore} %>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div class='clear'></div>
|