brisk-bills 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +8 -0
- data/COPYING +674 -0
- data/COPYING.LESSER +165 -0
- data/INSTALL +5 -0
- data/README +22 -0
- data/Rakefile +11 -0
- data/TODO.txt +112 -0
- data/app/controllers/admin/activities_controller.rb +151 -0
- data/app/controllers/admin/activities_controller/adjustment.rb +16 -0
- data/app/controllers/admin/activities_controller/labor.rb +119 -0
- data/app/controllers/admin/activities_controller/labor/slimtimer.rb +28 -0
- data/app/controllers/admin/activities_controller/material.rb +20 -0
- data/app/controllers/admin/activities_controller/proposal.rb +15 -0
- data/app/controllers/admin/activities_with_prices_controller.rb +68 -0
- data/app/controllers/admin/adjustments_controller.rb +22 -0
- data/app/controllers/admin/client_accounting_controller.rb +49 -0
- data/app/controllers/admin/client_financial_transactions_controller.rb +24 -0
- data/app/controllers/admin/client_representatives_controller.rb +31 -0
- data/app/controllers/admin/clients_controller.rb +31 -0
- data/app/controllers/admin/employee_client_labor_rate_controller.rb +30 -0
- data/app/controllers/admin/employees_controller.rb +32 -0
- data/app/controllers/admin/employees_controller/slimtimer.rb +29 -0
- data/app/controllers/admin/invoices_controller.rb +165 -0
- data/app/controllers/admin/labors_controller.rb +103 -0
- data/app/controllers/admin/labors_controller/slimtimer.rb +31 -0
- data/app/controllers/admin/materials_controller.rb +24 -0
- data/app/controllers/admin/payments_controller.rb +75 -0
- data/app/controllers/admin/proposals_controller.rb +22 -0
- data/app/controllers/admin/settings_controller.rb +23 -0
- data/app/controllers/application_controller.rb +22 -0
- data/app/controllers/authentication_controller.rb +131 -0
- data/app/helpers/activity_type_model_helper.rb +194 -0
- data/app/helpers/admin/activities_helper.rb +110 -0
- data/app/helpers/admin/activities_helper/labor_helper.rb +28 -0
- data/app/helpers/admin/activities_helper/proposal_helper.rb +11 -0
- data/app/helpers/admin/activities_helper/slimtimer_helper.rb +13 -0
- data/app/helpers/admin/activities_with_prices_helper.rb +17 -0
- data/app/helpers/admin/activity_tax_controller_helper.rb +48 -0
- data/app/helpers/admin/activity_tax_field_helper.rb +33 -0
- data/app/helpers/admin/activity_type_controller_helper.rb +83 -0
- data/app/helpers/admin/activity_type_field_helper.rb +45 -0
- data/app/helpers/admin/adjustments_helper.rb +5 -0
- data/app/helpers/admin/client_accounting_helper.rb +13 -0
- data/app/helpers/admin/client_financial_transactions_helper.rb +9 -0
- data/app/helpers/admin/client_representatives_helper.rb +26 -0
- data/app/helpers/admin/clients_helper.rb +6 -0
- data/app/helpers/admin/employee_client_labor_rate_helper.rb +77 -0
- data/app/helpers/admin/employees_helper.rb +9 -0
- data/app/helpers/admin/employees_helper/slimtimer_helper.rb +2 -0
- data/app/helpers/admin/has_credential_column_helper.rb +60 -0
- data/app/helpers/admin/invoices_helper.rb +59 -0
- data/app/helpers/admin/is_active_column_helper.rb +46 -0
- data/app/helpers/admin/labors_helper.rb +20 -0
- data/app/helpers/admin/labors_helper/slimtimer_helper.rb +13 -0
- data/app/helpers/admin/materials_helper.rb +5 -0
- data/app/helpers/admin/payments_helper.rb +41 -0
- data/app/helpers/admin/proposals_helper.rb +3 -0
- data/app/helpers/admin/settings_helper.rb +8 -0
- data/app/helpers/admin_layout_helper.rb +91 -0
- data/app/helpers/application_helper.rb +27 -0
- data/app/helpers/authentication_helper.rb +61 -0
- data/app/helpers/extensible_object_helper.rb +28 -0
- data/app/helpers/has_credential_model_helper.rb +39 -0
- data/app/helpers/invoice_pdf_helper.rb +71 -0
- data/app/helpers/is_active_model_helper.rb +40 -0
- data/app/helpers/money_model_helper.rb +21 -0
- data/app/model_views/client_accounting.rb +5 -0
- data/app/model_views/client_financial_transaction.rb +15 -0
- data/app/model_views/invoices_with_total.rb +36 -0
- data/app/models/activity.rb +104 -0
- data/app/models/activity/adjustment.rb +34 -0
- data/app/models/activity/labor.rb +91 -0
- data/app/models/activity/labor/slimtimer.rb +28 -0
- data/app/models/activity/material.rb +16 -0
- data/app/models/activity/proposal.rb +17 -0
- data/app/models/activity_type.rb +2 -0
- data/app/models/client.rb +93 -0
- data/app/models/client_eventlog.rb +5 -0
- data/app/models/client_representative.rb +22 -0
- data/app/models/credential.rb +195 -0
- data/app/models/employee.rb +49 -0
- data/app/models/employee/labor.rb +13 -0
- data/app/models/employee/slimtimer.rb +43 -0
- data/app/models/employee_client_labor_rate.rb +20 -0
- data/app/models/invoice.rb +280 -0
- data/app/models/invoice_payment.rb +8 -0
- data/app/models/notifier.rb +85 -0
- data/app/models/payment.rb +108 -0
- data/app/models/payment_method.rb +7 -0
- data/app/models/setting.rb +39 -0
- data/app/models/slimtimer_task.rb +6 -0
- data/app/models/slimtimer_time_entry.rb +69 -0
- data/app/views/admin/activities/_adjustment_column.rhtml +23 -0
- data/app/views/admin/activities/_form.rhtml +20 -0
- data/app/views/admin/activities/_form_attribute.rhtml +12 -0
- data/app/views/admin/activities/_labor_column.rhtml +17 -0
- data/app/views/admin/activities/_material_column.rhtml +10 -0
- data/app/views/admin/activities/_proposal_column.rhtml +11 -0
- data/app/views/admin/activities_with_prices/move_to_invoice.rhtml +44 -0
- data/app/views/admin/activities_with_prices/move_to_invoice.rjs +9 -0
- data/app/views/admin/invoices/download.rpdf +224 -0
- data/app/views/authentication/email.rjs +9 -0
- data/app/views/authentication/login.rhtml +75 -0
- data/app/views/authentication/login.rjs +14 -0
- data/app/views/authentication/reset_password_via_token.rhtml +16 -0
- data/app/views/authentication/reset_password_via_token.rjs +6 -0
- data/app/views/authentication/sign_in_error.rjs +2 -0
- data/app/views/layouts/_navigation_tree.rhtml +15 -0
- data/app/views/layouts/admin.rhtml +26 -0
- data/app/views/layouts/public.rhtml +18 -0
- data/app/views/notifier/_email_footer.html.rhtml +12 -0
- data/app/views/notifier/_email_footer.plain.rhtml +3 -0
- data/app/views/notifier/_email_header.html.rhtml +53 -0
- data/app/views/notifier/invoice_available.html.rhtml +5 -0
- data/app/views/notifier/invoice_available.plain.rhtml +4 -0
- data/app/views/notifier/reset_password_requested.html.rhtml +15 -0
- data/app/views/notifier/reset_password_requested.plain.rhtml +9 -0
- data/bin/brisk-bills +51 -0
- data/config/boot.rb +164 -0
- data/config/environment.rb +39 -0
- data/config/environments/development.rb +17 -0
- data/config/environments/production.rb +18 -0
- data/config/environments/test.rb +19 -0
- data/config/locale/en.rb +26 -0
- data/config/routes.rb +20 -0
- data/config/secrets.yml +2 -0
- data/db/migrate/001_create_employees.rb +14 -0
- data/db/migrate/002_create_employee_slimtimers.rb +14 -0
- data/db/migrate/003_create_slimtimer_tasks.rb +21 -0
- data/db/migrate/004_create_slimtimer_time_entries.rb +25 -0
- data/db/migrate/005_create_clients.rb +12 -0
- data/db/migrate/006_create_client_representatives.rb +16 -0
- data/db/migrate/007_create_client_eventlogs.rb +13 -0
- data/db/migrate/008_create_activities.rb +17 -0
- data/db/migrate/009_create_activity_labors.rb +16 -0
- data/db/migrate/010_create_employee_client_labor_rates.rb +19 -0
- data/db/migrate/011_create_activity_adjustments.rb +16 -0
- data/db/migrate/012_create_activity_materials.rb +16 -0
- data/db/migrate/013_create_activity_proposals.rb +18 -0
- data/db/migrate/014_create_invoices.rb +16 -0
- data/db/migrate/015_create_payments.rb +18 -0
- data/db/migrate/016_create_payment_methods.rb +18 -0
- data/db/migrate/017_create_invoice_payments.rb +14 -0
- data/db/migrate/018_create_activity_types.rb +37 -0
- data/db/migrate/019_create_settings.rb +45 -0
- data/db/migrate/020_is_active_employees_clients.rb +11 -0
- data/db/migrate/021_create_views_and_indexes.rb +78 -0
- data/db/migrate/022_create_client_financial_transactions.rb +32 -0
- data/db/migrate/023_create_credentials_migrate_representatives.rb +133 -0
- data/db/migrate/024_updates_for_sales_tax.rb +91 -0
- data/db/migrate/025_alter_credentials_for_reset.rb +11 -0
- data/db/migrate/026_create_st_settings.rb +17 -0
- data/db/migrate/027_create_sessions.rb +16 -0
- data/db/migrate/028_money_to_cents.rb +136 -0
- data/db/schema.rb +301 -0
- data/lib/brisk-bills.rb +17 -0
- data/lib/brisk-bills/initializer.rb +100 -0
- data/lib/dti-navigation-menu/lib/dti-navigation-menu.rb +27 -0
- data/lib/generators/generator_base_extension.rb +16 -0
- data/lib/generators/instance/instance_generator.rb +117 -0
- data/lib/generators/instance/templates/databases/mysql.yml +47 -0
- data/lib/generators/instance/templates/instance_boot.rb +166 -0
- data/lib/generators/instance/templates/instance_environment.rb +65 -0
- data/lib/generators/instance/templates/instance_generate +18 -0
- data/lib/generators/instance/templates/instance_rakefile +3 -0
- data/lib/generators/instance/templates/instance_routes.rb +1 -0
- data/lib/tasks/create_last_months_invoices.rake +37 -0
- data/lib/tasks/credential_tasks.rake +47 -0
- data/lib/tasks/first_time_setup.rake +96 -0
- data/lib/tasks/instance.rake +27 -0
- data/lib/tasks/invoice_as_csv.rake +32 -0
- data/lib/tasks/package.rake +120 -0
- data/lib/tasks/slimtimer_import.rake +198 -0
- data/lib/utilities.rb +18 -0
- data/log/.keep +0 -0
- data/public/.htaccess +40 -0
- data/public/404.html +30 -0
- data/public/500.html +30 -0
- data/public/blank.html +33 -0
- data/public/blank_iframe.html +2 -0
- data/public/dispatch.cgi +10 -0
- data/public/dispatch.fcgi +24 -0
- data/public/dispatch.rb +10 -0
- data/public/favicon.ico +0 -0
- data/public/images/active_scaffold/DO_NOT_EDIT +2 -0
- data/public/images/active_scaffold/default/add.gif +0 -0
- data/public/images/active_scaffold/default/arrow_down.gif +0 -0
- data/public/images/active_scaffold/default/arrow_up.gif +0 -0
- data/public/images/active_scaffold/default/close.gif +0 -0
- data/public/images/active_scaffold/default/cross.png +0 -0
- data/public/images/active_scaffold/default/indicator-small.gif +0 -0
- data/public/images/active_scaffold/default/indicator.gif +0 -0
- data/public/images/active_scaffold/default/magnifier.png +0 -0
- data/public/images/background.gif +0 -0
- data/public/images/brisk-bills-logo.gif +0 -0
- data/public/images/calendar_date_select/calendar.gif +0 -0
- data/public/images/dti-logo.gif +0 -0
- data/public/images/dti-logo.jpg +0 -0
- data/public/images/favicon.ico +0 -0
- data/public/images/invoice-background.jpg +0 -0
- data/public/images/login-form-spinner.gif +0 -0
- data/public/images/nav-arrow.gif +0 -0
- data/public/images/notice-error.gif +0 -0
- data/public/images/notice-info.gif +0 -0
- data/public/images/rails.png +0 -0
- data/public/javascripts/active_scaffold/DO_NOT_EDIT +2 -0
- data/public/javascripts/active_scaffold/default/active_scaffold.js +430 -0
- data/public/javascripts/active_scaffold/default/dhtml_history.js +867 -0
- data/public/javascripts/active_scaffold/default/form_enhancements.js +114 -0
- data/public/javascripts/active_scaffold/default/rico_corner.js +370 -0
- data/public/javascripts/application.js +2 -0
- data/public/javascripts/briskbills-quick-helpers.js +9 -0
- data/public/javascripts/builder.js +136 -0
- data/public/javascripts/controls.js +963 -0
- data/public/javascripts/dragdrop.js +973 -0
- data/public/javascripts/effects.js +1128 -0
- data/public/javascripts/modalbox.js +573 -0
- data/public/javascripts/prototype.js +4320 -0
- data/public/javascripts/scriptaculous.js +58 -0
- data/public/javascripts/shadedborder.js +249 -0
- data/public/javascripts/slider.js +275 -0
- data/public/javascripts/sound.js +55 -0
- data/public/javascripts/unittest.js +568 -0
- data/public/robots.txt +1 -0
- data/public/stylesheets/active_scaffold/DO_NOT_EDIT +2 -0
- data/public/stylesheets/active_scaffold/default/stylesheet-ie.css +35 -0
- data/public/stylesheets/active_scaffold/default/stylesheet.css +809 -0
- data/public/stylesheets/admin/global.css +152 -0
- data/public/stylesheets/admin/pages.css +137 -0
- data/public/stylesheets/admin/screen.css +3 -0
- data/public/stylesheets/admin/structure.css +88 -0
- data/public/stylesheets/modalbox.css +95 -0
- data/public/stylesheets/public/global.css +36 -0
- data/public/stylesheets/public/pages.css +105 -0
- data/public/stylesheets/public/screen.css +3 -0
- data/public/stylesheets/public/structure.css +0 -0
- data/public/stylesheets/spinner.gif +0 -0
- data/script/about +3 -0
- data/script/breakpointer +3 -0
- data/script/console +3 -0
- data/script/dbconsole +3 -0
- data/script/destroy +3 -0
- data/script/generate +3 -0
- data/script/performance/benchmarker +3 -0
- data/script/performance/profiler +3 -0
- data/script/performance/request +3 -0
- data/script/plugin +3 -0
- data/script/process/inspector +3 -0
- data/script/process/reaper +3 -0
- data/script/process/spawner +3 -0
- data/script/runner +3 -0
- data/script/server +3 -0
- data/test/fixtures/activities.yml +28 -0
- data/test/fixtures/activity_adjustments.yml +7 -0
- data/test/fixtures/activity_labors.yml +25 -0
- data/test/fixtures/activity_materials.yml +7 -0
- data/test/fixtures/activity_proposals.yml +7 -0
- data/test/fixtures/activity_types.yml +23 -0
- data/test/fixtures/client_eventlogs.yml +5 -0
- data/test/fixtures/client_financial_transactions.yml +7 -0
- data/test/fixtures/client_representatives.yml +56 -0
- data/test/fixtures/clients.yml +172 -0
- data/test/fixtures/credentials.yml +34 -0
- data/test/fixtures/employee_client_labor_rates.yml +365 -0
- data/test/fixtures/employee_slimtimers.yml +19 -0
- data/test/fixtures/employees.yml +22 -0
- data/test/fixtures/invoice_payments.yml +7 -0
- data/test/fixtures/invoices.yml +7 -0
- data/test/fixtures/payment_methods.yml +7 -0
- data/test/fixtures/payments.yml +7 -0
- data/test/fixtures/settings.yml +7 -0
- data/test/fixtures/slimtimer_tasks.yml +5 -0
- data/test/fixtures/slimtimer_time_entries.yml +5 -0
- data/test/functional/admin/activities_controller_test.rb +8 -0
- data/test/functional/admin/adjustments_controller_test.rb +8 -0
- data/test/functional/admin/client_accounting_controller_test.rb +8 -0
- data/test/functional/admin/client_financial_transactions_controller_test.rb +8 -0
- data/test/functional/admin/client_representatives_controller_test.rb +8 -0
- data/test/functional/admin/clients_controller_test.rb +8 -0
- data/test/functional/admin/employee_client_labor_rate_controller_test.rb +8 -0
- data/test/functional/admin/employees/slimtimer_controller_test.rb +8 -0
- data/test/functional/admin/employees_controller_test.rb +8 -0
- data/test/functional/admin/invoices_controller_test.rb +8 -0
- data/test/functional/admin/labors_controller_test.rb +8 -0
- data/test/functional/admin/materials_controller_test.rb +8 -0
- data/test/functional/admin/payments_controller_test.rb +8 -0
- data/test/functional/admin/proposals_controller_test.rb +8 -0
- data/test/functional/admin/settings_controller_test.rb +8 -0
- data/test/functional/authentication_controller_test.rb +8 -0
- data/test/test_helper.rb +30 -0
- data/test/test_unit_factory_helper.rb +154 -0
- data/test/unit/activity/adjustment_test.rb +8 -0
- data/test/unit/activity/labor_test.rb +279 -0
- data/test/unit/activity/material_test.rb +8 -0
- data/test/unit/activity/proposal_test.rb +8 -0
- data/test/unit/activity_test.rb +83 -0
- data/test/unit/activity_type_test.rb +8 -0
- data/test/unit/client_eventlog_test.rb +10 -0
- data/test/unit/client_financial_transaction_test.rb +8 -0
- data/test/unit/client_representative_test.rb +10 -0
- data/test/unit/client_test.rb +24 -0
- data/test/unit/credential_test.rb +217 -0
- data/test/unit/employee/slimtimer_test.rb +10 -0
- data/test/unit/employee_client_labor_rate_test.rb +8 -0
- data/test/unit/employee_test.rb +25 -0
- data/test/unit/invoice_payment_test.rb +8 -0
- data/test/unit/invoice_test.rb +459 -0
- data/test/unit/notifier_test.rb +9 -0
- data/test/unit/payment_method_test.rb +8 -0
- data/test/unit/payment_test.rb +155 -0
- data/test/unit/setting_test.rb +8 -0
- data/test/unit/slimtimer_task_test.rb +10 -0
- data/test/unit/slimtimer_time_entry_test.rb +132 -0
- data/vendor/plugins/InlineAttachment-0.3.0-modified/README +79 -0
- data/vendor/plugins/InlineAttachment-0.3.0-modified/init.rb +2 -0
- data/vendor/plugins/InlineAttachment-0.3.0-modified/lib/inline_attachment.rb +136 -0
- data/vendor/plugins/InlineAttachment-0.3.0-modified/lib/tmail_content_id.rb +40 -0
- data/vendor/plugins/active_scaffold/CHANGELOG +152 -0
- data/vendor/plugins/active_scaffold/MIT-LICENSE +20 -0
- data/vendor/plugins/active_scaffold/README +28 -0
- data/vendor/plugins/active_scaffold/Rakefile +24 -0
- data/vendor/plugins/active_scaffold/environment.rb +17 -0
- data/vendor/plugins/active_scaffold/frontends/default/images/add.gif +0 -0
- data/vendor/plugins/active_scaffold/frontends/default/images/arrow_down.gif +0 -0
- data/vendor/plugins/active_scaffold/frontends/default/images/arrow_up.gif +0 -0
- data/vendor/plugins/active_scaffold/frontends/default/images/close.gif +0 -0
- data/vendor/plugins/active_scaffold/frontends/default/images/cross.png +0 -0
- data/vendor/plugins/active_scaffold/frontends/default/images/indicator-small.gif +0 -0
- data/vendor/plugins/active_scaffold/frontends/default/images/indicator.gif +0 -0
- data/vendor/plugins/active_scaffold/frontends/default/images/magnifier.png +0 -0
- data/vendor/plugins/active_scaffold/frontends/default/javascripts/active_scaffold.js +430 -0
- data/vendor/plugins/active_scaffold/frontends/default/javascripts/dhtml_history.js +867 -0
- data/vendor/plugins/active_scaffold/frontends/default/javascripts/form_enhancements.js +114 -0
- data/vendor/plugins/active_scaffold/frontends/default/javascripts/rico_corner.js +370 -0
- data/vendor/plugins/active_scaffold/frontends/default/stylesheets/stylesheet-ie.css +35 -0
- data/vendor/plugins/active_scaffold/frontends/default/stylesheets/stylesheet.css +809 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_add_existing_form.html.erb +40 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_create_form.html.erb +49 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_create_form_on_list.html.erb +38 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_field_search.html.erb +45 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_form.html.erb +18 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_association.html.erb +20 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_association_footer.html.erb +42 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_association_header.html.erb +10 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_association_record.html.erb +27 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_attribute.html.erb +12 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_hidden_attribute.html.erb +1 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_messages.html.erb +5 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_horizontal_subform.html.erb +21 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_list.html.erb +37 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_actions.html.erb +13 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_calculations.html.erb +22 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_column_headings.html.erb +32 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_header.html.erb +14 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_inline_adapter.html.erb +9 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_pagination_links.html.erb +30 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_record.html.erb +35 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_live_search.html.erb +25 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_messages.html.erb +10 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_nested.html.erb +44 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_search.html.erb +21 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_show.html.erb +8 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_show_columns.html.erb +11 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_update_actions.html.erb +9 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_update_form.html.erb +53 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/add_existing.js.rjs +16 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/add_existing_form.html.erb +5 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/create.html.erb +5 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/delete.html.erb +13 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/destroy.js.rjs +10 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/edit_associated.js.rjs +15 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/field_search.html.erb +5 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/form_messages.js.rjs +1 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/form_messages_on_create.js.rjs +2 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/form_messages_on_update.js.rjs +2 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/list.html.erb +44 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/on_create.js.rjs +25 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/on_update.js.rjs +11 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/search.html.erb +5 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/show.html.erb +5 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/update.html.erb +8 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/update_column.js.rjs +12 -0
- data/vendor/plugins/active_scaffold/init.rb +18 -0
- data/vendor/plugins/active_scaffold/install.rb +40 -0
- data/vendor/plugins/active_scaffold/install_assets.rb +36 -0
- data/vendor/plugins/active_scaffold/lib/active_record_permissions.rb +123 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold.rb +144 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/core.rb +102 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/create.rb +120 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/delete.rb +46 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/field_search.rb +46 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/list.rb +77 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/live_search.rb +46 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/nested.rb +215 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/search.rb +40 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/show.rb +34 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/subform.rb +17 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/update.rb +114 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/attribute_params.rb +185 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/base.rb +37 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb +189 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/create.rb +43 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/delete.rb +25 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/field_search.rb +53 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/form.rb +49 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/list.rb +134 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/live_search.rb +52 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/nested.rb +31 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb +52 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/show.rb +39 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/subform.rb +33 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/update.rb +32 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/configurable.rb +29 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/constraints.rb +178 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/action_columns.rb +97 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/action_link.rb +136 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/action_links.rb +47 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/actions.rb +45 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/column.rb +297 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/columns.rb +75 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/error_message.rb +24 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/set.rb +62 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/sorting.rb +89 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/finder.rb +234 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/association_helpers.rb +40 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/controller_helpers.rb +25 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/country_helpers.rb +348 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/form_column_helpers.rb +267 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/id_helpers.rb +125 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/list_column_helpers.rb +178 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/pagination_helpers.rb +37 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/search_column_helpers.rb +172 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/show_column_helpers.rb +46 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/view_helpers.rb +196 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/en.rb +66 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/es.yml +64 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/hu.yml +62 -0
- data/vendor/plugins/active_scaffold/lib/bridges/bridge.rb +52 -0
- data/vendor/plugins/active_scaffold/lib/bridges/calendar_date_select/bridge.rb +11 -0
- data/vendor/plugins/active_scaffold/lib/bridges/calendar_date_select/lib/as_cds_bridge.rb +53 -0
- data/vendor/plugins/active_scaffold/lib/bridges/file_column/bridge.rb +12 -0
- data/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/as_file_column_bridge.rb +49 -0
- data/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/file_column_helpers.rb +51 -0
- data/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/form_ui.rb +32 -0
- data/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/list_ui.rb +26 -0
- data/vendor/plugins/active_scaffold/lib/bridges/file_column/test/functional/file_column_keep_test.rb +43 -0
- data/vendor/plugins/active_scaffold/lib/bridges/file_column/test/mock_model.rb +9 -0
- data/vendor/plugins/active_scaffold/lib/bridges/file_column/test/test_helper.rb +15 -0
- data/vendor/plugins/active_scaffold/lib/dhtml_confirm.rb +54 -0
- data/vendor/plugins/active_scaffold/lib/extensions/action_controller_rendering.rb +20 -0
- data/vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb +87 -0
- data/vendor/plugins/active_scaffold/lib/extensions/array.rb +7 -0
- data/vendor/plugins/active_scaffold/lib/extensions/component_response_with_namespacing.rb +17 -0
- data/vendor/plugins/active_scaffold/lib/extensions/generic_view_paths.rb +33 -0
- data/vendor/plugins/active_scaffold/lib/extensions/localize.rb +10 -0
- data/vendor/plugins/active_scaffold/lib/extensions/name_option_for_datetime.rb +12 -0
- data/vendor/plugins/active_scaffold/lib/extensions/nil_id_in_url_params.rb +7 -0
- data/vendor/plugins/active_scaffold/lib/extensions/resources.rb +26 -0
- data/vendor/plugins/active_scaffold/lib/extensions/reverse_associations.rb +56 -0
- data/vendor/plugins/active_scaffold/lib/extensions/to_label.rb +8 -0
- data/vendor/plugins/active_scaffold/lib/extensions/unsaved_associated.rb +61 -0
- data/vendor/plugins/active_scaffold/lib/extensions/unsaved_record.rb +20 -0
- data/vendor/plugins/active_scaffold/lib/extensions/usa_state.rb +46 -0
- data/vendor/plugins/active_scaffold/lib/paginator.rb +136 -0
- data/vendor/plugins/active_scaffold/lib/responds_to_parent.rb +68 -0
- data/vendor/plugins/active_scaffold/public/blank.html +33 -0
- data/vendor/plugins/active_scaffold/test/bridges/bridge_test.rb +47 -0
- data/vendor/plugins/active_scaffold/test/config/create_test.rb +55 -0
- data/vendor/plugins/active_scaffold/test/config/list_test.rb +74 -0
- data/vendor/plugins/active_scaffold/test/config/update_test.rb +17 -0
- data/vendor/plugins/active_scaffold/test/const_mocker.rb +36 -0
- data/vendor/plugins/active_scaffold/test/data_structures/action_columns_test.rb +119 -0
- data/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb +78 -0
- data/vendor/plugins/active_scaffold/test/data_structures/action_links_test.rb +78 -0
- data/vendor/plugins/active_scaffold/test/data_structures/actions_test.rb +25 -0
- data/vendor/plugins/active_scaffold/test/data_structures/association_column_test.rb +41 -0
- data/vendor/plugins/active_scaffold/test/data_structures/column_test.rb +161 -0
- data/vendor/plugins/active_scaffold/test/data_structures/columns_test.rb +69 -0
- data/vendor/plugins/active_scaffold/test/data_structures/error_message_test.rb +28 -0
- data/vendor/plugins/active_scaffold/test/data_structures/set_test.rb +86 -0
- data/vendor/plugins/active_scaffold/test/data_structures/sorting_test.rb +96 -0
- data/vendor/plugins/active_scaffold/test/data_structures/standard_column_test.rb +34 -0
- data/vendor/plugins/active_scaffold/test/data_structures/virtual_column_test.rb +34 -0
- data/vendor/plugins/active_scaffold/test/extensions/active_record_test.rb +45 -0
- data/vendor/plugins/active_scaffold/test/extensions/array.rb +12 -0
- data/vendor/plugins/active_scaffold/test/misc/active_record_permissions.rb +154 -0
- data/vendor/plugins/active_scaffold/test/misc/configurable_test.rb +96 -0
- data/vendor/plugins/active_scaffold/test/misc/constraints_test.rb +175 -0
- data/vendor/plugins/active_scaffold/test/misc/finder_test.rb +70 -0
- data/vendor/plugins/active_scaffold/test/misc/lang_test.rb +12 -0
- data/vendor/plugins/active_scaffold/test/model_stub.rb +39 -0
- data/vendor/plugins/active_scaffold/test/run_all.rb +8 -0
- data/vendor/plugins/active_scaffold/test/test_helper.rb +13 -0
- data/vendor/plugins/active_scaffold/uninstall.rb +12 -0
- data/vendor/plugins/active_scaffold_as_gem/init.rb +21 -0
- data/vendor/plugins/active_scaffold_form_observation/init.rb +4 -0
- data/vendor/plugins/active_scaffold_form_observation/lib/active_scaffold_form_observation.rb +99 -0
- data/vendor/plugins/active_scaffold_full_refresh/init.rb +7 -0
- data/vendor/plugins/active_scaffold_full_refresh/lib/active_scaffold_full_refresh.rb +46 -0
- data/vendor/plugins/active_scaffold_move_column_under/init.rb +17 -0
- data/vendor/plugins/acts_as_money/README +24 -0
- data/vendor/plugins/acts_as_money/Rakefile +22 -0
- data/vendor/plugins/acts_as_money/init.rb +3 -0
- data/vendor/plugins/acts_as_money/install.rb +1 -0
- data/vendor/plugins/acts_as_money/lib/acts_as_money.rb +27 -0
- data/vendor/plugins/acts_as_money/tasks/money_tasks.rake +4 -0
- data/vendor/plugins/acts_as_money/test/money_test.rb +8 -0
- data/vendor/plugins/association_hacks/init.rb +1 -0
- data/vendor/plugins/association_hacks/lib/association_hacks.rb +27 -0
- data/vendor/plugins/railspdf/CHANGELOG +5 -0
- data/vendor/plugins/railspdf/README +88 -0
- data/vendor/plugins/railspdf/Rakefile +22 -0
- data/vendor/plugins/railspdf/TODO +1 -0
- data/vendor/plugins/railspdf/init.rb +3 -0
- data/vendor/plugins/railspdf/lib/railspdf.rb +65 -0
- data/vendor/plugins/railspdf/test/railspdf_test.rb +14 -0
- data/vendor/plugins/railspdf/test/test_helper.rb +9 -0
- data/vendor/plugins/render_component/README +37 -0
- data/vendor/plugins/render_component/Rakefile +22 -0
- data/vendor/plugins/render_component/init.rb +2 -0
- data/vendor/plugins/render_component/lib/components.rb +142 -0
- data/vendor/plugins/render_component/test/abstract_unit.rb +8 -0
- data/vendor/plugins/render_component/test/components_test.rb +140 -0
- metadata +657 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
module TMail
|
2
|
+
|
3
|
+
class HeaderField # redefine
|
4
|
+
|
5
|
+
FNAME_TO_CLASS = {
|
6
|
+
'date' => DateTimeHeader,
|
7
|
+
'resent-date' => DateTimeHeader,
|
8
|
+
'to' => AddressHeader,
|
9
|
+
'cc' => AddressHeader,
|
10
|
+
'bcc' => AddressHeader,
|
11
|
+
'from' => AddressHeader,
|
12
|
+
'reply-to' => AddressHeader,
|
13
|
+
'resent-to' => AddressHeader,
|
14
|
+
'resent-cc' => AddressHeader,
|
15
|
+
'resent-bcc' => AddressHeader,
|
16
|
+
'resent-from' => AddressHeader,
|
17
|
+
'resent-reply-to' => AddressHeader,
|
18
|
+
'sender' => SingleAddressHeader,
|
19
|
+
'resent-sender' => SingleAddressHeader,
|
20
|
+
'return-path' => ReturnPathHeader,
|
21
|
+
'message-id' => MessageIdHeader,
|
22
|
+
'resent-message-id' => MessageIdHeader,
|
23
|
+
'in-reply-to' => ReferencesHeader,
|
24
|
+
'received' => ReceivedHeader,
|
25
|
+
'references' => ReferencesHeader,
|
26
|
+
'keywords' => KeywordsHeader,
|
27
|
+
'encrypted' => EncryptedHeader,
|
28
|
+
'mime-version' => MimeVersionHeader,
|
29
|
+
'content-type' => ContentTypeHeader,
|
30
|
+
'content-transfer-encoding' => ContentTransferEncodingHeader,
|
31
|
+
'content-disposition' => ContentDispositionHeader,
|
32
|
+
# 'content-id' => MessageIdHeader,
|
33
|
+
'subject' => UnstructuredHeader,
|
34
|
+
'comments' => UnstructuredHeader,
|
35
|
+
'content-description' => UnstructuredHeader
|
36
|
+
}
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
@@ -0,0 +1,152 @@
|
|
1
|
+
= 1.2RC1
|
2
|
+
|
3
|
+
== FEATURES
|
4
|
+
|
5
|
+
- Added view helpers (active_scaffold_javascripts, active_scaffold_stylesheets, active_scaffold_ie_stylesheets) to help with asset cacheing (Alexander Semyonov)
|
6
|
+
- Works with Rails 2.1 (2.0 / 1.2.x will continue to be supported by version 1.1)
|
7
|
+
|
8
|
+
== FIXES
|
9
|
+
|
10
|
+
- Javascript compatibility with FF3 / Safari 3.1 (Mike Dalessio)
|
11
|
+
see http://groups.google.com/group/activescaffold/browse_thread/thread/d37afa3f2ac687f2/b34ebf62d767bee3
|
12
|
+
- Avoid ruby deprecation warning in config/list.rb (Dustin Sallings)
|
13
|
+
- Fixes bug where template overrides are ignored when placed in Engines plugins (Mike Dalessio)
|
14
|
+
- Fixed in_place_editor to work with latest control.js
|
15
|
+
- Fixed infinite recursion bug when creating a new record with a new association
|
16
|
+
- Subform action name conflict fix
|
17
|
+
- Helpful warning message if record_select is not on a column with an association
|
18
|
+
|
19
|
+
= 1.1.1
|
20
|
+
|
21
|
+
== FIXES
|
22
|
+
|
23
|
+
* rendering for rails 1.2.x
|
24
|
+
|
25
|
+
= 1.1.0
|
26
|
+
|
27
|
+
== FEATURES
|
28
|
+
|
29
|
+
* `render :super' now accepts a :locals option
|
30
|
+
* parameter-based conditions now support arrays of values (e.g. users?name[]=bob&name[]=fred becomes "name IN ('bob', 'fred')")
|
31
|
+
|
32
|
+
== FIXES
|
33
|
+
|
34
|
+
* `render :super' now works from active_scaffold_overrides without endlessly looping
|
35
|
+
* `render :super' no longer assumes that the *immediate* caller was the override template file
|
36
|
+
* `render :super' works better with windows file names (e.g. c:/...)
|
37
|
+
* reload_if_empty() javascript now uses GET
|
38
|
+
* inplace_edit now uses POST instead of GET
|
39
|
+
* adding time and date fields to ignore list for determining whether subform row is empty. previously only datetime was ignored.
|
40
|
+
* closed a potential internet explorer security issue in dhtml_history.js library
|
41
|
+
|
42
|
+
= 1.1.0 RC1
|
43
|
+
|
44
|
+
== FEATURES
|
45
|
+
|
46
|
+
=== LIST
|
47
|
+
* row class: new helper method (list_row_class) gets called for each record in the list and returns a CSS class.
|
48
|
+
* automatically link to the :show action of singular associations. this is similar to the nested scaffolds for plural associations.
|
49
|
+
* column.list_ui: good for when you want to render multiple columns the same way.
|
50
|
+
* * built-in list interface options:
|
51
|
+
* * * for inplace edits - checkbox
|
52
|
+
* Support :joins_for_collection in column_calculation
|
53
|
+
* inplace_edit option on list columns. currently works for text boxes and booleans
|
54
|
+
|
55
|
+
=== CREATE/UPDATE
|
56
|
+
* file uploads - largely taken care of by file_column bridge.
|
57
|
+
* * automatically detects if FileColumn is installed. If so, uses it, and sets the form_ui for file columns to be file upload fields
|
58
|
+
* * sets multipart? on config.create and config.update if file_columns are used on the target model
|
59
|
+
* * Posts through iframe to give ajax-style file uploads
|
60
|
+
* * Image columns are recognized and previewed as such
|
61
|
+
* * Ability to delete a file
|
62
|
+
* form_ui
|
63
|
+
* * form interface options are now supported through helper method named active_scaffold_input_#{form_ui}. if you want a different form interface than activescaffold normally provides, you may configure the form_ui for that column to use one of these methods. you can easily define your own, too.
|
64
|
+
* * built-in form interface options:
|
65
|
+
* * * for associations - singular_association, plural_association, select, record_select
|
66
|
+
* * * others - select, checkbox, country, password, textarea, usa_state, virtual, boolean
|
67
|
+
* * subforms respect form_ui settings. but if form_ui is empty, it will be set to :select to disable subform nesting.
|
68
|
+
* boolean columns: when the database column allows nil, we now add a third option to the dropdown so you don't *have* to pick true or false.
|
69
|
+
* new :params option for a column lets you specify additional parameters to accept when the given column is on the form. this is for when a column needs to submit multiple values to work.
|
70
|
+
* improved support for associations in parameters. for simply selecting/deselecting associations, activescaffold will now recognize `:user => 5' or `:users => [1, 2, 5]'.
|
71
|
+
* Supply a unique id from active_scaffold_input_options for form fields.
|
72
|
+
* added after_update_save controller override method
|
73
|
+
|
74
|
+
=== EMBEDDING
|
75
|
+
* `render :active_scaffold' now accepts a :conditions option, which is a weaker but more flexible variation of :constraints
|
76
|
+
* active_scaffold_includes now accepts a frontend name. this is necessary so you can include the proper assets even if active_scaffold isn't configured on the current controller (it's embedded).
|
77
|
+
* polymorphic constraints are now supported, assuming params[:parent_model].to_s is the proper content for the polymorphic _type field.
|
78
|
+
* Beefing up the constraint system so it can handle has_one/belongs_to. Specifically, it can now disassociate a previous relationship before setting a new one. For example, Bear has_one Den. If creating a new Den, constrained to a certain Bear, the constraints system will now disassociate any previous Den from the Bear before associating the new one.
|
79
|
+
|
80
|
+
=== NESTING
|
81
|
+
* :through associations may now be nested
|
82
|
+
* nested#shallow_delete
|
83
|
+
|
84
|
+
=== SEARCH
|
85
|
+
* fieldsearch module handles booleans better - provides third option so you don't *have* to search on a boolean column
|
86
|
+
* In field search lock_version is the only magic column. May want to search by :id or date fields.
|
87
|
+
|
88
|
+
=== GENERAL
|
89
|
+
* use #human_name for the column label when possible.
|
90
|
+
* merge_conditions now supports hash conditions (and should forever support every conditions style that ActiveRecord supports)
|
91
|
+
* action links may now remove an action link with #clear_link
|
92
|
+
* action links have a new :controller option, so you don't have to sneak it into :params anymore
|
93
|
+
* dhtml history may now be disabled
|
94
|
+
* authorized_for? in ActiveRecordPermissions now calls respond_to? only as much as needed
|
95
|
+
* removing an assert_valid_keys? call in active_record_permissions#authorized_for?. it just wasn't worth the CPU time.
|
96
|
+
* render :super is now extension-agnostic. ex: `render :super` in list.html.erb will properly find list.rhtml as the "parent" template.
|
97
|
+
* Auto-bridge loading mechanism. Bridges integrated into core.
|
98
|
+
* inherited_view_paths: ability to specify other folders to look for if missing view occurs
|
99
|
+
|
100
|
+
== FIXES
|
101
|
+
|
102
|
+
=== LIST
|
103
|
+
* the calculation row now updates on edit/create/destroy.
|
104
|
+
* list now returns to page 1 if the current page has no records.
|
105
|
+
* list will now try to reload the scaffold on a previous page if you delete the last entry on the current page.
|
106
|
+
* if there were no end-of-line record actions, then any column actions would not use ajax. this was because the loading indicator was missing, which messed up the action link javascript.
|
107
|
+
* theme == :default no longer attempts to use Rico.Corner
|
108
|
+
* column_empty? now treats any values equal to list.empty_field_text as empty, too.
|
109
|
+
* better :method handling for action links.
|
110
|
+
* the ' ' fix for ie6 was failing for value types that weren't nil and didn't respond to empty?
|
111
|
+
* if someone sets singular columns to link to the 'nested' action, the link will now render with the appropriate id parameter.
|
112
|
+
* do not propagate params[:search] through action links that link to other controllers. closes issue #447.
|
113
|
+
* reworked rendering of pagination links for IE
|
114
|
+
|
115
|
+
=== CREATE/UPDATE
|
116
|
+
* constraints are now applied to a record during the #new action, in case any custom form rendering depends on the constrained column
|
117
|
+
* the default options_for_association_conditions now returns nil for :through associations
|
118
|
+
* will not update a record attribute if the value hasn't changed. this is a workaround for an activerecord bug with has_one associations.
|
119
|
+
* attributes_hash_is_empty? didn't handle multi-parameter attribute names like 'created_at(5i)', which resulted in extra records being created from subforms.
|
120
|
+
* Hide hidden column header labels - like lock_version - in sub-forms.
|
121
|
+
* configuring url_for to not escape ampersands for the add_new_url in association footers (the 'create another' button's url)
|
122
|
+
* attribute_params.rb#attributes_hash_is_empty now checks defaults by converting them to strings to match the parameter values.
|
123
|
+
|
124
|
+
=== NESTING
|
125
|
+
* no longer trying to nest a polymorphic association (there's no consistent model to list)
|
126
|
+
* fixed :conditions generation for nested/embedded scaffolds - was causing a bind variable mismatch.
|
127
|
+
|
128
|
+
=== SEARCH
|
129
|
+
* search/livesearch should no longer choke on virtual columns
|
130
|
+
* the search/live_search forms will now ignore params[:search] when generating the submit url
|
131
|
+
|
132
|
+
=== GENERAL
|
133
|
+
* no longer blow up on data strings with unintentional % characters. as_() was sprintf'ing too frequently.
|
134
|
+
* link_to no longer blows up on controller symbols
|
135
|
+
* activescaffold no longer loses information on columns - `config.columns.add', `config.columns = [...]', and `config.columns.exclude' all now affect the *inheritability* of a column by the other modules (list, create, update, etc.), but all columns remain in config.columns. this also makes _id columns behave better.
|
136
|
+
* dhtml history no longer saves null:null:null history bookmark.
|
137
|
+
* if there aren't any columns to search on, then activescaffold no longer creates an empty WHERE clause
|
138
|
+
* render :update was failing in some cases because activescaffold wasn't expecting blocks to the render call.
|
139
|
+
* quoting the scaffold id for report_500_response()
|
140
|
+
* adding :update_column => :post to the RESTful routing. closes issue #448.
|
141
|
+
|
142
|
+
== MISC
|
143
|
+
|
144
|
+
* reorganized the helpers and extensions
|
145
|
+
* ui_type is now only an alias for form_ui
|
146
|
+
* improvements to exception messages
|
147
|
+
* when initializing in production mode, activescaffold now recovers gracefully if it can't copy asset files
|
148
|
+
* RESTful routing is now accomplished in a way that'll let other add-ons extend the meaning of :active_scaffold => true.
|
149
|
+
* fixes for edge rails compatibility
|
150
|
+
* small improvements for localization accessibility
|
151
|
+
* minor string renaming (will affect localization tables, though)
|
152
|
+
* closed a few XSS holes
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2006 Richard White
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,28 @@
|
|
1
|
+
**********************************************************************************
|
2
|
+
** For all documentation see the project website: http://www.ActiveScaffold.com **
|
3
|
+
**********************************************************************************
|
4
|
+
|
5
|
+
ActiveScaffold plugin by Scott Rutherford (scott@caronsoftware.com), Richard White (rrwhite@gmail.com), Lance Ivy (lance@cainlevy.net), Ed Moss, and Tim Harper
|
6
|
+
|
7
|
+
Uses DhtmlHistory by Brad Neuberg (bkn3@columbia.edu)
|
8
|
+
http://codinginparadise.org
|
9
|
+
|
10
|
+
Uses Querystring by Adam Vandenberg
|
11
|
+
http://adamv.com/dev/javascript/querystring
|
12
|
+
|
13
|
+
Uses Paginator by Bruce Williams
|
14
|
+
http://paginator.rubyforge.org/
|
15
|
+
|
16
|
+
Supports RecordSelect by Lance Ivy
|
17
|
+
http://code.google.com/p/recordselect/
|
18
|
+
|
19
|
+
== Version Information
|
20
|
+
|
21
|
+
Please note the following list of Active Scaffold branches and Rails versions. Master will not work with Rails < 2.2
|
22
|
+
|
23
|
+
Rails master (edge): Active Scaffold master
|
24
|
+
Rails 2.2.*: Active Scaffold rails-2.2
|
25
|
+
Rails 2.1.*: Active Scaffold rails-2.1
|
26
|
+
Rails < 2.1: Active Scaffold 1-1-stable (no guarantees)
|
27
|
+
|
28
|
+
Released under the MIT license (included)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/testtask'
|
3
|
+
require 'rake/packagetask'
|
4
|
+
require 'rake/rdoctask'
|
5
|
+
require 'find'
|
6
|
+
|
7
|
+
desc 'Default: run unit tests.'
|
8
|
+
task :default => :test
|
9
|
+
|
10
|
+
desc 'Test ActiveScaffold.'
|
11
|
+
Rake::TestTask.new(:test) do |t|
|
12
|
+
t.libs << 'lib'
|
13
|
+
t.pattern = 'test/**/*_test.rb'
|
14
|
+
t.verbose = true
|
15
|
+
end
|
16
|
+
|
17
|
+
desc 'Generate documentation for ActiveScaffold.'
|
18
|
+
Rake::RDocTask.new(:rdoc) do |rdoc|
|
19
|
+
rdoc.rdoc_dir = 'rdoc'
|
20
|
+
rdoc.title = 'ActiveScaffold'
|
21
|
+
rdoc.options << '--line-numbers' << '--inline-source'
|
22
|
+
rdoc.rdoc_files.include('README')
|
23
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
24
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'active_scaffold'
|
2
|
+
|
3
|
+
# TODO: clean up extensions. some could be organized for autoloading, and others could be removed entirely.
|
4
|
+
Dir["#{File.dirname __FILE__}/lib/extensions/*.rb"].each { |file| require file }
|
5
|
+
|
6
|
+
ActionController::Base.send(:include, ActiveScaffold)
|
7
|
+
ActionController::Base.send(:include, RespondsToParent)
|
8
|
+
ActionController::Base.send(:include, ActiveScaffold::Helpers::ControllerHelpers)
|
9
|
+
ActionView::Base.send(:include, ActiveScaffold::Helpers::ViewHelpers)
|
10
|
+
|
11
|
+
ActionController::Base.class_eval {include ActiveRecordPermissions::ModelUserAccess::Controller}
|
12
|
+
ActiveRecord::Base.class_eval {include ActiveRecordPermissions::ModelUserAccess::Model}
|
13
|
+
ActiveRecord::Base.class_eval {include ActiveRecordPermissions::Permissions}
|
14
|
+
|
15
|
+
require 'bridges/bridge.rb'
|
16
|
+
|
17
|
+
I18n.load_path += Dir[File.join(File.dirname(__FILE__), 'lib', 'active_scaffold', 'locale', '*.{rb,yml}')]
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,430 @@
|
|
1
|
+
if (typeof Prototype == 'undefined')
|
2
|
+
{
|
3
|
+
warning = "ActiveScaffold Error: Prototype could not be found. Please make sure that your application's layout includes prototype.js (e.g. <%= javascript_include_tag :defaults %>) *before* it includes active_scaffold.js (e.g. <%= active_scaffold_includes %>).";
|
4
|
+
alert(warning);
|
5
|
+
}
|
6
|
+
if (Prototype.Version.substring(0, 3) != '1.6')
|
7
|
+
{
|
8
|
+
warning = "ActiveScaffold Error: Prototype version 1.6.x is required. Please update prototype.js (rake rails:update:javascripts).";
|
9
|
+
alert(warning);
|
10
|
+
}
|
11
|
+
|
12
|
+
/*
|
13
|
+
* Simple utility methods
|
14
|
+
*/
|
15
|
+
|
16
|
+
var ActiveScaffold = {
|
17
|
+
records_for: function(tbody_id) {
|
18
|
+
var rows = [];
|
19
|
+
var child = $(tbody_id).down('.record');
|
20
|
+
while (child) {
|
21
|
+
rows.push(child);
|
22
|
+
child = child.next('.record');
|
23
|
+
}
|
24
|
+
return rows;
|
25
|
+
},
|
26
|
+
stripe: function(tbody_id) {
|
27
|
+
var even = false;
|
28
|
+
var rows = this.records_for(tbody_id);
|
29
|
+
for (var i = 0; i < rows.length; i++) {
|
30
|
+
var child = rows[i];
|
31
|
+
//Make sure to skip rows that are create or edit rows or messages
|
32
|
+
if (child.tagName != 'SCRIPT'
|
33
|
+
&& !child.hasClassName("create")
|
34
|
+
&& !child.hasClassName("update")
|
35
|
+
&& !child.hasClassName("inline-adapter")
|
36
|
+
&& !child.hasClassName("active-scaffold-calculations")) {
|
37
|
+
|
38
|
+
if (even) child.addClassName("even-record");
|
39
|
+
else child.removeClassName("even-record");
|
40
|
+
|
41
|
+
even = !even;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
},
|
45
|
+
hide_empty_message: function(tbody, empty_message_id) {
|
46
|
+
if (this.records_for(tbody).length != 0) {
|
47
|
+
$(empty_message_id).hide();
|
48
|
+
}
|
49
|
+
},
|
50
|
+
reload_if_empty: function(tbody, url) {
|
51
|
+
var content_container_id = tbody.replace('tbody', 'content');
|
52
|
+
if (this.records_for(tbody).length == 0) {
|
53
|
+
new Ajax.Updater($(content_container_id), url, {
|
54
|
+
method: 'get',
|
55
|
+
asynchronous: true,
|
56
|
+
evalScripts: true
|
57
|
+
});
|
58
|
+
}
|
59
|
+
},
|
60
|
+
removeSortClasses: function(scaffold_id) {
|
61
|
+
$$('#' + scaffold_id + ' td.sorted').each(function(element) {
|
62
|
+
element.removeClassName("sorted");
|
63
|
+
});
|
64
|
+
$$('#' + scaffold_id + ' th.sorted').each(function(element) {
|
65
|
+
element.removeClassName("sorted");
|
66
|
+
element.removeClassName("asc");
|
67
|
+
element.removeClassName("desc");
|
68
|
+
});
|
69
|
+
},
|
70
|
+
decrement_record_count: function(scaffold_id) {
|
71
|
+
// decrement the last record count, firsts record count are in nested lists
|
72
|
+
count = $$('#' + scaffold_id + ' span.active-scaffold-records').last();
|
73
|
+
count.innerHTML = parseInt(count.innerHTML) - 1;
|
74
|
+
},
|
75
|
+
increment_record_count: function(scaffold_id) {
|
76
|
+
// increment the last record count, firsts record count are in nested lists
|
77
|
+
count = $$('#' + scaffold_id + ' span.active-scaffold-records').last();
|
78
|
+
count.innerHTML = parseInt(count.innerHTML) + 1;
|
79
|
+
},
|
80
|
+
|
81
|
+
server_error_response: '',
|
82
|
+
report_500_response: function(active_scaffold_id) {
|
83
|
+
messages_container = $(active_scaffold_id).down('td.messages-container');
|
84
|
+
new Insertion.Top(messages_container, this.server_error_response);
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
/*
|
89
|
+
* DHTML history tie-in
|
90
|
+
*/
|
91
|
+
function addActiveScaffoldPageToHistory(url, active_scaffold_id) {
|
92
|
+
if (typeof dhtmlHistory == 'undefined') return; // it may not be loaded
|
93
|
+
|
94
|
+
var array = url.split('?');
|
95
|
+
var qs = new Querystring(array[1]);
|
96
|
+
var sort = qs.get('sort')
|
97
|
+
var dir = qs.get('sort_direction')
|
98
|
+
var page = qs.get('page')
|
99
|
+
if (sort || dir || page) dhtmlHistory.add(active_scaffold_id+":"+page+":"+sort+":"+dir, url);
|
100
|
+
}
|
101
|
+
|
102
|
+
/*
|
103
|
+
* Add-ons/Patches to Prototype
|
104
|
+
*/
|
105
|
+
|
106
|
+
/* patch to support replacing TR/TD/TBODY in Internet Explorer, courtesy of http://dev.rubyonrails.org/ticket/4273 */
|
107
|
+
Element.replace = function(element, html) {
|
108
|
+
element = $(element);
|
109
|
+
if (element.outerHTML) {
|
110
|
+
try {
|
111
|
+
element.outerHTML = html.stripScripts();
|
112
|
+
} catch (e) {
|
113
|
+
var tn = element.tagName;
|
114
|
+
if(tn=='TBODY' || tn=='TR' || tn=='TD')
|
115
|
+
{
|
116
|
+
var tempDiv = document.createElement("div");
|
117
|
+
tempDiv.innerHTML = '<table id="tempTable" style="display: none">' + html.stripScripts() + '</table>';
|
118
|
+
element.parentNode.replaceChild(tempDiv.getElementsByTagName(tn).item(0), element);
|
119
|
+
}
|
120
|
+
else throw e;
|
121
|
+
}
|
122
|
+
} else {
|
123
|
+
var range = element.ownerDocument.createRange();
|
124
|
+
/* patch to fix <form> replaces in Firefox. see http://dev.rubyonrails.org/ticket/8010 */
|
125
|
+
range.selectNodeContents(element.parentNode);
|
126
|
+
element.parentNode.replaceChild(range.createContextualFragment(html.stripScripts()), element);
|
127
|
+
}
|
128
|
+
setTimeout(function() {html.evalScripts()}, 10);
|
129
|
+
return element;
|
130
|
+
};
|
131
|
+
|
132
|
+
/*
|
133
|
+
* URL modification support. Incomplete functionality.
|
134
|
+
*/
|
135
|
+
Object.extend(String.prototype, {
|
136
|
+
append_params: function(params) {
|
137
|
+
url = this;
|
138
|
+
if (url.indexOf('?') == -1) url += '?';
|
139
|
+
else if (url.lastIndexOf('&') != url.length) url += '&';
|
140
|
+
|
141
|
+
url += $H(params).collect(function(item) {
|
142
|
+
return item.key + '=' + item.value;
|
143
|
+
}).join('&');
|
144
|
+
|
145
|
+
return url;
|
146
|
+
}
|
147
|
+
});
|
148
|
+
|
149
|
+
/*
|
150
|
+
* Prototype's implementation was throwing an error instead of false
|
151
|
+
*/
|
152
|
+
Element.Methods.Simulated = {
|
153
|
+
hasAttribute: function(element, attribute) {
|
154
|
+
var t = Element._attributeTranslations;
|
155
|
+
attribute = (t.names && t.names[attribute]) || attribute;
|
156
|
+
// Return false if we get an error here
|
157
|
+
try {
|
158
|
+
return $(element).getAttributeNode(attribute).specified;
|
159
|
+
} catch (e) {
|
160
|
+
return false;
|
161
|
+
}
|
162
|
+
}
|
163
|
+
};
|
164
|
+
|
165
|
+
/**
|
166
|
+
* A set of links. As a set, they can be controlled such that only one is "open" at a time, etc.
|
167
|
+
*/
|
168
|
+
ActiveScaffold.Actions = new Object();
|
169
|
+
ActiveScaffold.Actions.Abstract = function(){}
|
170
|
+
ActiveScaffold.Actions.Abstract.prototype = {
|
171
|
+
initialize: function(links, target, loading_indicator, options) {
|
172
|
+
this.target = $(target);
|
173
|
+
this.loading_indicator = $(loading_indicator);
|
174
|
+
this.options = options;
|
175
|
+
this.links = links.collect(function(link) {
|
176
|
+
return this.instantiate_link(link);
|
177
|
+
}.bind(this));
|
178
|
+
},
|
179
|
+
|
180
|
+
instantiate_link: function(link) {
|
181
|
+
throw 'unimplemented'
|
182
|
+
}
|
183
|
+
}
|
184
|
+
|
185
|
+
/**
|
186
|
+
* A DataStructures::ActionLink, represented in JavaScript.
|
187
|
+
* Concerned with AJAX-enabling a link and adapting the result for insertion into the table.
|
188
|
+
*/
|
189
|
+
ActiveScaffold.ActionLink = new Object();
|
190
|
+
ActiveScaffold.ActionLink.Abstract = function(){}
|
191
|
+
ActiveScaffold.ActionLink.Abstract.prototype = {
|
192
|
+
initialize: function(a, target, loading_indicator) {
|
193
|
+
this.tag = $(a);
|
194
|
+
this.url = this.tag.href;
|
195
|
+
this.method = 'get';
|
196
|
+
if(this.url.match('_method=delete')){
|
197
|
+
this.method = 'delete';
|
198
|
+
} else if(this.url.match('_method=post')){
|
199
|
+
this.method = 'post';
|
200
|
+
}
|
201
|
+
this.target = target;
|
202
|
+
this.loading_indicator = loading_indicator;
|
203
|
+
this.hide_target = false;
|
204
|
+
this.position = this.tag.getAttribute('position');
|
205
|
+
this.page_link = this.tag.getAttribute('page_link');
|
206
|
+
|
207
|
+
this.onclick = this.tag.onclick;
|
208
|
+
this.tag.onclick = null;
|
209
|
+
this.tag.observe('click', function(event) {
|
210
|
+
this.open();
|
211
|
+
Event.stop(event);
|
212
|
+
}.bind(this));
|
213
|
+
|
214
|
+
this.tag.action_link = this;
|
215
|
+
},
|
216
|
+
|
217
|
+
open: function() {
|
218
|
+
if (this.is_disabled()) return;
|
219
|
+
|
220
|
+
if (this.tag.hasAttribute( "dhtml_confirm")) {
|
221
|
+
if (this.onclick) this.onclick();
|
222
|
+
return;
|
223
|
+
} else {
|
224
|
+
if (this.onclick && !this.onclick()) return;//e.g. confirmation messages
|
225
|
+
this.open_action();
|
226
|
+
}
|
227
|
+
},
|
228
|
+
|
229
|
+
open_action: function() {
|
230
|
+
if (this.position) this.disable();
|
231
|
+
|
232
|
+
if (this.page_link) {
|
233
|
+
window.location = this.url;
|
234
|
+
} else {
|
235
|
+
if (this.loading_indicator) this.loading_indicator.style.visibility = 'visible';
|
236
|
+
new Ajax.Request(this.url, {
|
237
|
+
asynchronous: true,
|
238
|
+
evalScripts: true,
|
239
|
+
method: this.method,
|
240
|
+
onSuccess: function(request) {
|
241
|
+
if (this.position) {
|
242
|
+
this.insert(request.responseText);
|
243
|
+
if (this.hide_target) this.target.hide();
|
244
|
+
} else {
|
245
|
+
request.evalResponse();
|
246
|
+
}
|
247
|
+
}.bind(this),
|
248
|
+
|
249
|
+
onFailure: function(request) {
|
250
|
+
ActiveScaffold.report_500_response(this.scaffold_id());
|
251
|
+
if (this.position) this.enable()
|
252
|
+
}.bind(this),
|
253
|
+
|
254
|
+
onComplete: function(request) {
|
255
|
+
if (this.loading_indicator) this.loading_indicator.style.visibility = 'hidden';
|
256
|
+
}.bind(this)
|
257
|
+
});
|
258
|
+
}
|
259
|
+
},
|
260
|
+
|
261
|
+
insert: function(content) {
|
262
|
+
throw 'unimplemented'
|
263
|
+
},
|
264
|
+
|
265
|
+
close: function() {
|
266
|
+
this.enable();
|
267
|
+
this.adapter.remove();
|
268
|
+
if (this.hide_target) this.target.show();
|
269
|
+
},
|
270
|
+
|
271
|
+
register_cancel_hooks: function() {
|
272
|
+
// anything in the insert with a class of cancel gets the closer method, and a reference to this object for good measure
|
273
|
+
var self = this;
|
274
|
+
this.adapter.select('.cancel').each(function(elem) {
|
275
|
+
elem.observe('click', this.close_handler.bind(this));
|
276
|
+
elem.link = self;
|
277
|
+
}.bind(this))
|
278
|
+
},
|
279
|
+
|
280
|
+
reload: function() {
|
281
|
+
this.close();
|
282
|
+
this.open();
|
283
|
+
},
|
284
|
+
|
285
|
+
get_new_adapter_id: function() {
|
286
|
+
var id = 'adapter_';
|
287
|
+
var i = 0;
|
288
|
+
while ($(id + i)) i++;
|
289
|
+
return id + i;
|
290
|
+
},
|
291
|
+
|
292
|
+
enable: function() {
|
293
|
+
return this.tag.removeClassName('disabled');
|
294
|
+
},
|
295
|
+
|
296
|
+
disable: function() {
|
297
|
+
return this.tag.addClassName('disabled');
|
298
|
+
},
|
299
|
+
|
300
|
+
is_disabled: function() {
|
301
|
+
return this.tag.hasClassName('disabled');
|
302
|
+
},
|
303
|
+
|
304
|
+
scaffold_id: function() {
|
305
|
+
return this.tag.up('div.active-scaffold').id;
|
306
|
+
}
|
307
|
+
}
|
308
|
+
|
309
|
+
/**
|
310
|
+
* Concrete classes for record actions
|
311
|
+
*/
|
312
|
+
ActiveScaffold.Actions.Record = Class.create();
|
313
|
+
ActiveScaffold.Actions.Record.prototype = Object.extend(new ActiveScaffold.Actions.Abstract(), {
|
314
|
+
instantiate_link: function(link) {
|
315
|
+
var l = new ActiveScaffold.ActionLink.Record(link, this.target, this.loading_indicator);
|
316
|
+
l.refresh_url = this.options.refresh_url;
|
317
|
+
if (l.position) l.url = l.url.append_params({adapter: '_list_inline_adapter'});
|
318
|
+
l.set = this;
|
319
|
+
return l;
|
320
|
+
}
|
321
|
+
});
|
322
|
+
|
323
|
+
ActiveScaffold.ActionLink.Record = Class.create();
|
324
|
+
ActiveScaffold.ActionLink.Record.prototype = Object.extend(new ActiveScaffold.ActionLink.Abstract(), {
|
325
|
+
close_previous_adapter: function() {
|
326
|
+
this.set.links.each(function(item) {
|
327
|
+
if (item.url != this.url && item.is_disabled() && item.adapter) item.close();
|
328
|
+
}.bind(this));
|
329
|
+
},
|
330
|
+
|
331
|
+
insert: function(content) {
|
332
|
+
this.close_previous_adapter();
|
333
|
+
|
334
|
+
if (this.position == 'replace') {
|
335
|
+
this.position = 'after';
|
336
|
+
this.hide_target = true;
|
337
|
+
}
|
338
|
+
|
339
|
+
if (this.position == 'after') {
|
340
|
+
new Insertion.After(this.target, content);
|
341
|
+
this.adapter = this.target.next();
|
342
|
+
}
|
343
|
+
else if (this.position == 'before') {
|
344
|
+
new Insertion.Before(this.target, content);
|
345
|
+
this.adapter = this.target.previous();
|
346
|
+
}
|
347
|
+
else {
|
348
|
+
return false;
|
349
|
+
}
|
350
|
+
|
351
|
+
this.adapter.down('a.inline-adapter-close').observe('click', this.close_handler.bind(this));
|
352
|
+
this.register_cancel_hooks();
|
353
|
+
|
354
|
+
new Effect.Highlight(this.adapter.down('td'));
|
355
|
+
},
|
356
|
+
|
357
|
+
close_handler: function(event) {
|
358
|
+
this.close_with_refresh();
|
359
|
+
if (event) Event.stop(event);
|
360
|
+
},
|
361
|
+
|
362
|
+
/* it might simplify things to just override the close function. then the Record and Table links could share more code ... wouldn't need custom close_handler functions, for instance */
|
363
|
+
close_with_refresh: function() {
|
364
|
+
new Ajax.Request(this.refresh_url, {
|
365
|
+
asynchronous: true,
|
366
|
+
evalScripts: true,
|
367
|
+
method: this.method,
|
368
|
+
onSuccess: function(request) {
|
369
|
+
Element.replace(this.target, request.responseText);
|
370
|
+
var new_target = $(this.target.id);
|
371
|
+
if (this.target.hasClassName('even-record')) new_target.addClassName('even-record');
|
372
|
+
this.target = new_target;
|
373
|
+
this.close();
|
374
|
+
}.bind(this),
|
375
|
+
|
376
|
+
onFailure: function(request) {
|
377
|
+
ActiveScaffold.report_500_response(this.scaffold_id());
|
378
|
+
}
|
379
|
+
});
|
380
|
+
},
|
381
|
+
|
382
|
+
enable: function() {
|
383
|
+
this.set.links.each(function(item) {
|
384
|
+
if (item.url != this.url) return;
|
385
|
+
item.tag.removeClassName('disabled');
|
386
|
+
}.bind(this));
|
387
|
+
},
|
388
|
+
|
389
|
+
disable: function() {
|
390
|
+
this.set.links.each(function(item) {
|
391
|
+
if (item.url != this.url) return;
|
392
|
+
item.tag.addClassName('disabled');
|
393
|
+
}.bind(this));
|
394
|
+
}
|
395
|
+
});
|
396
|
+
|
397
|
+
/**
|
398
|
+
* Concrete classes for table actions
|
399
|
+
*/
|
400
|
+
ActiveScaffold.Actions.Table = Class.create();
|
401
|
+
ActiveScaffold.Actions.Table.prototype = Object.extend(new ActiveScaffold.Actions.Abstract(), {
|
402
|
+
instantiate_link: function(link) {
|
403
|
+
var l = new ActiveScaffold.ActionLink.Table(link, this.target, this.loading_indicator);
|
404
|
+
if (l.position) l.url = l.url.append_params({adapter: '_list_inline_adapter'});
|
405
|
+
return l;
|
406
|
+
}
|
407
|
+
});
|
408
|
+
|
409
|
+
ActiveScaffold.ActionLink.Table = Class.create();
|
410
|
+
ActiveScaffold.ActionLink.Table.prototype = Object.extend(new ActiveScaffold.ActionLink.Abstract(), {
|
411
|
+
insert: function(content) {
|
412
|
+
if (this.position == 'top') {
|
413
|
+
new Insertion.Top(this.target, content);
|
414
|
+
this.adapter = this.target.immediateDescendants().first();
|
415
|
+
}
|
416
|
+
else {
|
417
|
+
throw 'Unknown position "' + this.position + '"'
|
418
|
+
}
|
419
|
+
|
420
|
+
this.adapter.down('a.inline-adapter-close').observe('click', this.close_handler.bind(this));
|
421
|
+
this.register_cancel_hooks();
|
422
|
+
|
423
|
+
new Effect.Highlight(this.adapter.down('td'));
|
424
|
+
},
|
425
|
+
|
426
|
+
close_handler: function(event) {
|
427
|
+
this.close();
|
428
|
+
if (event) Event.stop(event);
|
429
|
+
}
|
430
|
+
});
|