six-updater-web 0.10.8 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +8 -6
- data/bin/six-updater-web +1 -1
- data/lib/README +243 -0
- data/lib/Rakefile +10 -0
- data/lib/app/controllers/actions_controller.rb +23 -0
- data/lib/app/controllers/application_controller.rb +20 -0
- data/lib/app/controllers/appsettings_controller.rb +40 -0
- data/lib/app/controllers/logs_controller.rb +5 -0
- data/lib/app/controllers/logsessions_controller.rb +5 -0
- data/lib/app/controllers/logviews_controller.rb +52 -0
- data/lib/app/controllers/main_controller.rb +432 -0
- data/lib/app/controllers/mods_controller.rb +48 -0
- data/lib/app/controllers/queryservers_controller.rb +42 -0
- data/lib/app/controllers/repositories_controller.rb +16 -0
- data/lib/app/controllers/servers_controller.rb +34 -0
- data/lib/app/controllers/sixconfigs_controller.rb +33 -0
- data/lib/app/controllers/system_settings_controller.rb +5 -0
- data/lib/app/helpers/actions_helper.rb +2 -0
- data/lib/app/helpers/application_helper.rb +13 -0
- data/lib/app/helpers/appsettings_helper.rb +17 -0
- data/lib/app/helpers/logs_helper.rb +2 -0
- data/lib/app/helpers/logsessions_helper.rb +2 -0
- data/lib/app/helpers/logviews_helper.rb +5 -0
- data/lib/app/helpers/main_helper.rb +2 -0
- data/lib/app/helpers/mods_helper.rb +5 -0
- data/lib/app/helpers/queryservers_helper.rb +8 -0
- data/lib/app/helpers/repositories_helper.rb +2 -0
- data/lib/app/helpers/servers_helper.rb +13 -0
- data/lib/app/helpers/sixconfigs_helper.rb +5 -0
- data/lib/app/helpers/system_settings_helper.rb +2 -0
- data/lib/app/models/action.rb +5 -0
- data/lib/app/models/appsetting.rb +18 -0
- data/lib/app/models/log.rb +3 -0
- data/lib/app/models/log_observer.rb +23 -0
- data/lib/app/models/logsession.rb +3 -0
- data/lib/app/models/mod.rb +96 -0
- data/lib/app/models/queryserver.rb +167 -0
- data/lib/app/models/repository.rb +11 -0
- data/lib/app/models/server.rb +25 -0
- data/lib/app/models/sixconfig.rb +185 -0
- data/lib/app/models/system_setting.rb +77 -0
- data/lib/app/views/Repositories/imp.erb +1 -0
- data/lib/app/views/appsettings/manage.erb +4 -0
- data/lib/app/views/layouts/application.haml +48 -0
- data/lib/app/views/layouts/empty.haml +2 -0
- data/lib/app/views/logviews/_logs.erb +1 -0
- data/lib/app/views/logviews/upd.rjs +1 -0
- data/lib/app/views/main/_check.haml +18 -0
- data/lib/app/views/main/execute.haml +24 -0
- data/lib/app/views/main/fetch.haml +2 -0
- data/lib/app/views/main/index.haml +100 -0
- data/lib/app/views/main/logoutput.erb +6 -0
- data/lib/app/views/main/modlogs.erb +5 -0
- data/lib/app/views/main/reset.erb +40 -0
- data/lib/app/views/main/reset_act.haml +1 -0
- data/lib/app/views/mods/imp.haml +1 -0
- data/lib/app/views/servers/imp.erb +1 -0
- data/lib/config/GeoIP.dat +0 -0
- data/lib/config/boot.rb +110 -0
- data/lib/config/database.yml +34 -0
- data/lib/config/database.yml.sample +34 -0
- data/lib/config/environment.rb +59 -0
- data/lib/config/environments/development.rb +17 -0
- data/lib/config/environments/production.rb +28 -0
- data/lib/config/environments/test.rb +28 -0
- data/lib/config/gslist.cfg +3229 -0
- data/lib/config/initializers/backtrace_silencers.rb +7 -0
- data/lib/config/initializers/inflections.rb +10 -0
- data/lib/config/initializers/mime_types.rb +5 -0
- data/lib/config/initializers/new_rails_defaults.rb +19 -0
- data/lib/config/initializers/session_store.rb +15 -0
- data/lib/config/locales/en.yml +5 -0
- data/lib/config/routes.rb +43 -0
- data/lib/config/six-updater-web.rb +221 -0
- data/lib/db/migrate/20090826185820_create_repositories.rb +18 -0
- data/lib/db/migrate/20090826185836_create_mods.rb +23 -0
- data/lib/db/migrate/20090826185847_create_servers.rb +22 -0
- data/lib/db/migrate/20090826185930_create_appsettings.rb +21 -0
- data/lib/db/migrate/20090826190008_create_sixconfigs.rb +16 -0
- data/lib/db/migrate/20090829165545_create_actions.rb +18 -0
- data/lib/db/migrate/20090829165546_add_logpath_to_appsetting.rb +9 -0
- data/lib/db/migrate/20090829165547_change_columns_appsettings.rb +10 -0
- data/lib/db/migrate/20090916174120_create_logs.rb +14 -0
- data/lib/db/migrate/20090916174333_create_logsessions.rb +13 -0
- data/lib/db/migrate/20090921092253_create_sessions.rb +16 -0
- data/lib/db/migrate/20090921165547_change_columns.rb +46 -0
- data/lib/db/migrate/20090928163554_create_system_settings.rb +14 -0
- data/lib/db/migrate/20090928163555_change_columns_mods.rb +11 -0
- data/lib/db/migrate/20090928163556_change2_columns_mods.rb +11 -0
- data/lib/db/migrate/20090928163558_change_columns_repositories.rb +11 -0
- data/lib/db/migrate/20090928163559_change_columns_system_settings.rb +9 -0
- data/lib/db/migrate/20090928163560_change2_columns_system_settings.rb +9 -0
- data/lib/db/migrate/20090928163561_change2_columns.rb +46 -0
- data/lib/db/migrate/20090928163562_change3_columns_system_settings.rb +17 -0
- data/lib/db/migrate/20090928163563_change2_columns_appsettings.rb +9 -0
- data/lib/db/migrate/20100327164004_create_queryservers.rb +18 -0
- data/lib/db/migrate/20100404150547_add_fields_to_queryservers.rb +35 -0
- data/lib/db/migrate/20100404152436_create_mods_queryservers.rb +11 -0
- data/lib/db/migrate/20100405142958_add_saved_password_to_queryservers.rb +9 -0
- data/lib/db/migrate/20100405142959_change_mods_queryservers_id.rb +9 -0
- data/lib/db/migrate/20100405142960_add_gamespied_at_to_system_settings.rb +9 -0
- data/lib/db/migrate/20100409114653_add_priority_and_path_to_mods.rb +11 -0
- data/lib/db/schema.rb +289 -0
- data/lib/doc/README_FOR_APP +2 -0
- data/lib/init.rb +74 -0
- data/lib/lib/tasks/fixtures.rake +33 -0
- data/lib/lib/tasks/sync.rake +51 -0
- data/lib/log/production.log +1 -0
- data/lib/public/404.html +30 -0
- data/lib/public/422.html +30 -0
- data/lib/public/500.html +30 -0
- data/lib/public/blank.html +33 -0
- data/lib/public/favicon.ico +0 -0
- data/lib/public/goldberg/images/action.png +0 -0
- data/lib/public/goldberg/images/add.png +0 -0
- data/lib/public/goldberg/images/blockquote-bg.gif +0 -0
- data/lib/public/goldberg/images/body-bg.jpg +0 -0
- data/lib/public/goldberg/images/centerColumn-bg.jpg +0 -0
- data/lib/public/goldberg/images/daddy_leftarrow.gif +0 -0
- data/lib/public/goldberg/images/delete.png +0 -0
- data/lib/public/goldberg/images/down.png +0 -0
- data/lib/public/goldberg/images/h2-bg.gif +0 -0
- data/lib/public/goldberg/images/h3-bg.gif +0 -0
- data/lib/public/goldberg/images/header-bg.jpg +0 -0
- data/lib/public/goldberg/images/hr-bg.jpg +0 -0
- data/lib/public/goldberg/images/logo.jpg +0 -0
- data/lib/public/goldberg/images/page.png +0 -0
- data/lib/public/goldberg/images/permission.png +0 -0
- data/lib/public/goldberg/images/role.png +0 -0
- data/lib/public/goldberg/images/up.png +0 -0
- data/lib/public/goldberg/javascripts/suckerfish.js +12 -0
- data/lib/public/goldberg/stylesheets/goldberg.css +142 -0
- data/lib/public/goldberg/stylesheets/layout.css +433 -0
- data/lib/public/goldberg/stylesheets/suckerfish.css +124 -0
- data/lib/public/images/active_scaffold/DO_NOT_EDIT +2 -0
- data/lib/public/images/active_scaffold/default/add.gif +0 -0
- data/lib/public/images/active_scaffold/default/arrow_down.gif +0 -0
- data/lib/public/images/active_scaffold/default/arrow_refresh.png +0 -0
- data/lib/public/images/active_scaffold/default/arrow_up.gif +0 -0
- data/lib/public/images/active_scaffold/default/close.gif +0 -0
- data/lib/public/images/active_scaffold/default/cross.png +0 -0
- data/lib/public/images/active_scaffold/default/customize_tool.png +0 -0
- data/lib/public/images/active_scaffold/default/export_tool.png +0 -0
- data/lib/public/images/active_scaffold/default/indicator-small.gif +0 -0
- data/lib/public/images/active_scaffold/default/indicator.gif +0 -0
- data/lib/public/images/active_scaffold/default/magnifier.png +0 -0
- data/lib/public/images/active_scaffold/default/printer_tool.png +0 -0
- data/lib/public/images/rails.png +0 -0
- data/lib/public/images/record_select/cross.gif +0 -0
- data/lib/public/images/record_select/next.gif +0 -0
- data/lib/public/images/record_select/previous.gif +0 -0
- data/lib/public/images/top.png +0 -0
- data/lib/public/javascripts/active_scaffold/DO_NOT_EDIT +2 -0
- data/lib/public/javascripts/active_scaffold/default/active_scaffold.js +517 -0
- data/lib/public/javascripts/active_scaffold/default/advanced_search.js +54 -0
- data/lib/public/javascripts/active_scaffold/default/dhtml_history.js +867 -0
- data/lib/public/javascripts/active_scaffold/default/form_enhancements.js +117 -0
- data/lib/public/javascripts/active_scaffold/default/number_formats.js +167 -0
- data/lib/public/javascripts/active_scaffold/default/rico_corner.js +370 -0
- data/lib/public/javascripts/application.js +2 -0
- data/lib/public/javascripts/controls.js +963 -0
- data/lib/public/javascripts/dragdrop.js +973 -0
- data/lib/public/javascripts/effects.js +1128 -0
- data/lib/public/javascripts/prototype.js +4320 -0
- data/lib/public/javascripts/record_select/record_select.js +352 -0
- data/lib/public/robots.txt +5 -0
- data/lib/public/stylesheets/active_scaffold/DO_NOT_EDIT +2 -0
- data/lib/public/stylesheets/active_scaffold/default/advanced_search.css +11 -0
- data/lib/public/stylesheets/active_scaffold/default/stylesheet-ie.css +50 -0
- data/lib/public/stylesheets/active_scaffold/default/stylesheet.css +1059 -0
- data/lib/public/stylesheets/active_scaffold/default/tools-left-handed-stylesheet-ie.css +11 -0
- data/lib/public/stylesheets/active_scaffold/default/tools-left-handed-stylesheet.css +68 -0
- data/lib/public/stylesheets/record_select/record_select.css +129 -0
- data/lib/script/about +4 -0
- data/lib/script/console +3 -0
- data/lib/script/dbconsole +3 -0
- data/lib/script/destroy +3 -0
- data/lib/script/generate +3 -0
- data/lib/script/performance/benchmarker +3 -0
- data/lib/script/performance/profiler +3 -0
- data/lib/script/plugin +3 -0
- data/lib/script/runner +3 -0
- data/lib/script/server +3 -0
- data/lib/test/functional/actions_controller_test.rb +8 -0
- data/lib/test/functional/configs_controller_test.rb +8 -0
- data/lib/test/functional/logs_controller_test.rb +8 -0
- data/lib/test/functional/logsessions_controller_test.rb +8 -0
- data/lib/test/functional/logviews_controller_test.rb +8 -0
- data/lib/test/functional/main_controller_test.rb +8 -0
- data/lib/test/functional/mods_controller_test.rb +8 -0
- data/lib/test/functional/queryservers_controller_test.rb +8 -0
- data/lib/test/functional/repositories_controller_test.rb +8 -0
- data/lib/test/functional/servers_controller_test.rb +8 -0
- data/lib/test/functional/settings_controller_test.rb +8 -0
- data/lib/test/functional/system_settings_controller_test.rb +8 -0
- data/lib/test/performance/browsing_test.rb +9 -0
- data/lib/test/test_helper.rb +38 -0
- data/lib/test/unit/action_test.rb +8 -0
- data/lib/test/unit/config_test.rb +8 -0
- data/lib/test/unit/helpers/actions_helper_test.rb +4 -0
- data/lib/test/unit/helpers/configs_helper_test.rb +4 -0
- data/lib/test/unit/helpers/logs_helper_test.rb +4 -0
- data/lib/test/unit/helpers/logsessions_helper_test.rb +4 -0
- data/lib/test/unit/helpers/logviews_helper_test.rb +4 -0
- data/lib/test/unit/helpers/main_helper_test.rb +4 -0
- data/lib/test/unit/helpers/mods_helper_test.rb +4 -0
- data/lib/test/unit/helpers/queryservers_helper_test.rb +4 -0
- data/lib/test/unit/helpers/repositories_helper_test.rb +4 -0
- data/lib/test/unit/helpers/servers_helper_test.rb +4 -0
- data/lib/test/unit/helpers/settings_helper_test.rb +4 -0
- data/lib/test/unit/helpers/system_settings_helper_test.rb +4 -0
- data/lib/test/unit/log_test.rb +8 -0
- data/lib/test/unit/logsession_test.rb +8 -0
- data/lib/test/unit/mod_test.rb +8 -0
- data/lib/test/unit/queryserver_test.rb +8 -0
- data/lib/test/unit/repository_test.rb +8 -0
- data/lib/test/unit/server_test.rb +8 -0
- data/lib/test/unit/setting_test.rb +8 -0
- data/lib/test/unit/system_setting_test.rb +8 -0
- data/lib/vendor/plugins/active_scaffold/CHANGELOG +152 -0
- data/lib/vendor/plugins/active_scaffold/MIT-LICENSE +20 -0
- data/lib/vendor/plugins/active_scaffold/README +128 -0
- data/lib/vendor/plugins/active_scaffold/Rakefile +24 -0
- data/lib/vendor/plugins/active_scaffold/environment.rb +20 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/images/add.gif +0 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/images/arrow_down.gif +0 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/images/arrow_refresh.png +0 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/images/arrow_up.gif +0 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/images/close.gif +0 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/images/cross.png +0 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/images/customize_tool.png +0 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/images/export_tool.png +0 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/images/indicator-small.gif +0 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/images/indicator.gif +0 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/images/magnifier.png +0 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/images/printer_tool.png +0 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/javascripts/active_scaffold.js +517 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/javascripts/dhtml_history.js +867 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/javascripts/form_enhancements.js +117 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/javascripts/number_formats.js +167 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/javascripts/rico_corner.js +370 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/stylesheets/stylesheet-ie.css +50 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/stylesheets/stylesheet.css +1059 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/stylesheets/tools-left-handed-stylesheet-ie.css +11 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/stylesheets/tools-left-handed-stylesheet.css +68 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_add_existing_form.html.erb +36 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_create_form.html.erb +57 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_create_form_on_list.html.erb +45 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_create_form_submit.html.erb +2 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_export_csv.html.erb +20 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_field_search.html.erb +58 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_form.html.erb +23 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_form_association.html.erb +12 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_form_association_footer.html.erb +43 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_form_attribute.html.erb +24 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_form_hidden_attribute.html.erb +1 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_form_messages.html.erb +5 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_horizontal_subform.html.erb +19 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_horizontal_subform_header.html.erb +10 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_horizontal_subform_record.html.erb +29 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_list.html.erb +43 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_list_actions.html.erb +29 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_list_calculations.html.erb +43 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_list_column_headings.html.erb +64 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_list_header.html.erb +29 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_list_inline_adapter.html.erb +11 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_list_pagination_links.html.erb +30 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_list_record.html.erb +32 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_list_record_actions.html.erb +5 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_list_record_columns.html.erb +20 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_live_search.html.erb +23 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_messages.html.erb +10 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_nested.html.erb +45 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_print_list.html.erb +22 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_revision.html.erb +11 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_revision_columns.html.erb +62 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_search.html.erb +21 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_show.html.erb +8 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_show_columns.html.erb +19 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_show_customize.html.erb +27 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_show_export_tool.html.erb +17 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_update_actions.html.erb +9 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_update_form.html.erb +61 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_update_form_submit.html.erb +2 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_vertical_subform.html.erb +12 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/_vertical_subform_record.html.erb +31 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/add_existing.js.rjs +16 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/add_existing_form.html.erb +5 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/copy.rjs +4 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/create.html.erb +5 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/delete.html.erb +13 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/destroy.js.rjs +10 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/edit_associated.js.rjs +14 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/field_search.html.erb +5 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/form_messages.js.rjs +1 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/form_messages_on_save.js.rjs +10 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/latest.rjs +2 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/list.html.erb +48 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/on_create.js.rjs +25 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/on_update.js.rjs +11 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/print_list.prawn +26 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/refresh_list.js.rjs +6 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/refresh_record.js.rjs +2 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/render_field.js.rjs +9 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/revision.html.erb +5 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/search.html.erb +5 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/show.html.erb +5 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/show_customize.html.erb +5 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/show_export_tool.html.erb +5 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/update.html.erb +8 -0
- data/lib/vendor/plugins/active_scaffold/frontends/default/views/update_column.js.rjs +12 -0
- data/lib/vendor/plugins/active_scaffold/init.rb +18 -0
- data/lib/vendor/plugins/active_scaffold/install.rb +39 -0
- data/lib/vendor/plugins/active_scaffold/install_assets.rb +36 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_record_permissions.rb +136 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold.rb +215 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/core.rb +142 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/create.rb +160 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/customize.rb +59 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/delete.rb +72 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/export_tool.rb +49 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/field_search.rb +82 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/list.rb +119 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/live_search.rb +59 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/nested.rb +219 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/print_base.rb +23 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/print_list.rb +44 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/refresh.rb +31 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/revision.rb +51 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/search.rb +50 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/show.rb +54 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/subform.rb +17 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/actions/update.rb +128 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/attribute_params.rb +196 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/base.rb +45 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb +263 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/create.rb +43 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/customize.rb +34 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/delete.rb +25 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/export_tool.rb +52 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/field_search.rb +53 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/form.rb +49 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/list.rb +142 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/live_search.rb +52 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/nested.rb +34 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/print_base.rb +40 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/print_list.rb +52 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/refresh.rb +22 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/revision.rb +39 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb +52 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/show.rb +36 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/subform.rb +40 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/config/update.rb +32 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/configurable.rb +29 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/constraints.rb +181 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/action_columns.rb +97 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/action_link.rb +140 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/action_links.rb +47 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/actions.rb +45 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/column.rb +343 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/columns.rb +75 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/error_message.rb +24 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/set.rb +62 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/sorting.rb +159 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/finder.rb +331 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/generators/active_scaffold/active_scaffold_generator.rb +348 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/generators/active_scaffold/templates/controller_methods.rb +36 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/generators/active_scaffold/templates/controller_scaffolding.rhtml +10 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/generators/active_scaffold/templates/fixtures.yml +5 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/generators/active_scaffold/templates/form.rhtml +3 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/generators/active_scaffold/templates/form_scaffolding.rhtml +1 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/generators/active_scaffold/templates/functional_test.rb +45 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/generators/active_scaffold/templates/helper.rb +2 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/generators/active_scaffold/templates/model.rb +3 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/generators/active_scaffold/templates/model_scaffolding.rhtml +90 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/generators/active_scaffold/templates/show.rhtml +8 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/generators/active_scaffold/templates/show_scaffolding.rhtml +1 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/generators/active_scaffold/templates/unit_test.rb +5 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/association_helpers.rb +40 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/controller_helpers.rb +41 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/country_helpers.rb +365 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/form_column_helpers.rb +484 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/id_helpers.rb +152 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/list_column_helpers.rb +397 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/number_helpers.rb +143 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/pagination_helpers.rb +39 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/search_column_helpers.rb +279 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/show_column_helpers.rb +46 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/view_helpers.rb +227 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/locale/en-countries.yml +247 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/locale/en.rb +68 -0
- data/lib/vendor/plugins/active_scaffold/lib/active_scaffold/search.rb +21 -0
- data/lib/vendor/plugins/active_scaffold/lib/bridges/bridge.rb +52 -0
- data/lib/vendor/plugins/active_scaffold/lib/bridges/calendar_date_select/bridge.rb +11 -0
- data/lib/vendor/plugins/active_scaffold/lib/bridges/calendar_date_select/lib/as_cds_bridge.rb +135 -0
- data/lib/vendor/plugins/active_scaffold/lib/bridges/checkbox.rb +21 -0
- data/lib/vendor/plugins/active_scaffold/lib/bridges/file_column/bridge.rb +12 -0
- data/lib/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/as_file_column_bridge.rb +75 -0
- data/lib/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/file_column_helpers.rb +51 -0
- data/lib/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/form_ui.rb +33 -0
- data/lib/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/list_ui.rb +42 -0
- data/lib/vendor/plugins/active_scaffold/lib/bridges/file_column/test/functional/file_column_keep_test.rb +43 -0
- data/lib/vendor/plugins/active_scaffold/lib/bridges/file_column/test/mock_model.rb +9 -0
- data/lib/vendor/plugins/active_scaffold/lib/bridges/file_column/test/test_helper.rb +15 -0
- data/lib/vendor/plugins/active_scaffold/lib/bridges/tiny_mce/bridge.rb +5 -0
- data/lib/vendor/plugins/active_scaffold/lib/bridges/tiny_mce/lib/tiny_mce_bridge.rb +45 -0
- data/lib/vendor/plugins/active_scaffold/lib/dhtml_confirm.rb +54 -0
- data/lib/vendor/plugins/active_scaffold/lib/extensions/action_controller_rendering.rb +20 -0
- data/lib/vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb +88 -0
- data/lib/vendor/plugins/active_scaffold/lib/extensions/array.rb +7 -0
- data/lib/vendor/plugins/active_scaffold/lib/extensions/component_response_with_namespacing.rb +17 -0
- data/lib/vendor/plugins/active_scaffold/lib/extensions/generic_view_paths.rb +33 -0
- data/lib/vendor/plugins/active_scaffold/lib/extensions/java_script_macros_helper.rb +152 -0
- data/lib/vendor/plugins/active_scaffold/lib/extensions/localize.rb +11 -0
- data/lib/vendor/plugins/active_scaffold/lib/extensions/name_option_for_datetime.rb +12 -0
- data/lib/vendor/plugins/active_scaffold/lib/extensions/nil_id_in_url_params.rb +7 -0
- data/lib/vendor/plugins/active_scaffold/lib/extensions/resources.rb +27 -0
- data/lib/vendor/plugins/active_scaffold/lib/extensions/reverse_associations.rb +56 -0
- data/lib/vendor/plugins/active_scaffold/lib/extensions/schema_definitions.rb +15 -0
- data/lib/vendor/plugins/active_scaffold/lib/extensions/to_label.rb +8 -0
- data/lib/vendor/plugins/active_scaffold/lib/extensions/unsaved_associated.rb +61 -0
- data/lib/vendor/plugins/active_scaffold/lib/extensions/unsaved_record.rb +20 -0
- data/lib/vendor/plugins/active_scaffold/lib/extensions/usa_state.rb +46 -0
- data/lib/vendor/plugins/active_scaffold/lib/paginator.rb +136 -0
- data/lib/vendor/plugins/active_scaffold/lib/responds_to_parent.rb +68 -0
- data/lib/vendor/plugins/active_scaffold/public/blank.html +33 -0
- data/lib/vendor/plugins/active_scaffold/test/bridges/bridge_test.rb +47 -0
- data/lib/vendor/plugins/active_scaffold/test/config/create_test.rb +55 -0
- data/lib/vendor/plugins/active_scaffold/test/config/list_test.rb +74 -0
- data/lib/vendor/plugins/active_scaffold/test/config/update_test.rb +17 -0
- data/lib/vendor/plugins/active_scaffold/test/const_mocker.rb +36 -0
- data/lib/vendor/plugins/active_scaffold/test/data_structures/action_columns_test.rb +119 -0
- data/lib/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb +78 -0
- data/lib/vendor/plugins/active_scaffold/test/data_structures/action_links_test.rb +78 -0
- data/lib/vendor/plugins/active_scaffold/test/data_structures/actions_test.rb +25 -0
- data/lib/vendor/plugins/active_scaffold/test/data_structures/association_column_test.rb +41 -0
- data/lib/vendor/plugins/active_scaffold/test/data_structures/column_test.rb +161 -0
- data/lib/vendor/plugins/active_scaffold/test/data_structures/columns_test.rb +69 -0
- data/lib/vendor/plugins/active_scaffold/test/data_structures/error_message_test.rb +28 -0
- data/lib/vendor/plugins/active_scaffold/test/data_structures/set_test.rb +86 -0
- data/lib/vendor/plugins/active_scaffold/test/data_structures/sorting_test.rb +96 -0
- data/lib/vendor/plugins/active_scaffold/test/data_structures/standard_column_test.rb +34 -0
- data/lib/vendor/plugins/active_scaffold/test/data_structures/virtual_column_test.rb +34 -0
- data/lib/vendor/plugins/active_scaffold/test/extensions/active_record_test.rb +45 -0
- data/lib/vendor/plugins/active_scaffold/test/extensions/array.rb +12 -0
- data/lib/vendor/plugins/active_scaffold/test/misc/active_record_permissions.rb +154 -0
- data/lib/vendor/plugins/active_scaffold/test/misc/configurable_test.rb +96 -0
- data/lib/vendor/plugins/active_scaffold/test/misc/constraints_test.rb +175 -0
- data/lib/vendor/plugins/active_scaffold/test/misc/finder_test.rb +70 -0
- data/lib/vendor/plugins/active_scaffold/test/misc/lang_test.rb +12 -0
- data/lib/vendor/plugins/active_scaffold/test/model_stub.rb +39 -0
- data/lib/vendor/plugins/active_scaffold/test/render_component/abstract_unit.rb +8 -0
- data/lib/vendor/plugins/active_scaffold/test/render_component/components_test.rb +140 -0
- data/lib/vendor/plugins/active_scaffold/test/run_all.rb +8 -0
- data/lib/vendor/plugins/active_scaffold/test/test_helper.rb +13 -0
- data/lib/vendor/plugins/active_scaffold/things.todo +55 -0
- data/lib/vendor/plugins/active_scaffold/uninstall.rb +13 -0
- data/lib/vendor/plugins/activescaffold_advanced_search/README +1 -0
- data/lib/vendor/plugins/activescaffold_advanced_search/README.markdown +39 -0
- data/lib/vendor/plugins/activescaffold_advanced_search/app/views/active_scaffold_overrides/_advanced_search.rhtml +41 -0
- data/lib/vendor/plugins/activescaffold_advanced_search/frontends/default/javascripts/advanced_search.js +54 -0
- data/lib/vendor/plugins/activescaffold_advanced_search/frontends/default/stylesheets/advanced_search.css +11 -0
- data/lib/vendor/plugins/activescaffold_advanced_search/init.rb +22 -0
- data/lib/vendor/plugins/activescaffold_advanced_search/install.rb +50 -0
- data/lib/vendor/plugins/activescaffold_advanced_search/lib/actions/advanced_search.rb +62 -0
- data/lib/vendor/plugins/activescaffold_advanced_search/lib/advanced_finder.rb +101 -0
- data/lib/vendor/plugins/activescaffold_advanced_search/lib/config/advanced_search.rb +48 -0
- data/lib/vendor/plugins/activescaffold_advanced_search/lib/config/core.rb +23 -0
- data/lib/vendor/plugins/activescaffold_advanced_search/lib/helpers/advanced_search_helpers.rb +19 -0
- data/lib/vendor/plugins/activescaffold_advanced_search/lib/helpers/view_helpers.rb +20 -0
- data/lib/vendor/plugins/activescaffold_advanced_search/uninstall.rb.rb +2 -0
- data/lib/vendor/plugins/goldberg/README.rdoc +36 -0
- data/lib/vendor/plugins/goldberg/app/controllers/goldberg/auth_controller.rb +97 -0
- data/lib/vendor/plugins/goldberg/app/controllers/goldberg/content_pages_controller.rb +197 -0
- data/lib/vendor/plugins/goldberg/app/controllers/goldberg/controller_actions_controller.rb +130 -0
- data/lib/vendor/plugins/goldberg/app/controllers/goldberg/menu_items_controller.rb +184 -0
- data/lib/vendor/plugins/goldberg/app/controllers/goldberg/permissions_controller.rb +60 -0
- data/lib/vendor/plugins/goldberg/app/controllers/goldberg/roles_controller.rb +85 -0
- data/lib/vendor/plugins/goldberg/app/controllers/goldberg/roles_permissions_controller.rb +65 -0
- data/lib/vendor/plugins/goldberg/app/controllers/goldberg/site_controllers_controller.rb +157 -0
- data/lib/vendor/plugins/goldberg/app/controllers/goldberg/system_settings_controller.rb +75 -0
- data/lib/vendor/plugins/goldberg/app/controllers/goldberg/users_controller.rb +293 -0
- data/lib/vendor/plugins/goldberg/app/helpers/goldberg/auth_helper.rb +4 -0
- data/lib/vendor/plugins/goldberg/app/helpers/goldberg/content_pages_helper.rb +23 -0
- data/lib/vendor/plugins/goldberg/app/helpers/goldberg/controller_actions_helper.rb +5 -0
- data/lib/vendor/plugins/goldberg/app/helpers/goldberg/menu_items_helper.rb +4 -0
- data/lib/vendor/plugins/goldberg/app/helpers/goldberg/permissions_helper.rb +4 -0
- data/lib/vendor/plugins/goldberg/app/helpers/goldberg/roles_helper.rb +4 -0
- data/lib/vendor/plugins/goldberg/app/helpers/goldberg/roles_permissions_helper.rb +4 -0
- data/lib/vendor/plugins/goldberg/app/helpers/goldberg/site_controllers_helper.rb +4 -0
- data/lib/vendor/plugins/goldberg/app/helpers/goldberg/system_settings_helper.rb +4 -0
- data/lib/vendor/plugins/goldberg/app/helpers/goldberg/users_helper.rb +4 -0
- data/lib/vendor/plugins/goldberg/app/models/goldberg/content_page.rb +134 -0
- data/lib/vendor/plugins/goldberg/app/models/goldberg/controller_action.rb +86 -0
- data/lib/vendor/plugins/goldberg/app/models/goldberg/credentials.rb +128 -0
- data/lib/vendor/plugins/goldberg/app/models/goldberg/menu.rb +198 -0
- data/lib/vendor/plugins/goldberg/app/models/goldberg/menu_item.rb +127 -0
- data/lib/vendor/plugins/goldberg/app/models/goldberg/permission.rb +37 -0
- data/lib/vendor/plugins/goldberg/app/models/goldberg/role.rb +68 -0
- data/lib/vendor/plugins/goldberg/app/models/goldberg/roles_permission.rb +18 -0
- data/lib/vendor/plugins/goldberg/app/models/goldberg/site_controller.rb +60 -0
- data/lib/vendor/plugins/goldberg/app/models/goldberg/system_settings.rb +112 -0
- data/lib/vendor/plugins/goldberg/app/models/goldberg/user.rb +69 -0
- data/lib/vendor/plugins/goldberg/app/models/goldberg/user_mailer.rb +43 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/auth/_login.rhtml +15 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/auth/login.rhtml +22 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/auth/logout.rhtml +2 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/content_pages/_fck_create_folder.rxml +6 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/content_pages/_fck_files.rxml +19 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/content_pages/_form.rhtml +32 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/content_pages/edit.rhtml +10 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/content_pages/fck_speller_pages.rhtml +58 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/content_pages/list.rhtml +22 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/content_pages/new.rhtml +8 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/content_pages/show.rhtml +57 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/content_pages/view.rhtml +1 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/content_pages/view_default.rhtml +1 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/controller_actions/_form.rhtml +53 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/controller_actions/edit.rhtml +9 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/controller_actions/list.rhtml +27 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/controller_actions/new.rhtml +10 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/controller_actions/show.rhtml +13 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/layouts/_tabpanel_js.rhtml +52 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/layouts/_tabpanel_list.rhtml +7 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/menu_items/_breadcrumbs.rhtml +5 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/menu_items/_form.rhtml +42 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/menu_items/_item_list.rhtml +52 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/menu_items/_item_parent_list.rhtml +15 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/menu_items/_menubar.rhtml +21 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/menu_items/_suckerfish.rhtml +14 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/menu_items/edit.rhtml +10 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/menu_items/list-original.rhtml +27 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/menu_items/list.rhtml +16 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/menu_items/new.rhtml +9 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/menu_items/show.rhtml +8 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/permissions/_form.rhtml +7 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/permissions/edit.rhtml +9 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/permissions/list.rhtml +14 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/permissions/new.rhtml +8 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/permissions/show.rhtml +38 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/roles/_form.rhtml +18 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/roles/edit.rhtml +9 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/roles/list.rhtml +21 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/roles/new.rhtml +8 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/roles/show.rhtml +79 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/roles_permissions/_form.rhtml +13 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/roles_permissions/edit.rhtml +9 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/roles_permissions/list.rhtml +24 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/roles_permissions/new.rhtml +8 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/roles_permissions/new_permission_for_role.rhtml +8 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/roles_permissions/show.rhtml +8 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/site_controllers/_form.rhtml +15 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/site_controllers/_list.rhtml +26 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/site_controllers/edit.rhtml +9 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/site_controllers/list.rhtml +107 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/site_controllers/new.rhtml +8 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/site_controllers/show.rhtml +38 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/system_settings/_form.rhtml +71 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/system_settings/edit.rhtml +9 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/system_settings/list.rhtml +27 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/system_settings/new.rhtml +8 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/system_settings/show.rhtml +189 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/user_mailer/confirmation_request.rhtml +19 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/user_mailer/reset_password.rhtml +17 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/user_mailer/reset_password_request.rhtml +23 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/users/_form.rhtml +53 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/users/confirm_registration.rhtml +26 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/users/confirm_registration_submit.rhtml +4 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/users/create.rhtml +19 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/users/edit.rhtml +11 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/users/forgot_password.rhtml +27 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/users/forgot_password_submit.rhtml +4 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/users/list.rhtml +18 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/users/new.rhtml +19 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/users/reset_password.rhtml +11 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/users/reset_password_submit.rhtml +3 -0
- data/lib/vendor/plugins/goldberg/app/views/goldberg/users/show.rhtml +33 -0
- data/lib/vendor/plugins/goldberg/db/ContentPage.yml +466 -0
- data/lib/vendor/plugins/goldberg/db/ControllerAction.yml +162 -0
- data/lib/vendor/plugins/goldberg/db/MenuItem.yml +109 -0
- data/lib/vendor/plugins/goldberg/db/Permission.yml +21 -0
- data/lib/vendor/plugins/goldberg/db/Role.yml +493 -0
- data/lib/vendor/plugins/goldberg/db/RolesPermission.yml +26 -0
- data/lib/vendor/plugins/goldberg/db/SiteController.yml +61 -0
- data/lib/vendor/plugins/goldberg/db/SystemSettings.yml +21 -0
- data/lib/vendor/plugins/goldberg/db/User.yml +15 -0
- data/lib/vendor/plugins/goldberg/db/migrate/001_initial_setup.rb +128 -0
- data/lib/vendor/plugins/goldberg/db/migrate/002_menu_rest_items_users_cached_content_pages.rb +26 -0
- data/lib/vendor/plugins/goldberg/db/migrate/003_self_registration.rb +54 -0
- data/lib/vendor/plugins/goldberg/db/migrate/004_column_fixes.rb +119 -0
- data/lib/vendor/plugins/goldberg/goldberg.txt +1 -0
- data/lib/vendor/plugins/goldberg/init.rb +15 -0
- data/lib/vendor/plugins/goldberg/lib/goldberg.rb +37 -0
- data/lib/vendor/plugins/goldberg/lib/goldberg/controller.rb +10 -0
- data/lib/vendor/plugins/goldberg/lib/goldberg/filters.rb +197 -0
- data/lib/vendor/plugins/goldberg/lib/goldberg/helper.rb +66 -0
- data/lib/vendor/plugins/goldberg/lib/goldberg/migration.rb +113 -0
- data/lib/vendor/plugins/goldberg/lib/goldberg/migrator.rb +133 -0
- data/lib/vendor/plugins/goldberg/lib/goldberg/model.rb +127 -0
- data/lib/vendor/plugins/goldberg/lib/goldberg/routes.rb +49 -0
- data/lib/vendor/plugins/goldberg/lib/goldberg/test_helper.rb +82 -0
- data/lib/vendor/plugins/goldberg/tasks/goldberg_tasks.rake +81 -0
- data/lib/vendor/plugins/goldberg/test/functional/content_pages_controller_test.rb +31 -0
- data/lib/vendor/plugins/goldberg/test/integration/security_test.rb +95 -0
- data/lib/vendor/plugins/goldberg/test/test_helper.rb +40 -0
- data/lib/vendor/plugins/goldberg/test/unit/content_page_test.rb +87 -0
- data/lib/vendor/plugins/goldberg/test/unit/controller_action_test.rb +85 -0
- data/lib/vendor/plugins/goldberg/test/unit/menu_item_test.rb +46 -0
- data/lib/vendor/plugins/goldberg/test/unit/permission_test.rb +35 -0
- data/lib/vendor/plugins/goldberg/test/unit/site_controller_test.rb +53 -0
- data/lib/vendor/plugins/goldberg/test/unit/system_settings_test.rb +71 -0
- data/lib/vendor/plugins/goldberg/test/unit/user_test.rb +104 -0
- data/lib/vendor/plugins/goldberg/themes/common/public/images/action.png +0 -0
- data/lib/vendor/plugins/goldberg/themes/common/public/images/add.png +0 -0
- data/lib/vendor/plugins/goldberg/themes/common/public/images/delete.png +0 -0
- data/lib/vendor/plugins/goldberg/themes/common/public/images/down.png +0 -0
- data/lib/vendor/plugins/goldberg/themes/common/public/images/page.png +0 -0
- data/lib/vendor/plugins/goldberg/themes/common/public/images/permission.png +0 -0
- data/lib/vendor/plugins/goldberg/themes/common/public/images/role.png +0 -0
- data/lib/vendor/plugins/goldberg/themes/common/public/images/up.png +0 -0
- data/lib/vendor/plugins/goldberg/themes/common/public/javascripts/suckerfish.js +12 -0
- data/lib/vendor/plugins/goldberg/themes/common/public/stylesheets/goldberg.css +142 -0
- data/lib/vendor/plugins/goldberg/themes/common/public/stylesheets/suckerfish.css +124 -0
- data/lib/vendor/plugins/goldberg/themes/ewnf/app/views/layouts/application.html.erb +74 -0
- data/lib/vendor/plugins/goldberg/themes/ewnf/public/images/bg.gif +0 -0
- data/lib/vendor/plugins/goldberg/themes/ewnf/public/images/daddy_rightarrow.gif +0 -0
- data/lib/vendor/plugins/goldberg/themes/ewnf/public/images/sample.jpg +0 -0
- data/lib/vendor/plugins/goldberg/themes/ewnf/public/images/title_img.jpg +0 -0
- data/lib/vendor/plugins/goldberg/themes/ewnf/public/stylesheets/layout.css +223 -0
- data/lib/vendor/plugins/goldberg/themes/goldberg/app/views/layouts/application.html.erb +80 -0
- data/lib/vendor/plugins/goldberg/themes/goldberg/public/images/bodybg.jpg +0 -0
- data/lib/vendor/plugins/goldberg/themes/goldberg/public/images/footerbg.jpg +0 -0
- data/lib/vendor/plugins/goldberg/themes/goldberg/public/images/logo_right.jpg +0 -0
- data/lib/vendor/plugins/goldberg/themes/goldberg/public/images/menuhover.jpg +0 -0
- data/lib/vendor/plugins/goldberg/themes/goldberg/public/stylesheets/layout.css +321 -0
- data/lib/vendor/plugins/goldberg/themes/snooker/app/views/layouts/application.html.erb +74 -0
- data/lib/vendor/plugins/goldberg/themes/snooker/public/images/column_200.png +0 -0
- data/lib/vendor/plugins/goldberg/themes/snooker/public/images/daddy_rightarrow.gif +0 -0
- data/lib/vendor/plugins/goldberg/themes/snooker/public/images/footer_bg.png +0 -0
- data/lib/vendor/plugins/goldberg/themes/snooker/public/images/logo.jpg +0 -0
- data/lib/vendor/plugins/goldberg/themes/snooker/public/stylesheets/layout.css +183 -0
- data/lib/vendor/plugins/goldberg/themes/spoiled_brat/app/views/layouts/application.html.erb +71 -0
- data/lib/vendor/plugins/goldberg/themes/spoiled_brat/public/images/blockquote-bg.gif +0 -0
- data/lib/vendor/plugins/goldberg/themes/spoiled_brat/public/images/body-bg.jpg +0 -0
- data/lib/vendor/plugins/goldberg/themes/spoiled_brat/public/images/centerColumn-bg.jpg +0 -0
- data/lib/vendor/plugins/goldberg/themes/spoiled_brat/public/images/daddy_leftarrow.gif +0 -0
- data/lib/vendor/plugins/goldberg/themes/spoiled_brat/public/images/h2-bg.gif +0 -0
- data/lib/vendor/plugins/goldberg/themes/spoiled_brat/public/images/h3-bg.gif +0 -0
- data/lib/vendor/plugins/goldberg/themes/spoiled_brat/public/images/header-bg.jpg +0 -0
- data/lib/vendor/plugins/goldberg/themes/spoiled_brat/public/images/hr-bg.jpg +0 -0
- data/lib/vendor/plugins/goldberg/themes/spoiled_brat/public/images/logo.jpg +0 -0
- data/lib/vendor/plugins/goldberg/themes/spoiled_brat/public/stylesheets/layout.css +379 -0
- data/lib/vendor/plugins/in_place_editing/README +14 -0
- data/lib/vendor/plugins/in_place_editing/Rakefile +22 -0
- data/lib/vendor/plugins/in_place_editing/init.rb +2 -0
- data/lib/vendor/plugins/in_place_editing/lib/in_place_editing.rb +29 -0
- data/lib/vendor/plugins/in_place_editing/lib/in_place_macros_helper.rb +81 -0
- data/lib/vendor/plugins/in_place_editing/test/in_place_editing_test.rb +89 -0
- data/lib/vendor/plugins/in_place_editing/test/test_helper.rb +8 -0
- data/lib/vendor/plugins/recordselect/CHANGELOG +25 -0
- data/lib/vendor/plugins/recordselect/MIT-LICENSE +20 -0
- data/lib/vendor/plugins/recordselect/README +11 -0
- data/lib/vendor/plugins/recordselect/Rakefile +23 -0
- data/lib/vendor/plugins/recordselect/app/helpers/record_select_helper.rb +187 -0
- data/lib/vendor/plugins/recordselect/app/views/record_select/_browse.html.erb +8 -0
- data/lib/vendor/plugins/recordselect/app/views/record_select/_list.html.erb +31 -0
- data/lib/vendor/plugins/recordselect/app/views/record_select/_search.html.erb +14 -0
- data/lib/vendor/plugins/recordselect/app/views/record_select/browse.js.rjs +4 -0
- data/lib/vendor/plugins/recordselect/assets/images/cross.gif +0 -0
- data/lib/vendor/plugins/recordselect/assets/images/next.gif +0 -0
- data/lib/vendor/plugins/recordselect/assets/images/previous.gif +0 -0
- data/lib/vendor/plugins/recordselect/assets/javascripts/record_select.js +352 -0
- data/lib/vendor/plugins/recordselect/assets/stylesheets/record_select.css +129 -0
- data/lib/vendor/plugins/recordselect/init.rb +16 -0
- data/lib/vendor/plugins/recordselect/install.rb +1 -0
- data/lib/vendor/plugins/recordselect/lib/extensions/active_record.rb +9 -0
- data/lib/vendor/plugins/recordselect/lib/localization.rb +8 -0
- data/lib/vendor/plugins/recordselect/lib/record_select.rb +36 -0
- data/lib/vendor/plugins/recordselect/lib/record_select/actions.rb +67 -0
- data/lib/vendor/plugins/recordselect/lib/record_select/conditions.rb +86 -0
- data/lib/vendor/plugins/recordselect/lib/record_select/config.rb +91 -0
- data/lib/vendor/plugins/recordselect/lib/record_select/form_builder.rb +25 -0
- data/lib/vendor/plugins/recordselect/test/recordselect_test.rb +8 -0
- data/lib/vendor/plugins/recordselect/uninstall.rb +4 -0
- data/lib/vendor/plugins/render_component/README +37 -0
- data/lib/vendor/plugins/render_component/Rakefile +22 -0
- data/lib/vendor/plugins/render_component/init.rb +2 -0
- data/lib/vendor/plugins/render_component/lib/components.rb +142 -0
- data/lib/vendor/plugins/render_component/test/abstract_unit.rb +8 -0
- data/lib/vendor/plugins/render_component/test/components_test.rb +140 -0
- data/lib/vendor/plugins/six-app_manager/Rakefile +26 -0
- data/lib/vendor/plugins/six-app_manager/environment.rb +30 -0
- data/lib/vendor/plugins/six-app_manager/init.rb +18 -0
- data/lib/vendor/plugins/six-app_manager/lib/six/appmanager.rb +247 -0
- data/lib/vendor/plugins/six-db_manager/Rakefile +26 -0
- data/lib/vendor/plugins/six-db_manager/db/actions.yml +1 -0
- data/lib/vendor/plugins/six-db_manager/db/actions_sixconfigs.yml +1 -0
- data/lib/vendor/plugins/six-db_manager/db/appsettings.yml +1 -0
- data/lib/vendor/plugins/six-db_manager/db/appsettings_sixconfigs.yml +1 -0
- data/lib/vendor/plugins/six-db_manager/db/goldberg_content_pages.yml +360 -0
- data/lib/vendor/plugins/six-db_manager/db/goldberg_controller_actions.yml +211 -0
- data/lib/vendor/plugins/six-db_manager/db/goldberg_menu_items.yml +169 -0
- data/lib/vendor/plugins/six-db_manager/db/goldberg_permissions.yml +16 -0
- data/lib/vendor/plugins/six-db_manager/db/goldberg_roles.yml +683 -0
- data/lib/vendor/plugins/six-db_manager/db/goldberg_roles_permissions.yml +21 -0
- data/lib/vendor/plugins/six-db_manager/db/goldberg_site_controllers.yml +106 -0
- data/lib/vendor/plugins/six-db_manager/db/goldberg_system_settings.yml +20 -0
- data/lib/vendor/plugins/six-db_manager/db/goldberg_users.yml +27 -0
- data/lib/vendor/plugins/six-db_manager/db/mods.yml +1 -0
- data/lib/vendor/plugins/six-db_manager/db/mods_servers.yml +2 -0
- data/lib/vendor/plugins/six-db_manager/db/mods_sixconfigs.yml +1 -0
- data/lib/vendor/plugins/six-db_manager/db/queryservers.yml +1 -0
- data/lib/vendor/plugins/six-db_manager/db/repositories.yml +1 -0
- data/lib/vendor/plugins/six-db_manager/db/servers.yml +2 -0
- data/lib/vendor/plugins/six-db_manager/db/servers_sixconfigs.yml +2 -0
- data/lib/vendor/plugins/six-db_manager/db/sixconfigs.yml +1 -0
- data/lib/vendor/plugins/six-db_manager/db/system_settings.yml +1 -0
- data/lib/vendor/plugins/six-db_manager/environment.rb +24 -0
- data/lib/vendor/plugins/six-db_manager/init.rb +18 -0
- data/lib/vendor/plugins/six-db_manager/lib/six/dbmanager.rb +204 -0
- data/lib/vendor/plugins/six-guid/Rakefile +26 -0
- data/lib/vendor/plugins/six-guid/environment.rb +24 -0
- data/lib/vendor/plugins/six-guid/init.rb +18 -0
- data/lib/vendor/plugins/six-guid/lib/six/guid.rb +32 -0
- data/lib/vendor/plugins/six-import/Rakefile +26 -0
- data/lib/vendor/plugins/six-import/environment.rb +24 -0
- data/lib/vendor/plugins/six-import/init.rb +18 -0
- data/lib/vendor/plugins/six-import/lib/six/import.rb +133 -0
- data/lib/vendor/plugins/six-network/Rakefile +26 -0
- data/lib/vendor/plugins/six-network/environment.rb +2 -0
- data/lib/vendor/plugins/six-network/init.rb +18 -0
- data/lib/vendor/plugins/six-network/lib/six/network.rb +72 -0
- data/lib/vendor/plugins/six-query/Rakefile +26 -0
- data/lib/vendor/plugins/six-query/app/controllers/sixsense/auth_controller.rb +165 -0
- data/lib/vendor/plugins/six-query/environment.rb +33 -0
- data/lib/vendor/plugins/six-query/init.rb +18 -0
- data/lib/vendor/plugins/six-query/lib/six/query.rb +4 -0
- data/lib/vendor/plugins/six-query/lib/six/query/base.rb +37 -0
- data/lib/vendor/plugins/six-query/lib/six/query/gamespy.rb +107 -0
- data/lib/vendor/plugins/six-query/lib/six/query/gamespy_master.rb +61 -0
- metadata +743 -7
- data/lib/six/updater-web-app.rb +0 -80722
@@ -0,0 +1,75 @@
|
|
1
|
+
module ActiveScaffold::DataStructures
|
2
|
+
class Columns
|
3
|
+
include Enumerable
|
4
|
+
include ActiveScaffold::Configurable
|
5
|
+
|
6
|
+
# The motivation for this collection is that this Columns data structure fills two roles: it provides
|
7
|
+
# the master list of all known columns, and it provides an inheritable list for all other actions (e.g.
|
8
|
+
# Create and Update and List). Well we actually want to *know* about as many columns as possible, so
|
9
|
+
# we don't want people actually removing columns from @set. But at the same time, we want to be able to
|
10
|
+
# manage which columns get inherited. Tada!
|
11
|
+
#
|
12
|
+
# This collection is referenced by other parts of ActiveScaffold and by methods within this DataStructure.
|
13
|
+
# IT IS NOT MEANT FOR PUBLIC USE (but if you know what you're doing, go ahead)
|
14
|
+
def _inheritable=(value)
|
15
|
+
@sorted = true
|
16
|
+
@_inheritable = value
|
17
|
+
end
|
18
|
+
|
19
|
+
# This accessor is used by ActionColumns to create new Column objects without adding them to this set
|
20
|
+
attr_reader :active_record_class
|
21
|
+
|
22
|
+
def initialize(active_record_class, *args)
|
23
|
+
@active_record_class = active_record_class
|
24
|
+
@_inheritable = []
|
25
|
+
@set = []
|
26
|
+
|
27
|
+
self.add *args
|
28
|
+
end
|
29
|
+
|
30
|
+
# the way to add columns to the set. this is primarily useful for virtual columns.
|
31
|
+
# note that this also makes columns inheritable
|
32
|
+
def add(*args)
|
33
|
+
args.flatten! # allow [] as a param
|
34
|
+
args = args.collect{ |a| a.to_sym }
|
35
|
+
|
36
|
+
# make the columns inheritable
|
37
|
+
@_inheritable.concat(args)
|
38
|
+
# then add columns to @set (unless they already exist)
|
39
|
+
args.each { |a| @set << ActiveScaffold::DataStructures::Column.new(a.to_sym, @active_record_class) unless find_by_name(a) }
|
40
|
+
end
|
41
|
+
alias_method :<<, :add
|
42
|
+
|
43
|
+
def exclude(*args)
|
44
|
+
# only remove columns from _inheritable. we never want to completely forget about a column.
|
45
|
+
args.each { |a| @_inheritable.delete a }
|
46
|
+
end
|
47
|
+
|
48
|
+
# returns an array of columns with the provided names
|
49
|
+
def find_by_names(*names)
|
50
|
+
@set.find_all { |column| names.include? column.name }
|
51
|
+
end
|
52
|
+
|
53
|
+
# returns the column of the given name.
|
54
|
+
def find_by_name(name)
|
55
|
+
# this works because of `def column.=='
|
56
|
+
column = @set.find { |c| c == name }
|
57
|
+
column
|
58
|
+
end
|
59
|
+
alias_method :[], :find_by_name
|
60
|
+
|
61
|
+
def each
|
62
|
+
@set.each {|i| yield i }
|
63
|
+
end
|
64
|
+
|
65
|
+
def _inheritable
|
66
|
+
if @sorted
|
67
|
+
@_inheritable
|
68
|
+
else
|
69
|
+
@_inheritable.sort do |a, b|
|
70
|
+
self[a] <=> self[b]
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module ActiveScaffold::DataStructures
|
2
|
+
# Wrapper for error strings so that they may be exported using to_xxx
|
3
|
+
class ErrorMessage
|
4
|
+
def initialize(error)
|
5
|
+
@error = error
|
6
|
+
end
|
7
|
+
|
8
|
+
def public_attributes
|
9
|
+
{ :error => @error }
|
10
|
+
end
|
11
|
+
|
12
|
+
def to_xml
|
13
|
+
public_attributes.to_xml(:root => "errors")
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_yaml
|
17
|
+
public_attributes.to_yaml
|
18
|
+
end
|
19
|
+
|
20
|
+
def to_s
|
21
|
+
@error
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
module ActiveScaffold::DataStructures
|
2
|
+
class Set
|
3
|
+
include Enumerable
|
4
|
+
include ActiveScaffold::Configurable
|
5
|
+
|
6
|
+
attr_writer :label
|
7
|
+
def label
|
8
|
+
as_(@label)
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(*args)
|
12
|
+
@set = []
|
13
|
+
self.add *args
|
14
|
+
end
|
15
|
+
|
16
|
+
# the way to add items to the set.
|
17
|
+
def add(*args)
|
18
|
+
args.flatten! # allow [] as a param
|
19
|
+
args.each { |arg|
|
20
|
+
arg = arg.to_sym if arg.is_a? String
|
21
|
+
@set << arg unless @set.include? arg # avoid duplicates
|
22
|
+
}
|
23
|
+
end
|
24
|
+
alias_method :<<, :add
|
25
|
+
|
26
|
+
# the way to remove items from the set.
|
27
|
+
def exclude(*args)
|
28
|
+
args.flatten! # allow [] as a param
|
29
|
+
args.collect! { |a| a.to_sym } # symbolize the args
|
30
|
+
# check respond_to? :to_sym, ActionColumns doesn't respond to to_sym
|
31
|
+
@set.reject! { |c| c.respond_to? :to_sym and args.include? c.to_sym } # reject all items specified
|
32
|
+
end
|
33
|
+
alias_method :remove, :exclude
|
34
|
+
|
35
|
+
# returns an array of items with the provided names
|
36
|
+
def find_by_names(*names)
|
37
|
+
@set.find_all { |item| names.include? item }
|
38
|
+
end
|
39
|
+
|
40
|
+
# returns the item of the given name.
|
41
|
+
def find_by_name(name)
|
42
|
+
# this works because of `def item.=='
|
43
|
+
item = @set.find { |c| c == name }
|
44
|
+
item
|
45
|
+
end
|
46
|
+
alias_method :[], :find_by_name
|
47
|
+
|
48
|
+
def each
|
49
|
+
@set.each {|i| yield i }
|
50
|
+
end
|
51
|
+
|
52
|
+
# returns the number of items in the set
|
53
|
+
def length
|
54
|
+
@set.length
|
55
|
+
end
|
56
|
+
|
57
|
+
def empty?
|
58
|
+
@set.empty?
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,159 @@
|
|
1
|
+
module ActiveScaffold::DataStructures
|
2
|
+
# encapsulates the column sorting configuration for the List view
|
3
|
+
class Sorting
|
4
|
+
include Enumerable
|
5
|
+
|
6
|
+
def initialize(columns)
|
7
|
+
@columns = columns
|
8
|
+
@clauses = []
|
9
|
+
end
|
10
|
+
|
11
|
+
def set_default_sorting(model)
|
12
|
+
last_scope = model.default_scoping.last
|
13
|
+
if last_scope.nil? || last_scope[:find].nil? || last_scope[:find][:order].nil?
|
14
|
+
set(model.primary_key, 'ASC') if model.column_names.include?(model.primary_key)
|
15
|
+
else
|
16
|
+
set_sorting_from_order_clause(last_scope[:find][:order].to_s, model.table_name)
|
17
|
+
@default_sorting = true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
# add a clause to the sorting, assuming the column is sortable
|
22
|
+
def add(column_name, direction = nil)
|
23
|
+
direction ||= 'ASC'
|
24
|
+
direction = direction.to_s.upcase
|
25
|
+
column = get_column(column_name)
|
26
|
+
raise ArgumentError, "Could not find column #{column_name}" if column.nil?
|
27
|
+
raise ArgumentError, "Sorting direction unknown" unless [:ASC, :DESC].include? direction.to_sym
|
28
|
+
@clauses << [column, direction] if column.sortable?
|
29
|
+
raise ArgumentError, "Can't mix :method- and :sql-based sorting" if mixed_sorting?
|
30
|
+
end
|
31
|
+
|
32
|
+
# an alias for +add+. must accept its arguments in a slightly different form, though.
|
33
|
+
def <<(arg)
|
34
|
+
add(*arg)
|
35
|
+
end
|
36
|
+
|
37
|
+
# clears the sorting before setting to the given column/direction
|
38
|
+
def set(*args)
|
39
|
+
clear
|
40
|
+
add(*args)
|
41
|
+
end
|
42
|
+
|
43
|
+
# clears the sorting
|
44
|
+
def clear
|
45
|
+
@default_sorting = false
|
46
|
+
@clauses = []
|
47
|
+
end
|
48
|
+
|
49
|
+
# checks whether the given column (a Column object or a column name) is in the sorting
|
50
|
+
def sorts_on?(column)
|
51
|
+
!get_clause(column).nil?
|
52
|
+
end
|
53
|
+
|
54
|
+
def direction_of(column)
|
55
|
+
clause = get_clause(column)
|
56
|
+
return if clause.nil?
|
57
|
+
clause[1]
|
58
|
+
end
|
59
|
+
|
60
|
+
# checks whether any column is configured to sort by method (using a proc)
|
61
|
+
def sorts_by_method?
|
62
|
+
@clauses.any? { |sorting| sorting[0].sort.is_a? Hash and sorting[0].sort.has_key? :method }
|
63
|
+
end
|
64
|
+
|
65
|
+
def sorts_by_sql?
|
66
|
+
@clauses.any? { |sorting| sorting[0].sort.is_a? Hash and sorting[0].sort.has_key? :sql }
|
67
|
+
end
|
68
|
+
|
69
|
+
# iterate over the clauses
|
70
|
+
def each
|
71
|
+
@clauses.each { |clause| yield clause }
|
72
|
+
end
|
73
|
+
|
74
|
+
# provides quick access to the first (and sometimes only) clause
|
75
|
+
def first
|
76
|
+
@clauses.first
|
77
|
+
end
|
78
|
+
|
79
|
+
# builds an order-by clause
|
80
|
+
def clause
|
81
|
+
return nil if sorts_by_method? || default_sorting?
|
82
|
+
|
83
|
+
# unless the sorting is by method, create the sql string
|
84
|
+
order = []
|
85
|
+
each do |sort_column, sort_direction|
|
86
|
+
sql = sort_column.sort[:sql]
|
87
|
+
next if sql.nil? or sql.empty?
|
88
|
+
|
89
|
+
order << "#{sql} #{sort_direction}"
|
90
|
+
end
|
91
|
+
|
92
|
+
order.join(', ') unless order.empty?
|
93
|
+
end
|
94
|
+
|
95
|
+
protected
|
96
|
+
|
97
|
+
# retrieves the sorting clause for the given column
|
98
|
+
def get_clause(column)
|
99
|
+
column = get_column(column)
|
100
|
+
@clauses.find{ |clause| clause[0] == column}
|
101
|
+
end
|
102
|
+
|
103
|
+
# possibly converts the given argument into a column object from @columns (if it's not already)
|
104
|
+
def get_column(name_or_column)
|
105
|
+
# it's a column
|
106
|
+
return name_or_column if name_or_column.is_a? ActiveScaffold::DataStructures::Column
|
107
|
+
# it's a name
|
108
|
+
name_or_column = name_or_column.to_s.split('.').last if name_or_column.to_s.include? '.'
|
109
|
+
return @columns[name_or_column]
|
110
|
+
end
|
111
|
+
|
112
|
+
def mixed_sorting?
|
113
|
+
sorts_by_method? and sorts_by_sql?
|
114
|
+
end
|
115
|
+
|
116
|
+
def default_sorting?
|
117
|
+
@default_sorting
|
118
|
+
end
|
119
|
+
|
120
|
+
def set_sorting_from_order_clause(order_clause, model_table_name = nil)
|
121
|
+
clear
|
122
|
+
order_clause.split(',').each do |criterion|
|
123
|
+
unless criterion.blank?
|
124
|
+
order_parts = extract_order_parts(criterion)
|
125
|
+
add(order_parts[:column_name], order_parts[:direction]) unless different_table?(model_table_name, order_parts[:table_name])
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
def extract_order_parts(criterion_parts)
|
131
|
+
column_name_part, direction_part = criterion_parts.strip.split(' ')
|
132
|
+
column_name_parts = column_name_part.split('.')
|
133
|
+
order = {:direction => extract_direction(direction_part),
|
134
|
+
:column_name => remove_quotes(column_name_parts.last)}
|
135
|
+
order[:table_name] = remove_quotes(column_name_parts[-2]) if column_name_parts.length >= 2
|
136
|
+
order
|
137
|
+
end
|
138
|
+
|
139
|
+
def different_table?(model_table_name, order_table_name)
|
140
|
+
!order_table_name.nil? && model_table_name != order_table_name
|
141
|
+
end
|
142
|
+
|
143
|
+
def remove_quotes(sql_name)
|
144
|
+
if sql_name.starts_with?('"') || sql_name.starts_with?('`')
|
145
|
+
sql_name[1, (sql_name.length - 2)]
|
146
|
+
else
|
147
|
+
sql_name
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
def extract_direction(direction_part)
|
152
|
+
if direction_part.to_s.upcase == 'DESC'
|
153
|
+
'DESC'
|
154
|
+
else
|
155
|
+
'ASC'
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
@@ -0,0 +1,331 @@
|
|
1
|
+
module ActiveScaffold
|
2
|
+
module Finder
|
3
|
+
module ClassMethods
|
4
|
+
# Takes a collection of search terms (the tokens) and creates SQL that
|
5
|
+
# searches all specified ActiveScaffold columns. A row will match if each
|
6
|
+
# token is found in at least one of the columns.
|
7
|
+
def create_conditions_for_columns(tokens, columns, like_pattern = '%?%')
|
8
|
+
# if there aren't any columns, then just return a nil condition
|
9
|
+
return unless columns.length > 0
|
10
|
+
|
11
|
+
tokens = [tokens] if tokens.is_a? String
|
12
|
+
|
13
|
+
where_clauses = []
|
14
|
+
columns.each do |column|
|
15
|
+
where_clauses << ((column.column.nil? || column.column.text?) ? "LOWER(#{column.search_sql}) LIKE ?" : "#{column.search_sql} = ?")
|
16
|
+
end
|
17
|
+
phrase = "(#{where_clauses.join(' OR ')})"
|
18
|
+
|
19
|
+
sql = ([phrase] * tokens.length).join(' AND ')
|
20
|
+
tokens = tokens.collect do |value|
|
21
|
+
columns.collect {|column| (column.column.nil? || column.column.text?) ? like_pattern.sub('?', value.downcase) : column.column.type_cast(value)}
|
22
|
+
end.flatten
|
23
|
+
|
24
|
+
[sql, *tokens]
|
25
|
+
end
|
26
|
+
|
27
|
+
# Generates an SQL condition for the given ActiveScaffold column based on
|
28
|
+
# that column's database type (or form_ui ... for virtual columns?).
|
29
|
+
# TODO: this should reside on the column, not the controller
|
30
|
+
def condition_for_column(column, value, like_pattern = '%?%')
|
31
|
+
# we must check false or not blank because we want to search for false but false is blank
|
32
|
+
return unless column and column.search_sql and not value.blank?
|
33
|
+
# AST Begin - TODO - is this still needed?
|
34
|
+
begin
|
35
|
+
return if (value.is_a?(Array) and value.join.blank?)
|
36
|
+
# AST End
|
37
|
+
search_ui = column.search_ui || column.column.type
|
38
|
+
if self.respond_to?("condition_for_#{column.name}_column")
|
39
|
+
self.send("condition_for_#{column.name}_column", column, value, like_pattern)
|
40
|
+
elsif self.respond_to?("condition_for_#{search_ui}_type")
|
41
|
+
self.send("condition_for_#{search_ui}_type", column, value, like_pattern)
|
42
|
+
else
|
43
|
+
case search_ui
|
44
|
+
when :boolean, :checkbox
|
45
|
+
["#{column.search_sql} = ?", column.column.type_cast(value)]
|
46
|
+
when :select
|
47
|
+
["#{column.search_sql} = ?", value[:id]] unless value[:id].blank?
|
48
|
+
when :multi_select
|
49
|
+
["#{column.search_sql} in (?)", value.values.collect{|hash| hash[:id]}]
|
50
|
+
else
|
51
|
+
if column.column.nil? || column.column.text?
|
52
|
+
["LOWER(#{column.search_sql}) LIKE ?", like_pattern.sub('?', value.downcase)]
|
53
|
+
else
|
54
|
+
["#{column.search_sql} = ?", column.column.type_cast(value)]
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
rescue Exception => e
|
59
|
+
logger.error Time.now.to_s + "#{e.inspect} -- on the ActiveScaffold column = :#{column.name}, search_ui = #{search_ui} in #{@controller.class}"
|
60
|
+
raise e
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
# AST why require like_pattern
|
65
|
+
def condition_for_integer_type(column, value, like_pattern = nil)
|
66
|
+
if value['from'].blank? or not ActiveScaffold::Finder::NumericComparators.include?(value['opt'])
|
67
|
+
nil
|
68
|
+
elsif value['opt'] == 'BETWEEN'
|
69
|
+
["#{column.search_sql} BETWEEN ? AND ?", value['from'].to_f, value['to'].to_f]
|
70
|
+
else
|
71
|
+
["#{column.search_sql} #{value['opt']} ?", value['from'].to_f]
|
72
|
+
end
|
73
|
+
end
|
74
|
+
alias_method :condition_for_decimal_type, :condition_for_integer_type
|
75
|
+
alias_method :condition_for_float_type, :condition_for_integer_type
|
76
|
+
# AST condition_for_usa_money_type
|
77
|
+
alias_method :condition_for_usa_money_type, :condition_for_integer_type
|
78
|
+
|
79
|
+
# AST condition_for_string_type
|
80
|
+
def condition_for_string_type(column, value, like_pattern = '%?%')
|
81
|
+
if !value.is_a?(Hash)
|
82
|
+
["LOWER(#{column.search_sql}) LIKE ?", like_pattern.sub('?', value.downcase)]
|
83
|
+
elsif value['from'].blank? or not ActiveScaffold::Finder::StringComparators.flatten.include?(value['opt'])
|
84
|
+
nil
|
85
|
+
elsif value['opt'] == 'BETWEEN'
|
86
|
+
["#{column.search_sql} BETWEEN ? AND ?", value['from'], value['to']]
|
87
|
+
elsif value['opt'].include?('?')
|
88
|
+
["#{column.search_sql} LIKE ?", value['opt'].sub('?', value['from'].downcase)]
|
89
|
+
else
|
90
|
+
["#{column.search_sql} #{value['opt']} ?", value['from']]
|
91
|
+
end
|
92
|
+
end
|
93
|
+
alias_method :condition_for_email_type, :condition_for_string_type
|
94
|
+
alias_method :condition_for_text_type, :condition_for_string_type
|
95
|
+
|
96
|
+
# AST why require like_pattern
|
97
|
+
def condition_for_datetime_type(column, value, like_pattern = nil)
|
98
|
+
conversion = value['from']['hour'].blank? && value['to']['hour'].blank? ? 'to_date' : 'to_time'
|
99
|
+
from_value, to_value = ['from', 'to'].collect do |field|
|
100
|
+
Time.zone.local(*['year', 'month', 'day', 'hour', 'minutes', 'seconds'].collect {|part| value[field][part].to_i}) rescue nil
|
101
|
+
end
|
102
|
+
|
103
|
+
if from_value.nil? and to_value.nil?
|
104
|
+
nil
|
105
|
+
elsif !from_value
|
106
|
+
["#{column.search_sql} <= ?", to_value.send(conversion).to_s(:db)]
|
107
|
+
elsif !to_value
|
108
|
+
["#{column.search_sql} >= ?", from_value.send(conversion).to_s(:db)]
|
109
|
+
else
|
110
|
+
["#{column.search_sql} BETWEEN ? AND ?", from_value.send(conversion).to_s(:db), to_value.send(conversion).to_s(:db)]
|
111
|
+
end
|
112
|
+
end
|
113
|
+
alias_method :condition_for_date_type, :condition_for_datetime_type
|
114
|
+
alias_method :condition_for_time_type, :condition_for_datetime_type
|
115
|
+
alias_method :condition_for_timestamp_type, :condition_for_datetime_type
|
116
|
+
|
117
|
+
# AST Begin
|
118
|
+
def condition_for_exact_type(column, value, like_pattern = nil)
|
119
|
+
["#{column.search_sql} = ?", value]
|
120
|
+
end
|
121
|
+
|
122
|
+
def condition_for_record_select_type(column, value, like_pattern = nil)
|
123
|
+
if value.is_a?(Array)
|
124
|
+
["#{column.search_sql} IN (?)", value]
|
125
|
+
else
|
126
|
+
["#{column.search_sql} = ?", value]
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
def condition_for_multi_select_type(column, value, like_pattern = nil)
|
131
|
+
case value
|
132
|
+
when Hash
|
133
|
+
values = value.values
|
134
|
+
else
|
135
|
+
values = value
|
136
|
+
end
|
137
|
+
["#{column.search_sql} in (?)", values]
|
138
|
+
end
|
139
|
+
alias_method :condition_for_usa_state_type, :condition_for_multi_select_type
|
140
|
+
# AST End
|
141
|
+
end
|
142
|
+
|
143
|
+
NumericComparators = [
|
144
|
+
'=',
|
145
|
+
'>=',
|
146
|
+
'<=',
|
147
|
+
'>',
|
148
|
+
'<',
|
149
|
+
'!=',
|
150
|
+
'BETWEEN'
|
151
|
+
]
|
152
|
+
|
153
|
+
# AST StringComparators
|
154
|
+
StringComparators = [
|
155
|
+
['is_like', '%?%'],
|
156
|
+
['begins_with', '?%'],
|
157
|
+
['ends_with', '%?'],
|
158
|
+
['=', '='],
|
159
|
+
['!=', '!='],
|
160
|
+
['BETWEEN', 'BETWEEN']
|
161
|
+
]
|
162
|
+
|
163
|
+
def self.included(klass)
|
164
|
+
klass.extend ClassMethods
|
165
|
+
end
|
166
|
+
|
167
|
+
protected
|
168
|
+
|
169
|
+
attr_writer :active_scaffold_conditions
|
170
|
+
def active_scaffold_conditions
|
171
|
+
@active_scaffold_conditions ||= []
|
172
|
+
end
|
173
|
+
|
174
|
+
attr_writer :active_scaffold_joins
|
175
|
+
def active_scaffold_joins
|
176
|
+
@active_scaffold_joins ||= []
|
177
|
+
end
|
178
|
+
|
179
|
+
attr_writer :active_scaffold_habtm_joins
|
180
|
+
def active_scaffold_habtm_joins
|
181
|
+
@active_scaffold_habtm_joins ||= []
|
182
|
+
end
|
183
|
+
|
184
|
+
def all_conditions
|
185
|
+
merge_conditions(
|
186
|
+
active_scaffold_conditions, # from the search modules
|
187
|
+
conditions_for_collection, # from the dev
|
188
|
+
conditions_from_params, # from the parameters (e.g. /users/list?first_name=Fred)
|
189
|
+
conditions_from_constraints, # from any constraints (embedded scaffolds)
|
190
|
+
active_scaffold_session_storage[:conditions] # embedding conditions (weaker constraints)
|
191
|
+
)
|
192
|
+
end
|
193
|
+
|
194
|
+
def model_with_named_scope(model = active_scaffold_config.model, scope_definitions = named_scopes_for_collection)
|
195
|
+
case scope_definitions
|
196
|
+
when String
|
197
|
+
model.instance_eval(scope_definitions)
|
198
|
+
when Symbol
|
199
|
+
model.send(scope_definitions)
|
200
|
+
when Array
|
201
|
+
if scope_definitions.any?{|element| element.is_a?(Array)}
|
202
|
+
scope_definitions.inject(model) {|records, scope_definition| records = model_with_named_scope(records, scope_definition)}
|
203
|
+
else
|
204
|
+
model.send(*scope_definitions)
|
205
|
+
end
|
206
|
+
else
|
207
|
+
model
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
# returns a single record (the given id) but only if it's allowed for the specified action.
|
212
|
+
# accomplishes this by checking model.#{action}_authorized?
|
213
|
+
# TODO: this should reside on the model, not the controller
|
214
|
+
def find_if_allowed(id, action, klass = nil)
|
215
|
+
klass ||= active_scaffold_config.model
|
216
|
+
record = klass.find(id)
|
217
|
+
# AST - add some additional info
|
218
|
+
raise ActiveScaffold::RecordNotAllowed, "#{klass} with id = #{id}" unless record.authorized_for?(:action => action.to_sym)
|
219
|
+
return record
|
220
|
+
end
|
221
|
+
|
222
|
+
# returns a Paginator::Page (not from ActiveRecord::Paginator) for the given parameters
|
223
|
+
# options may include:
|
224
|
+
# * :sorting - a Sorting DataStructure (basically an array of hashes of field => direction, e.g. [{:field1 => 'asc'}, {:field2 => 'desc'}]). please note that multi-column sorting has some limitations: if any column in a multi-field sort uses method-based sorting, it will be ignored. method sorting only works for single-column sorting.
|
225
|
+
# * :per_page
|
226
|
+
# * :page
|
227
|
+
# TODO: this should reside on the model, not the controller
|
228
|
+
def find_page(options = {})
|
229
|
+
options.assert_valid_keys :sorting, :per_page, :page, :count_includes
|
230
|
+
|
231
|
+
full_includes = (active_scaffold_joins.blank? ? nil : active_scaffold_joins)
|
232
|
+
search_conditions = all_conditions
|
233
|
+
options[:per_page] ||= 999999999
|
234
|
+
options[:page] ||= 1
|
235
|
+
options[:count_includes] ||= full_includes unless search_conditions.nil?
|
236
|
+
|
237
|
+
klass = model_with_named_scope
|
238
|
+
|
239
|
+
# create a general-use options array that's compatible with Rails finders
|
240
|
+
finder_options = { :order => options[:sorting].try(:clause),
|
241
|
+
:conditions => search_conditions,
|
242
|
+
:joins => joins_for_finder,
|
243
|
+
:include => options[:count_includes]}
|
244
|
+
|
245
|
+
finder_options.merge! custom_finder_options
|
246
|
+
|
247
|
+
# NOTE: we must use :include in the count query, because some conditions may reference other tables
|
248
|
+
count = klass.count(finder_options.reject{|k,v| [:select, :order].include? k})
|
249
|
+
|
250
|
+
# Converts count to an integer if ActiveRecord returned an OrderedHash
|
251
|
+
# that happens when finder_options contains a :group key
|
252
|
+
count = count.length if count.is_a? ActiveSupport::OrderedHash
|
253
|
+
|
254
|
+
finder_options.merge! :include => full_includes
|
255
|
+
|
256
|
+
# we build the paginator differently for method- and sql-based sorting
|
257
|
+
if options[:sorting] and options[:sorting].sorts_by_method?
|
258
|
+
pager = ::Paginator.new(count, options[:per_page]) do |offset, per_page|
|
259
|
+
sorted_collection = sort_collection_by_column(klass.all(finder_options), *options[:sorting].first)
|
260
|
+
sorted_collection.slice(offset, per_page)
|
261
|
+
end
|
262
|
+
else
|
263
|
+
pager = ::Paginator.new(count, options[:per_page]) do |offset, per_page|
|
264
|
+
klass.all(finder_options.merge(:offset => offset, :limit => per_page))
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
pager.page(options[:page])
|
269
|
+
end
|
270
|
+
|
271
|
+
def joins_for_finder
|
272
|
+
case joins_for_collection
|
273
|
+
when String
|
274
|
+
[ joins_for_collection ]
|
275
|
+
when Array
|
276
|
+
joins_for_collection
|
277
|
+
else
|
278
|
+
[]
|
279
|
+
end + active_scaffold_habtm_joins
|
280
|
+
end
|
281
|
+
|
282
|
+
# AST find_page_by_sql
|
283
|
+
def find_page_by_sql(options = {}, sql_options = {})
|
284
|
+
options.assert_valid_keys :sorting, :per_page, :page
|
285
|
+
sql_options.assert_valid_keys :select, :from, :where, :group_by, :order_by
|
286
|
+
options[:per_page] ||= 999999999
|
287
|
+
options[:page] ||= 1
|
288
|
+
|
289
|
+
klass = active_scaffold_config.model
|
290
|
+
|
291
|
+
if active_scaffold_conditions.length > 0
|
292
|
+
sql_options[:where] << " AND " if sql_options[:where]
|
293
|
+
sql_options[:where] ||= " Where "
|
294
|
+
sql_options[:where] << active_scaffold_conditions
|
295
|
+
end
|
296
|
+
count_clause = "Select count(*) #{sql_options[:from]} #{sql_options[:where]}"
|
297
|
+
count_clause = "Select count(*) From (Select count(*) #{sql_options[:from]} #{sql_options[:where]} #{sql_options[:group_by]}) as T" if sql_options[:group_by]
|
298
|
+
count = klass.count_by_sql(count_clause)
|
299
|
+
|
300
|
+
# we build the paginator differently for method- and sql-based sorting
|
301
|
+
if options[:sorting] and options[:sorting].sorts_by_method?
|
302
|
+
pager = ::Paginator.new(count, options[:per_page]) do |offset, per_page|
|
303
|
+
sorted_collection = sort_collection_by_column(klass.find_by_sql("#{sql_options[:select]} #{sql_options[:from]} #{sql_options[:where]} #{sql_options[:group_by]} #{sql_options[:order_by]}"), *options[:sorting].first)
|
304
|
+
sorted_collection.slice(offset, per_page)
|
305
|
+
end
|
306
|
+
else
|
307
|
+
pager = ::Paginator.new(count, options[:per_page]) do |offset, per_page|
|
308
|
+
klass.find_by_sql("#{sql_options[:select]} #{sql_options[:from]} #{sql_options[:where]} #{sql_options[:group_by]} #{sql_options[:order_by]} Limit #{offset}, #{per_page}")
|
309
|
+
end
|
310
|
+
end
|
311
|
+
|
312
|
+
page = pager.page(options[:page])
|
313
|
+
end
|
314
|
+
|
315
|
+
def merge_conditions(*conditions)
|
316
|
+
active_scaffold_config.model.merge_conditions(*conditions)
|
317
|
+
end
|
318
|
+
|
319
|
+
# TODO: this should reside on the column, not the controller
|
320
|
+
def sort_collection_by_column(collection, column, order)
|
321
|
+
sorter = column.sort[:method]
|
322
|
+
collection = collection.sort_by { |record|
|
323
|
+
value = (sorter.is_a? Proc) ? record.instance_eval(&sorter) : record.instance_eval(sorter)
|
324
|
+
value = '' if value.nil?
|
325
|
+
value
|
326
|
+
}
|
327
|
+
collection.reverse! if order.downcase == 'desc'
|
328
|
+
collection
|
329
|
+
end
|
330
|
+
end
|
331
|
+
end
|