guara 0.0.1.rc
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +23 -0
- data/.rspec +2 -0
- data/.travis.yml +33 -0
- data/Gemfile +82 -0
- data/Gemfile.lock +323 -0
- data/Guardfile +32 -0
- data/MIT-LICENSE +20 -0
- data/README.md +8 -0
- data/Rakefile +7 -0
- data/app/admin/business_activities.rb +3 -0
- data/app/admin/business_departments.rb +3 -0
- data/app/admin/business_segments.rb +13 -0
- data/app/admin/cities.rb +3 -0
- data/app/admin/company_businesses.rb +3 -0
- data/app/admin/dashboard.rb +39 -0
- data/app/admin/districts.rb +3 -0
- data/app/admin/states.rb +3 -0
- data/app/admin/task_types.rb +3 -0
- data/app/admin/user_groups.rb +3 -0
- data/app/admin/users.rb +3 -0
- data/app/assets/images/close.gif +0 -0
- data/app/assets/images/custom/logo.png +0 -0
- data/app/assets/images/custom/nav_logo.png +0 -0
- data/app/assets/images/custom/nav_logo.psd +0 -0
- data/app/assets/images/rails.png +0 -0
- data/app/assets/javascripts/active_admin.js +5 -0
- data/app/assets/javascripts/application.js +97 -0
- data/app/assets/javascripts/business_departments.js.coffee +3 -0
- data/app/assets/javascripts/company_businesses.js.coffee +3 -0
- data/app/assets/javascripts/crm.js.coffee +14 -0
- data/app/assets/javascripts/fcbk.js +556 -0
- data/app/assets/javascripts/jquery-ui-timepicker-addon.js +1326 -0
- data/app/assets/javascripts/jquery.mask.1.3.js +7 -0
- data/app/assets/javascripts/jquery.multiselect.filter.xjs +173 -0
- data/app/assets/javascripts/jquery.multiselect.xjs +668 -0
- data/app/assets/javascripts/system_task_status.js.coffee +3 -0
- data/app/assets/javascripts/tests/ajaxes.js.coffee +3 -0
- data/app/assets/stylesheets/abilities.css.scss +6 -0
- data/app/assets/stylesheets/active_admin.css.scss +65 -0
- data/app/assets/stylesheets/application.css +19 -0
- data/app/assets/stylesheets/business_departments.css.scss +3 -0
- data/app/assets/stylesheets/company_businesses.css.scss +3 -0
- data/app/assets/stylesheets/custom.css.scss +322 -0
- data/app/assets/stylesheets/customer.scss +7 -0
- data/app/assets/stylesheets/fcbk.css +165 -0
- data/app/assets/stylesheets/guara.css.scss +159 -0
- data/app/assets/stylesheets/jquery-ui.css +567 -0
- data/app/assets/stylesheets/jquery_bootstrap.css.scss +92 -0
- data/app/assets/stylesheets/jquery_multiselect_filter.xcss +3 -0
- data/app/assets/stylesheets/scaffolds.css.scss +42 -0
- data/app/assets/stylesheets/users.css.scss +10 -0
- data/app/controllers/abilities_controller.rb +37 -0
- data/app/controllers/application_controller.rb +12 -0
- data/app/controllers/business_activities_controller.rb +87 -0
- data/app/controllers/business_departments_controller.rb +90 -0
- data/app/controllers/business_segments_controller.rb +88 -0
- data/app/controllers/company_businesses_controller.rb +46 -0
- data/app/controllers/contacts_controller.rb +105 -0
- data/app/controllers/customers_controller.rb +117 -0
- data/app/controllers/microposts_controller.rb +31 -0
- data/app/controllers/sessions_controller.rb +32 -0
- data/app/controllers/static_pages_controller.rb +23 -0
- data/app/controllers/system_task_status_controller.rb +84 -0
- data/app/controllers/task_feedbacks_controller.rb +6 -0
- data/app/controllers/task_types_controller.rb +85 -0
- data/app/controllers/tasks_controller.rb +107 -0
- data/app/controllers/tests/ajaxes_controller.rb +115 -0
- data/app/controllers/tests/lab_ajax_controller.rb +27 -0
- data/app/controllers/users_controller.rb +62 -0
- data/app/helpers/ability_helper.rb +15 -0
- data/app/helpers/application_helper.rb +32 -0
- data/app/helpers/business_activities_helper.rb +2 -0
- data/app/helpers/business_departments_helper.rb +2 -0
- data/app/helpers/business_segments_helper.rb +2 -0
- data/app/helpers/company_businesses_helper.rb +2 -0
- data/app/helpers/contacts_helper.rb +2 -0
- data/app/helpers/customers_helper.rb +23 -0
- data/app/helpers/email_helper.rb +8 -0
- data/app/helpers/form_ajax_helper.rb +8 -0
- data/app/helpers/guara_views_helper.rb +38 -0
- data/app/helpers/locale_helper.rb +24 -0
- data/app/helpers/menu_helper.rb +55 -0
- data/app/helpers/sessions_helper.rb +56 -0
- data/app/helpers/tasks_helper.rb +20 -0
- data/app/helpers/tests/ajaxes_helper.rb +2 -0
- data/app/helpers/user_abilities_helper.rb +12 -0
- data/app/helpers/users_helper.rb +29 -0
- data/app/mailers/.gitkeep +0 -0
- data/app/models/.gitkeep +0 -0
- data/app/models/ability.rb +52 -0
- data/app/models/address.rb +7 -0
- data/app/models/business_activity.rb +5 -0
- data/app/models/business_department.rb +3 -0
- data/app/models/business_segment.rb +5 -0
- data/app/models/city.rb +7 -0
- data/app/models/company_business.rb +6 -0
- data/app/models/contact.rb +69 -0
- data/app/models/customer.rb +117 -0
- data/app/models/customer_activity.rb +9 -0
- data/app/models/customer_financial.rb +10 -0
- data/app/models/customer_has_customers.rb +7 -0
- data/app/models/customer_pf.rb +13 -0
- data/app/models/customer_pj.rb +71 -0
- data/app/models/customer_pj_has_customers_pj.rb +7 -0
- data/app/models/customer_product.rb +3 -0
- data/app/models/customer_segment.rb +9 -0
- data/app/models/district.rb +6 -0
- data/app/models/email.rb +7 -0
- data/app/models/micropost.rb +10 -0
- data/app/models/relationship.rb +9 -0
- data/app/models/search.rb +17 -0
- data/app/models/state.rb +3 -0
- data/app/models/system_ability.rb +16 -0
- data/app/models/system_module.rb +16 -0
- data/app/models/system_task_resolution.rb +26 -0
- data/app/models/system_task_status.rb +19 -0
- data/app/models/task.rb +76 -0
- data/app/models/task_feedback.rb +11 -0
- data/app/models/task_type.rb +12 -0
- data/app/models/tests.rb +5 -0
- data/app/models/tests/ajax.rb +3 -0
- data/app/models/user.rb +126 -0
- data/app/models/user_ability.rb +23 -0
- data/app/models/user_group.rb +9 -0
- data/app/models/user_type.rb +9 -0
- data/app/models/users_has_groups.rb +9 -0
- data/app/validators/customer_cnpj_validator.rb +14 -0
- data/app/validators/email_validator.rb +21 -0
- data/app/views/abilities/index.html.erb +25 -0
- data/app/views/active_extend/_one_to_many_inputs.html.erb +7 -0
- data/app/views/active_extend/_one_to_many_inputs_fields.html.erb +10 -0
- data/app/views/active_extend/_one_to_many_inputs_with_glyph.html.erb +21 -0
- data/app/views/business_activities/_business_activity.html.erb +0 -0
- data/app/views/business_activities/_form.html.erb +25 -0
- data/app/views/business_activities/edit.html.erb +6 -0
- data/app/views/business_activities/index.html.erb +33 -0
- data/app/views/business_activities/new.html.erb +5 -0
- data/app/views/business_activities/show.html.erb +15 -0
- data/app/views/business_departments/_form.html.erb +10 -0
- data/app/views/business_departments/edit.html.erb +6 -0
- data/app/views/business_departments/index.html.erb +33 -0
- data/app/views/business_departments/new.html.erb +5 -0
- data/app/views/business_departments/show.html.erb +15 -0
- data/app/views/business_segments/_business_segment.html.erb +8 -0
- data/app/views/business_segments/_form.html.erb +25 -0
- data/app/views/business_segments/edit.html.erb +6 -0
- data/app/views/business_segments/index.html.erb +33 -0
- data/app/views/business_segments/new.html.erb +5 -0
- data/app/views/business_segments/show.html.erb +15 -0
- data/app/views/company_businesses/_form.html.erb +10 -0
- data/app/views/company_businesses/edit.html.erb +6 -0
- data/app/views/company_businesses/index.html.erb +25 -0
- data/app/views/company_businesses/new.html.erb +5 -0
- data/app/views/company_businesses/show.html.erb +15 -0
- data/app/views/contacts/_form.html.erb +53 -0
- data/app/views/contacts/_header.html.erb +3 -0
- data/app/views/contacts/_list.html.erb +46 -0
- data/app/views/contacts/_side_panel.html.erb +61 -0
- data/app/views/contacts/edit.html.erb +6 -0
- data/app/views/contacts/index.html.erb +72 -0
- data/app/views/contacts/new.html.erb +5 -0
- data/app/views/contacts/show.html.erb +52 -0
- data/app/views/customers/_businesses_done.html.erb +18 -0
- data/app/views/customers/_customer_segment.html.erb +9 -0
- data/app/views/customers/_form.html.erb +177 -0
- data/app/views/customers/_form_search.html.erb +119 -0
- data/app/views/customers/_modules.html.erb +6 -0
- data/app/views/customers/_navbar.html.erb +23 -0
- data/app/views/customers/_segment.html.erb +10 -0
- data/app/views/customers/edit.html.erb +8 -0
- data/app/views/customers/index.html.erb +46 -0
- data/app/views/customers/new.pj.html.erb +4 -0
- data/app/views/customers/show.pj.html.erb +200 -0
- data/app/views/devise/confirmations/new.html.erb +12 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/devise/passwords/edit.html.erb +16 -0
- data/app/views/devise/passwords/new.html.erb +12 -0
- data/app/views/devise/registrations/edit.html.erb +25 -0
- data/app/views/devise/registrations/new.html.erb +18 -0
- data/app/views/devise/sessions/new.html.erb +24 -0
- data/app/views/devise/shared/_links.erb +25 -0
- data/app/views/devise/unlocks/new.html.erb +12 -0
- data/app/views/emails/_email_fields.html.erb +1 -0
- data/app/views/layouts/_active_admin_footer.html.erb +4 -0
- data/app/views/layouts/_active_admin_header.html.erb +5 -0
- data/app/views/layouts/_footer.html.erb +12 -0
- data/app/views/layouts/_header.html.erb +51 -0
- data/app/views/layouts/_shim.html.erb +3 -0
- data/app/views/layouts/active_admin.html.arb +1 -0
- data/app/views/layouts/application.html.erb +24 -0
- data/app/views/microposts/_micropost.html.erb +11 -0
- data/app/views/sessions/new.html.erb +18 -0
- data/app/views/shared/_calendar.html.erb +17 -0
- data/app/views/shared/_error_messages.html.erb +13 -0
- data/app/views/shared/_feed.html.erb +10 -0
- data/app/views/shared/_feed_item.html.erb +15 -0
- data/app/views/shared/_micropost_form.html.erb +7 -0
- data/app/views/shared/_multi_selection.html.erb +16 -0
- data/app/views/shared/_multi_selection.html_checkbox.erb +11 -0
- data/app/views/shared/_multi_selection_autocomple.html.erb +5 -0
- data/app/views/shared/_notifies.html.erb +17 -0
- data/app/views/shared/_user_info.html.erb +14 -0
- data/app/views/static_pages/about.html.erb +5 -0
- data/app/views/static_pages/contact.html.erb +5 -0
- data/app/views/static_pages/help.html.erb +5 -0
- data/app/views/static_pages/home.html.erb +37 -0
- data/app/views/static_pages/news.html.erb +2 -0
- data/app/views/system_task_status/_form.html.erb +9 -0
- data/app/views/system_task_status/edit.html.erb +6 -0
- data/app/views/system_task_status/index.html.erb +23 -0
- data/app/views/system_task_status/new.html.erb +5 -0
- data/app/views/system_task_status/show.html.erb +10 -0
- data/app/views/task_feedbacks/_list.html.erb +51 -0
- data/app/views/task_feedbacks/_side_form.html.erb +56 -0
- data/app/views/task_feedbacks/_side_panel.html.erb +64 -0
- data/app/views/task_types/_form.html.erb +10 -0
- data/app/views/task_types/edit.html.erb +6 -0
- data/app/views/task_types/index.html.erb +23 -0
- data/app/views/task_types/new.html.erb +5 -0
- data/app/views/task_types/show.html.erb +10 -0
- data/app/views/tasks/_form.html.erb +52 -0
- data/app/views/tasks/_header.html.erb +3 -0
- data/app/views/tasks/_list.html.erb +50 -0
- data/app/views/tasks/_side_panel.html.erb +64 -0
- data/app/views/tasks/create.js.erb +1 -0
- data/app/views/tasks/edit.html.erb +6 -0
- data/app/views/tasks/index.html.erb +61 -0
- data/app/views/tasks/new.html.erb +5 -0
- data/app/views/tasks/show.html.erb +46 -0
- data/app/views/tests/ajaxes/_form.html.erb +10 -0
- data/app/views/tests/ajaxes/_list.html.erb +6 -0
- data/app/views/tests/ajaxes/add_and_update.html.erb +22 -0
- data/app/views/tests/ajaxes/all.js.erb +2 -0
- data/app/views/tests/ajaxes/edit.html.erb +6 -0
- data/app/views/tests/ajaxes/index.html.erb +25 -0
- data/app/views/tests/ajaxes/new.html.erb +5 -0
- data/app/views/tests/ajaxes/show.html.erb +15 -0
- data/app/views/tests/js.js +51 -0
- data/app/views/tests/lab_ajax/multiselection.html.erb +84 -0
- data/app/views/users/_user.html.erb +8 -0
- data/app/views/users/edit.html.erb +27 -0
- data/app/views/users/index.html.erb +9 -0
- data/app/views/users/new.html.erb +24 -0
- data/app/views/users/show.html.erb +26 -0
- data/bundle +0 -0
- data/config.ru +4 -0
- data/config/application.rb +73 -0
- data/config/boot.rb +6 -0
- data/config/database.yml +38 -0
- data/config/environment.rb +31 -0
- data/config/environments/development.rb +42 -0
- data/config/environments/production.rb +68 -0
- data/config/environments/test.rb +39 -0
- data/config/guara/menus.rb +34 -0
- data/config/initializers/active_admin.rb +210 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/cmgb_rules.rb +2 -0
- data/config/initializers/devise.rb +216 -0
- data/config/initializers/formtastic.rb +77 -0
- data/config/initializers/inflections.rb +19 -0
- data/config/initializers/json_paches_utf8.rb +13 -0
- data/config/initializers/kaminari.rb +21 -0
- data/config/initializers/locale.rb +7 -0
- data/config/initializers/meta_search.rb +10 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/secret_token.rb +7 -0
- data/config/initializers/session_store.rb +8 -0
- data/config/initializers/string.rb +9 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/locales/devise.en.yml +57 -0
- data/config/locales/devise.pt-BR.yml +62 -0
- data/config/locales/pt-BR.yml +404 -0
- data/config/routes.rb +129 -0
- data/db/migrate/20120610142404_create_users.rb +10 -0
- data/db/migrate/20120610183820_add_index_to_users_email.rb +5 -0
- data/db/migrate/20120610185217_add_password_digest_to_users.rb +5 -0
- data/db/migrate/20120612000411_add_remember_token_to_users.rb +6 -0
- data/db/migrate/20120616162515_add_admin_to_users.rb +5 -0
- data/db/migrate/20120616215835_create_microposts.rb +11 -0
- data/db/migrate/20120617224530_create_relationships.rb +14 -0
- data/db/migrate/20120621095918_create_customers.rb +36 -0
- data/db/migrate/20120621100528_create_customer_pfs.rb +14 -0
- data/db/migrate/20120621100534_create_customer_pjs.rb +13 -0
- data/db/migrate/20120621100557_create_emails.rb +13 -0
- data/db/migrate/20120621100618_create_tasks.rb +26 -0
- data/db/migrate/20120621100639_create_customer_products.rb +14 -0
- data/db/migrate/20120621100705_create_districts.rb +11 -0
- data/db/migrate/20120621100720_create_cities.rb +11 -0
- data/db/migrate/20120624192444_create_business_segments.rb +10 -0
- data/db/migrate/20120624224245_create_business_activities.rb +13 -0
- data/db/migrate/20120628092744_create_customer_activities.rb +9 -0
- data/db/migrate/20120628092754_create_customer_segments.rb +9 -0
- data/db/migrate/20120703102859_create_states.rb +10 -0
- data/db/migrate/20120705121011_create_contacts.rb +18 -0
- data/db/migrate/20120711233943_add_devise_to_users.rb +56 -0
- data/db/migrate/20120723102847_create_user_abilities.rb +10 -0
- data/db/migrate/20120723104500_create_system_modules.rb +9 -0
- data/db/migrate/20120723104639_create_system_abilities.rb +9 -0
- data/db/migrate/20120728181903_create_user_groups.rb +10 -0
- data/db/migrate/20120729112600_create_users_has_groups.rb +14 -0
- data/db/migrate/20120729121922_add_groups_to_users.rb +6 -0
- data/db/migrate/20120910002835_create_system_task_status.rb +7 -0
- data/db/migrate/20120910010153_create_system_task_resolutions.rb +7 -0
- data/db/migrate/20120911021535_create_task_types.rb +10 -0
- data/db/migrate/20120911070836_create_task_feedbacks.rb +14 -0
- data/db/migrate/20120924022719_create_tests_ajaxes.rb +10 -0
- data/db/migrate/20121007131035_create_business_departments.rb +10 -0
- data/db/migrate/20121013120849_add_notes_and_other_contacts_to_customer.rb +5 -0
- data/db/migrate/20121014201255_create_company_businesses.rb +10 -0
- data/db/migrate/20121014202449_add_company_business_to_task_type.rb +6 -0
- data/db/migrate/20121014212430_add_primary_company_business_to_user.rb +5 -0
- data/db/migrate/20121015101844_add_parent_id_to_system_task_resolution.rb +5 -0
- data/db/migrate/20121026231241_create_customer_has_customers.rb +10 -0
- data/db/migrate/20121026232755_create_customer_pj_has_customers_pjs.rb +10 -0
- data/db/migrate/20121029094047_create_admin_notes.rb +17 -0
- data/db/migrate/20121029094048_move_admin_notes_to_comments.rb +25 -0
- data/db/migrate/20121103183646_add_enabled_to_cities.rb +5 -0
- data/db/migrate/20121104135014_create_customer_financials.rb +17 -0
- data/db/migrate/20121104141751_create_addresses.rb +19 -0
- data/db/migrate/20121205150619_add_type_id_to_users.rb +5 -0
- data/db/schema.rb~ +378 -0
- data/db/seeds.rb +99 -0
- data/gemfiles/Gemfile.rails.3.2.x +82 -0
- data/guara.gemspec +31 -0
- data/lib/active_extend/README.md +19 -0
- data/lib/active_extend/active_disablable.rb +59 -0
- data/lib/active_extend/string_helper.rb +9 -0
- data/lib/active_migration.rb +4 -0
- data/lib/active_migration/converters/rtf_to_html.rb +123 -0
- data/lib/active_migration/dictionary.rb +19 -0
- data/lib/active_migration/migration.rb +211 -0
- data/lib/active_migration/schemas.rb +143 -0
- data/lib/active_migration/spelling_fix.rb +20 -0
- data/lib/active_migration/transformer/grouped_field_fixed_spelling.rb +110 -0
- data/lib/assets/.gitkeep +0 -0
- data/lib/cmgb_rules/app/models/task.rb +19 -0
- data/lib/guara/version.rb +3 -0
- data/lib/spec/asserts/sheet1.xls +0 -0
- data/lib/spec/lib/active_migration_schemas_spec.rb +40 -0
- data/lib/spec/lib/active_migration_spec.rb +78 -0
- data/lib/spec/spec_helper.rb +121 -0
- data/lib/spec/support/active_migration_helper.rb +109 -0
- data/lib/spec/support/utilities.rb +7 -0
- data/lib/tasks/.gitkeep +0 -0
- data/lib/tasks/add_privilegies.rake +6 -0
- data/lib/tasks/external_migration.rake +22 -0
- data/lib/tasks/sample_data.rake +77 -0
- data/lib/tasks/smaple_data_test.rake +13 -0
- data/lib/templates/erb/scaffold/_form.html.erb +11 -0
- data/public/404.html +26 -0
- data/public/422.html +26 -0
- data/public/500.html +25 -0
- data/public/data.txt +1 -0
- data/public/favicon.ico +0 -0
- data/public/javascripts/autocomplete-rails.js +16 -0
- data/public/robots.txt +5 -0
- data/script/create_db +5 -0
- data/script/rails +6 -0
- data/script/recreate_db +5 -0
- data/script/recreate_db.bat +9 -0
- data/script/recreate_db_test +5 -0
- data/script/recreate_development_db +10 -0
- data/spec/controllers/business_activities_controller_spec.disabled +167 -0
- data/spec/controllers/business_departments_controller_spec.disabled +164 -0
- data/spec/controllers/business_segments_controller_spec.disabled +165 -0
- data/spec/controllers/company_businesses_controller_spec.disabled +164 -0
- data/spec/controllers/system_task_status_controller_spec.disabled +164 -0
- data/spec/controllers/system_task_status_spec.disabled +11 -0
- data/spec/controllers/task_types_controller_spec.disabled +164 -0
- data/spec/controllers/tasks_controller_spec.disabled +23 -0
- data/spec/controllers/tests/ajaxes_controller_spec.disabled +164 -0
- data/spec/factories.rb +101 -0
- data/spec/factories/addresses.rb +13 -0
- data/spec/factories/business_departments.rb +8 -0
- data/spec/factories/company_businesses.rb +8 -0
- data/spec/factories/customer_financials.rb +11 -0
- data/spec/factories/customer_has_customers.rb +8 -0
- data/spec/factories/customer_pj_has_customers_pjs.rb +8 -0
- data/spec/factories/system_task_resolutions.rb +7 -0
- data/spec/factories/system_task_status.rb +7 -0
- data/spec/factories/task.rb +17 -0
- data/spec/factories/task_feedbacks.rb +19 -0
- data/spec/factories/task_types.rb +8 -0
- data/spec/factories/tests_ajaxes.rb +8 -0
- data/spec/helpers/business_activities_helper_spec.rb +15 -0
- data/spec/helpers/business_departments_helper_spec.rb +15 -0
- data/spec/helpers/business_segments_helper_spec.rb +15 -0
- data/spec/helpers/company_businesses_helper_spec.rb +15 -0
- data/spec/helpers/customers/contacts_helper_spec.rb +15 -0
- data/spec/helpers/menu_helper_spec.rb +25 -0
- data/spec/helpers/tests/ajaxes_helper_spec.rb +15 -0
- data/spec/helpers/users_helpers_spec.rb +32 -0
- data/spec/models/address_spec.rb +5 -0
- data/spec/models/business_activity_spec.rb +5 -0
- data/spec/models/business_department_spec.rb +5 -0
- data/spec/models/business_segment_spec.rb +5 -0
- data/spec/models/city_spec.rb +5 -0
- data/spec/models/company_business_spec.rb +19 -0
- data/spec/models/contact_spec.rb +60 -0
- data/spec/models/customer_activity_spec.rb +5 -0
- data/spec/models/customer_financial_spec.rb +48 -0
- data/spec/models/customer_has_customers_spec.rb +18 -0
- data/spec/models/customer_pf_spec.rb +24 -0
- data/spec/models/customer_pj_has_customers_pj_spec.rb +34 -0
- data/spec/models/customer_pj_spec.rb +72 -0
- data/spec/models/customer_product_spec.rb +5 -0
- data/spec/models/customer_segment_spec.rb +5 -0
- data/spec/models/customer_spec.rb +135 -0
- data/spec/models/district_spec.rb +5 -0
- data/spec/models/emails_spec.rb +24 -0
- data/spec/models/micropost_spec.rb +49 -0
- data/spec/models/relationship_spec.rb +38 -0
- data/spec/models/state_spec.rb +5 -0
- data/spec/models/system_ability_spec.rb +5 -0
- data/spec/models/system_module_spec.rb +5 -0
- data/spec/models/system_task_resolution_spec.rb +17 -0
- data/spec/models/system_task_status_spec.rb +17 -0
- data/spec/models/task_feedback_spec.rb +46 -0
- data/spec/models/task_spec.rb +176 -0
- data/spec/models/task_type_spec.rb +27 -0
- data/spec/models/tests/ajax_spec.rb +5 -0
- data/spec/models/user_ability_spec.rb +35 -0
- data/spec/models/user_group_spec.rb +26 -0
- data/spec/models/user_spec.rb +274 -0
- data/spec/models/users_has_groups_spec.rb +29 -0
- data/spec/requests/authentication_pages_spec.rb +157 -0
- data/spec/requests/business_activities_spec.rb +7 -0
- data/spec/requests/business_departments_spec.rb +7 -0
- data/spec/requests/business_segments_spec.rb +7 -0
- data/spec/requests/company_businesses_spec.rb +11 -0
- data/spec/requests/customer_contacts_pages_spec.rb +96 -0
- data/spec/requests/customer_pages_spec.rb +60 -0
- data/spec/requests/micropost_pages_spec.rb +58 -0
- data/spec/requests/static_pages_spec.rb +57 -0
- data/spec/requests/task_pages_spec.rb +124 -0
- data/spec/requests/tests/tests_ajaxes_spec.rb +11 -0
- data/spec/requests/user_abilities_pages_spec.rb +73 -0
- data/spec/requests/user_pages_spec.rb +116 -0
- data/spec/routing/business_activities_routing_spec.rb +35 -0
- data/spec/routing/business_departments_routing_spec.rb +35 -0
- data/spec/routing/business_segments_routing_spec.rb +35 -0
- data/spec/routing/company_businesses_routing_spec.rb +35 -0
- data/spec/routing/system_task_status_routing_spec.rb +35 -0
- data/spec/routing/task_types_routing_spec.rb +35 -0
- data/spec/routing/tests/ajaxes_routing_spec.rb +35 -0
- data/spec/spec_helper.rb +123 -0
- data/spec/support/custom_matchers.rb +9 -0
- data/spec/support/utilities.rb +120 -0
- data/spec/views/business_departments/edit.html.erb_spec.rb +20 -0
- data/spec/views/business_departments/index.html.erb_spec.disabled +23 -0
- data/spec/views/business_departments/new.html.erb_spec.rb +20 -0
- data/spec/views/business_departments/show.html.erb_spec.rb +17 -0
- data/spec/views/company_businesses/edit.html.erb_spec.rb +20 -0
- data/spec/views/company_businesses/index.html.erb_spec.rb +23 -0
- data/spec/views/company_businesses/new.html.erb_spec.rb +20 -0
- data/spec/views/company_businesses/show.html.erb_spec.rb +17 -0
- data/spec/views/task_types/edit.html.erb_spec.rb +18 -0
- data/spec/views/task_types/index.html.erb_spec.rb +20 -0
- data/spec/views/task_types/new.html.erb_spec.rb +18 -0
- data/spec/views/task_types/show.html.erb_spec.rb +15 -0
- data/test/fixtures/.gitkeep +0 -0
- data/test/functional/.gitkeep +0 -0
- data/test/integration/.gitkeep +0 -0
- data/test/performance/browsing_test.rb +12 -0
- data/test/test_helper.rb +13 -0
- data/test/unit/.gitkeep +0 -0
- data/vendor/assets/javascripts/.gitkeep +0 -0
- data/vendor/assets/stylesheets/.gitkeep +0 -0
- data/vendor/assets/stylesheets/active_admin/_base.css.scss +45 -0
- data/vendor/assets/stylesheets/active_admin/_forms.css.scss +270 -0
- data/vendor/assets/stylesheets/active_admin/_header.css.scss +137 -0
- data/vendor/assets/stylesheets/active_admin/_mixins.css.scss +1 -0
- data/vendor/assets/stylesheets/active_admin/_typography.css.scss +100 -0
- data/vendor/assets/stylesheets/active_admin/components/_batch_actions.css.scss +11 -0
- data/vendor/assets/stylesheets/active_admin/components/_blank_slates.scss +31 -0
- data/vendor/assets/stylesheets/active_admin/components/_breadcrumbs.scss +20 -0
- data/vendor/assets/stylesheets/active_admin/components/_buttons.scss +11 -0
- data/vendor/assets/stylesheets/active_admin/components/_columns.scss +3 -0
- data/vendor/assets/stylesheets/active_admin/components/_comments.css.scss +40 -0
- data/vendor/assets/stylesheets/active_admin/components/_date_picker.css.scss +123 -0
- data/vendor/assets/stylesheets/active_admin/components/_dropdown_menu.scss +151 -0
- data/vendor/assets/stylesheets/active_admin/components/_flash_messages.css.scss +39 -0
- data/vendor/assets/stylesheets/active_admin/components/_grid.scss +9 -0
- data/vendor/assets/stylesheets/active_admin/components/_links.scss +5 -0
- data/vendor/assets/stylesheets/active_admin/components/_pagination.scss +34 -0
- data/vendor/assets/stylesheets/active_admin/components/_panels.scss +6 -0
- data/vendor/assets/stylesheets/active_admin/components/_popovers.css.scss +123 -0
- data/vendor/assets/stylesheets/active_admin/components/_scopes.scss +10 -0
- data/vendor/assets/stylesheets/active_admin/components/_status_tags.scss +12 -0
- data/vendor/assets/stylesheets/active_admin/components/_table_tools.css.scss +94 -0
- data/vendor/assets/stylesheets/active_admin/components/_tables.css.scss +108 -0
- data/vendor/assets/stylesheets/active_admin/mixins/_all.css.scss +11 -0
- data/vendor/assets/stylesheets/active_admin/mixins/_buttons.css.scss +66 -0
- data/vendor/assets/stylesheets/active_admin/mixins/_gradients.css.scss +37 -0
- data/vendor/assets/stylesheets/active_admin/mixins/_icons.css.scss +24 -0
- data/vendor/assets/stylesheets/active_admin/mixins/_reset.css.scss +165 -0
- data/vendor/assets/stylesheets/active_admin/mixins/_rounded.css.scss +43 -0
- data/vendor/assets/stylesheets/active_admin/mixins/_sections.css.scss +36 -0
- data/vendor/assets/stylesheets/active_admin/mixins/_shadows.css.scss +22 -0
- data/vendor/assets/stylesheets/active_admin/mixins/_typography.scss +3 -0
- data/vendor/assets/stylesheets/active_admin/mixins/_utilities.scss +26 -0
- data/vendor/assets/stylesheets/active_admin/mixins/_variables.css.scss +24 -0
- data/vendor/assets/stylesheets/active_admin/pages/_dashboard.scss +5 -0
- data/vendor/assets/stylesheets/active_admin/pages/_logged_out.scss +44 -0
- data/vendor/assets/stylesheets/active_admin/print.css.scss +290 -0
- data/vendor/assets/stylesheets/active_admin/structure/_footer.scss +14 -0
- data/vendor/assets/stylesheets/active_admin/structure/_main_structure.scss +26 -0
- data/vendor/assets/stylesheets/active_admin/structure/_title_bar.scss +44 -0
- data/vendor/plugins/.gitkeep +0 -0
- metadata +731 -0
@@ -0,0 +1,52 @@
|
|
1
|
+
<% if @json %>
|
2
|
+
<%= render :partial => "header" %>
|
3
|
+
<% end %>
|
4
|
+
<section class="show">
|
5
|
+
|
6
|
+
<ul class="thumbnails">
|
7
|
+
<li class="span9">
|
8
|
+
<div class="thumbnail">
|
9
|
+
<div class="caption">
|
10
|
+
<legend><%= t("contacts.show.title") %></legend>
|
11
|
+
</div>
|
12
|
+
<div class="row">
|
13
|
+
<div class="span4">
|
14
|
+
|
15
|
+
<div class="control-group">
|
16
|
+
<%= show_label_tag t('contacts.name') %>
|
17
|
+
<%= @contact.name %>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="control-group">
|
21
|
+
<%= show_label_tag t('contacts.departament') %>
|
22
|
+
<%= name_or_empty @contact.department %>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div class="control-group">
|
26
|
+
<%= show_label_tag t('contacts.business_function') %>
|
27
|
+
<%= @contact.business_function %>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<div class="control-group">
|
31
|
+
<%= show_label_tag t('contacts.phone') %>
|
32
|
+
<%= @contact.phone %>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div class="control-group">
|
36
|
+
<%= show_label_tag t('contacts.cell') %>
|
37
|
+
<%= @contact.cell %>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<div class="control-group">
|
41
|
+
<%= show_label_tag t('contacts.birthday') %>
|
42
|
+
<%= @contact.birthday %>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
</li>
|
48
|
+
</ul>
|
49
|
+
</section>
|
50
|
+
<% if @json then @new_target = { target: 'new' } end %>
|
51
|
+
<%= link_to t('helpers.forms.edit'), edit_customer_contact_path(@contact.customer, @contact), @new_target %> |
|
52
|
+
<%= link_to t('helpers.forms.back'), customer_contacts_path(@contact.customer), @new_target %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
<% if @customer.businesses.count>0 then %>
|
3
|
+
<div class="btn-group" id="businesses">
|
4
|
+
<button class="btn btn-info dropdown-toggle" data-toggle="dropdown"><i class="icon-ok icon-white"></i><%= t("customers.a_customer") %>
|
5
|
+
<span class="caret"></span>
|
6
|
+
</button>
|
7
|
+
<ul class="dropdown-menu">
|
8
|
+
<% @customer.businesses.each do |b_d| %>
|
9
|
+
<li><a href="#"><%= b_d.business.name %> <em><%= format_date b_d.business_at %></em></a></li>
|
10
|
+
<% end %>
|
11
|
+
</ul>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<% else %>
|
15
|
+
<% if @customer.is_customer then %>
|
16
|
+
<span class="badge badge-info"><i class="icon-ok icon-white"></i> <%= t("customers.a_customer") %></span>
|
17
|
+
<% end %>
|
18
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% new_or_existing = customer_segment.new_record? ? 'new' : 'existing' %>
|
2
|
+
<% prefix = "customer[#{new_or_existing}_customer_segment_attributes][]" %>
|
3
|
+
<% fields_for prefix, customer_segment do |customer_segment_form| %>
|
4
|
+
<p>
|
5
|
+
<%= 1 %>
|
6
|
+
<%= customer_segment_form.collection_select :segment_id, @segments, :id, :name %>
|
7
|
+
<%= link_to_function t("remove"), "$(this).up('.customer_segment').remove()" %>
|
8
|
+
</p>
|
9
|
+
<% end %>
|
@@ -0,0 +1,177 @@
|
|
1
|
+
<%= semantic_form_for @customer, :html => {:class => "well"} do |f| %>
|
2
|
+
<%= f.semantic_fields_for @customer.person do |person_f| %>
|
3
|
+
<%= render 'shared/error_messages', object: f.object %>
|
4
|
+
<fieldset>
|
5
|
+
<legend><%= @customer.new_record? ? t("customers.new.title") : t("customers.edit.title") %></legend>
|
6
|
+
<div class="row">
|
7
|
+
<div class="span4">
|
8
|
+
|
9
|
+
<%= f.input :doc, :label => t("customers.cnpj") , :input_html => { :class => "cnpj" } %>
|
10
|
+
<%= f.input :doc_rg, :label => t('customers.inscricao_estadual') %>
|
11
|
+
<%= f.input :name_sec %>
|
12
|
+
<%= f.input :name %>
|
13
|
+
<%= f.input :address %>
|
14
|
+
|
15
|
+
<div class="control-group">
|
16
|
+
<%= f.label :state_id, :class => "control-label" %>
|
17
|
+
<div class="controls">
|
18
|
+
<%= f.collection_select(:state_id, State.all, :id, :acronym, :include_blank => true) %>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<div class="control-group">
|
23
|
+
<%= f.label :city_id, :class => "control-label" %>
|
24
|
+
<div class="controls">
|
25
|
+
<%= f.collection_select(:city_id, City.all, :id, :name, :include_blank => true) %>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div class="control-group">
|
30
|
+
<%= f.label :district_id, :class => "control-label" %>
|
31
|
+
<div class="controls">
|
32
|
+
<%= f.collection_select(:district_id, District.all, :id, :name, :include_blank => true) %>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
|
37
|
+
<%= f.input :postal, :input_html => { :class => "postal" } %>
|
38
|
+
|
39
|
+
|
40
|
+
</div>
|
41
|
+
<div class="span4 column2">
|
42
|
+
|
43
|
+
<%= f.input :complete, :label => false %>
|
44
|
+
|
45
|
+
<%= f.input :phone, :class => "phone" %>
|
46
|
+
|
47
|
+
<%= person_f.input :fax, :class => "phone" %>
|
48
|
+
|
49
|
+
<%= f.input :site %>
|
50
|
+
|
51
|
+
<%= f.input :social_link %>
|
52
|
+
|
53
|
+
<%= f.input :other_contacts %>
|
54
|
+
|
55
|
+
<%= person_f.input :total_employes %>
|
56
|
+
|
57
|
+
<%= f.input :notes, :as => :text, :input_html => { rows: 2 } %>
|
58
|
+
|
59
|
+
</div>
|
60
|
+
|
61
|
+
<div class="span3 column2">
|
62
|
+
<div class="control-group">
|
63
|
+
<%= person_f.label :segments, :class => "control-label" %>
|
64
|
+
<div class="controls">
|
65
|
+
<!-- %= render :partial => 'customer_segment', :collection => @person.customer_segments % -->
|
66
|
+
<%= render :partial => 'shared/multi_selection',
|
67
|
+
:locals => {
|
68
|
+
:form => person_f,
|
69
|
+
:values => @person.segments,
|
70
|
+
:autocomplete => multiselect_business_segments_customers_path,
|
71
|
+
:form_field => :segments,
|
72
|
+
:field_show => :name,
|
73
|
+
:field_store => :id,
|
74
|
+
:width => 220
|
75
|
+
} %>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
|
80
|
+
<div class="control-group">
|
81
|
+
<%= person_f.label :activities, :class => "control-label" %>
|
82
|
+
<div class="controls">
|
83
|
+
<!-- %= render :partial => 'customer_segment', :collection => @person.customer_segments % -->
|
84
|
+
<%= render :partial => 'shared/multi_selection',
|
85
|
+
:locals => {
|
86
|
+
:form => person_f,
|
87
|
+
:values => @person.activities,
|
88
|
+
:autocomplete => multiselect_business_activities_customers_path,
|
89
|
+
:form_field => :activities,
|
90
|
+
:field_show => :name,
|
91
|
+
:field_store => :id,
|
92
|
+
:width => 220
|
93
|
+
} %>
|
94
|
+
</div>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
<div class="control-group">
|
98
|
+
<%= person_f.label :associateds, :class => "control-label" %>
|
99
|
+
<div class="controls">
|
100
|
+
<%= render :partial => 'shared/multi_selection',
|
101
|
+
:locals => {
|
102
|
+
:form => person_f,
|
103
|
+
:values => @person.associateds,
|
104
|
+
:autocomplete => multiselect_customers_pj_customers_path,
|
105
|
+
:form_field => :associateds,
|
106
|
+
:field_show => :name,
|
107
|
+
:field_store => :id,
|
108
|
+
:width => 220
|
109
|
+
} %>
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
|
113
|
+
<div class="thumbnail" id="emails">
|
114
|
+
<legend><small><%= t("customers.emails").titleize %></small></legend>
|
115
|
+
<%= render :partial => 'active_extend/one_to_many_inputs',
|
116
|
+
:locals => {
|
117
|
+
:values => @customer.emails,
|
118
|
+
:form => f,
|
119
|
+
:target => :emails,
|
120
|
+
:inputs => {
|
121
|
+
:email => {
|
122
|
+
:as => :string,
|
123
|
+
:class => "span2",
|
124
|
+
:label => false,
|
125
|
+
:placeholder => "e-mail",
|
126
|
+
:glyph => "icon-envelope"
|
127
|
+
}
|
128
|
+
}
|
129
|
+
} %>
|
130
|
+
</div>
|
131
|
+
|
132
|
+
|
133
|
+
</div>
|
134
|
+
|
135
|
+
<div class="span8">
|
136
|
+
<div class="form-actions">
|
137
|
+
<%= f.submit :class => "btn btn-primary" %>
|
138
|
+
<button type="reset" class="btn"><%= t("helpers.forms.cancel") %></button>
|
139
|
+
</div>
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
</fieldset>
|
143
|
+
<% end %>
|
144
|
+
<% end %>
|
145
|
+
|
146
|
+
<script>
|
147
|
+
|
148
|
+
$(function(){
|
149
|
+
|
150
|
+
$("input.cnpj").mask("99.999.999/9999-99");
|
151
|
+
$("input.cpf").mask("999.999.999-99");
|
152
|
+
$("input.phone").mask("99.9999-9999");
|
153
|
+
$("input.postal").mask("99.999-999");
|
154
|
+
|
155
|
+
$('#state').change(function(){
|
156
|
+
if( $(this).val() ) {
|
157
|
+
$('#cod_cidades').hide();
|
158
|
+
$('.carregando').show();
|
159
|
+
$.getJSON('cidades.ajax.php?search=',{cod_estados: $(this).val(), ajax: 'true'}, function(j){
|
160
|
+
var options = '<option value=""></option>';
|
161
|
+
for (var i = 0; i < j.length; i++) {
|
162
|
+
options += '<option value="' + j[i].cod_cidades + '">' + j[i].nome + '</option>';
|
163
|
+
}
|
164
|
+
$('#cod_cidades').html(options).show();
|
165
|
+
$('.carregando').hide();
|
166
|
+
});
|
167
|
+
} else {
|
168
|
+
$('#cod_cidades').html('<option value="">-- Escolha um estado --</option>');
|
169
|
+
}
|
170
|
+
});
|
171
|
+
|
172
|
+
$("form.customer").submit(function() {
|
173
|
+
$("input.postal").val($("input.postal").val().replace(/\D/g, "")).unmask();
|
174
|
+
})
|
175
|
+
});
|
176
|
+
|
177
|
+
</script>
|
@@ -0,0 +1,119 @@
|
|
1
|
+
<div class="page-header"><%= t("customers.index.title") %></div>
|
2
|
+
|
3
|
+
<%= form_for @search, :html => { :class => "well form-search", :method => :get } do |f| %>
|
4
|
+
<% f.fields_for :person do |person_f| %>
|
5
|
+
<fieldset>
|
6
|
+
<div class="row">
|
7
|
+
<div class="control-group">
|
8
|
+
<%= f.label :name_contains, t("helpers.label.customers.search.names"), :class => "control-label" %>
|
9
|
+
<div class="controls">
|
10
|
+
<%= f.text_field :name_contains %>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
<% if (mode == :advanced) then %>
|
14
|
+
<%= hidden_field_tag :search_mode_advanced, "true" %>
|
15
|
+
<div class="control-group">
|
16
|
+
<%= label_tag :segment, t("helpers.label.customers.search.segment"), :class => "control-label" %>
|
17
|
+
<div class="controls">
|
18
|
+
<%= autocomplete_field_tag :segment_autocomplete,
|
19
|
+
name_or_nothing(BusinessSegment.find_by_id(params[:search][:person_customer_pj_type_segments_id_eq])),
|
20
|
+
autocomplete_business_segment_name_customers_path,
|
21
|
+
:size => 75,
|
22
|
+
:id_element => '#search_person_customer_pj_type_segments_id_eq'
|
23
|
+
%>
|
24
|
+
<%= f.hidden_field :person_customer_pj_type_segments_id_eq %>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<div class="control-group">
|
29
|
+
<%= label_tag :activity, t("helpers.label.customers.search.activity"), :class => "control-label" %>
|
30
|
+
<div class="controls">
|
31
|
+
<%= autocomplete_field_tag :activity_autocomplete, name_or_nothing(BusinessActivity.find_by_id(params[:search][:person_customer_pj_type_activities_id_eq])),
|
32
|
+
autocomplete_business_activity_name_customers_path,
|
33
|
+
:size => 75,
|
34
|
+
:id_element => '#search_person_customer_pj_type_activities_id_eq' %>
|
35
|
+
<%= f.hidden_field :person_customer_pj_type_activities_id_eq %>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="control-group">
|
40
|
+
<%= label_tag :district, t("helpers.label.customers.search.bairro"), :class => "control-label" %>
|
41
|
+
<div class="controls">
|
42
|
+
<%= f.text_field :district_name_contains %>
|
43
|
+
</div>
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div class="control-group">
|
47
|
+
<%= label_tag :total_employes, t("helpers.label.customers.search.employes_count"), :class => "control-label" %>
|
48
|
+
<div class="controls">
|
49
|
+
<%= f.multiparameter_field :person_customer_pj_type_total_employes_btw, {:field_type => :number_field, :placeholder => t("commons.min"), :style => "width: 120px" }, {:field_type => :number_field, :placeholder => t("commons.max"), :style => "width: 120px" }, :size => 5 %>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
<% end %>
|
53
|
+
<% if (mode == :advanced) then %>
|
54
|
+
|
55
|
+
|
56
|
+
<div class="control-group">
|
57
|
+
<%= label_tag :is_customer, t("helpers.label.customers.search.is_customer"), :class => "control-label" %>
|
58
|
+
<div class="controls">
|
59
|
+
<%= f.check_box :is_customer_is_true %>
|
60
|
+
</div>
|
61
|
+
</div>
|
62
|
+
|
63
|
+
<!-- div class="control-group">
|
64
|
+
<%= label_tag :type, t("helpers.label.customers.search.type"), :class => "control-label" %>
|
65
|
+
<div class="controls">
|
66
|
+
<%= radio_button_tag :type, :fisica %> <%= label_tag :type_fisica, t("helpers.label.customers.search.type_fisica") %>
|
67
|
+
<%= radio_button_tag :type, :juridica %> <%= label_tag :type_juridica, t("helpers.label.customers.search.type_juridica") %>
|
68
|
+
</div>
|
69
|
+
</div -->
|
70
|
+
|
71
|
+
<div class="control-group">
|
72
|
+
<%= label_tag :contact_name, t("helpers.label.customers.search.contact_name"), :class => "control-label" %>
|
73
|
+
<div class="controls">
|
74
|
+
<%= f.text_field :contacts_name_contains %>
|
75
|
+
</div>
|
76
|
+
</div>
|
77
|
+
|
78
|
+
<div class="control-group">
|
79
|
+
<%= label_tag :enabled, t("commons.no")+" "+t("helpers.label.customers.search.enabled"), :class => "control-label" %>
|
80
|
+
<div class="controls">
|
81
|
+
<%= f.check_box :enabled_is_false %>
|
82
|
+
</div>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div class="control-group">
|
86
|
+
<%= label_tag :email, t("emails.email"), :class => "control-label" %>
|
87
|
+
<div class="controls">
|
88
|
+
<%= f.text_field :emails_email_contains %>
|
89
|
+
</div>
|
90
|
+
</div>
|
91
|
+
|
92
|
+
<div class="control-group">
|
93
|
+
<%= label_tag :doc, t("customers.doc"), :class => "control-label" %>
|
94
|
+
<div class="controls">
|
95
|
+
<%= f.text_field :doc_equals %>
|
96
|
+
</div>
|
97
|
+
</div>
|
98
|
+
|
99
|
+
<% end %>
|
100
|
+
<div class="form-actions span3">
|
101
|
+
<%= submit_tag t("helpers.forms.search"), :class => "btn btn-primary" %>
|
102
|
+
<% if (mode != :advanced) then %>
|
103
|
+
<%= link_to t("searches.advanced"), customers_path(:search_mode_advanced => true), :class => "btn" %>
|
104
|
+
<% end %>
|
105
|
+
</div>
|
106
|
+
</div>
|
107
|
+
</fieldset>
|
108
|
+
<% end %>
|
109
|
+
<% end %>
|
110
|
+
</div>
|
111
|
+
|
112
|
+
<script>
|
113
|
+
$("[id$=autocomplete]").on("blur", function(e) {
|
114
|
+
jobj = $(e.currentTarget);
|
115
|
+
if (jobj.val() == "") {
|
116
|
+
$(jobj.attr("data-id-element")).val("");
|
117
|
+
}
|
118
|
+
})
|
119
|
+
</script>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<ul class="nav nav-tabs">
|
2
|
+
<li <%= 'class=active' if active == :customer %> ><%= link_to t("customers.general"), customer_path(@customer) %></li>
|
3
|
+
<li <%= 'class=active' if active == :contacts %> ><%= link_to t("contacts.index.link"), customer_contacts_path(@customer) %></li>
|
4
|
+
<li <%= 'class=active' if active == :financial %> ><a href="#">Dados de Cobrança</a></li>
|
5
|
+
<li <%= 'class=active' if active == :customer_association %> ><a href="#">Empresas relacionadas</a></li>
|
6
|
+
</ul>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<section id="navbar">
|
2
|
+
|
3
|
+
<div class="navbar">
|
4
|
+
<div class="navbar-inner">
|
5
|
+
<div class="container" style="width: auto;">
|
6
|
+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
7
|
+
<span class="icon-bar"></span>
|
8
|
+
<span class="icon-bar"></span>
|
9
|
+
<span class="icon-bar"></span>
|
10
|
+
</a>
|
11
|
+
<%= link_to navbar_title==nil ? t("customers.title") : navbar_title, "#", :class => "brand" %>
|
12
|
+
<div class="nav-collapse">
|
13
|
+
<ul class="nav">
|
14
|
+
<li <%= 'class=active' if active == :search %> ><%= link_to t("customers.index.title"), customers_path %></li>
|
15
|
+
<li <%= 'class=active' if active == :new %> ><%= link_to t("customers.new.link"), new_customer_path %></li>
|
16
|
+
<li <%= 'class=active' if active == :edit %> ><%= link_to t("customers.edit.link"), "#" %></li>
|
17
|
+
</ul>
|
18
|
+
|
19
|
+
</div><!-- /.nav-collapse -->
|
20
|
+
</div>
|
21
|
+
</div><!-- /navbar-inner -->
|
22
|
+
</div><!-- /navbar -->
|
23
|
+
</section >
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div class="segments">
|
2
|
+
<% new_or_existing = authorship.new_record? ? 'new' : 'existing' %>
|
3
|
+
<% prefix = "source[#{new_or_existing}_authorship_attributes][]" %>
|
4
|
+
<% fields_for prefix, custumer_segments do |custumer_segments_form| %>
|
5
|
+
<p>
|
6
|
+
<%= custumer_segments_form.collection_select(:segment_id, Author.find(:all), :id, :name, :include_blank => true)$
|
7
|
+
<%= link_to_function "remove", "$(this).up('.authorship').remove()" %>
|
8
|
+
</p>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<% provide(:title, t("customers.index.title")) %>
|
2
|
+
|
3
|
+
<%= render :partial => "navbar", :locals => { :active => :search } %>
|
4
|
+
|
5
|
+
|
6
|
+
<div class="row">
|
7
|
+
<div class="span9">
|
8
|
+
<section id="index">
|
9
|
+
<div class="page-header">
|
10
|
+
<%= t("search.results")%>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<table class="table table-bordered table-striped">
|
14
|
+
<thead>
|
15
|
+
<tr>
|
16
|
+
<th><%= t("search.select") %></th>
|
17
|
+
<th><%= t("customers.code") %></th>
|
18
|
+
<th><%= t("customers.names") %></th>
|
19
|
+
<th><%= t("customers.a_customer") %></th>
|
20
|
+
<th><%= t("customers.enabled") %></th>
|
21
|
+
<th><%= t("customers.complete") %></th>
|
22
|
+
<th><%= t("helpers.forms.actions") %></th>
|
23
|
+
</tr>
|
24
|
+
</thead>
|
25
|
+
<tbody>
|
26
|
+
<% @customers.each do |c| %>
|
27
|
+
<tr>
|
28
|
+
<td><%= check_box_tag 'sels[]', c.id, @sels[c.id] %></td>
|
29
|
+
<td><%= c.id %></td>
|
30
|
+
<td><%= link_to c.name, customer_path(c) %></td>
|
31
|
+
<td><span class="badge <%= c.a_customer? ? "badge-success" : "badge-important" %>"><%= format_boolean c.a_customer? %></td>
|
32
|
+
<td><span class="badge <%= c.enabled ? "badge-success" : "badge-important" %>"><%= format_boolean c.enabled %></span></td>
|
33
|
+
<td><span class="badge <%= c.complete? ? "badge-success" : "badge-important" %>"><%= format_boolean c.complete %></span></td>
|
34
|
+
<td><%= link_to t("helpers.forms.show"), customer_path(c), :class => "btn" %></td>
|
35
|
+
</tr>
|
36
|
+
<% end %>
|
37
|
+
|
38
|
+
</tbody>
|
39
|
+
</table>
|
40
|
+
</section>
|
41
|
+
</div>
|
42
|
+
<div class="span3">
|
43
|
+
<%= render :partial => "form_search", :locals => { :mode => (params[:search_mode_advanced] ? :advanced : :simple) } %>
|
44
|
+
</div>
|
45
|
+
<%= will_paginate %>
|
46
|
+
</div>
|