brisk-bills 0.7.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +55 -0
- data/TODO.txt +36 -67
- data/app/controllers/admin/activities_controller.rb +4 -3
- data/app/controllers/admin/activities_with_prices_controller.rb +28 -14
- data/app/controllers/admin/client_accounting_controller.rb +11 -8
- data/app/controllers/admin/client_representatives_controller.rb +34 -5
- data/app/controllers/admin/clients_controller.rb +1 -1
- data/app/controllers/admin/draft_invoices_controller.rb +92 -0
- data/app/controllers/admin/{employee_client_labor_rate_controller.rb → employee_client_labor_rates_controller.rb} +1 -1
- data/app/controllers/admin/employees_controller.rb +3 -4
- data/app/controllers/admin/invoices_controller.rb +111 -53
- data/app/controllers/admin/payments_controller.rb +168 -41
- data/app/controllers/authentication_controller.rb +3 -3
- data/app/helpers/admin/activities_helper.rb +16 -13
- data/app/helpers/admin/activities_helper/labor_helper.rb +4 -4
- data/app/helpers/admin/activities_helper/proposal_helper.rb +1 -1
- data/app/helpers/admin/activities_helper/slimtimer_helper.rb +1 -1
- data/app/helpers/admin/activities_with_prices_helper.rb +2 -2
- data/app/helpers/admin/activity_type_controller_helper.rb +6 -0
- data/app/helpers/admin/activity_type_field_helper.rb +9 -9
- data/app/helpers/admin/adjustments_helper.rb +9 -1
- data/app/helpers/admin/client_accounting_helper.rb +2 -2
- data/app/helpers/admin/client_financial_transactions_helper.rb +1 -1
- data/app/helpers/admin/client_representatives_helper.rb +16 -12
- data/app/helpers/admin/clients_helper.rb +2 -0
- data/app/helpers/admin/draft_invoices_helper.rb +24 -0
- data/app/helpers/admin/{employee_client_labor_rate_helper.rb → employee_client_labor_rates_helper.rb} +8 -8
- data/app/helpers/admin/employees_helper.rb +6 -0
- data/app/helpers/admin/has_credential_column_helper.rb +8 -8
- data/app/helpers/admin/invoices_helper.rb +71 -16
- data/app/helpers/admin/is_active_column_helper.rb +2 -2
- data/app/helpers/admin/labors_helper.rb +12 -1
- data/app/helpers/admin/labors_helper/slimtimer_helper.rb +1 -1
- data/app/helpers/admin/materials_helper.rb +11 -0
- data/app/helpers/admin/payments_helper.rb +204 -29
- data/app/helpers/admin/proposals_helper.rb +10 -0
- data/app/helpers/admin/settings_helper.rb +1 -1
- data/app/helpers/admin_layout_helper.rb +3 -6
- data/app/helpers/authentication_helper.rb +7 -10
- data/app/helpers/money_model_helper.rb +1 -2
- data/app/models/activity.rb +17 -7
- data/app/models/client.rb +35 -8
- data/app/{model_views → models}/client_financial_transaction.rb +0 -0
- data/app/models/client_representative.rb +6 -14
- data/app/models/credential.rb +1 -1
- data/app/models/employee.rb +9 -11
- data/app/models/invoice.rb +13 -9
- data/app/models/invoice_payment.rb +1 -1
- data/app/models/notifier.rb +2 -2
- data/app/models/payment.rb +51 -7
- data/app/models/setting.rb +3 -1
- data/app/views/active_scaffold_overrides/add_existing.js.rjs +25 -0
- data/app/views/admin/activities/_adjustment_column.html.erb +10 -0
- data/app/views/admin/activities/{_form.rhtml → _form.html.erb} +0 -0
- data/app/views/admin/activities/{_form_attribute.rhtml → _form_attribute.html.erb} +0 -0
- data/app/views/admin/activities/{_labor_column.rhtml → _labor_column.html.erb} +0 -0
- data/app/views/admin/activities/{_material_column.rhtml → _material_column.html.erb} +0 -0
- data/app/views/admin/activities/{_proposal_column.rhtml → _proposal_column.html.erb} +0 -0
- data/app/views/admin/activities_with_prices/{move_to_invoice.rhtml → move_to_invoice.html.erb} +2 -2
- data/app/views/admin/activities_with_prices/move_to_invoice.js.rjs +5 -0
- data/app/views/admin/draft_invoices/batch_create.html.erb +73 -0
- data/app/views/admin/draft_invoices/batch_create.js.rjs +5 -0
- data/app/views/admin/invoices/confirm_publish_modal.html.erb +48 -0
- data/app/views/admin/payments/commit_payment_warning.html.erb +8 -0
- data/app/views/admin/payments/observation_error.js.rjs +28 -0
- data/app/views/admin/payments/on_assignment_observation.js.rjs +28 -0
- data/app/views/authentication/{email.rjs → email.js.rjs} +0 -0
- data/app/views/authentication/{login.rhtml → login.html.erb} +21 -26
- data/app/views/authentication/{login.rjs → login.js.rjs} +0 -0
- data/app/views/authentication/{reset_password_via_token.rhtml → reset_password_via_token.html.erb} +0 -0
- data/app/views/authentication/{reset_password_via_token.rjs → reset_password_via_token.js.rjs} +0 -0
- data/app/views/authentication/{sign_in_error.rjs → sign_in_error.js.rjs} +0 -0
- data/app/views/layouts/{_navigation_tree.rhtml → _navigation_tree.html.erb} +0 -0
- data/app/views/layouts/{admin.rhtml → admin.html.erb} +0 -0
- data/app/views/layouts/{public.rhtml → public.html.erb} +0 -0
- data/app/views/notifier/{_email_footer.html.rhtml → _email_footer.html.erb} +0 -0
- data/app/views/notifier/{_email_footer.plain.rhtml → _email_footer.plain.erb} +0 -0
- data/app/views/notifier/{_email_header.html.rhtml → _email_header.html.erb} +0 -0
- data/app/views/notifier/invoice_available.html.erb +5 -0
- data/app/views/notifier/{invoice_available.plain.rhtml → invoice_available.plain.erb} +1 -1
- data/app/views/notifier/{reset_password_requested.html.rhtml → reset_password_requested.html.erb} +2 -2
- data/app/views/notifier/{reset_password_requested.plain.rhtml → reset_password_requested.plain.erb} +1 -1
- data/config/environment.rb +6 -5
- data/config/locale/en.rb +9 -0
- data/db/migrate/001_create_employees.rb +1 -1
- data/db/migrate/002_create_employee_slimtimers.rb +1 -1
- data/db/migrate/003_create_slimtimer_tasks.rb +1 -1
- data/db/migrate/004_create_slimtimer_time_entries.rb +1 -1
- data/db/migrate/005_create_clients.rb +1 -1
- data/db/migrate/006_create_client_representatives.rb +1 -1
- data/db/migrate/008_create_activities.rb +1 -1
- data/db/migrate/009_create_activity_labors.rb +1 -1
- data/db/migrate/010_create_employee_client_labor_rates.rb +1 -1
- data/db/migrate/011_create_activity_adjustments.rb +1 -1
- data/db/migrate/012_create_activity_materials.rb +1 -1
- data/db/migrate/013_create_activity_proposals.rb +1 -1
- data/db/migrate/014_create_invoices.rb +1 -1
- data/db/migrate/015_create_payments.rb +1 -1
- data/db/migrate/016_create_payment_methods.rb +1 -1
- data/db/migrate/017_create_invoice_payments.rb +1 -1
- data/db/migrate/018_create_activity_types.rb +2 -2
- data/db/migrate/019_create_settings.rb +1 -1
- data/db/migrate/023_create_credentials_migrate_representatives.rb +2 -2
- data/db/migrate/028_money_to_cents.rb +2 -2
- data/db/schema.rb +10 -10
- data/lib/brisk-bills.rb +2 -2
- data/lib/brisk-bills/initializer.rb +2 -2
- data/lib/generators/instance/templates/instance_environment.rb +1 -1
- data/lib/libpptable.rb +48 -0
- data/lib/tasks/create_last_months_invoices.rake +1 -14
- data/lib/tasks/first_time_setup.rake +2 -2
- data/lib/tasks/package.rake +2 -1
- data/lib/tasks/payment_assignment_consistency_check.rake +110 -0
- data/lib/utilities.rb +4 -4
- data/public/images/page-new.gif +0 -0
- data/public/javascripts/active_scaffold/default/active_scaffold.js +532 -430
- data/public/javascripts/active_scaffold/default/dhtml_history.js +1 -1
- data/public/javascripts/active_scaffold/default/form_enhancements.js +7 -4
- data/public/stylesheets/active_scaffold/default/stylesheet-ie.css +5 -5
- data/public/stylesheets/active_scaffold/default/stylesheet.css +54 -18
- data/public/stylesheets/admin/global.css +1 -1
- data/public/stylesheets/admin/pages.css +29 -0
- data/test/unit/activity/adjustment_test.rb +1 -1
- data/test/unit/activity/labor_test.rb +1 -1
- data/test/unit/activity/material_test.rb +1 -1
- data/test/unit/activity/proposal_test.rb +1 -1
- data/test/unit/activity_test.rb +1 -1
- data/test/unit/activity_type_test.rb +1 -1
- data/test/unit/client_eventlog_test.rb +1 -1
- data/test/unit/client_financial_transaction_test.rb +1 -1
- data/test/unit/client_representative_test.rb +1 -1
- data/test/unit/client_test.rb +37 -6
- data/test/unit/credential_test.rb +1 -1
- data/test/unit/employee/slimtimer_test.rb +1 -1
- data/test/unit/employee_client_labor_rate_test.rb +1 -1
- data/test/unit/employee_test.rb +1 -1
- data/test/unit/helpers/admin/draft_invoices_helper_test.rb +4 -0
- data/test/unit/invoice_payment_test.rb +90 -50
- data/test/unit/invoice_test.rb +48 -8
- data/test/unit/notifier_test.rb +1 -1
- data/test/unit/payment_method_test.rb +1 -1
- data/test/unit/payment_test.rb +7 -7
- data/test/unit/setting_test.rb +1 -1
- data/test/unit/slimtimer_task_test.rb +1 -1
- data/test/unit/slimtimer_time_entry_test.rb +1 -1
- data/vendor/plugins/active_scaffold/CHANGELOG +3 -1
- data/vendor/plugins/active_scaffold/README +18 -5
- data/vendor/plugins/active_scaffold/environment.rb +1 -1
- data/vendor/plugins/active_scaffold/frontends/default/javascripts/active_scaffold.js +532 -430
- data/vendor/plugins/active_scaffold/frontends/default/javascripts/dhtml_history.js +1 -1
- data/vendor/plugins/active_scaffold/frontends/default/javascripts/form_enhancements.js +7 -4
- data/vendor/plugins/active_scaffold/frontends/default/stylesheets/stylesheet-ie.css +5 -5
- data/vendor/plugins/active_scaffold/frontends/default/stylesheets/stylesheet.css +54 -18
- data/vendor/plugins/active_scaffold/frontends/default/views/_add_existing_form.html.erb +3 -7
- data/vendor/plugins/active_scaffold/frontends/default/views/_create_form.html.erb +10 -7
- data/vendor/plugins/active_scaffold/frontends/default/views/_field_search.html.erb +7 -12
- data/vendor/plugins/active_scaffold/frontends/default/views/_form.html.erb +3 -3
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_association.html.erb +15 -20
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_association_footer.html.erb +8 -10
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_attribute.html.erb +5 -2
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_hidden_attribute.html.erb +2 -1
- data/vendor/plugins/active_scaffold/frontends/default/views/_horizontal_subform.html.erb +19 -21
- data/vendor/plugins/active_scaffold/frontends/default/views/{_form_association_header.html.erb → _horizontal_subform_header.html.erb} +2 -2
- data/vendor/plugins/active_scaffold/frontends/default/views/_horizontal_subform_record.html.erb +31 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_list.html.erb +4 -18
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_actions.html.erb +18 -5
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_calculations.html.erb +2 -9
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_column_headings.html.erb +4 -4
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_header.html.erb +6 -6
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_inline_adapter.html.erb +2 -1
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_messages.html.erb +20 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_pagination.html.erb +11 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_pagination_links.html.erb +3 -5
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_record.html.erb +2 -26
- data/vendor/plugins/active_scaffold/frontends/default/views/_list_record_columns.html.erb +9 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_nested.html.erb +3 -12
- data/vendor/plugins/active_scaffold/frontends/default/views/_render_fields.js.rjs +11 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_search.html.erb +17 -11
- data/vendor/plugins/active_scaffold/frontends/default/views/_show.html.erb +3 -3
- data/vendor/plugins/active_scaffold/frontends/default/views/_show_columns.html.erb +8 -7
- data/vendor/plugins/active_scaffold/frontends/default/views/_update_actions.html.erb +3 -3
- data/vendor/plugins/active_scaffold/frontends/default/views/_update_form.html.erb +9 -6
- data/vendor/plugins/active_scaffold/frontends/default/views/_vertical_subform.html.erb +7 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/_vertical_subform_record.html.erb +38 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/add_existing.js.rjs +2 -1
- data/vendor/plugins/active_scaffold/frontends/default/views/delete.html.erb +1 -1
- data/vendor/plugins/active_scaffold/frontends/default/views/destroy.js.rjs +2 -2
- data/vendor/plugins/active_scaffold/frontends/default/views/edit_associated.js.rjs +20 -15
- data/vendor/plugins/active_scaffold/frontends/default/views/list.html.erb +12 -8
- data/vendor/plugins/active_scaffold/frontends/default/views/list.js.rjs +1 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/mark.js.rjs +6 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/on_create.js.rjs +12 -8
- data/vendor/plugins/active_scaffold/frontends/default/views/on_update.js.rjs +13 -6
- data/vendor/plugins/active_scaffold/frontends/default/views/render_field.js.rjs +1 -0
- data/vendor/plugins/active_scaffold/frontends/default/views/search.html.erb +2 -2
- data/vendor/plugins/active_scaffold/frontends/default/views/update.html.erb +2 -2
- data/vendor/plugins/active_scaffold/frontends/default/views/update_column.js.rjs +4 -3
- data/vendor/plugins/active_scaffold/frontends/default/views/update_row.js.rjs +2 -0
- data/vendor/plugins/active_scaffold/init.rb +2 -2
- data/vendor/plugins/active_scaffold/install.rb +1 -2
- data/vendor/plugins/active_scaffold/install_assets.rb +1 -1
- data/vendor/plugins/active_scaffold/lib/active_record_permissions.rb +53 -42
- data/vendor/plugins/active_scaffold/lib/active_scaffold.rb +96 -23
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/common_search.rb +18 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/core.rb +152 -102
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/create.rb +81 -49
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/delete.rb +44 -17
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/field_search.rb +60 -46
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/list.rb +42 -37
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/mark.rb +72 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/nested.rb +94 -92
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/search.rb +54 -40
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/show.rb +30 -10
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/update.rb +62 -47
- data/vendor/plugins/active_scaffold/lib/active_scaffold/attribute_params.rb +187 -185
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/base.rb +28 -3
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/core.rb +43 -3
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/create.rb +8 -15
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/delete.rb +3 -4
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/field_search.rb +19 -17
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/form.rb +2 -9
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/list.rb +46 -9
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/nested.rb +17 -7
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/search.rb +36 -16
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/show.rb +5 -12
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/subform.rb +8 -6
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/update.rb +12 -8
- data/vendor/plugins/active_scaffold/lib/active_scaffold/configurable.rb +2 -2
- data/vendor/plugins/active_scaffold/lib/active_scaffold/constraints.rb +173 -178
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/action_columns.rb +101 -97
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/action_link.rb +29 -19
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/column.rb +74 -34
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/columns.rb +74 -74
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/set.rb +57 -62
- data/vendor/plugins/active_scaffold/lib/active_scaffold/data_structures/sorting.rb +73 -3
- data/vendor/plugins/active_scaffold/lib/active_scaffold/finder.rb +304 -234
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/association_helpers.rb +40 -40
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/controller_helpers.rb +39 -24
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/country_helpers.rb +32 -28
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/form_column_helpers.rb +157 -86
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/id_helpers.rb +7 -7
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/list_column_helpers.rb +278 -85
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/pagination_helpers.rb +38 -12
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/search_column_helpers.rb +74 -35
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/show_column_helpers.rb +53 -46
- data/vendor/plugins/active_scaffold/lib/active_scaffold/helpers/view_helpers.rb +51 -17
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/de.yml +69 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/en.yml +72 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/es.yml +23 -13
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/fr.yml +68 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/hu.yml +24 -14
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/ja.yml +69 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/ru.yml +72 -0
- data/vendor/plugins/active_scaffold/lib/active_scaffold/marked_model.rb +38 -0
- data/vendor/plugins/active_scaffold/lib/bridges/calendar_date_select/lib/as_cds_bridge.rb +47 -13
- data/vendor/plugins/active_scaffold/lib/bridges/dependent_protect/bridge.rb +10 -0
- data/vendor/plugins/active_scaffold/lib/bridges/dependent_protect/lib/dependent_protect_bridge.rb +11 -0
- data/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/as_file_column_bridge.rb +3 -6
- data/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/form_ui.rb +10 -2
- data/vendor/plugins/active_scaffold/lib/bridges/paperclip/bridge.rb +13 -0
- data/vendor/plugins/active_scaffold/lib/bridges/paperclip/lib/form_ui.rb +20 -0
- data/vendor/plugins/active_scaffold/lib/bridges/paperclip/lib/list_ui.rb +16 -0
- data/vendor/plugins/active_scaffold/lib/bridges/paperclip/lib/paperclip_bridge.rb +32 -0
- data/vendor/plugins/active_scaffold/lib/bridges/paperclip/lib/paperclip_bridge_helpers.rb +18 -0
- data/vendor/plugins/active_scaffold/lib/bridges/record_select/bridge.rb +5 -0
- data/vendor/plugins/active_scaffold/lib/bridges/record_select/lib/record_select_bridge.rb +79 -0
- data/vendor/plugins/active_scaffold/lib/bridges/semantic_attributes/bridge.rb +5 -0
- data/vendor/plugins/active_scaffold/lib/bridges/semantic_attributes/lib/semantic_attributes_bridge.rb +20 -0
- data/vendor/plugins/active_scaffold/lib/bridges/tiny_mce/bridge.rb +5 -0
- data/vendor/plugins/active_scaffold/lib/bridges/tiny_mce/lib/tiny_mce_bridge.rb +57 -0
- data/vendor/plugins/active_scaffold/lib/bridges/unobtrusive_date_picker/bridge.rb +9 -0
- data/vendor/plugins/active_scaffold/lib/bridges/unobtrusive_date_picker/lib/form_ui.rb +14 -0
- data/vendor/plugins/active_scaffold/lib/bridges/unobtrusive_date_picker/lib/unobtrusive_date_picker_bridge.rb +15 -0
- data/vendor/plugins/active_scaffold/lib/bridges/unobtrusive_date_picker/lib/view_helpers.rb +16 -0
- data/vendor/plugins/active_scaffold/lib/bridges/validation_reflection/bridge.rb +9 -0
- data/vendor/plugins/active_scaffold/lib/bridges/validation_reflection/lib/validation_reflection_bridge.rb +19 -0
- data/vendor/plugins/active_scaffold/lib/extensions/action_view_rendering.rb +20 -8
- data/vendor/plugins/active_scaffold/lib/extensions/generic_view_paths.rb +2 -2
- data/vendor/plugins/active_scaffold/lib/extensions/paginator_extensions.rb +26 -0
- data/vendor/plugins/active_scaffold/lib/extensions/resources.rb +6 -5
- data/vendor/plugins/active_scaffold/lib/extensions/reverse_associations.rb +26 -20
- data/vendor/plugins/active_scaffold/lib/extensions/unsaved_associated.rb +1 -1
- data/vendor/plugins/active_scaffold/lib/paginator.rb +1 -1
- data/vendor/plugins/active_scaffold/lib/responds_to_parent.rb +1 -1
- data/vendor/plugins/active_scaffold/shoulda_macros/macros.rb +136 -0
- data/vendor/plugins/active_scaffold/test/bridges/active_scaffold_dependent_protect_test.rb +34 -0
- data/vendor/plugins/active_scaffold/test/bridges/bridge_test.rb +43 -0
- data/vendor/plugins/active_scaffold/test/bridges/company.rb +81 -0
- data/vendor/plugins/active_scaffold/test/bridges/paperclip_test.rb +68 -0
- data/vendor/plugins/active_scaffold/test/bridges/tiny_mce_test.rb +27 -0
- data/vendor/plugins/active_scaffold/test/bridges/unobtrusive_date_picker_test.rb +49 -0
- data/vendor/plugins/active_scaffold/test/bridges/validation_reflection_test.rb +57 -0
- data/vendor/plugins/active_scaffold/test/config/base_test.rb +15 -0
- data/vendor/plugins/active_scaffold/test/config/core_test.rb +58 -0
- data/vendor/plugins/active_scaffold/test/config/create_test.rb +9 -6
- data/vendor/plugins/active_scaffold/test/config/delete_test.rb +33 -0
- data/vendor/plugins/active_scaffold/test/config/field_search_test.rb +47 -0
- data/vendor/plugins/active_scaffold/test/config/list_test.rb +66 -11
- data/vendor/plugins/active_scaffold/test/config/nested_test.rb +62 -0
- data/vendor/plugins/active_scaffold/test/config/search_test.rb +60 -0
- data/vendor/plugins/active_scaffold/test/config/show_test.rb +43 -0
- data/vendor/plugins/active_scaffold/test/config/subform_test.rb +17 -0
- data/vendor/plugins/active_scaffold/test/config/update_test.rb +27 -4
- data/vendor/plugins/active_scaffold/test/data_structures/action_columns_test.rb +2 -8
- data/vendor/plugins/active_scaffold/test/data_structures/action_link_test.rb +11 -11
- data/vendor/plugins/active_scaffold/test/data_structures/action_links_test.rb +5 -5
- data/vendor/plugins/active_scaffold/test/data_structures/association_column_test.rb +4 -3
- data/vendor/plugins/active_scaffold/test/data_structures/column_test.rb +29 -5
- data/vendor/plugins/active_scaffold/test/data_structures/sorting_test.rb +31 -1
- data/vendor/plugins/active_scaffold/test/data_structures/standard_column_test.rb +3 -13
- data/vendor/plugins/active_scaffold/test/data_structures/virtual_column_test.rb +0 -11
- data/vendor/plugins/active_scaffold/test/extensions/{array.rb → array_test.rb} +0 -0
- data/vendor/plugins/active_scaffold/test/helpers/form_column_helpers_test.rb +31 -0
- data/vendor/plugins/active_scaffold/test/helpers/list_column_helpers_test.rb +42 -0
- data/vendor/plugins/active_scaffold/test/helpers/pagination_helpers_test.rb +59 -0
- data/vendor/plugins/active_scaffold/test/misc/active_record_permissions_test.rb +154 -0
- data/vendor/plugins/active_scaffold/test/misc/attribute_params_test.rb +146 -0
- data/vendor/plugins/active_scaffold/test/misc/configurable_test.rb +2 -2
- data/vendor/plugins/active_scaffold/test/misc/constraints_test.rb +26 -8
- data/vendor/plugins/active_scaffold/test/misc/finder_test.rb +41 -19
- data/vendor/plugins/active_scaffold/test/misc/lang_test.rb +5 -6
- data/vendor/plugins/active_scaffold/test/mock_app/app/controllers/application_controller.rb +10 -0
- data/vendor/plugins/active_scaffold/test/mock_app/app/helpers/application_helper.rb +3 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/boot.rb +110 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/environment.rb +43 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/environments/development.rb +17 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/environments/production.rb +28 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/environments/test.rb +28 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/initializers/backtrace_silencers.rb +7 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/initializers/inflections.rb +10 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/initializers/mime_types.rb +5 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/initializers/new_rails_defaults.rb +19 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/initializers/session_store.rb +15 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/locales/en.yml +5 -0
- data/vendor/plugins/active_scaffold/test/mock_app/config/routes.rb +43 -0
- data/vendor/plugins/active_scaffold/test/mock_app/db/test.sqlite3 +1 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/blank.html +33 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/DO_NOT_EDIT +2 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/default/add.gif +0 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/default/arrow_down.gif +0 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/default/arrow_up.gif +0 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/default/close.gif +0 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/default/cross.png +0 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/default/indicator-small.gif +0 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/default/indicator.gif +0 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/images/active_scaffold/default/magnifier.png +0 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/javascripts/active_scaffold/DO_NOT_EDIT +2 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/javascripts/active_scaffold/default/active_scaffold.js +532 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/javascripts/active_scaffold/default/dhtml_history.js +867 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/javascripts/active_scaffold/default/form_enhancements.js +117 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/javascripts/active_scaffold/default/rico_corner.js +370 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/stylesheets/active_scaffold/DO_NOT_EDIT +2 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/stylesheets/active_scaffold/default/stylesheet-ie.css +35 -0
- data/vendor/plugins/active_scaffold/test/mock_app/public/stylesheets/active_scaffold/default/stylesheet.css +845 -0
- data/vendor/plugins/active_scaffold/test/model_stub.rb +17 -1
- data/vendor/plugins/active_scaffold/test/test_helper.rb +31 -5
- data/vendor/plugins/active_scaffold/uninstall.rb +2 -1
- data/vendor/plugins/active_scaffold_form_observation/init.rb +1 -1
- data/vendor/plugins/active_scaffold_form_observation/lib/active_scaffold_form_observation.rb +1 -2
- data/vendor/plugins/active_scaffold_full_refresh/init.rb +2 -0
- data/vendor/plugins/active_scaffold_full_refresh/lib/active_scaffold_full_refresh.rb +29 -0
- data/vendor/plugins/acts_as_money/{tasks → lib/tasks}/money_tasks.rake +0 -0
- metadata +668 -563
- data/app/model_views/client_accounting.rb +0 -5
- data/app/model_views/invoices_with_total.rb +0 -41
- data/app/views/admin/activities/_adjustment_column.rhtml +0 -23
- data/app/views/admin/activities_with_prices/move_to_invoice.rjs +0 -9
- data/app/views/notifier/invoice_available.html.rhtml +0 -5
- data/public/javascripts/prototype.js-1.6.0.3 +0 -4320
- data/test/functional/admin/activities_controller_test.rb +0 -8
- data/test/functional/admin/adjustments_controller_test.rb +0 -8
- data/test/functional/admin/client_accounting_controller_test.rb +0 -8
- data/test/functional/admin/client_financial_transactions_controller_test.rb +0 -8
- data/test/functional/admin/client_representatives_controller_test.rb +0 -8
- data/test/functional/admin/clients_controller_test.rb +0 -8
- data/test/functional/admin/employee_client_labor_rate_controller_test.rb +0 -8
- data/test/functional/admin/employees/slimtimer_controller_test.rb +0 -8
- data/test/functional/admin/employees_controller_test.rb +0 -8
- data/test/functional/admin/invoices_controller_test.rb +0 -8
- data/test/functional/admin/labors_controller_test.rb +0 -8
- data/test/functional/admin/materials_controller_test.rb +0 -8
- data/test/functional/admin/payments_controller_test.rb +0 -8
- data/test/functional/admin/proposals_controller_test.rb +0 -8
- data/test/functional/admin/settings_controller_test.rb +0 -8
- data/test/functional/authentication_controller_test.rb +0 -8
- data/vendor/plugins/active_scaffold/frontends/default/views/_form_association_record.html.erb +0 -27
- data/vendor/plugins/active_scaffold/frontends/default/views/_live_search.html.erb +0 -25
- data/vendor/plugins/active_scaffold/frontends/default/views/form_messages_on_create.js.rjs +0 -2
- data/vendor/plugins/active_scaffold/frontends/default/views/form_messages_on_update.js.rjs +0 -2
- data/vendor/plugins/active_scaffold/lib/active_scaffold/actions/live_search.rb +0 -46
- data/vendor/plugins/active_scaffold/lib/active_scaffold/config/live_search.rb +0 -52
- data/vendor/plugins/active_scaffold/lib/active_scaffold/locale/en.rb +0 -66
- data/vendor/plugins/active_scaffold/lib/extensions/name_option_for_datetime.rb +0 -12
- data/vendor/plugins/active_scaffold/test/misc/active_record_permissions.rb +0 -154
@@ -1,8 +1,8 @@
|
|
1
|
-
<h4><%= active_scaffold_config.show.label
|
1
|
+
<h4><%= active_scaffold_config.show.label(@record.to_label.nil? ? nil : clean_column_value(@record.to_label)) %></h4>
|
2
2
|
|
3
3
|
<%= render :partial => 'show_columns', :locals => {:columns => active_scaffold_config.show.columns} -%>
|
4
4
|
|
5
5
|
<p class="form-footer">
|
6
|
-
<%= link_to as_(:close),
|
6
|
+
<%= link_to as_(:close), main_path_to_return, :class => 'cancel' %>
|
7
7
|
<%= loading_indicator_tag(:action => :create, :id => params[:id]) %>
|
8
|
-
</p>
|
8
|
+
</p>
|
@@ -1,11 +1,12 @@
|
|
1
1
|
<dl>
|
2
2
|
<% columns.each :for => @record do |column| %>
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
<dt><%= column.label -%></dt>
|
4
|
+
<dd<%= " class=\"#{column.name}-view #{column.css_class}\"" unless column.is_a? ActiveScaffold::DataStructures::ActionColumns %>>
|
5
|
+
<% if column.is_a? ActiveScaffold::DataStructures::ActionColumns -%>
|
6
|
+
<%= render :partial => 'show_columns', :locals => {:columns => column} %>
|
7
|
+
<% else -%>
|
8
|
+
<%= show_column_value(@record, column) %>
|
9
|
+
<% end -%>
|
10
|
+
</dd>
|
10
11
|
<% end -%>
|
11
12
|
</dl>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<div class="active-scaffold-header">
|
2
2
|
<div class="actions">
|
3
|
-
<% active_scaffold_config.action_links.each :
|
3
|
+
<% active_scaffold_config.action_links.each :member do |link| -%>
|
4
4
|
<% next unless link.action == 'nested' -%>
|
5
|
-
<% next if
|
6
|
-
<%= record.authorized_for?(:action => link.
|
5
|
+
<% next if skip_action_link(link) -%>
|
6
|
+
<%= record.authorized_for?(:crud_type => link.crud_type, :action => link.action) ? render_action_link(link, url_options, record) : "<a class='disabled'>#{link.label}</a>" -%>
|
7
7
|
<% end -%>
|
8
8
|
</div>
|
9
9
|
</div>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<% url_options = params_for(:action => :update) -%>
|
2
|
+
<% xhr ||= request.xhr? -%>
|
2
3
|
<%=
|
3
|
-
if
|
4
|
+
if xhr
|
4
5
|
if active_scaffold_config.update.multipart? # file_uploads
|
5
6
|
form_remote_upload_tag url_options.merge({:iframe => true}),
|
6
7
|
:onsubmit => onsubmit,
|
@@ -33,17 +34,19 @@ end
|
|
33
34
|
|
34
35
|
<h4><%= @record.to_label.nil? ? active_scaffold_config.update.label : as_(:update_model, :model => clean_column_value(@record.to_label)) %></h4>
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
|
37
|
+
<div id="<%= element_messages_id(:action => :update) %>" class="messages-container">
|
38
|
+
<% if request.xhr? -%>
|
39
|
+
<%= error_messages_for :record, :object_name => @record.class.human_name.downcase %>
|
40
|
+
<% else -%>
|
39
41
|
<%= render :partial => 'form_messages' %>
|
40
|
-
|
42
|
+
<% end -%>
|
43
|
+
</div>
|
41
44
|
|
42
45
|
<%= render :partial => 'form', :locals => { :columns => active_scaffold_config.update.columns } %>
|
43
46
|
|
44
47
|
<p class="form-footer">
|
45
48
|
<%= submit_tag as_(:update), :class => "submit" %>
|
46
|
-
<%= link_to as_(:cancel),
|
49
|
+
<%= link_to as_(:cancel), main_path_to_return, :class => 'cancel' %>
|
47
50
|
<%= loading_indicator_tag(:action => :update, :id => params[:id]) %>
|
48
51
|
</p>
|
49
52
|
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<div id="<%= sub_form_list_id(:association => column.name) %>">
|
2
|
+
<% associated.each_index do |index| %>
|
3
|
+
<% @record = associated[index] -%>
|
4
|
+
<%= render :partial => 'vertical_subform_record', :locals => {:scope => column_scope(column), :parent_record => parent_record, :column => column, :locked => @record == locked} %>
|
5
|
+
<% end -%>
|
6
|
+
</div>
|
7
|
+
<%= render :partial => 'form_association_footer', :locals => {:parent_record => parent_record, :column => column, :associated => associated} -%>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<%
|
2
|
+
record_column = column
|
3
|
+
readonly = (@record.readonly? or not @record.authorized_for?(:crud_type => :update))
|
4
|
+
crud_type = @record.new_record? ? :create : (readonly ? :read : :update)
|
5
|
+
show_actions = false
|
6
|
+
config = active_scaffold_config_for(@record.class)
|
7
|
+
-%>
|
8
|
+
<ol class="association-record <%= 'association-record-new' if @record.new_record? -%> <%= 'locked' if locked -%>">
|
9
|
+
<% if @record.errors.count -%>
|
10
|
+
<div class="association-record-errors" id="<%= element_messages_id :action => @record.class.name.underscore, :id => "#{parent_record.id}-#{index}" %>">
|
11
|
+
<%= error_messages_for :record, :object_name => @record.class.human_name.downcase %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
<% config.subform.columns.each :for => @record, :crud_type => crud_type, :flatten => true do |column| %>
|
15
|
+
<%
|
16
|
+
next unless in_subform?(column, parent_record)
|
17
|
+
show_actions = true
|
18
|
+
column = column.clone
|
19
|
+
column.form_ui ||= :select if column.association
|
20
|
+
-%>
|
21
|
+
<li class="form-element <%= 'required' if column.required? %> <%= column.css_class unless column.css_class.nil? %>">
|
22
|
+
<% unless readonly -%>
|
23
|
+
<%= render :partial => form_partial_for_column(column), :locals => { :column => column, :scope => scope } -%>
|
24
|
+
<% else -%>
|
25
|
+
<p><%= get_column_value(@record, column) -%></p>
|
26
|
+
<% end -%>
|
27
|
+
</li>
|
28
|
+
<% end -%>
|
29
|
+
<% if show_actions -%>
|
30
|
+
<li class="actions">
|
31
|
+
<%= link_to_function as_(:remove), '$(this).up(".association-record").remove()', { :class => "destroy" } if record_column.plural_association? and (@record.authorized_for?(:crud_type => :delete) or not [:destroy, :delete_all].include?(record_column.association.options[:dependent])) %>
|
32
|
+
<% unless @record.new_record? %>
|
33
|
+
<% options = active_scaffold_input_options(config.columns[@record.class.primary_key], scope) -%>
|
34
|
+
<input type="hidden" name="<%= options[:name] -%>" id="<%= options[:id] -%>" value="<%= @record.id -%>" />
|
35
|
+
<% end -%>
|
36
|
+
</li>
|
37
|
+
<% end -%>
|
38
|
+
</ol>
|
@@ -1,4 +1,5 @@
|
|
1
1
|
page.insert_html :top, active_scaffold_tbody_id, :partial => 'list_record', :locals => {:record => @record}
|
2
|
+
page.replace active_scaffold_calculations_id, :partial => 'list_calculations' if active_scaffold_config.list.columns.any? {|c| c.calculation?}
|
2
3
|
page << "ActiveScaffold.stripe($('#{active_scaffold_tbody_id}'))"
|
3
4
|
page << "ActiveScaffold.hide_empty_message('#{active_scaffold_tbody_id}','#{empty_message_id}');"
|
4
5
|
page << "ActiveScaffold.increment_record_count('#{active_scaffold_id}');"
|
@@ -13,4 +14,4 @@ if (form_stays_open = true)
|
|
13
14
|
end
|
14
15
|
else
|
15
16
|
page << "$$('##{element_form_id(:action => :new_existing)} a.cancel').first().link.close();"
|
16
|
-
end
|
17
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
if controller.send(:successful?)
|
2
|
-
page << "$('#{action_link_id((respond_to?(:nested_habtm?) and nested_habtm? and active_scaffold_config.nested.shallow_delete) ? 'destroy_existing' : '
|
2
|
+
page << "$('#{action_link_id((respond_to?(:nested_habtm?) and nested_habtm? and active_scaffold_config.nested.shallow_delete) ? 'destroy_existing' : 'delete', params[:id])}').action_link.close_previous_adapter();"
|
3
3
|
page.remove element_row_id(:action => 'list', :id => params[:id])
|
4
|
-
page << "ActiveScaffold.reload_if_empty('#{active_scaffold_tbody_id}','#{url_for(params_for(:action =>
|
4
|
+
page << "ActiveScaffold.reload_if_empty('#{active_scaffold_tbody_id}','#{url_for(params_for(:action => :index, :id => nil, :page => [active_scaffold_config.list.user.page.to_i - 1, 1].max, :escape => false))}');"
|
5
5
|
page << "ActiveScaffold.stripe('#{active_scaffold_tbody_id}');"
|
6
6
|
page << "ActiveScaffold.decrement_record_count('#{active_scaffold_id}');"
|
7
7
|
page.replace active_scaffold_calculations_id, :partial => 'list_calculations' if active_scaffold_config.list.columns.any? {|c| c.calculation?}
|
@@ -1,15 +1,20 @@
|
|
1
|
-
associated_form = render :partial =>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
1
|
+
associated_form = render :partial => "#{subform_partial_for_column(@column)}_record", :locals => {:scope => @scope, :parent_record => @parent_record, :column => @column, :locked => @record.new_record? && @column.singular_association?}
|
2
|
+
|
3
|
+
if @column.singular_association?
|
4
|
+
page << %|
|
5
|
+
associated = #{associated_form.to_json};
|
6
|
+
if (current = $$('##{sub_form_list_id(:association => @column.name)} .association-record')[0]) {
|
7
|
+
Element.replace(current, associated)
|
8
|
+
} else {
|
9
|
+
new Insertion.Top('#{sub_form_list_id(:association => @column.name)}', associated)
|
10
|
+
}
|
11
|
+
|
|
12
|
+
else
|
13
|
+
unless @record.new_record?
|
14
|
+
column = active_scaffold_config_for(@record.class).columns[@record.class.primary_key]
|
15
|
+
id = active_scaffold_input_options(column, @scope)[:id]
|
16
|
+
page << "if (!$('#{id}')) {"
|
17
|
+
end
|
18
|
+
page.insert_html :bottom, sub_form_list_id(:association => @column.name), associated_form
|
19
|
+
page << "}" unless @record.new_record?
|
20
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div id="<%= active_scaffold_id -%>" class="active-scaffold active-scaffold-<%= controller_id %> <%=
|
1
|
+
<div id="<%= active_scaffold_id -%>" class="active-scaffold active-scaffold-<%= controller_id %> <%= controller_class %> <%= active_scaffold_config.theme %>-theme">
|
2
2
|
<div class="active-scaffold-header">
|
3
3
|
<%= render :partial => 'list_header' %>
|
4
4
|
</div>
|
@@ -7,16 +7,18 @@
|
|
7
7
|
<% if active_scaffold_config.list.always_show_search %>
|
8
8
|
<tr>
|
9
9
|
<td>
|
10
|
-
<div class="active-scaffold show_search-view <%=
|
10
|
+
<div class="active-scaffold show_search-view <%= controller_class %> view">
|
11
11
|
<%= render :partial => active_scaffold_config.list.search_partial %>
|
12
12
|
</div>
|
13
13
|
</td>
|
14
14
|
</tr>
|
15
|
+
<% else %>
|
16
|
+
<tr><td></td></tr>
|
15
17
|
<% end %>
|
16
18
|
<% if params[:nested].nil? && active_scaffold_config.list.always_show_create %>
|
17
19
|
<tr>
|
18
20
|
<td>
|
19
|
-
<div class="active-scaffold create-view <%=
|
21
|
+
<div class="active-scaffold create-view <%= controller_class %> view">
|
20
22
|
<%= render :partial => 'create_form_on_list' %>
|
21
23
|
</div>
|
22
24
|
</td>
|
@@ -30,15 +32,17 @@
|
|
30
32
|
</div>
|
31
33
|
|
32
34
|
<script type="text/javascript">
|
33
|
-
|
35
|
+
//<![CDATA[
|
36
|
+
<% if active_scaffold_config.theme != :default -%>
|
34
37
|
Rico.Corner.round($$('#<%= active_scaffold_id %> div.active-scaffold-header').first(), {color: 'fromElement', bgColor: 'fromParent', corners: 'top', compact: true});
|
35
38
|
Rico.Corner.round($$('#<%= active_scaffold_id %> div.active-scaffold-footer').first(), {color: 'fromElement', bgColor: 'fromParent', corners: 'bottom', compact: true});
|
36
|
-
<% end
|
37
|
-
new ActiveScaffold.Actions.Table($$('#<%= active_scaffold_id -%> div.active-scaffold-header a.action'), $('<%= before_header_id -%>'), $('<%= loading_indicator_id(:action => :
|
39
|
+
<% end -%>
|
40
|
+
new ActiveScaffold.Actions.Table($$('#<%= active_scaffold_id -%> div.active-scaffold-header a.action'), $('<%= before_header_id -%>'), $('<%= loading_indicator_id(:action => :index) -%>'));
|
38
41
|
ActiveScaffold.server_error_response = '<p class="error-message message">'
|
39
|
-
+ <%= as_(:internal_error).to_json %>
|
42
|
+
+ <%= as_(:internal_error).to_json.html_safe %>
|
40
43
|
+ '<a href="#" onclick="Element.remove(this.parentNode); return false;">'
|
41
|
-
+ <%= as_(:close).to_json %>
|
44
|
+
+ <%= as_(:close).to_json.html_safe %>
|
42
45
|
+ '</a>'
|
43
46
|
+ '</p>';
|
47
|
+
//]]>
|
44
48
|
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
page[active_scaffold_content_id].replace_html render(:partial => 'list', :layout => false)
|
@@ -0,0 +1,6 @@
|
|
1
|
+
if params[:id]
|
2
|
+
# FIXME: It isn't right when there are filtered records by a search
|
3
|
+
page << "$('#{active_scaffold_id}').down('.mark_record').checked = #{@mark ? true : false};"
|
4
|
+
else
|
5
|
+
page << "$$('##{active_scaffold_tbody_id} > tr > td > .mark_record').each(function(checkbox) { checkbox.checked = #{@mark ? true : false};});"
|
6
|
+
end
|
@@ -1,25 +1,29 @@
|
|
1
|
-
|
1
|
+
form = element_form_id(:action => :create)
|
2
|
+
cancel_selector = "##{form} a.cancel".to_json
|
2
3
|
|
3
4
|
if controller.send :successful?
|
4
5
|
if @insert_row
|
5
6
|
page.insert_html :top, active_scaffold_tbody_id, :partial => 'list_record', :locals => {:record => @record}
|
7
|
+
page.replace active_scaffold_calculations_id, :partial => 'list_calculations' if active_scaffold_config.list.columns.any? {|c| c.calculation?}
|
6
8
|
page << "ActiveScaffold.stripe($('#{active_scaffold_tbody_id}'))"
|
7
9
|
page << "ActiveScaffold.hide_empty_message('#{active_scaffold_tbody_id}','#{empty_message_id}');"
|
8
10
|
page << "ActiveScaffold.increment_record_count('#{active_scaffold_id}');"
|
11
|
+
page[element_row_id(:action => :list, :id => @record.id)].highlight
|
9
12
|
end
|
10
13
|
|
11
14
|
if (active_scaffold_config.create.persistent)
|
12
15
|
page << "$$(#{cancel_selector}).first().link.reload();"
|
13
16
|
else
|
14
|
-
page << "$$(#{cancel_selector}).first().link.close
|
17
|
+
page << "$$(#{cancel_selector}).first().link.close();"
|
15
18
|
end
|
16
|
-
if (active_scaffold_config.create.
|
17
|
-
page << "var link = $('#{action_link_id
|
19
|
+
if (action = active_scaffold_config.create.action_after_create)
|
20
|
+
page << "var link = $('#{action_link_id action, @record.id}');"
|
18
21
|
page << "if (link) (function() { link.action_link.open() }).defer();"
|
19
22
|
end
|
20
23
|
else
|
21
|
-
page << "l = $$(#{cancel_selector}).first().link;"
|
22
|
-
page.replace
|
23
|
-
page << "l.register_cancel_hooks();"
|
24
|
+
page << "var l = $$(#{cancel_selector}).first().link;"
|
25
|
+
page.replace form, :partial => 'create_form', :locals => {:xhr => true}
|
26
|
+
page << "if (l) l.register_cancel_hooks();"
|
27
|
+
page[form].scroll_to
|
24
28
|
end
|
25
|
-
page.replace_html active_scaffold_messages_id, :partial => 'messages'
|
29
|
+
page.replace_html active_scaffold_messages_id, :partial => 'messages'
|
@@ -1,11 +1,18 @@
|
|
1
|
-
|
1
|
+
form = element_form_id(:action => :update)
|
2
|
+
cancel_selector = "##{form} a.cancel".to_json
|
2
3
|
|
3
4
|
if controller.send :successful?
|
4
|
-
|
5
|
+
if active_scaffold_config.update.persistent
|
6
|
+
flash.now[:info] = 'Update Succeeded!'
|
7
|
+
else
|
8
|
+
updated_row = render :partial => 'list_record', :locals => {:record => @record} if params[:parent_controller].nil?
|
9
|
+
page << "$$(#{cancel_selector}).first().link.close('#{escape_javascript(updated_row)}');"
|
10
|
+
end
|
5
11
|
page.replace active_scaffold_calculations_id, :partial => 'list_calculations' if active_scaffold_config.list.columns.any? {|c| c.calculation?}
|
6
12
|
else
|
7
|
-
page << "l = $$(#{cancel_selector}).first().link;"
|
8
|
-
page.replace
|
9
|
-
page << "l.register_cancel_hooks();"
|
13
|
+
page << "var l = $$(#{cancel_selector}).first().link;"
|
14
|
+
page.replace form, :partial => 'update_form', :locals => {:xhr => true}
|
15
|
+
page << "if (l) l.register_cancel_hooks();"
|
16
|
+
page[form].scroll_to
|
10
17
|
end
|
11
|
-
page.replace_html active_scaffold_messages_id, :partial => 'messages'
|
18
|
+
page.replace_html active_scaffold_messages_id, :partial => 'messages'
|
@@ -0,0 +1 @@
|
|
1
|
+
page << render(:partial => 'render_fields.js', :object => @update_columns)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<div class="active-scaffold">
|
2
2
|
<div class="update-view <%= "#{params[:controller]}-view" %> view">
|
3
|
-
<% if active_scaffold_config.update.nested_links and active_scaffold_config.action_links.any? {|link| link.type == :
|
3
|
+
<% if active_scaffold_config.update.nested_links and active_scaffold_config.action_links.any? {|link| link.type == :member } -%>
|
4
4
|
<%= render :partial => 'update_actions', :locals => {:record => @record, :url_options => params_for(:action => :list, :id => @record.id)} %>
|
5
5
|
<% end -%>
|
6
6
|
<%= render :partial => 'update_form' -%>
|
7
7
|
</div>
|
8
|
-
</div>
|
8
|
+
</div>
|
@@ -5,8 +5,9 @@ unless controller.send :successful?
|
|
5
5
|
end
|
6
6
|
column = active_scaffold_config.columns[params[:column]]
|
7
7
|
if column.inplace_edit
|
8
|
-
page.replace_html(column_span_id,format_inplace_edit_column(@record, column))
|
8
|
+
page.replace_html(column_span_id, format_inplace_edit_column(@record, column))
|
9
9
|
else
|
10
10
|
formatted_value = get_column_value(@record, column)
|
11
|
-
page.replace_html(column_span_id,
|
12
|
-
end
|
11
|
+
page.replace_html(column_span_id, formatted_value)
|
12
|
+
end
|
13
|
+
page.replace_html(active_scaffold_calculations_id(column), render_column_calculation(column)) if column.calculation?
|
@@ -0,0 +1,2 @@
|
|
1
|
+
page.call 'ActiveScaffold.update_row', element_row_id(:action => 'list', :id => @record.id), render(:partial => 'list_record', :locals => {:record => @record})
|
2
|
+
page.replace active_scaffold_calculations_id, :partial => 'list_calculations' if active_scaffold_config.list.columns.any? {|c| c.calculation?}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
##
|
2
2
|
## Initialize the environment
|
3
3
|
##
|
4
|
-
unless Rails::VERSION::MAJOR == 2 && Rails::VERSION::MINOR >= 3
|
5
|
-
raise "This version of ActiveScaffold requires Rails 2.3 or higher. Please use an earlier version."
|
4
|
+
unless Rails::VERSION::MAJOR == 2 && Rails::VERSION::MINOR >= 3 && Rails::VERSION::TINY >= 8
|
5
|
+
raise "This version of ActiveScaffold requires Rails 2.3.8 or higher. Please use an earlier version."
|
6
6
|
end
|
7
7
|
|
8
8
|
require File.dirname(__FILE__) + '/environment'
|
@@ -30,11 +30,10 @@ class ErrCounter # using errcount.com
|
|
30
30
|
def self.increment
|
31
31
|
@http = Net::HTTP.new("errcount.com")
|
32
32
|
resp, data = @http.get2("/ctr/#{@@ACCOUNT_ID}.js", {'Referer' => @@SITE_DOMAIN})
|
33
|
-
puts resp.body
|
34
33
|
end
|
35
34
|
end
|
36
35
|
|
37
36
|
begin
|
38
37
|
ErrCounter.increment
|
39
38
|
rescue
|
40
|
-
end
|
39
|
+
end
|
@@ -8,7 +8,7 @@ Dir.chdir(Dir.getwd.sub(/vendor.*/, '')) do
|
|
8
8
|
|
9
9
|
def copy_files(source_path, destination_path, directory)
|
10
10
|
source, destination = File.join(directory, source_path), File.join(Rails.root, destination_path)
|
11
|
-
FileUtils.
|
11
|
+
FileUtils.mkdir_p(destination) unless File.exist?(destination)
|
12
12
|
FileUtils.cp_r(Dir.glob(source+'/*.*'), destination)
|
13
13
|
end
|
14
14
|
|
@@ -62,33 +62,8 @@ module ActiveRecordPermissions
|
|
62
62
|
|
63
63
|
module Permissions
|
64
64
|
def self.included(base)
|
65
|
-
base.extend
|
66
|
-
|
67
|
-
|
68
|
-
# A generic authorization query. This is what will be called programatically, since
|
69
|
-
# the actual permission methods can't be guaranteed to exist. And because we want to
|
70
|
-
# intelligently combine multiple applicable methods.
|
71
|
-
#
|
72
|
-
# options[:action] should be a CRUD verb (:create, :read, :update, :destroy)
|
73
|
-
# options[:column] should be the name of a model attribute
|
74
|
-
def authorized_for?(options = {})
|
75
|
-
raise ArgumentError, "unknown action #{options[:action]}" if options[:action] and ![:create, :read, :update, :destroy].include?(options[:action])
|
76
|
-
|
77
|
-
# collect the possibly-related methods that actually exist
|
78
|
-
methods = [
|
79
|
-
column_security_method(options[:column]),
|
80
|
-
action_security_method(options[:action]),
|
81
|
-
column_and_action_security_method(options[:column], options[:action])
|
82
|
-
].compact.select {|m| respond_to?(m)}
|
83
|
-
|
84
|
-
# if any method returns false, then return false
|
85
|
-
return false if methods.any? {|m| !send(m)}
|
86
|
-
|
87
|
-
# if any method actually exists then it must've returned true, so return true
|
88
|
-
return true unless methods.empty?
|
89
|
-
|
90
|
-
# if no method exists, return the default permission
|
91
|
-
return ActiveRecordPermissions.default_permission
|
65
|
+
base.extend SecurityMethods
|
66
|
+
base.send :include, SecurityMethods
|
92
67
|
end
|
93
68
|
|
94
69
|
# Because any class-level queries get delegated to the instance level via a new record,
|
@@ -98,26 +73,62 @@ module ActiveRecordPermissions
|
|
98
73
|
!new_record?
|
99
74
|
end
|
100
75
|
|
101
|
-
module
|
102
|
-
#
|
103
|
-
|
104
|
-
|
105
|
-
|
76
|
+
module SecurityMethods
|
77
|
+
# A generic authorization query. This is what will be called programatically, since
|
78
|
+
# the actual permission methods can't be guaranteed to exist. And because we want to
|
79
|
+
# intelligently combine multiple applicable methods.
|
80
|
+
#
|
81
|
+
# options[:crud_type] should be a CRUD verb (:create, :read, :update, :destroy)
|
82
|
+
# options[:column] should be the name of a model attribute
|
83
|
+
# options[:action] is the name of a method
|
84
|
+
def authorized_for?(options = {})
|
85
|
+
raise ArgumentError, "unknown crud type #{options[:crud_type]}" if options[:crud_type] and ![:create, :read, :update, :delete].include?(options[:crud_type])
|
86
|
+
|
87
|
+
# column_authorized_for_crud_type? has the highest priority over other methods,
|
88
|
+
# you can disable a crud verb and enable that verb for a column
|
89
|
+
# (for example, disable update and enable inplace_edit in a column)
|
90
|
+
method = column_and_crud_type_security_method(options[:column], options[:crud_type])
|
91
|
+
return send(method) if method and respond_to?(method)
|
92
|
+
|
93
|
+
# authorized_for_action? has higher priority than other methods,
|
94
|
+
# you can disable a crud verb and enable an action with that crud verb
|
95
|
+
# (for example, disable update and enable an action with update as crud type)
|
96
|
+
method = action_security_method(options[:action])
|
97
|
+
return send(method) if method and respond_to?(method)
|
98
|
+
|
99
|
+
# collect other possibly-related methods that actually exist
|
100
|
+
methods = [
|
101
|
+
column_security_method(options[:column]),
|
102
|
+
crud_type_security_method(options[:crud_type]),
|
103
|
+
].compact.select {|m| respond_to?(m)}
|
104
|
+
|
105
|
+
# if any method returns false, then return false
|
106
|
+
return false if methods.any? {|m| !send(m)}
|
107
|
+
|
108
|
+
# if any method actually exists then it must've returned true, so return true
|
109
|
+
return true unless methods.empty?
|
110
|
+
|
111
|
+
# if no method exists, return the default permission
|
112
|
+
return ActiveRecordPermissions.default_permission
|
106
113
|
end
|
107
|
-
end
|
108
114
|
|
109
|
-
|
115
|
+
private
|
110
116
|
|
111
|
-
|
112
|
-
|
113
|
-
|
117
|
+
def column_security_method(column)
|
118
|
+
"#{column}_authorized?" if column
|
119
|
+
end
|
114
120
|
|
115
|
-
|
116
|
-
|
117
|
-
|
121
|
+
def crud_type_security_method(crud_type)
|
122
|
+
"authorized_for_#{crud_type}?" if crud_type
|
123
|
+
end
|
118
124
|
|
119
|
-
|
120
|
-
|
125
|
+
def action_security_method(action)
|
126
|
+
"authorized_for_#{action}?" if action
|
127
|
+
end
|
128
|
+
|
129
|
+
def column_and_crud_type_security_method(column, crud_type)
|
130
|
+
"#{column}_authorized_for_#{crud_type}?" if column and crud_type
|
131
|
+
end
|
121
132
|
end
|
122
133
|
end
|
123
134
|
end
|