artfully_ose 1.1.0 → 1.2.0.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/README.md +28 -0
- data/app/assets/fonts/FontAwesome.otf +0 -0
- data/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/fonts/fontawesome-webfont.svg +472 -252
- data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/images/actions/do.png +0 -0
- data/app/assets/images/actions/do.psd +0 -0
- data/app/assets/images/actions/get.png +0 -0
- data/app/assets/images/actions/get.psd +0 -0
- data/app/assets/images/actions/give.png +0 -0
- data/app/assets/images/actions/give.psd +0 -0
- data/app/assets/images/actions/go.png +0 -0
- data/app/assets/images/actions/go.psd +0 -0
- data/app/assets/images/actions/hear.png +0 -0
- data/app/assets/images/actions/hear.psd +0 -0
- data/app/assets/images/actions/join.png +0 -0
- data/app/assets/images/actions/join.psd +0 -0
- data/app/assets/images/actions/say.png +0 -0
- data/app/assets/images/actions/say.psd +0 -0
- data/app/assets/images/business-default-avatar.png +0 -0
- data/app/assets/images/foundation-default-avatar.png +0 -0
- data/app/assets/images/glyphish/people/208-facebook.png +0 -0
- data/app/assets/images/glyphish/people/210-twitterbird.png +0 -0
- data/app/assets/images/glyphish/people/218-trash2-small.png +0 -0
- data/app/assets/images/glyphish/people/291-idcard.png +0 -0
- data/app/assets/images/glyphish/people/email.png +0 -0
- data/app/assets/images/glyphish/people/email.psd +0 -0
- data/app/assets/images/glyphish/people/linkedin.png +0 -0
- data/app/assets/images/glyphish/people/linkedin.psd +0 -0
- data/app/assets/images/glyphish/people/website.png +0 -0
- data/app/assets/images/glyphish/people/website.psd +0 -0
- data/app/assets/images/government-default-avatar.png +0 -0
- data/app/assets/images/household-default-avatar.png +0 -0
- data/app/assets/images/loading.gif +0 -0
- data/app/assets/images/nonprofit-default-avatar.png +0 -0
- data/app/assets/images/other-default-avatar.png +0 -0
- data/app/assets/images/person-default-avatar.png +0 -0
- data/app/assets/images/person-default-avatar.psd +0 -0
- data/app/assets/javascripts/angular-bootstrap-ui.js +1 -0
- data/app/assets/javascripts/angular-resource.js +546 -0
- data/app/assets/javascripts/angular.js +20311 -0
- data/app/assets/javascripts/application.js +340 -24
- data/app/assets/javascripts/bootstrap-wysihtml5.js +511 -0
- data/app/assets/javascripts/bootstrap.js +1005 -455
- data/app/assets/javascripts/boxoffice.js +558 -0
- data/app/assets/javascripts/change-membership.js +152 -0
- data/app/assets/javascripts/custom/door-list.js +14 -0
- data/app/assets/javascripts/custom/endless-scroll.js +25 -0
- data/app/assets/javascripts/custom/inline-people-search.js +51 -49
- data/app/assets/javascripts/custom/kits-config.js +33 -0
- data/app/assets/javascripts/custom/people.js +74 -9
- data/app/assets/javascripts/custom/prices.js +1 -0
- data/app/assets/javascripts/custom/show.js +116 -27
- data/app/assets/javascripts/households.js +59 -0
- data/app/assets/javascripts/jquery-lib/fullcalendar.js +5982 -0
- data/app/assets/javascripts/jquery-lib/jquery-ui-1.10.3.custom.min.js +7 -0
- data/app/assets/javascripts/jquery-lib/jquery-ui-timepicker-addon.js +1992 -949
- data/app/assets/javascripts/jquery-lib/jquery.mask-money.js +305 -294
- data/app/assets/javascripts/jquery-migrate-1.2.1.js +521 -0
- data/app/assets/javascripts/jquery-migrate-1.2.1.min.js +2 -0
- data/app/assets/javascripts/jquery.js +5318 -4987
- data/app/assets/javascripts/locationselector.js +107 -0
- data/app/assets/javascripts/relationships.js +63 -0
- data/app/assets/javascripts/sales-console.js +158 -0
- data/app/assets/javascripts/store/jquery.validate.additional-methods.js +476 -159
- data/app/assets/javascripts/store/jquery.validate.js +449 -406
- data/app/assets/javascripts/store/store.js +107 -349
- data/app/assets/javascripts/storefront.js +1 -0
- data/app/assets/javascripts/wysihtml5-0.3.0.min.js +261 -0
- data/app/assets/stylesheets/application.sass +414 -48
- data/app/assets/stylesheets/bootstrap-overrides.css +100 -26
- data/app/assets/stylesheets/bootstrap-wysihtml5.css +102 -0
- data/app/assets/stylesheets/bootstrap.css +6 -3607
- data/app/assets/stylesheets/boxoffice.css.scss +258 -0
- data/app/assets/stylesheets/font-awesome.css.scss +1566 -0
- data/app/assets/stylesheets/jquery/fullcalendar.css +223 -252
- data/app/assets/stylesheets/pages/bootstrap-responsive.css +1109 -0
- data/app/assets/stylesheets/sass/_event_list.sass +43 -0
- data/app/assets/stylesheets/sass/_tags.sass +24 -2
- data/app/assets/stylesheets/sass/box-office.sass +24 -4
- data/app/assets/stylesheets/sass/cart.sass +0 -6
- data/app/assets/stylesheets/sass/store.sass +274 -55
- data/app/assets/stylesheets/storefront.css +2 -1
- data/app/assets/stylesheets/wysiwyg-color.css +67 -0
- data/app/concerns/cart_finder.rb +50 -0
- data/app/concerns/immutable_action.rb +9 -0
- data/app/concerns/pdf_generation.rb +74 -0
- data/app/{models/orders → concerns}/unrefundable.rb +0 -0
- data/app/controllers/actions_controller.rb +29 -22
- data/app/controllers/addresses_controller.rb +3 -3
- data/app/controllers/artfully_ose_controller.rb +56 -7
- data/app/controllers/assignments_controller.rb +28 -0
- data/app/controllers/charts_controller.rb +1 -1
- data/app/controllers/console_sales_controller.rb +182 -0
- data/app/controllers/contributions_controller.rb +31 -6
- data/app/controllers/discounts_controller.rb +10 -3
- data/app/controllers/events_controller.rb +42 -33
- data/app/controllers/events_pass_types_controller.rb +87 -0
- data/app/controllers/exchanges_controller.rb +16 -8
- data/app/controllers/export_controller.rb +10 -2
- data/app/controllers/households_controller.rb +71 -0
- data/app/controllers/imports_controller.rb +46 -7
- data/app/controllers/index_controller.rb +6 -1
- data/app/controllers/member_cards_controller.rb +45 -0
- data/app/controllers/members/index_controller.rb +4 -0
- data/app/controllers/members/invitations_controller.rb +7 -0
- data/app/controllers/members/members_controller.rb +9 -0
- data/app/controllers/members/passwords_controller.rb +10 -0
- data/app/controllers/members/people_controller.rb +17 -0
- data/app/controllers/members/sessions_controller.rb +14 -0
- data/app/controllers/membership_cancellations_controller.rb +46 -0
- data/app/controllers/membership_changes_controller.rb +39 -0
- data/app/controllers/membership_comps_controller.rb +102 -0
- data/app/controllers/membership_kits_controller.rb +25 -0
- data/app/controllers/membership_types_controller.rb +57 -0
- data/app/controllers/memberships_controller.rb +18 -47
- data/app/controllers/merges_controller.rb +11 -5
- data/app/controllers/mobile/dashboard_controller.rb +17 -0
- data/app/controllers/mobile/events_controller.rb +16 -0
- data/app/controllers/mobile/orders_controller.rb +61 -0
- data/app/controllers/mobile/shows_controller.rb +39 -0
- data/app/controllers/mobile/tickets_controller.rb +114 -0
- data/app/controllers/mobile/users_controller.rb +30 -0
- data/app/controllers/notes_controller.rb +3 -3
- data/app/controllers/orders_controller.rb +87 -8
- data/app/controllers/organizations_controller.rb +3 -2
- data/app/controllers/pass_types_controller.rb +53 -0
- data/app/controllers/passes_controller.rb +52 -0
- data/app/controllers/passes_kits_controller.rb +25 -0
- data/app/controllers/passes_reports_controller.rb +5 -0
- data/app/controllers/people_controller.rb +83 -28
- data/app/controllers/refunds_controller.rb +7 -7
- data/app/controllers/regular_donation_kits_controller.rb +32 -0
- data/app/controllers/relationships_controller.rb +15 -0
- data/app/controllers/sales_controller.rb +95 -31
- data/app/controllers/searches_controller.rb +15 -7
- data/app/controllers/sections_controller.rb +3 -3
- data/app/controllers/segments_controller.rb +4 -4
- data/app/controllers/shows_controller.rb +119 -98
- data/app/controllers/slices_controller.rb +3 -2
- data/app/controllers/statements_controller.rb +1 -1
- data/app/controllers/store/checkouts_controller.rb +27 -8
- data/app/controllers/store/donations_controller.rb +22 -0
- data/app/controllers/store/events_controller.rb +19 -1
- data/app/controllers/store/memberships_controller.rb +16 -0
- data/app/controllers/store/orders_controller.rb +46 -77
- data/app/controllers/store/passes_controller.rb +13 -0
- data/app/controllers/store/retrievals_controller.rb +29 -0
- data/app/controllers/store/shows_controller.rb +6 -0
- data/app/controllers/store/store_controller.rb +21 -23
- data/app/controllers/ticket_types_controller.rb +41 -0
- data/app/controllers/tickets_controller.rb +16 -0
- data/app/controllers/user_memberships_controller.rb +57 -0
- data/app/controllers/users/sessions_controller.rb +3 -0
- data/app/helpers/artfully_ose_helper.rb +88 -37
- data/app/helpers/households_helper.rb +7 -0
- data/app/helpers/link_helper.rb +15 -1
- data/app/helpers/members_helper.rb +9 -0
- data/app/helpers/membership_types_helper.rb +22 -0
- data/app/helpers/people_helper.rb +55 -1
- data/app/helpers/relationships_helper.rb +26 -0
- data/app/helpers/sales_helper.rb +29 -0
- data/app/helpers/searches_helper.rb +13 -0
- data/app/helpers/suggested_households_helper.rb +5 -0
- data/app/mailers/order_mailer.rb +28 -1
- data/app/mailers/pass_mailer.rb +17 -0
- data/app/mailers/producer_mailer.rb +2 -2
- data/app/mailers/reports_mailer.rb +6 -5
- data/app/models/ability.rb +1 -0
- data/app/models/action.rb +48 -24
- data/app/models/actions/change_action.rb +13 -0
- data/app/models/actions/comp_action.rb +15 -0
- data/app/models/actions/do_action.rb +12 -0
- data/app/models/actions/exchange_action.rb +15 -0
- data/app/models/actions/get_action.rb +7 -1
- data/app/models/actions/give_action.rb +20 -4
- data/app/models/actions/go_action.rb +27 -8
- data/app/models/actions/hear_action.rb +14 -2
- data/app/models/actions/join_action.rb +4 -0
- data/app/models/actions/refund_action.rb +2 -1
- data/app/models/actions/say_action.rb +23 -0
- data/app/models/address.rb +39 -9
- data/app/models/cart.rb +254 -0
- data/app/models/chart.rb +30 -23
- data/app/models/checkout.rb +94 -38
- data/app/models/comp.rb +25 -17
- data/app/models/company.rb +18 -0
- data/app/models/console_sale.rb +30 -0
- data/app/models/contribution.rb +11 -9
- data/app/models/daily_donation_report.rb +11 -8
- data/app/models/daily_membership_report.rb +50 -0
- data/app/models/daily_pass_report.rb +48 -0
- data/app/models/daily_ticket_report.rb +34 -14
- data/app/models/database_views/item_view.rb +148 -0
- data/app/models/discount.rb +7 -7
- data/app/models/discounts/buy_one_get_one_free_discount_type.rb +6 -1
- data/app/models/discounts/discount_type.rb +5 -1
- data/app/models/discounts/dollars_off_tickets_discount_type.rb +8 -2
- data/app/models/donation.rb +10 -6
- data/app/models/donation_search.rb +1 -1
- data/app/models/door_list.rb +14 -9
- data/app/models/event.rb +81 -10
- data/app/models/events_pass_type.rb +18 -0
- data/app/models/exchange.rb +23 -15
- data/app/models/{ext/ext.rb → ext.rb} +16 -3
- data/app/models/ext/integrations.rb +47 -32
- data/app/models/ext/preprocessor.rb +7 -0
- data/app/models/extendable.rb +6 -0
- data/app/models/fee_calculator.rb +13 -0
- data/app/models/fee_strategy.rb +5 -0
- data/app/models/gateway_transaction.rb +3 -1
- data/app/models/household.rb +61 -0
- data/app/models/household_suggester.rb +58 -0
- data/app/models/import.rb +48 -15
- data/app/models/import_message.rb +6 -0
- data/app/models/imports/donations_import.rb +3 -22
- data/app/models/imports/events_import.rb +56 -57
- data/app/models/imports/memberships_import.rb +43 -0
- data/app/models/imports/people_import.rb +45 -17
- data/app/models/imports/rollback.rb +7 -2
- data/app/models/imports/status.rb +8 -0
- data/app/models/individual.rb +20 -0
- data/app/models/item.rb +65 -54
- data/app/models/job/checkout_processor.rb +46 -0
- data/app/models/job/cleanup_suggested_households_job.rb +17 -0
- data/app/models/job/daily_email_report_job.rb +28 -7
- data/app/models/job/destroy_show_job.rb +10 -0
- data/app/models/job/expire_ticket_job.rb +9 -0
- data/app/models/job/geocode_address_job.rb +11 -0
- data/app/models/job/mailchimp_sync_job.rb +1 -3
- data/app/models/job/order_mailer_job.rb +8 -0
- data/app/models/job/order_processor.rb +93 -0
- data/app/models/job/person_lifetime_value_job.rb +10 -0
- data/app/models/job/recall_import_job.rb +5 -0
- data/app/models/job/refund_order_processor.rb +16 -0
- data/app/models/job/show_creator.rb +39 -0
- data/app/models/kit.rb +2 -4
- data/app/models/kits/mailchimp_kit.rb +49 -22
- data/app/models/kits/membership_kit.rb +62 -0
- data/app/models/kits/passes_kit.rb +62 -0
- data/app/models/kits/regular_donation_kit.rb +38 -8
- data/app/models/kits/scannable_tickets_kit.rb +23 -0
- data/app/models/member.rb +190 -0
- data/app/models/member_card_generator.rb +63 -0
- data/app/models/member_number_generator.rb +8 -0
- data/app/models/member_walkup.rb +150 -0
- data/app/models/membership.rb +97 -7
- data/app/models/membership_cancellation.rb +80 -0
- data/app/models/membership_change.rb +187 -0
- data/app/models/membership_comp.rb +105 -0
- data/app/models/membership_comp_job.rb +32 -0
- data/app/models/membership_sale_search.rb +36 -0
- data/app/models/membership_type.rb +67 -0
- data/app/models/note.rb +1 -1
- data/app/models/{orders/order.rb → order.rb} +224 -28
- data/app/models/order_handler.rb +154 -0
- data/app/models/orders/comp_order.rb +4 -0
- data/app/models/orders/exchange_order.rb +16 -0
- data/app/models/orders/imported_order.rb +4 -0
- data/app/models/orders/refund_order.rb +8 -0
- data/app/models/organization.rb +68 -17
- data/app/models/organization_ability.rb +1 -0
- data/app/models/parsed_row.rb +103 -20
- data/app/models/pass.rb +196 -0
- data/app/models/pass_summary.rb +18 -0
- data/app/models/pass_type.rb +41 -0
- data/app/models/{payments/payment.rb → payment.rb} +29 -1
- data/app/models/payments/cash_payment.rb +3 -1
- data/app/models/payments/check_payment.rb +33 -0
- data/app/models/payments/comp_payment.rb +3 -1
- data/app/models/payments/credit_card_payment.rb +44 -23
- data/app/models/person.rb +270 -62
- data/app/models/phone.rb +0 -8
- data/app/models/refund.rb +28 -18
- data/app/models/relation.rb +27 -0
- data/app/models/relation_builder.rb +32 -0
- data/app/models/relationship.rb +55 -0
- data/app/models/relationship_builder.rb +12 -0
- data/app/models/relationship_validator.rb +46 -0
- data/app/models/relationships_kit.rb +31 -0
- data/app/models/rolling_membership_type.rb +11 -0
- data/app/models/sale.rb +28 -21
- data/app/models/sale_search.rb +1 -1
- data/app/models/search.rb +334 -45
- data/app/models/seasonal_membership_type.rb +3 -0
- data/app/models/section.rb +49 -17
- data/app/models/segment.rb +1 -1
- data/app/models/show.rb +93 -16
- data/app/models/slices.rb +26 -10
- data/app/models/statement.rb +38 -9
- data/app/models/suggested_household.rb +24 -0
- data/app/models/sundial.rb +12 -0
- data/app/models/ticket.rb +109 -15
- data/app/models/ticket/glance.rb +1 -2
- data/app/models/ticket/locker.rb +51 -0
- data/app/models/ticket/pricing.rb +30 -22
- data/app/models/ticket/qr_code.rb +21 -0
- data/app/models/ticket/reports.rb +16 -10
- data/app/models/ticket/sale_transitions.rb +4 -0
- data/app/models/ticket/template.rb +1 -0
- data/app/models/ticket/transfers.rb +12 -1
- data/app/models/ticket_summary.rb +7 -1
- data/app/models/ticket_type.rb +137 -0
- data/app/models/user.rb +22 -9
- data/app/models/user_membership.rb +28 -0
- data/app/models/valuation/lifetime_donations.rb +2 -2
- data/app/models/valuation/lifetime_fees.rb +40 -0
- data/app/models/valuation/lifetime_memberships.rb +24 -0
- data/app/models/valuation/lifetime_ticket_value.rb +30 -0
- data/app/models/valuation/lifetime_value.rb +3 -8
- data/app/models/venue.rb +25 -7
- data/app/presenters/event_presenter.rb +1 -1
- data/app/serializers/show_serializer.rb +15 -0
- data/app/views/actions/_action.html.haml +21 -0
- data/app/views/actions/_form.html.haml +47 -0
- data/app/views/actions/_inline.html.haml +1 -0
- data/app/views/actions/_modal.html.haml +5 -0
- data/app/views/actions/get/_show.html.haml +3 -0
- data/app/views/actions/give/_show.html.haml +8 -0
- data/app/views/actions/shared/_show.html.haml +5 -0
- data/app/views/addresses/_address.html.haml +7 -6
- data/app/views/assignments/new.html.haml +31 -0
- data/app/views/console_sales/_aloha.html.haml +26 -0
- data/app/views/console_sales/_cart.html.haml +60 -0
- data/app/views/console_sales/_payment.html.haml +111 -0
- data/app/views/console_sales/_shows.html.haml +24 -0
- data/app/views/console_sales/new.html.haml +143 -0
- data/app/views/contributions/_form.html.haml +3 -3
- data/app/views/contributions/find_person.html.haml +1 -1
- data/app/views/contributions/index.html.haml +8 -6
- data/app/views/contributions/new.html.haml +5 -9
- data/app/views/discounts/_discount_section_fields.html.haml +1 -1
- data/app/views/discounts/_form.html.haml +3 -3
- data/app/views/discounts/index.html.haml +1 -1
- data/app/views/events/_day_date_show.html.haml +2 -2
- data/app/views/events/_discount_section_fields.html.haml +1 -1
- data/app/views/events/_glance.html.haml +28 -37
- data/app/views/events/_header.html.haml +1 -0
- data/app/views/events/_list.html.haml +11 -5
- data/app/views/events/_menu.html.haml +25 -20
- data/app/views/events/_section_fields.html.haml +16 -46
- data/app/views/events/_share_and_sell.haml +9 -5
- data/app/views/events/_ticket_type_fields.html.haml +86 -0
- data/app/views/events/edit.html.haml +13 -3
- data/app/views/events/image.html.haml +4 -3
- data/app/views/events/index.html.haml +20 -3
- data/app/views/events/messages.html.haml +2 -2
- data/app/views/events/prices.html.haml +4 -12
- data/app/views/events/show.html.haml +3 -1
- data/app/views/events/storefront_link.html.haml +1 -1
- data/app/views/events/temp_discount_form.html.haml +1 -1
- data/app/views/events/temp_discounts_index.html.haml +1 -1
- data/app/views/events_pass_types/_form.html.haml +42 -0
- data/app/views/events_pass_types/edit.html.haml +22 -0
- data/app/views/events_pass_types/index.html.haml +47 -0
- data/app/views/events_pass_types/new.html.haml +22 -0
- data/app/views/exchanges/new.html.haml +58 -35
- data/app/views/households/_action.html.haml +24 -0
- data/app/views/households/_edit_modal.html.haml +143 -0
- data/app/views/households/_form.html.haml +26 -0
- data/app/views/households/_header.html.haml +25 -0
- data/app/views/households/_individual_fields.html.haml +8 -0
- data/app/views/households/_list.html.haml +10 -0
- data/app/views/households/_note.html.haml +33 -0
- data/app/views/households/edit.html.haml +1 -0
- data/app/views/households/index.html.haml +13 -0
- data/app/views/households/new.html.haml +14 -0
- data/app/views/households/show.html.haml +72 -0
- data/app/views/households/suggested.html.haml +38 -0
- data/app/views/imports/_export_links.html.haml +3 -0
- data/app/views/imports/donations/_new.html.haml +6 -0
- data/app/views/imports/donations/_pending.html.haml +6 -22
- data/app/views/imports/events/_new.html.haml +7 -1
- data/app/views/imports/events/_pending.html.haml +6 -17
- data/app/views/imports/index.html.haml +6 -3
- data/app/views/imports/people/_imported.html.haml +35 -5
- data/app/views/imports/people/_importing.html.haml +8 -0
- data/app/views/imports/people/_new.html.haml +61 -21
- data/app/views/imports/people/_pending.html.haml +26 -20
- data/app/views/imports/people/_recalled.html.haml +25 -0
- data/app/views/imports/people/_recalling.html.haml +15 -0
- data/app/views/imports/shared/_knowledge_base.haml +11 -2
- data/app/views/imports/shared/_sidebar.html.haml +1 -1
- data/app/views/index/_action.html.haml +7 -0
- data/app/views/index/_recent_activity.html.haml +11 -0
- data/app/views/index/_recent_activity.js.haml +5 -0
- data/app/views/index/dashboard.html.haml +40 -36
- data/app/views/index/recent_activity.js.haml +5 -0
- data/app/views/kits/_list.html.haml +9 -0
- data/app/views/layouts/_flash.html.haml +3 -3
- data/app/views/layouts/_google_analytics.html.haml +5 -2
- data/app/views/layouts/_menu.html.haml +10 -6
- data/app/views/layouts/application.html.haml +6 -3
- data/app/views/layouts/devise_layout.html.haml +2 -2
- data/app/views/layouts/mail.html.haml +20 -0
- data/app/views/layouts/members.html.haml +14 -0
- data/app/views/layouts/storefront.html.haml +39 -3
- data/app/views/members/index/index.html.haml +41 -0
- data/app/views/members/invitations/edit.html.haml +17 -0
- data/app/views/members/invitations/new.html.erb +14 -0
- data/app/views/members/mailer/_invitation_body.html.haml +18 -0
- data/app/views/members/mailer/invitation_instructions.html.haml +6 -0
- data/app/views/members/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/members/passwords/edit.html.haml +18 -0
- data/app/views/members/sessions/new.html.haml +19 -0
- data/app/views/membership_cancellations/_form.html.haml +39 -0
- data/app/views/membership_cancellations/_modal.html.haml +2 -0
- data/app/views/membership_cancellations/_processing.html.haml +12 -0
- data/app/views/membership_cancellations/create.js.erb +3 -0
- data/app/views/membership_cancellations/new.js.erb +3 -0
- data/app/views/membership_comps/confirm.html.haml +86 -0
- data/app/views/membership_comps/create.html.haml +20 -0
- data/app/views/membership_comps/new.html.haml +95 -0
- data/app/views/membership_kits/edit.html.haml +52 -0
- data/app/views/membership_mailer/cancellation_confirmation.html.haml +9 -0
- data/app/views/membership_mailer/cancellation_confirmation.text.haml +6 -0
- data/app/views/membership_mailer/refund_problem.html.haml +18 -0
- data/app/views/membership_mailer/refund_problem.text.haml +14 -0
- data/app/views/membership_types/_form.html.haml +89 -0
- data/app/views/membership_types/_membership_type_fees.html.haml +0 -0
- data/app/views/membership_types/_rolling_membership_type_form.html.haml +5 -0
- data/app/views/membership_types/_seasonal_membership_type_form.html.haml +8 -0
- data/app/views/membership_types/edit.html.haml +4 -0
- data/app/views/membership_types/index.html.haml +28 -0
- data/app/views/membership_types/new.html.haml +4 -0
- data/app/views/membership_types/type.html.haml +19 -0
- data/app/views/memberships/_membership_scripts.js.erb +15 -0
- data/app/views/memberships/index.html.haml +160 -0
- data/app/views/merges/_merge_preview_person.html.haml +11 -6
- data/app/views/merges/find_person.html.haml +5 -5
- data/app/views/merges/new.html.haml +7 -6
- data/app/views/notes/_note.html.haml +29 -0
- data/app/views/order_mailer/confirmation_for.html.haml +34 -22
- data/app/views/order_mailer/confirmation_for.text.haml +7 -4
- data/app/views/order_mailer/confirmation_for_exchange.html.haml +34 -0
- data/app/views/order_mailer/confirmation_for_exchange.text.haml +26 -0
- data/app/views/order_mailer/confirmation_for_refund.html.haml +36 -0
- data/app/views/order_mailer/confirmation_for_refund.text.haml +22 -0
- data/app/views/orders/_item_donations_table.html.haml +27 -0
- data/app/views/orders/_item_memberships_table.html.haml +16 -0
- data/app/views/orders/_item_table.haml +31 -13
- data/app/views/orders/_item_tickets_table.html.haml +27 -0
- data/app/views/orders/_order_sidebar.html.haml +40 -18
- data/app/views/orders/index.html.haml +2 -0
- data/app/views/orders/membership.html.haml +104 -0
- data/app/views/orders/sales.html.haml +15 -13
- data/app/views/orders/show.html.haml +3 -3
- data/app/views/organizations/_connection_form.html.haml +1 -1
- data/app/views/organizations/_form.html.haml +25 -20
- data/app/views/organizations/edit.html.haml +2 -2
- data/app/views/organizations/new.html.haml +1 -1
- data/app/views/organizations/show.html.haml +22 -16
- data/app/views/pass_mailer/pass_info_for.html.haml +21 -0
- data/app/views/pass_types/_form.html.haml +76 -0
- data/app/views/pass_types/_pass_type_fees.html.haml +0 -0
- data/app/views/pass_types/edit.html.haml +4 -0
- data/app/views/pass_types/index.html.haml +34 -0
- data/app/views/pass_types/new.html.haml +4 -0
- data/app/views/passes/index.html.haml +108 -0
- data/app/views/passes_kits/edit.html.haml +30 -0
- data/app/views/passes_reports/index.html.haml +2 -0
- data/app/views/pdfs/member.html.haml +66 -0
- data/app/views/pdfs/member_card_generator/blanks_usa_idc6.html.haml +109 -0
- data/app/views/pdfs/order.html.haml +84 -0
- data/app/views/people/_convert_to_company_modal.html.haml +42 -0
- data/app/views/people/_edit_modal.html.haml +186 -0
- data/app/views/people/_form.html.haml +23 -5
- data/app/views/people/_header.html.haml +50 -0
- data/app/views/people/_household_fields.html.haml +5 -0
- data/app/views/people/_phone_fields.html.haml +10 -0
- data/app/views/people/_relationship_fields.html.haml +14 -0
- data/app/views/people/_work_with_menu.html.haml +39 -0
- data/app/views/people/index.html.haml +18 -6
- data/app/views/people/new.html.haml +2 -2
- data/app/views/people/show.html.haml +149 -28
- data/app/views/people/show.js.haml +5 -0
- data/app/views/producer_mailer/donation_kit_notification.html.haml +8 -0
- data/app/views/producer_mailer/donation_kit_notification.text.erb +8 -0
- data/app/views/producer_mailer/mailchimp_kit_initial_sync_notification.html.haml +21 -0
- data/app/views/producer_mailer/ticket_offer_accepted.html.haml +7 -0
- data/app/views/producer_mailer/ticket_offer_accepted.text.erb +7 -0
- data/app/views/producer_mailer/ticket_offer_rejected.html.haml +11 -0
- data/app/views/producer_mailer/ticket_offer_rejected.text.erb +13 -0
- data/app/views/refunds/new.html.haml +45 -27
- data/app/views/regular_donation_kits/edit.html.haml +140 -0
- data/app/views/relationships/index.html.haml +32 -0
- data/app/views/reports_mailer/_fine_print.html.haml +0 -0
- data/app/views/reports_mailer/daily.html.haml +113 -51
- data/app/views/reports_mailer/daily.text.erb +5 -5
- data/app/views/sales/_boxoffice.html.haml +141 -0
- data/app/views/sales/_doorlist.html.haml +79 -0
- data/app/views/sales/new.html.haml +33 -125
- data/app/views/searches/_form.html.haml +180 -34
- data/app/views/searches/_household.html.haml +7 -0
- data/app/views/searches/_person.html.haml +5 -2
- data/app/views/searches/new.html.haml +1 -1
- data/app/views/searches/show.html.haml +29 -21
- data/app/views/sections/edit.html.haml +1 -1
- data/app/views/sections/new.html.haml +1 -1
- data/app/views/segments/show.html.haml +19 -15
- data/app/views/shared/_door_list_table.haml +19 -6
- data/app/views/shared/_error_messages.html.haml +1 -1
- data/app/views/shared/_event_image_icon.html.haml +1 -3
- data/app/views/shared/_save_save_and_next.html.haml +2 -0
- data/app/views/shared/_show_summary.html.haml +0 -6
- data/app/views/shared/_show_time_and_calendar.html.haml +21 -0
- data/app/views/shared/_submit_cancel.haml +1 -1
- data/app/views/shared/_tags.html.haml +5 -3
- data/app/views/shows/_controls.html.haml +5 -23
- data/app/views/shows/_glance.html.haml +3 -11
- data/app/views/shows/_sections_table.html.haml +89 -0
- data/app/views/shows/_ticket_table.html.haml +12 -88
- data/app/views/shows/_work_with.html.haml +23 -0
- data/app/views/shows/calendar.html.haml +18 -0
- data/app/views/shows/door_list.html.haml +2 -2
- data/app/views/shows/door_list.pdf.haml +29 -0
- data/app/views/shows/index.html.haml +88 -19
- data/app/views/shows/new.html.haml +13 -27
- data/app/views/shows/show.html.haml +11 -11
- data/app/views/slices/index.html.haml +2 -1
- data/app/views/statements/_discounts_table.html.haml +1 -1
- data/app/views/statements/_order_location_table.html.haml +1 -1
- data/app/views/statements/_passes_table.html.haml +22 -0
- data/app/views/statements/_payment_method_table.haml +1 -1
- data/app/views/statements/_ticket_type_table.haml +5 -2
- data/app/views/statements/show.html.haml +5 -2
- data/app/views/store/checkouts/_membership_info.html.haml +12 -0
- data/app/views/store/checkouts/thanks.html.haml +134 -0
- data/app/views/store/donations/index.html.haml +19 -0
- data/app/views/store/events/_calendar.html.haml +4 -5
- data/app/views/store/events/_venue.html.haml +9 -0
- data/app/views/store/events/calendar.html.haml +50 -0
- data/app/views/store/events/index.html.haml +23 -0
- data/app/views/store/events/show.html.haml +26 -185
- data/app/views/store/events/single_show.html.haml +45 -0
- data/app/views/store/memberships/index.html.haml +40 -0
- data/app/views/store/orders/show.html.haml +198 -0
- data/app/views/store/passes/index.html.haml +33 -0
- data/app/views/store/retrievals/index.html.haml +11 -0
- data/app/views/store/shared/_donate_form.html.haml +31 -0
- data/app/views/store/shared/_small_donate_form.html.haml +21 -0
- data/app/views/store/shows/_show.html.haml +50 -0
- data/app/views/store/shows/show.html.haml +1 -0
- data/app/views/ticket_types/edit.html.haml +12 -0
- data/app/views/ticket_types/new.html.haml +13 -0
- data/app/views/user_memberships/_list.html.haml +30 -0
- data/app/views/users/invitations/edit.html.haml +19 -9
- data/app/views/users/mailer/invitation_instructions.html.haml +14 -0
- data/app/views/users/passwords/edit.html.haml +2 -2
- data/app/views/users/registrations/edit.html.erb +3 -3
- data/app/views/users/sessions/new.html.haml +2 -2
- data/app/views/venues/edit.html.haml +6 -4
- data/config/initializers/devise.rb +2 -5
- data/config/initializers/paperclip.rb +69 -0
- data/config/locales/devise.en.yml +1 -1
- data/config/locales/devise_invitable.en.yml +1 -1
- data/config/locales/en.yml +16 -3
- data/config/routes.rb +178 -22
- data/db/migrate/20130311184839_rename_memberships.rb +5 -0
- data/db/migrate/20130329201707_clean_geographic_data.rb +230 -0
- data/db/migrate/20130411162346_add_country_zip_state_phone_number_discipline_to_organizations.rb +9 -0
- data/db/migrate/20130412145428_massage_action_subtypes.rb +15 -0
- data/db/migrate/20130412184415_add_first_name_and_last_name_to_users.rb +6 -0
- data/db/migrate/20130420232537_add_starred_to_note.rb +5 -0
- data/db/migrate/20130425153848_add_notes_to_orders.rb +5 -0
- data/db/migrate/20130506173918_add_token_to_cart.rb +6 -0
- data/db/migrate/20130508180421_ticket_types_ahoy.rb +17 -0
- data/db/migrate/20130508194552_add_members_to_section.rb +6 -0
- data/db/migrate/20130514153006_add_import_messages.rb +17 -0
- data/db/migrate/20130520190452_add_ticket_type_to_tickets.rb +6 -0
- data/db/migrate/20130521185848_add_sti_to_cart.rb +12 -0
- data/db/migrate/20130526021126_add_validated_to_ticket.rb +5 -0
- data/db/migrate/20130528193811_add_widget_requests.rb +12 -0
- data/db/migrate/20130530011409_add_ticket_types_to_discounts.rb +5 -0
- data/db/migrate/20130531160800_migrate_to_ticket_types.rb +59 -0
- data/db/migrate/20130531160801_drop_price_from_ticket.rb +5 -0
- data/db/migrate/20130531160802_remove_price_from_section.rb +5 -0
- data/db/migrate/20130531180955_add_defaults_to_people_types.rb +21 -0
- data/db/migrate/20130604161411_add_validated_action_to_ticket.rb +5 -0
- data/db/migrate/20130607180250_change_institution_to_company.rb +9 -0
- data/db/migrate/20130609233536_revenue_applies_at.rb +11 -0
- data/db/migrate/20130611175122_add_more_indexes.rb +8 -0
- data/db/migrate/20130612183117_add_types_to_searches.rb +6 -0
- data/db/migrate/20130712145416_add_middle_name_and_suffix_to_people.rb +6 -0
- data/db/migrate/20130722153731_add_autentication_token_to_users.rb +5 -0
- data/db/migrate/20130722182255_create_membership_types.rb +18 -0
- data/db/migrate/20130723182754_create_slugged_slugs.rb +20 -0
- data/db/migrate/20130723182811_add_cached_slug_to_organizations.rb +16 -0
- data/db/migrate/20130723212712_add_qr_code_to_tickets.rb +9 -0
- data/db/migrate/20130725012338_create_new_memberships.rb +28 -0
- data/db/migrate/20130725013145_devise_create_members.rb +41 -0
- data/db/migrate/20130729140618_convert_to_company.rb +5 -0
- data/db/migrate/20130731145336_last_member_number.rb +5 -0
- data/db/migrate/20130731153806_add_member_number.rb +5 -0
- data/db/migrate/20130801194634_make_events_public.rb +5 -0
- data/db/migrate/20130802235709_add_memberships_to_search.rb +9 -0
- data/db/migrate/20130808002742_add_lifetime_ticket_value_to_person.rb +9 -0
- data/db/migrate/20130808005856_add_members_only_to_events.rb +5 -0
- data/db/migrate/20130820011240_add_uuid_to_tickets.rb +13 -0
- data/db/migrate/20130820025134_make_ticket_uuid_not_null.rb +11 -0
- data/db/migrate/20130823191625_add_pdf_to_orders.rb +5 -0
- data/db/migrate/20130827190839_add_fee_to_tickets_and_donations.rb +8 -0
- data/db/migrate/20130829015011_migrate_fees_to_items.rb +5 -0
- data/db/migrate/20130916194547_add_relationships.rb +21 -0
- data/db/migrate/20130917165559_add_service_fee_to_memberships.rb +5 -0
- data/db/migrate/20131002191646_create_show_stats_view.rb +16 -0
- data/db/migrate/20131003134821_add_relationships_to_search.rb +7 -0
- data/db/migrate/20131003200508_add_starred_to_relationships.rb +5 -0
- data/db/migrate/20131007141421_add_counters_to_member.rb +7 -0
- data/db/migrate/20131007144456_remove_expires_at_from_membership.rb +6 -0
- data/db/migrate/20131011154027_add_purchased_to_searches.rb +5 -0
- data/db/migrate/20131013144010_add_type_to_membership_type.rb +5 -0
- data/db/migrate/20131013150230_add_duration_to_membership_type.rb +6 -0
- data/db/migrate/20131013192807_change_number_of_shows_to_tickets.rb +5 -0
- data/db/migrate/20131015151550_add_households.rb +18 -0
- data/db/migrate/20131022183913_add_search_output_options.rb +24 -0
- data/db/migrate/20131023200559_add_admin_to_user_memberships.rb +14 -0
- data/db/migrate/20131025162155_default_search_filter_values.rb +10 -0
- data/db/migrate/20131025180139_unique_household_names.rb +8 -0
- data/db/migrate/20131029173612_add_sales_start_to_membership_typ.rb +6 -0
- data/db/migrate/20131106191847_add_suggested_households.rb +13 -0
- data/db/migrate/20131127162818_add_buyer_id_index_to_tickets.rb +5 -0
- data/db/migrate/20131127164000_member_tickets.rb +9 -0
- data/db/migrate/20131204162642_add_shared_address.rb +9 -0
- data/db/migrate/20131206153323_add_membership_kit.rb +5 -0
- data/db/migrate/20131206175325_add_marketing_to_membership_type.rb +6 -0
- data/db/migrate/20131210212342_add_show_fee_to_memberhsip_type.rb +5 -0
- data/db/migrate/20131210222814_add_renewal_price_to_membership_type.rb +6 -0
- data/db/migrate/20131212164553_add_copy_to_individuals_option.rb +5 -0
- data/db/migrate/20131223215615_goodbye_order_view.rb +6 -0
- data/db/migrate/20140114011856_add_welcome_message_to_memberships.rb +5 -0
- data/db/migrate/20140114212127_add_send_email_to_memberships.rb +5 -0
- data/db/migrate/20140125183606_index_memberships_and_types.rb +6 -0
- data/db/migrate/20140128213101_add_pdf_to_members.rb +5 -0
- data/db/migrate/20140128223140_add_uuid_to_member.rb +6 -0
- data/db/migrate/20140128223948_add_qr_code_to_member.rb +9 -0
- data/db/migrate/20140207135731_update_items_view.rb +38 -0
- data/db/migrate/20140210154723_add_cached_stats.rb +5 -0
- data/db/migrate/20140218202726_cache_stats.rb +7 -0
- data/db/migrate/20140304171625_passes_ahoy.rb +52 -0
- data/db/migrate/20140304174807_add_passes_kit.rb +5 -0
- data/db/migrate/20140307144454_add_events_pass_types.rb +9 -0
- data/db/migrate/20140307193350_add_pass_id_to_cart.rb +7 -0
- data/db/migrate/20140314162422_add_total_paid_to_membership.rb +13 -0
- data/db/migrate/20140319191237_add_show_dates_to_advanced_search.rb +6 -0
- data/db/migrate/20140328172333_add_cols_to_events_pass_types.rb +6 -0
- data/db/migrate/20140328174217_add_deleted_at_to_ept.rb +9 -0
- data/db/migrate/20140328185432_add_active_to_ept.rb +5 -0
- data/db/migrate/20140328192612_add_pass_type_id_to_search.rb +5 -0
- data/db/migrate/20140415212841_add_min_max_start_dates_to_searches.artfully_ose_engine.rb +6 -0
- data/db/migrate/20140422193345_add_email_copy_to_pass_type.rb +5 -0
- data/db/migrate/20140423181639_add_min_max_end_dates_to_searches.artfully_ose_engine.rb +6 -0
- data/db/migrate/20140423185921_add_cached_stats_to_event.rb +9 -0
- data/db/migrate/20140424174423_add_lifetime_memberships_to_people.artfully_ose_engine.rb +5 -0
- data/db/migrate/20140506155241_add_lpt_to_membership_type.rb +5 -0
- data/db/migrate/20140507184646_add_bday_attributes_to_person.rb +7 -0
- data/db/migrate/20140507201048_add_check_number_to_orders.rb +5 -0
- data/db/migrate/20140515143651_remove_show_stats_view.rb +6 -0
- data/db/migrate/20140521195853_add_deleted_at_to_pass_type.rb +5 -0
- data/db/migrate/20140522205554_add_limit_to_events_pass_types.rb +5 -0
- data/db/migrate/20140523180444_remove_tickets_purchased_from_passes.rb +5 -0
- data/db/migrate/20140603200735_add_subtitle_to_events.rb +5 -0
- data/db/migrate/20140619194127_add_do_not_call_to_people.artfully_ose_engine.rb +5 -0
- data/db/migrate/20140623160543_add_index_to_items.rb +7 -0
- data/lib/artfully_ose.rb +7 -4
- data/lib/artfully_ose/common_abilities.rb +8 -2
- data/lib/artfully_ose/engine.rb +34 -10
- data/lib/artfully_ose/version.rb +1 -1
- data/spec/factories/action_factories.rb +19 -0
- data/spec/factories/address_factories.rb +11 -0
- data/spec/factories/cart_factories.rb +26 -0
- data/spec/factories/chart_factories.rb +52 -0
- data/spec/factories/discount_factories.rb +11 -0
- data/spec/factories/donation_factories.rb +14 -0
- data/spec/factories/event_factories.rb +29 -0
- data/spec/factories/household_factories.rb +8 -0
- data/spec/factories/import_factories.rb +61 -0
- data/spec/factories/item_factories.rb +51 -0
- data/spec/factories/kit_factories.rb +33 -0
- data/spec/factories/member_factories.rb +19 -0
- data/spec/factories/membership_factories.rb +9 -0
- data/spec/factories/membership_type_factories.rb +18 -0
- data/spec/factories/order_factories.rb +40 -0
- data/spec/factories/organization_factories.rb +48 -0
- data/spec/factories/pass_type_factories.rb +11 -0
- data/spec/factories/payments_factories.rb +97 -0
- data/spec/factories/person_factories.rb +47 -0
- data/spec/factories/phone_factories.rb +6 -0
- data/spec/factories/section_factories.rb +21 -0
- data/spec/factories/segment_factories.rb +6 -0
- data/spec/factories/show_factories.rb +33 -0
- data/spec/factories/ticket_factories.rb +57 -0
- data/spec/factories/ticket_offer_factories.rb +16 -0
- data/spec/factories/ticket_type_factories.rb +8 -0
- data/spec/factories/user_factories.rb +24 -0
- metadata +522 -49
- data/app/assets/javascripts/box-office.js +0 -244
- data/app/assets/javascripts/jquery-lib/fullcalendar.min.js +0 -113
- data/app/assets/javascripts/jquery-lib/jquery-ui-1.8.14.custom.min.js +0 -570
- data/app/assets/javascripts/jquery_ujs.js +0 -316
- data/app/assets/stylesheets/font-awesome.sass +0 -759
- data/app/models/adjustments.rb +0 -10
- data/app/models/carts/cart.rb +0 -171
- data/app/models/database_views/order_view.rb +0 -34
- data/app/views/actions/_list.html.haml +0 -25
- data/app/views/actions/edit.html.haml +0 -19
- data/app/views/actions/new.html.haml +0 -19
- data/app/views/memberships/_list.html.haml +0 -31
- data/app/views/notes/_list.html.haml +0 -30
- data/app/views/notes/edit.html.haml +0 -14
- data/app/views/notes/new.html.haml +0 -14
- data/app/views/orders/_grouped_form_help.haml +0 -4
- data/app/views/people/_person_summary_sidebar.html.haml +0 -86
- data/app/views/people/edit.html.haml +0 -10
- data/app/views/shared/_new_person_popup.html.haml +0 -21
- data/app/views/store/events/_show.html.haml +0 -43
- data/app/views/users/mailer/invitation_instructions.html.erb +0 -8
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.collapse","ui.bootstrap.dialog","ui.bootstrap.dropdownToggle","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.popover","ui.bootstrap.tabs","ui.bootstrap.tooltip","ui.bootstrap.transition","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.tpls",["template/accordion/accordion-group.html","template/accordion/accordion.html","template/alert/alert.html","template/carousel/carousel.html","template/carousel/slide.html","template/dialog/message.html","template/pagination/pagination.html","template/popover/popover.html","template/tabs/pane.html","template/tabs/tabs.html","template/tooltip/tooltip-popup.html","template/typeahead/typeahead.html"]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("accordionConfig",{closeOthers:!0}).controller("AccordionController",["$scope","$attrs","accordionConfig",function(e,t,n){this.groups=[],this.closeOthers=function(r){var i=angular.isDefined(t.closeOthers)?e.$eval(t.closeOthers):n.closeOthers;i&&angular.forEach(this.groups,function(e){e!==r&&(e.isOpen=!1)})},this.addGroup=function(e){var t=this;this.groups.push(e),e.$on("$destroy",function(n){t.removeGroup(e)})},this.removeGroup=function(e){var t=this.groups.indexOf(e);t!==-1&&this.groups.splice(this.groups.indexOf(e),1)}}]).directive("accordion",function(){return{restrict:"EA",controller:"AccordionController",transclude:!0,replace:!1,templateUrl:"template/accordion/accordion.html"}}).directive("accordionGroup",["$parse","$transition","$timeout",function(e,t,n){return{require:"^accordion",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/accordion/accordion-group.html",scope:{heading:"@"},controller:["$scope",function(e){this.setHeading=function(e){this.heading=e}}],link:function(t,n,r,i){var s,o;i.addGroup(t),t.isOpen=!1,r.isOpen&&(s=e(r.isOpen),o=s.assign,t.$watch(function(){return s(t.$parent)},function(n){t.isOpen=n}),t.isOpen=s?s(t.$parent):!1),t.$watch("isOpen",function(e){e&&i.closeOthers(t),o&&o(t.$parent,e)})}}}]).directive("accordionHeading",function(){return{restrict:"E",transclude:!0,template:"",replace:!0,require:"^accordionGroup",compile:function(e,t,n){return function(t,r,i,s){s.setHeading(n(t,function(){}))}}}}).directive("accordionTransclude",function(){return{require:"^accordionGroup",link:function(e,t,n,r){e.$watch(function(){return r[n.accordionTransclude]},function(e){e&&(t.html(""),t.append(e))})}}}),angular.module("ui.bootstrap.alert",[]).directive("alert",function(){return{restrict:"EA",templateUrl:"template/alert/alert.html",transclude:!0,replace:!0,scope:{type:"=",close:"&"}}}),angular.module("ui.bootstrap.buttons",[]).constant("buttonConfig",{activeClass:"active",toggleEvent:"click"}).directive("btnRadio",["buttonConfig",function(e){var t=e.activeClass||"active",n=e.toggleEvent||"click";return{require:"ngModel",link:function(e,r,i,s){var o=e.$eval(i.btnRadio);e.$watch(function(){return s.$modelValue},function(e){angular.equals(e,o)?r.addClass(t):r.removeClass(t)}),r.bind(n,function(){r.hasClass(t)||e.$apply(function(){s.$setViewValue(o)})})}}}]).directive("btnCheckbox",["buttonConfig",function(e){var t=e.activeClass||"active",n=e.toggleEvent||"click";return{require:"ngModel",link:function(e,r,i,s){var o=e.$eval(i.btnCheckboxTrue),u=e.$eval(i.btnCheckboxFalse);o=angular.isDefined(o)?o:!0,u=angular.isDefined(u)?u:!1,e.$watch(function(){return s.$modelValue},function(e){angular.equals(e,o)?r.addClass(t):r.removeClass(t)}),r.bind(n,function(){e.$apply(function(){s.$setViewValue(r.hasClass(t)?u:o)})})}}}]),angular.module("ui.bootstrap.carousel",["ui.bootstrap.transition"]).controller("CarouselController",["$scope","$timeout","$transition","$q",function(e,t,n,r){function f(){function n(){a?(e.next(),f()):e.pause()}u&&t.cancel(u);var r=+e.interval;!isNaN(r)&&r>=0&&(u=t(n,r))}var i=this,s=i.slides=[],o=-1,u,a;i.currentSlide=null,i.select=function(r,u){function l(){i.currentSlide&&angular.isString(u)&&!e.noTransition&&r.$element?(r.$element.addClass(u),r.$element[0].offsetWidth=r.$element[0].offsetWidth,angular.forEach(s,function(e){angular.extend(e,{direction:"",entering:!1,leaving:!1,active:!1})}),angular.extend(r,{direction:u,active:!0,entering:!0}),angular.extend(i.currentSlide||{},{direction:u,leaving:!0}),e.$currentTransition=n(r.$element,{}),function(t,n){e.$currentTransition.then(function(){c(t,n)},function(){c(t,n)})}(r,i.currentSlide)):c(r,i.currentSlide),i.currentSlide=r,o=a,f()}function c(t,n){angular.extend(t,{direction:"",active:!0,leaving:!1,entering:!1}),angular.extend(n||{},{direction:"",active:!1,leaving:!1,entering:!1}),e.$currentTransition=null}var a=s.indexOf(r);u===undefined&&(u=a>o?"next":"prev"),r&&r!==i.currentSlide&&(e.$currentTransition?(e.$currentTransition.cancel(),t(l)):l())},i.indexOfSlide=function(e){return s.indexOf(e)},e.next=function(){var e=(o+1)%s.length;return i.select(s[e],"next")},e.prev=function(){var e=o-1<0?s.length-1:o-1;return i.select(s[e],"prev")},e.select=function(e){i.select(e)},e.isActive=function(e){return i.currentSlide===e},e.slides=function(){return s},e.$watch("interval",f),e.play=function(){a||(a=!0,f())},e.pause=function(){a=!1,u&&t.cancel(u)},i.addSlide=function(t,n){t.$element=n,s.push(t),s.length===1||t.active?(i.select(s[s.length-1]),s.length==1&&e.play()):t.active=!1},i.removeSlide=function(e){var t=s.indexOf(e);s.splice(t,1),s.length>0&&e.active&&(t>=s.length?i.select(s[t-1]):i.select(s[t]))}}]).directive("carousel",[function(){return{restrict:"EA",transclude:!0,replace:!0,controller:"CarouselController",require:"carousel",templateUrl:"template/carousel/carousel.html",scope:{interval:"=",noTransition:"="}}}]).directive("slide",[function(){return{require:"^carousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/carousel/slide.html",scope:{active:"="},link:function(e,t,n,r){r.addSlide(e,t),e.$on("$destroy",function(){r.removeSlide(e)}),e.$watch("active",function(t){t&&r.select(e)})}}}]),angular.module("ui.bootstrap.collapse",["ui.bootstrap.transition"]).directive("collapse",["$transition",function(e){var t=function(e,t,n){t.removeClass("collapse"),t.css({height:n});var r=t[0].offsetWidth;t.addClass("collapse")};return{link:function(n,r,i){var s,o=!0;n.$watch(function(){return r[0].scrollHeight},function(e){r[0].scrollHeight!==0&&(s||(o?t(n,r,r[0].scrollHeight+"px"):t(n,r,"auto")))}),n.$watch(i.collapse,function(e){e?l():f()});var u,a=function(t){return u&&u.cancel(),u=e(r,t),u.then(function(){u=undefined},function(){u=undefined}),u},f=function(){o?(o=!1,s||t(n,r,"auto")):a({height:r[0].scrollHeight+"px"}).then(function(){s||t(n,r,"auto")}),s=!1},l=function(){s=!0,o?(o=!1,t(n,r,0)):(t(n,r,r[0].scrollHeight+"px"),a({height:"0"}))}}}}]);var dialogModule=angular.module("ui.bootstrap.dialog",["ui.bootstrap.transition"]);dialogModule.controller("MessageBoxController",["$scope","dialog","model",function(e,t,n){e.title=n.title,e.message=n.message,e.buttons=n.buttons,e.close=function(e){t.close(e)}}]),dialogModule.provider("$dialog",function(){var e={backdrop:!0,dialogClass:"modal",backdropClass:"modal-backdrop",transitionClass:"fade",triggerClass:"in",dialogOpenClass:"modal-open",resolve:{},backdropFade:!1,dialogFade:!1,keyboard:!0,backdropClick:!0},t={},n={value:0};this.options=function(e){t=e},this.$get=["$http","$document","$compile","$rootScope","$controller","$templateCache","$q","$transition","$injector",function(r,i,s,o,u,a,f,l,c){function p(e){var t=angular.element("<div>");return t.addClass(e),t}function d(n){var r=this,i=this.options=angular.extend({},e,t,n);this.backdropEl=p(i.backdropClass),i.backdropFade&&(this.backdropEl.addClass(i.transitionClass),this.backdropEl.removeClass(i.triggerClass)),this.modalEl=p(i.dialogClass),i.dialogFade&&(this.modalEl.addClass(i.transitionClass),this.modalEl.removeClass(i.triggerClass)),this.handledEscapeKey=function(e){e.which===27&&(r.close(),e.preventDefault(),r.$scope.$apply())},this.handleBackDropClick=function(e){r.close(),e.preventDefault(),r.$scope.$apply()}}var h=i.find("body");return d.prototype.isOpen=function(){return this._open},d.prototype.open=function(e,t){var n=this,r=this.options;e&&(r.templateUrl=e),t&&(r.controller=t);if(!r.template&&!r.templateUrl)throw new Error("Dialog.open expected template or templateUrl, neither found. Use options or open method to specify them.");return this._loadResolves().then(function(e){var t=e.$scope=n.$scope=e.$scope?e.$scope:o.$new();n.modalEl.html(e.$template);if(n.options.controller){var r=u(n.options.controller,e);n.modalEl.contents().data("ngControllerController",r)}s(n.modalEl)(t),n._addElementsToDom(),h.addClass(n.options.dialogOpenClass),setTimeout(function(){n.options.dialogFade&&n.modalEl.addClass(n.options.triggerClass),n.options.backdropFade&&n.backdropEl.addClass(n.options.triggerClass)}),n._bindEvents()}),this.deferred=f.defer(),this.deferred.promise},d.prototype.close=function(e){function i(e){e.removeClass(t.options.triggerClass)}function s(){t._open&&t._onCloseComplete(e)}var t=this,n=this._getFadingElements();h.removeClass(t.options.dialogOpenClass);if(n.length>0){for(var r=n.length-1;r>=0;r--)l(n[r],i).then(s);return}this._onCloseComplete(e)},d.prototype._getFadingElements=function(){var e=[];return this.options.dialogFade&&e.push(this.modalEl),this.options.backdropFade&&e.push(this.backdropEl),e},d.prototype._bindEvents=function(){this.options.keyboard&&h.bind("keydown",this.handledEscapeKey),this.options.backdrop&&this.options.backdropClick&&this.backdropEl.bind("click",this.handleBackDropClick)},d.prototype._unbindEvents=function(){this.options.keyboard&&h.unbind("keydown",this.handledEscapeKey),this.options.backdrop&&this.options.backdropClick&&this.backdropEl.unbind("click",this.handleBackDropClick)},d.prototype._onCloseComplete=function(e){this._removeElementsFromDom(),this._unbindEvents(),this.deferred.resolve(e)},d.prototype._addElementsToDom=function(){h.append(this.modalEl),this.options.backdrop&&(n.value===0&&h.append(this.backdropEl),n.value++),this._open=!0},d.prototype._removeElementsFromDom=function(){this.modalEl.remove(),this.options.backdrop&&(n.value--,n.value===0&&this.backdropEl.remove()),this._open=!1},d.prototype._loadResolves=function(){var e=[],t=[],n,i=this;return this.options.template?n=f.when(this.options.template):this.options.templateUrl&&(n=r.get(this.options.templateUrl,{cache:a}).then(function(e){return e.data})),angular.forEach(this.options.resolve||[],function(n,r){t.push(r),e.push(angular.isString(n)?c.get(n):c.invoke(n))}),t.push("$template"),e.push(n),f.all(e).then(function(e){var n={};return angular.forEach(e,function(e,r){n[t[r]]=e}),n.dialog=i,n})},{dialog:function(e){return new d(e)},messageBox:function(e,t,n){return new d({templateUrl:"template/dialog/message.html",controller:"MessageBoxController",resolve:{model:function(){return{title:e,message:t,buttons:n}}}})}}}]}),angular.module("ui.bootstrap.dropdownToggle",[]).directive("dropdownToggle",["$document","$location","$window",function(e,t,n){var r=null,i;return{restrict:"CA",link:function(n,s,o){n.$watch(function(){return t.path()},function(){i&&i()}),s.parent().bind("click",function(e){i&&i()}),s.bind("click",function(t){t.preventDefault(),t.stopPropagation();var n=!1;r&&(n=r===s,i()),n||(s.parent().addClass("open"),r=s,i=function(t){t&&(t.preventDefault(),t.stopPropagation()),e.unbind("click",i),s.parent().removeClass("open"),i=null,r=null},e.bind("click",i))})}}}]),angular.module("ui.bootstrap.modal",["ui.bootstrap.dialog"]).directive("modal",["$parse","$dialog",function(e,t){var n,r=angular.element(document.getElementsByTagName("body")[0]);return{restrict:"EA",terminal:!0,link:function(n,r,i){var s=angular.extend({},n.$eval(i.uiOptions||i.bsOptions||i.options)),o=i.modal||i.show,u;s=angular.extend(s,{template:r.html(),resolve:{$scope:function(){return n}}});var a=t.dialog(s);r.remove(),i.close?u=function(){e(i.close)(n)}:u=function(){angular.isFunction(e(o).assign)&&e(o).assign(n,!1)},n.$watch(o,function(e,t){e?a.open().then(function(){u()}):a.isOpen()&&a.close()})}}}]),angular.module("ui.bootstrap.pagination",[]).constant("paginationConfig",{boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last"}).directive("pagination",["paginationConfig",function(e){return{restrict:"EA",scope:{numPages:"=",currentPage:"=",maxSize:"=",onSelectPage:"&"},templateUrl:"template/pagination/pagination.html",replace:!0,link:function(t,n,r){function l(e,t,n,r){return{number:e,text:t,active:n,disabled:r}}var i=angular.isDefined(r.boundaryLinks)?t.$eval(r.boundaryLinks):e.boundaryLinks,s=angular.isDefined(r.directionLinks)?t.$eval(r.directionLinks):e.directionLinks,o=angular.isDefined(r.firstText)?r.firstText:e.firstText,u=angular.isDefined(r.previousText)?r.previousText:e.previousText,a=angular.isDefined(r.nextText)?r.nextText:e.nextText,f=angular.isDefined(r.lastText)?r.lastText:e.lastText;t.$watch("numPages + currentPage + maxSize",function(){t.pages=[];var e=t.maxSize&&t.maxSize<t.numPages?t.maxSize:t.numPages,n=t.currentPage-Math.floor(e/2);n<1&&(n=1),n+e-1>t.numPages&&(n-=n+e-1-t.numPages);for(var r=n,c=n+e;r<c;r++){var h=l(r,r,t.isActive(r),!1);t.pages.push(h)}if(s){var p=l(t.currentPage-1,u,!1,t.noPrevious());t.pages.unshift(p);var d=l(t.currentPage+1,a,!1,t.noNext());t.pages.push(d)}if(i){var v=l(1,o,!1,t.noPrevious());t.pages.unshift(v);var m=l(t.numPages,f,!1,t.noNext());t.pages.push(m)}t.currentPage>t.numPages&&t.selectPage(t.numPages)}),t.noPrevious=function(){return t.currentPage===1},t.noNext=function(){return t.currentPage===t.numPages},t.isActive=function(e){return t.currentPage===e},t.selectPage=function(e){!t.isActive(e)&&e>0&&e<=t.numPages&&(t.currentPage=e,t.onSelectPage({page:e}))}}}}]),angular.module("ui.bootstrap.popover",[]).directive("popoverPopup",function(){return{restrict:"EA",replace:!0,scope:{popoverTitle:"@",popoverContent:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/popover/popover.html"}}).directive("popover",["$compile","$timeout","$parse","$window",function(e,t,n,r){var i='<popover-popup popover-title="{{tt_title}}" popover-content="{{tt_popover}}" placement="{{tt_placement}}" animation="tt_animation()" is-open="tt_isOpen"></popover-popup>';return{scope:!0,link:function(s,o,u){function l(){var e=o[0].getBoundingClientRect();return{width:o.prop("offsetWidth"),height:o.prop("offsetHeight"),top:e.top+r.pageYOffset,left:e.left+r.pageXOffset}}function c(){var e,n,r,i;f&&t.cancel(f),a.css({top:0,left:0,display:"block"}),o.after(a),e=l(),n=a.prop("offsetWidth"),r=a.prop("offsetHeight");switch(s.tt_placement){case"right":i={top:e.top+e.height/2-r/2+"px",left:e.left+e.width+"px"};break;case"bottom":i={top:e.top+e.height+"px",left:e.left+e.width/2-n/2+"px"};break;case"left":i={top:e.top+e.height/2-r/2+"px",left:e.left-n+"px"};break;default:i={top:e.top-r+"px",left:e.left+e.width/2-n/2+"px"}}a.css(i),s.tt_isOpen=!0}function h(){s.tt_isOpen=!1,angular.isDefined(s.tt_animation)&&s.tt_animation()?f=t(function(){a.remove()},500):a.remove()}var a=e(i)(s),f;u.$observe("popover",function(e){s.tt_popover=e}),u.$observe("popoverTitle",function(e){s.tt_title=e}),u.$observe("popoverPlacement",function(e){s.tt_placement=e||"top"}),u.$observe("popoverAnimation",function(e){s.tt_animation=n(e)}),s.tt_isOpen=!1,o.bind("click",function(){s.tt_isOpen?s.$apply(h):s.$apply(c)})}}}]),angular.module("ui.bootstrap.tabs",[]).controller("TabsController",["$scope","$element",function(e,t){var n=e.panes=[];this.select=e.select=function(t){angular.forEach(n,function(e){e.selected=!1}),t.selected=!0},this.addPane=function(r){n.length||e.select(r),n.push(r)},this.removePane=function(r){var i=n.indexOf(r);n.splice(i,1),r.selected&&n.length>0&&e.select(n[i<n.length?i:i-1])}}]).directive("tabs",function(){return{restrict:"EA",transclude:!0,scope:{},controller:"TabsController",templateUrl:"template/tabs/tabs.html",replace:!0}}).directive("pane",["$parse",function(e){return{require:"^tabs",restrict:"EA",transclude:!0,scope:{heading:"@"},link:function(t,n,r,i){var s,o;t.selected=!1,r.active&&(s=e(r.active),o=s.assign,t.$watch(function(){return s(t.$parent)},function(n){t.selected=n}),t.selected=s?s(t.$parent):!1),t.$watch("selected",function(e){e&&i.select(t),o&&o(t.$parent,e)}),i.addPane(t),t.$on("$destroy",function(){i.removePane(t)})},templateUrl:"template/tabs/pane.html",replace:!0}}]),angular.module("ui.bootstrap.tooltip",[]).directive("tooltipPopup",function(){return{restrict:"EA",replace:!0,scope:{tooltipTitle:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}}).directive("tooltip",["$compile","$timeout","$parse","$window",function(e,t,n,r){var i='<tooltip-popup tooltip-title="{{tt_tooltip}}" placement="{{tt_placement}}" animation="tt_animation()" is-open="tt_isOpen"></tooltip-popup>';return{scope:!0,link:function(s,o,u){function l(){var e=o[0].getBoundingClientRect();return{width:o.prop("offsetWidth"),height:o.prop("offsetHeight"),top:e.top+r.pageYOffset,left:e.left+r.pageXOffset}}function c(){var e,n,r,i;if(!s.tt_tooltip)return;f&&t.cancel(f),a.css({top:0,left:0,display:"block"}),o.after(a),e=l(),n=a.prop("offsetWidth"),r=a.prop("offsetHeight");switch(s.tt_placement){case"right":i={top:e.top+e.height/2-r/2+"px",left:e.left+e.width+"px"};break;case"bottom":i={top:e.top+e.height+"px",left:e.left+e.width/2-n/2+"px"};break;case"left":i={top:e.top+e.height/2-r/2+"px",left:e.left-n+"px"};break;default:i={top:e.top-r+"px",left:e.left+e.width/2-n/2+"px"}}a.css(i),s.tt_isOpen=!0}function h(){s.tt_isOpen=!1,angular.isDefined(s.tt_animation)&&s.tt_animation()?f=t(function(){a.remove()},500):a.remove()}var a=e(i)(s),f;u.$observe("tooltip",function(e){s.tt_tooltip=e}),u.$observe("tooltipPlacement",function(e){s.tt_placement=e||"top"}),u.$observe("tooltipAnimation",function(e){s.tt_animation=n(e)}),s.tt_isOpen=!1,o.bind("mouseenter",function(){s.$apply(c)}),o.bind("mouseleave",function(){s.$apply(h)})}}}]),angular.module("ui.bootstrap.transition",[]).factory("$transition",["$q","$timeout","$rootScope",function(e,t,n){function u(e){for(var t in e)if(i.style[t]!==undefined)return e[t]}var r=function(i,s,o){o=o||{};var u=e.defer(),a=r[o.animation?"animationEndEventName":"transitionEndEventName"],f=function(e){n.$apply(function(){i.unbind(a,f),u.resolve(i)})};return a&&i.bind(a,f),t(function(){angular.isString(s)?i.addClass(s):angular.isFunction(s)?s(i):angular.isObject(s)&&i.css(s),a||u.resolve(i)}),u.promise.cancel=function(){a&&i.unbind(a,f),u.reject("Transition cancelled")},u.promise},i=document.createElement("trans"),s={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"},o={WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",msTransition:"MSAnimationEnd",transition:"animationend"};return r.transitionEndEventName=u(s),r.animationEndEventName=u(o),r}]),angular.module("ui.bootstrap.typeahead",[]).factory("typeaheadParser",["$parse",function(e){var t=/^\s*(.*?)(?:\s+as\s+(.*?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+(.*)$/;return{parse:function(n){var r=n.match(t),i,s,o;if(!r)throw new Error("Expected typeahead specification in form of '_modelValue_ (as _label_)? for _item_ in _collection_' but got '"+n+"'.");return{itemName:r[3],source:e(r[4]),viewMapper:e(r[2]||r[1]),modelMapper:e(r[1])}}}}]).directive("typeahead",["$compile","$q","typeaheadParser",function(e,t,n){var r=[9,13,27,38,40];return{require:"ngModel",link:function(i,s,o,u){var a=u.$modelValue,f=i.$eval(o.typeaheadMinLength)||1,l=n.parse(o.typeahead),c=i.$new();i.$on("$destroy",function(){c.$destroy()});var h=function(){c.matches=[],c.activeIdx=-1},p=function(e){var n={$viewValue:e};t.when(l.source(c,n)).then(function(t){if(e===u.$viewValue)if(t.length>0){c.activeIdx=0,c.matches.length=0;for(var r=0;r<t.length;r++)n[l.itemName]=t[r],c.matches.push({label:l.viewMapper(c,n),model:t[r]});c.query=e}else h()},h)};h(),c.query=undefined,u.$parsers.push(function(e){return h(),a?e:(e&&e.length>=f&&p(e),undefined)}),u.$render=function(){var e={};e[l.itemName]=a,s.val(l.viewMapper(c,e)||u.$viewValue),a=undefined},c.select=function(e){var t={};t[l.itemName]=a=c.matches[e].model,u.$setViewValue(l.modelMapper(c,t)),u.$render()},s.bind("keydown",function(e){if(c.matches.length===0||r.indexOf(e.which)===-1)return;e.preventDefault(),e.which===40?(c.activeIdx=(c.activeIdx+1)%c.matches.length,c.$digest()):e.which===38?(c.activeIdx=(c.activeIdx?c.activeIdx:c.matches.length)-1,c.$digest()):e.which===13||e.which===9?c.$apply(function(){c.select(c.activeIdx)}):e.which===27&&(c.matches=[],c.$digest())});var d=e("<typeahead-popup matches='matches' active='activeIdx' select='select(activeIdx)' query='query'></typeahead-popup>")(c);s.after(d)}}}]).directive("typeaheadPopup",function(){return{restrict:"E",scope:{matches:"=",query:"=",active:"=",select:"&"},replace:!0,templateUrl:"template/typeahead/typeahead.html",link:function(e,t,n){e.isOpen=function(){return e.matches.length>0},e.isActive=function(t){return e.active==t},e.selectActive=function(t){e.active=t},e.selectMatch=function(t){e.select({activeIdx:t})}}}}).filter("typeaheadHighlight",function(){return function(e,t){return t?e.replace(new RegExp(t,"gi"),"<strong>$&</strong>"):t}}),angular.module("template/accordion/accordion-group.html",[]).run(["$templateCache",function(e){e.put("template/accordion/accordion-group.html",'<div class="accordion-group"> <div class="accordion-heading" ><a class="accordion-toggle" ng-click="isOpen = !isOpen" accordion-transclude="heading">{{heading}}</a></div> <div class="accordion-body" collapse="!isOpen"> <div class="accordion-inner" ng-transclude></div> </div></div>')}]),angular.module("template/accordion/accordion.html",[]).run(["$templateCache",function(e){e.put("template/accordion/accordion.html",'<div class="accordion" ng-transclude></div>')}]),angular.module("template/alert/alert.html",[]).run(["$templateCache",function(e){e.put("template/alert/alert.html","<div class='alert' ng-class='type && \"alert-\" + type'> <button type='button' class='close' ng-click='close()'>×</button> <div ng-transclude></div></div>")}]),angular.module("template/carousel/carousel.html",[]).run(["$templateCache",function(e){e.put("template/carousel/carousel.html",'<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel"> <ol class="carousel-indicators"> <li ng-repeat="slide in slides()" ng-class="{active: isActive(slide)}" ng-click="select(slide)"></li> </ol> <div class="carousel-inner" ng-transclude></div> <a ng-click="prev()" class="carousel-control left">‹</a> <a ng-click="next()" class="carousel-control right">›</a></div>')}]),angular.module("template/carousel/slide.html",[]).run(["$templateCache",function(e){e.put("template/carousel/slide.html","<div ng-class=\"{ 'active': leaving || (active && !entering), 'prev': (next || active) && direction=='prev', 'next': (next || active) && direction=='next', 'right': direction=='prev', 'left': direction=='next' }\" class=\"item\" ng-transclude></div>")}]),angular.module("template/dialog/message.html",[]).run(["$templateCache",function(e){e.put("template/dialog/message.html",'<div class="modal-header"> <h1>{{ title }}</h1></div><div class="modal-body"> <p>{{ message }}</p></div><div class="modal-footer"> <button ng-repeat="btn in buttons" ng-click="close(btn.result)" class=btn ng-class="btn.cssClass">{{ btn.label }}</button></div>')}]),angular.module("template/pagination/pagination.html",[]).run(["$templateCache",function(e){e.put("template/pagination/pagination.html",'<div class="pagination"><ul> <li ng-repeat="page in pages" ng-class="{active: page.active, disabled: page.disabled}"><a ng-click="selectPage(page.number)">{{page.text}}</a></li> </ul></div>')}]),angular.module("template/popover/popover.html",[]).run(["$templateCache",function(e){e.put("template/popover/popover.html",'<div class="popover {{placement}}" ng-class="{ in: isOpen(), fade: animation() }"> <div class="arrow"></div> <div class="popover-inner"> <h3 class="popover-title" ng-bind="popoverTitle" ng-show="popoverTitle"></h3> <div class="popover-content" ng-bind="popoverContent"></div> </div></div>')}]),angular.module("template/tabs/pane.html",[]).run(["$templateCache",function(e){e.put("template/tabs/pane.html",'<div class="tab-pane" ng-class="{active: selected}" ng-show="selected" ng-transclude></div>')}]),angular.module("template/tabs/tabs.html",[]).run(["$templateCache",function(e){e.put("template/tabs/tabs.html",'<div class="tabbable"> <ul class="nav nav-tabs"> <li ng-repeat="pane in panes" ng-class="{active:pane.selected}"> <a href="" ng-click="select(pane)">{{pane.heading}}</a> </li> </ul> <div class="tab-content" ng-transclude></div></div>')}]),angular.module("template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(e){e.put("template/tooltip/tooltip-popup.html",'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }"> <div class="tooltip-arrow"></div> <div class="tooltip-inner" ng-bind="tooltipTitle"></div></div>')}]),angular.module("template/typeahead/typeahead.html",[]).run(["$templateCache",function(e){e.put("template/typeahead/typeahead.html",'<div class="dropdown clearfix" ng-class="{open: isOpen()}"> <ul class="typeahead dropdown-menu"> <li ng-repeat="match in matches" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)"> <a tabindex="-1" ng-click="selectMatch($index)" ng-bind-html-unsafe="match.label | typeaheadHighlight:query"></a> </li> </ul></div>')}]);
|
@@ -0,0 +1,546 @@
|
|
1
|
+
/**
|
2
|
+
* @license AngularJS v1.2.4
|
3
|
+
* (c) 2010-2014 Google, Inc. http://angularjs.org
|
4
|
+
* License: MIT
|
5
|
+
*/
|
6
|
+
(function(window, angular, undefined) {'use strict';
|
7
|
+
|
8
|
+
var $resourceMinErr = angular.$$minErr('$resource');
|
9
|
+
|
10
|
+
// Helper functions and regex to lookup a dotted path on an object
|
11
|
+
// stopping at undefined/null. The path must be composed of ASCII
|
12
|
+
// identifiers (just like $parse)
|
13
|
+
var MEMBER_NAME_REGEX = /^(\.[a-zA-Z_$][0-9a-zA-Z_$]*)+$/;
|
14
|
+
|
15
|
+
function isValidDottedPath(path) {
|
16
|
+
return (path != null && path !== '' && path !== 'hasOwnProperty' &&
|
17
|
+
MEMBER_NAME_REGEX.test('.' + path));
|
18
|
+
}
|
19
|
+
|
20
|
+
function lookupDottedPath(obj, path) {
|
21
|
+
if (!isValidDottedPath(path)) {
|
22
|
+
throw $resourceMinErr('badmember', 'Dotted member path "@{0}" is invalid.', path);
|
23
|
+
}
|
24
|
+
var keys = path.split('.');
|
25
|
+
for (var i = 0, ii = keys.length; i < ii && obj !== undefined; i++) {
|
26
|
+
var key = keys[i];
|
27
|
+
obj = (obj !== null) ? obj[key] : undefined;
|
28
|
+
}
|
29
|
+
return obj;
|
30
|
+
}
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @ngdoc overview
|
34
|
+
* @name ngResource
|
35
|
+
* @description
|
36
|
+
*
|
37
|
+
* # ngResource
|
38
|
+
*
|
39
|
+
* The `ngResource` module provides interaction support with RESTful services
|
40
|
+
* via the $resource service.
|
41
|
+
*
|
42
|
+
* {@installModule resource}
|
43
|
+
*
|
44
|
+
* <div doc-module-components="ngResource"></div>
|
45
|
+
*
|
46
|
+
* See {@link ngResource.$resource `$resource`} for usage.
|
47
|
+
*/
|
48
|
+
|
49
|
+
/**
|
50
|
+
* @ngdoc object
|
51
|
+
* @name ngResource.$resource
|
52
|
+
* @requires $http
|
53
|
+
*
|
54
|
+
* @description
|
55
|
+
* A factory which creates a resource object that lets you interact with
|
56
|
+
* [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources.
|
57
|
+
*
|
58
|
+
* The returned resource object has action methods which provide high-level behaviors without
|
59
|
+
* the need to interact with the low level {@link ng.$http $http} service.
|
60
|
+
*
|
61
|
+
* Requires the {@link ngResource `ngResource`} module to be installed.
|
62
|
+
*
|
63
|
+
* @param {string} url A parametrized URL template with parameters prefixed by `:` as in
|
64
|
+
* `/user/:username`. If you are using a URL with a port number (e.g.
|
65
|
+
* `http://example.com:8080/api`), it will be respected.
|
66
|
+
*
|
67
|
+
* If you are using a url with a suffix, just add the suffix, like this:
|
68
|
+
* `$resource('http://example.com/resource.json')` or `$resource('http://example.com/:id.json')`
|
69
|
+
* or even `$resource('http://example.com/resource/:resource_id.:format')`
|
70
|
+
* If the parameter before the suffix is empty, :resource_id in this case, then the `/.` will be
|
71
|
+
* collapsed down to a single `.`. If you need this sequence to appear and not collapse then you
|
72
|
+
* can escape it with `/\.`.
|
73
|
+
*
|
74
|
+
* @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in
|
75
|
+
* `actions` methods. If any of the parameter value is a function, it will be executed every time
|
76
|
+
* when a param value needs to be obtained for a request (unless the param was overridden).
|
77
|
+
*
|
78
|
+
* Each key value in the parameter object is first bound to url template if present and then any
|
79
|
+
* excess keys are appended to the url search query after the `?`.
|
80
|
+
*
|
81
|
+
* Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in
|
82
|
+
* URL `/path/greet?salutation=Hello`.
|
83
|
+
*
|
84
|
+
* If the parameter value is prefixed with `@` then the value of that parameter is extracted from
|
85
|
+
* the data object (useful for non-GET operations).
|
86
|
+
*
|
87
|
+
* @param {Object.<Object>=} actions Hash with declaration of custom action that should extend the
|
88
|
+
* default set of resource actions. The declaration should be created in the format of {@link
|
89
|
+
* ng.$http#usage_parameters $http.config}:
|
90
|
+
*
|
91
|
+
* {action1: {method:?, params:?, isArray:?, headers:?, ...},
|
92
|
+
* action2: {method:?, params:?, isArray:?, headers:?, ...},
|
93
|
+
* ...}
|
94
|
+
*
|
95
|
+
* Where:
|
96
|
+
*
|
97
|
+
* - **`action`** – {string} – The name of action. This name becomes the name of the method on
|
98
|
+
* your resource object.
|
99
|
+
* - **`method`** – {string} – HTTP request method. Valid methods are: `GET`, `POST`, `PUT`,
|
100
|
+
* `DELETE`, and `JSONP`.
|
101
|
+
* - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of
|
102
|
+
* the parameter value is a function, it will be executed every time when a param value needs to
|
103
|
+
* be obtained for a request (unless the param was overridden).
|
104
|
+
* - **`url`** – {string} – action specific `url` override. The url templating is supported just
|
105
|
+
* like for the resource-level urls.
|
106
|
+
* - **`isArray`** – {boolean=} – If true then the returned object for this action is an array,
|
107
|
+
* see `returns` section.
|
108
|
+
* - **`transformRequest`** –
|
109
|
+
* `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
|
110
|
+
* transform function or an array of such functions. The transform function takes the http
|
111
|
+
* request body and headers and returns its transformed (typically serialized) version.
|
112
|
+
* - **`transformResponse`** –
|
113
|
+
* `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
|
114
|
+
* transform function or an array of such functions. The transform function takes the http
|
115
|
+
* response body and headers and returns its transformed (typically deserialized) version.
|
116
|
+
* - **`cache`** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the
|
117
|
+
* GET request, otherwise if a cache instance built with
|
118
|
+
* {@link ng.$cacheFactory $cacheFactory}, this cache will be used for
|
119
|
+
* caching.
|
120
|
+
* - **`timeout`** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} that
|
121
|
+
* should abort the request when resolved.
|
122
|
+
* - **`withCredentials`** - `{boolean}` - whether to set the `withCredentials` flag on the
|
123
|
+
* XHR object. See {@link https://developer.mozilla.org/en/http_access_control#section_5
|
124
|
+
* requests with credentials} for more information.
|
125
|
+
* - **`responseType`** - `{string}` - see {@link
|
126
|
+
* https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType requestType}.
|
127
|
+
* - **`interceptor`** - `{Object=}` - The interceptor object has two optional methods -
|
128
|
+
* `response` and `responseError`. Both `response` and `responseError` interceptors get called
|
129
|
+
* with `http response` object. See {@link ng.$http $http interceptors}.
|
130
|
+
*
|
131
|
+
* @returns {Object} A resource "class" object with methods for the default set of resource actions
|
132
|
+
* optionally extended with custom `actions`. The default set contains these actions:
|
133
|
+
*
|
134
|
+
* { 'get': {method:'GET'},
|
135
|
+
* 'save': {method:'POST'},
|
136
|
+
* 'query': {method:'GET', isArray:true},
|
137
|
+
* 'remove': {method:'DELETE'},
|
138
|
+
* 'delete': {method:'DELETE'} };
|
139
|
+
*
|
140
|
+
* Calling these methods invoke an {@link ng.$http} with the specified http method,
|
141
|
+
* destination and parameters. When the data is returned from the server then the object is an
|
142
|
+
* instance of the resource class. The actions `save`, `remove` and `delete` are available on it
|
143
|
+
* as methods with the `$` prefix. This allows you to easily perform CRUD operations (create,
|
144
|
+
* read, update, delete) on server-side data like this:
|
145
|
+
* <pre>
|
146
|
+
var User = $resource('/user/:userId', {userId:'@id'});
|
147
|
+
var user = User.get({userId:123}, function() {
|
148
|
+
user.abc = true;
|
149
|
+
user.$save();
|
150
|
+
});
|
151
|
+
</pre>
|
152
|
+
*
|
153
|
+
* It is important to realize that invoking a $resource object method immediately returns an
|
154
|
+
* empty reference (object or array depending on `isArray`). Once the data is returned from the
|
155
|
+
* server the existing reference is populated with the actual data. This is a useful trick since
|
156
|
+
* usually the resource is assigned to a model which is then rendered by the view. Having an empty
|
157
|
+
* object results in no rendering, once the data arrives from the server then the object is
|
158
|
+
* populated with the data and the view automatically re-renders itself showing the new data. This
|
159
|
+
* means that in most cases one never has to write a callback function for the action methods.
|
160
|
+
*
|
161
|
+
* The action methods on the class object or instance object can be invoked with the following
|
162
|
+
* parameters:
|
163
|
+
*
|
164
|
+
* - HTTP GET "class" actions: `Resource.action([parameters], [success], [error])`
|
165
|
+
* - non-GET "class" actions: `Resource.action([parameters], postData, [success], [error])`
|
166
|
+
* - non-GET instance actions: `instance.$action([parameters], [success], [error])`
|
167
|
+
*
|
168
|
+
* Success callback is called with (value, responseHeaders) arguments. Error callback is called
|
169
|
+
* with (httpResponse) argument.
|
170
|
+
*
|
171
|
+
* Class actions return empty instance (with additional properties below).
|
172
|
+
* Instance actions return promise of the action.
|
173
|
+
*
|
174
|
+
* The Resource instances and collection have these additional properties:
|
175
|
+
*
|
176
|
+
* - `$promise`: the {@link ng.$q promise} of the original server interaction that created this
|
177
|
+
* instance or collection.
|
178
|
+
*
|
179
|
+
* On success, the promise is resolved with the same resource instance or collection object,
|
180
|
+
* updated with data from server. This makes it easy to use in
|
181
|
+
* {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view
|
182
|
+
* rendering until the resource(s) are loaded.
|
183
|
+
*
|
184
|
+
* On failure, the promise is resolved with the {@link ng.$http http response} object, without
|
185
|
+
* the `resource` property.
|
186
|
+
*
|
187
|
+
* - `$resolved`: `true` after first server interaction is completed (either with success or
|
188
|
+
* rejection), `false` before that. Knowing if the Resource has been resolved is useful in
|
189
|
+
* data-binding.
|
190
|
+
*
|
191
|
+
* @example
|
192
|
+
*
|
193
|
+
* # Credit card resource
|
194
|
+
*
|
195
|
+
* <pre>
|
196
|
+
// Define CreditCard class
|
197
|
+
var CreditCard = $resource('/user/:userId/card/:cardId',
|
198
|
+
{userId:123, cardId:'@id'}, {
|
199
|
+
charge: {method:'POST', params:{charge:true}}
|
200
|
+
});
|
201
|
+
|
202
|
+
// We can retrieve a collection from the server
|
203
|
+
var cards = CreditCard.query(function() {
|
204
|
+
// GET: /user/123/card
|
205
|
+
// server returns: [ {id:456, number:'1234', name:'Smith'} ];
|
206
|
+
|
207
|
+
var card = cards[0];
|
208
|
+
// each item is an instance of CreditCard
|
209
|
+
expect(card instanceof CreditCard).toEqual(true);
|
210
|
+
card.name = "J. Smith";
|
211
|
+
// non GET methods are mapped onto the instances
|
212
|
+
card.$save();
|
213
|
+
// POST: /user/123/card/456 {id:456, number:'1234', name:'J. Smith'}
|
214
|
+
// server returns: {id:456, number:'1234', name: 'J. Smith'};
|
215
|
+
|
216
|
+
// our custom method is mapped as well.
|
217
|
+
card.$charge({amount:9.99});
|
218
|
+
// POST: /user/123/card/456?amount=9.99&charge=true {id:456, number:'1234', name:'J. Smith'}
|
219
|
+
});
|
220
|
+
|
221
|
+
// we can create an instance as well
|
222
|
+
var newCard = new CreditCard({number:'0123'});
|
223
|
+
newCard.name = "Mike Smith";
|
224
|
+
newCard.$save();
|
225
|
+
// POST: /user/123/card {number:'0123', name:'Mike Smith'}
|
226
|
+
// server returns: {id:789, number:'01234', name: 'Mike Smith'};
|
227
|
+
expect(newCard.id).toEqual(789);
|
228
|
+
* </pre>
|
229
|
+
*
|
230
|
+
* The object returned from this function execution is a resource "class" which has "static" method
|
231
|
+
* for each action in the definition.
|
232
|
+
*
|
233
|
+
* Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and
|
234
|
+
* `headers`.
|
235
|
+
* When the data is returned from the server then the object is an instance of the resource type and
|
236
|
+
* all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD
|
237
|
+
* operations (create, read, update, delete) on server-side data.
|
238
|
+
|
239
|
+
<pre>
|
240
|
+
var User = $resource('/user/:userId', {userId:'@id'});
|
241
|
+
var user = User.get({userId:123}, function() {
|
242
|
+
user.abc = true;
|
243
|
+
user.$save();
|
244
|
+
});
|
245
|
+
</pre>
|
246
|
+
*
|
247
|
+
* It's worth noting that the success callback for `get`, `query` and other methods gets passed
|
248
|
+
* in the response that came from the server as well as $http header getter function, so one
|
249
|
+
* could rewrite the above example and get access to http headers as:
|
250
|
+
*
|
251
|
+
<pre>
|
252
|
+
var User = $resource('/user/:userId', {userId:'@id'});
|
253
|
+
User.get({userId:123}, function(u, getResponseHeaders){
|
254
|
+
u.abc = true;
|
255
|
+
u.$save(function(u, putResponseHeaders) {
|
256
|
+
//u => saved user object
|
257
|
+
//putResponseHeaders => $http header getter
|
258
|
+
});
|
259
|
+
});
|
260
|
+
</pre>
|
261
|
+
*/
|
262
|
+
angular.module('ngResource', ['ng']).
|
263
|
+
factory('$resource', ['$http', '$q', function($http, $q) {
|
264
|
+
|
265
|
+
var DEFAULT_ACTIONS = {
|
266
|
+
'get': {method:'GET'},
|
267
|
+
'save': {method:'POST'},
|
268
|
+
'query': {method:'GET', isArray:true},
|
269
|
+
'remove': {method:'DELETE'},
|
270
|
+
'delete': {method:'DELETE'}
|
271
|
+
};
|
272
|
+
var noop = angular.noop,
|
273
|
+
forEach = angular.forEach,
|
274
|
+
extend = angular.extend,
|
275
|
+
copy = angular.copy,
|
276
|
+
isFunction = angular.isFunction;
|
277
|
+
|
278
|
+
/**
|
279
|
+
* We need our custom method because encodeURIComponent is too aggressive and doesn't follow
|
280
|
+
* http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path
|
281
|
+
* segments:
|
282
|
+
* segment = *pchar
|
283
|
+
* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
|
284
|
+
* pct-encoded = "%" HEXDIG HEXDIG
|
285
|
+
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
286
|
+
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
|
287
|
+
* / "*" / "+" / "," / ";" / "="
|
288
|
+
*/
|
289
|
+
function encodeUriSegment(val) {
|
290
|
+
return encodeUriQuery(val, true).
|
291
|
+
replace(/%26/gi, '&').
|
292
|
+
replace(/%3D/gi, '=').
|
293
|
+
replace(/%2B/gi, '+');
|
294
|
+
}
|
295
|
+
|
296
|
+
|
297
|
+
/**
|
298
|
+
* This method is intended for encoding *key* or *value* parts of query component. We need a
|
299
|
+
* custom method because encodeURIComponent is too aggressive and encodes stuff that doesn't
|
300
|
+
* have to be encoded per http://tools.ietf.org/html/rfc3986:
|
301
|
+
* query = *( pchar / "/" / "?" )
|
302
|
+
* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
|
303
|
+
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
304
|
+
* pct-encoded = "%" HEXDIG HEXDIG
|
305
|
+
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
|
306
|
+
* / "*" / "+" / "," / ";" / "="
|
307
|
+
*/
|
308
|
+
function encodeUriQuery(val, pctEncodeSpaces) {
|
309
|
+
return encodeURIComponent(val).
|
310
|
+
replace(/%40/gi, '@').
|
311
|
+
replace(/%3A/gi, ':').
|
312
|
+
replace(/%24/g, '$').
|
313
|
+
replace(/%2C/gi, ',').
|
314
|
+
replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
|
315
|
+
}
|
316
|
+
|
317
|
+
function Route(template, defaults) {
|
318
|
+
this.template = template;
|
319
|
+
this.defaults = defaults || {};
|
320
|
+
this.urlParams = {};
|
321
|
+
}
|
322
|
+
|
323
|
+
Route.prototype = {
|
324
|
+
setUrlParams: function(config, params, actionUrl) {
|
325
|
+
var self = this,
|
326
|
+
url = actionUrl || self.template,
|
327
|
+
val,
|
328
|
+
encodedVal;
|
329
|
+
|
330
|
+
var urlParams = self.urlParams = {};
|
331
|
+
forEach(url.split(/\W/), function(param){
|
332
|
+
if (param === 'hasOwnProperty') {
|
333
|
+
throw $resourceMinErr('badname', "hasOwnProperty is not a valid parameter name.");
|
334
|
+
}
|
335
|
+
if (!(new RegExp("^\\d+$").test(param)) && param &&
|
336
|
+
(new RegExp("(^|[^\\\\]):" + param + "(\\W|$)").test(url))) {
|
337
|
+
urlParams[param] = true;
|
338
|
+
}
|
339
|
+
});
|
340
|
+
url = url.replace(/\\:/g, ':');
|
341
|
+
|
342
|
+
params = params || {};
|
343
|
+
forEach(self.urlParams, function(_, urlParam){
|
344
|
+
val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam];
|
345
|
+
if (angular.isDefined(val) && val !== null) {
|
346
|
+
encodedVal = encodeUriSegment(val);
|
347
|
+
url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), encodedVal + "$1");
|
348
|
+
} else {
|
349
|
+
url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function(match,
|
350
|
+
leadingSlashes, tail) {
|
351
|
+
if (tail.charAt(0) == '/') {
|
352
|
+
return tail;
|
353
|
+
} else {
|
354
|
+
return leadingSlashes + tail;
|
355
|
+
}
|
356
|
+
});
|
357
|
+
}
|
358
|
+
});
|
359
|
+
|
360
|
+
// strip trailing slashes and set the url
|
361
|
+
url = url.replace(/\/+$/, '');
|
362
|
+
// then replace collapse `/.` if found in the last URL path segment before the query
|
363
|
+
// E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x`
|
364
|
+
url = url.replace(/\/\.(?=\w+($|\?))/, '.');
|
365
|
+
// replace escaped `/\.` with `/.`
|
366
|
+
config.url = url.replace(/\/\\\./, '/.');
|
367
|
+
|
368
|
+
|
369
|
+
// set params - delegate param encoding to $http
|
370
|
+
forEach(params, function(value, key){
|
371
|
+
if (!self.urlParams[key]) {
|
372
|
+
config.params = config.params || {};
|
373
|
+
config.params[key] = value;
|
374
|
+
}
|
375
|
+
});
|
376
|
+
}
|
377
|
+
};
|
378
|
+
|
379
|
+
|
380
|
+
function resourceFactory(url, paramDefaults, actions) {
|
381
|
+
var route = new Route(url);
|
382
|
+
|
383
|
+
actions = extend({}, DEFAULT_ACTIONS, actions);
|
384
|
+
|
385
|
+
function extractParams(data, actionParams){
|
386
|
+
var ids = {};
|
387
|
+
actionParams = extend({}, paramDefaults, actionParams);
|
388
|
+
forEach(actionParams, function(value, key){
|
389
|
+
if (isFunction(value)) { value = value(); }
|
390
|
+
ids[key] = value && value.charAt && value.charAt(0) == '@' ?
|
391
|
+
lookupDottedPath(data, value.substr(1)) : value;
|
392
|
+
});
|
393
|
+
return ids;
|
394
|
+
}
|
395
|
+
|
396
|
+
function defaultResponseInterceptor(response) {
|
397
|
+
return response.resource;
|
398
|
+
}
|
399
|
+
|
400
|
+
function Resource(value){
|
401
|
+
copy(value || {}, this);
|
402
|
+
}
|
403
|
+
|
404
|
+
forEach(actions, function(action, name) {
|
405
|
+
var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method);
|
406
|
+
|
407
|
+
Resource[name] = function(a1, a2, a3, a4) {
|
408
|
+
var params = {}, data, success, error;
|
409
|
+
|
410
|
+
/* jshint -W086 */ /* (purposefully fall through case statements) */
|
411
|
+
switch(arguments.length) {
|
412
|
+
case 4:
|
413
|
+
error = a4;
|
414
|
+
success = a3;
|
415
|
+
//fallthrough
|
416
|
+
case 3:
|
417
|
+
case 2:
|
418
|
+
if (isFunction(a2)) {
|
419
|
+
if (isFunction(a1)) {
|
420
|
+
success = a1;
|
421
|
+
error = a2;
|
422
|
+
break;
|
423
|
+
}
|
424
|
+
|
425
|
+
success = a2;
|
426
|
+
error = a3;
|
427
|
+
//fallthrough
|
428
|
+
} else {
|
429
|
+
params = a1;
|
430
|
+
data = a2;
|
431
|
+
success = a3;
|
432
|
+
break;
|
433
|
+
}
|
434
|
+
case 1:
|
435
|
+
if (isFunction(a1)) success = a1;
|
436
|
+
else if (hasBody) data = a1;
|
437
|
+
else params = a1;
|
438
|
+
break;
|
439
|
+
case 0: break;
|
440
|
+
default:
|
441
|
+
throw $resourceMinErr('badargs',
|
442
|
+
"Expected up to 4 arguments [params, data, success, error], got {0} arguments",
|
443
|
+
arguments.length);
|
444
|
+
}
|
445
|
+
/* jshint +W086 */ /* (purposefully fall through case statements) */
|
446
|
+
|
447
|
+
var isInstanceCall = this instanceof Resource;
|
448
|
+
var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data));
|
449
|
+
var httpConfig = {};
|
450
|
+
var responseInterceptor = action.interceptor && action.interceptor.response ||
|
451
|
+
defaultResponseInterceptor;
|
452
|
+
var responseErrorInterceptor = action.interceptor && action.interceptor.responseError ||
|
453
|
+
undefined;
|
454
|
+
|
455
|
+
forEach(action, function(value, key) {
|
456
|
+
if (key != 'params' && key != 'isArray' && key != 'interceptor') {
|
457
|
+
httpConfig[key] = copy(value);
|
458
|
+
}
|
459
|
+
});
|
460
|
+
|
461
|
+
if (hasBody) httpConfig.data = data;
|
462
|
+
route.setUrlParams(httpConfig,
|
463
|
+
extend({}, extractParams(data, action.params || {}), params),
|
464
|
+
action.url);
|
465
|
+
|
466
|
+
var promise = $http(httpConfig).then(function(response) {
|
467
|
+
var data = response.data,
|
468
|
+
promise = value.$promise;
|
469
|
+
|
470
|
+
if (data) {
|
471
|
+
// Need to convert action.isArray to boolean in case it is undefined
|
472
|
+
// jshint -W018
|
473
|
+
if ( angular.isArray(data) !== (!!action.isArray) ) {
|
474
|
+
throw $resourceMinErr('badcfg', 'Error in resource configuration. Expected ' +
|
475
|
+
'response to contain an {0} but got an {1}',
|
476
|
+
action.isArray?'array':'object', angular.isArray(data)?'array':'object');
|
477
|
+
}
|
478
|
+
// jshint +W018
|
479
|
+
if (action.isArray) {
|
480
|
+
value.length = 0;
|
481
|
+
forEach(data, function(item) {
|
482
|
+
value.push(new Resource(item));
|
483
|
+
});
|
484
|
+
} else {
|
485
|
+
copy(data, value);
|
486
|
+
value.$promise = promise;
|
487
|
+
}
|
488
|
+
}
|
489
|
+
|
490
|
+
value.$resolved = true;
|
491
|
+
|
492
|
+
response.resource = value;
|
493
|
+
|
494
|
+
return response;
|
495
|
+
}, function(response) {
|
496
|
+
value.$resolved = true;
|
497
|
+
|
498
|
+
(error||noop)(response);
|
499
|
+
|
500
|
+
return $q.reject(response);
|
501
|
+
});
|
502
|
+
|
503
|
+
promise = promise.then(
|
504
|
+
function(response) {
|
505
|
+
var value = responseInterceptor(response);
|
506
|
+
(success||noop)(value, response.headers);
|
507
|
+
return value;
|
508
|
+
},
|
509
|
+
responseErrorInterceptor);
|
510
|
+
|
511
|
+
if (!isInstanceCall) {
|
512
|
+
// we are creating instance / collection
|
513
|
+
// - set the initial promise
|
514
|
+
// - return the instance / collection
|
515
|
+
value.$promise = promise;
|
516
|
+
value.$resolved = false;
|
517
|
+
|
518
|
+
return value;
|
519
|
+
}
|
520
|
+
|
521
|
+
// instance call
|
522
|
+
return promise;
|
523
|
+
};
|
524
|
+
|
525
|
+
|
526
|
+
Resource.prototype['$' + name] = function(params, success, error) {
|
527
|
+
if (isFunction(params)) {
|
528
|
+
error = success; success = params; params = {};
|
529
|
+
}
|
530
|
+
var result = Resource[name].call(this, params, this, success, error);
|
531
|
+
return result.$promise || result;
|
532
|
+
};
|
533
|
+
});
|
534
|
+
|
535
|
+
Resource.bind = function(additionalParamDefaults){
|
536
|
+
return resourceFactory(url, extend({}, paramDefaults, additionalParamDefaults), actions);
|
537
|
+
};
|
538
|
+
|
539
|
+
return Resource;
|
540
|
+
}
|
541
|
+
|
542
|
+
return resourceFactory;
|
543
|
+
}]);
|
544
|
+
|
545
|
+
|
546
|
+
})(window, window.angular);
|