dm_event 4.2.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +23 -0
- data/README.md +33 -0
- data/Rakefile +36 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/at/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/be/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/ch/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/de/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/es/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/fr/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/it/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/nl/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/pl/icon-64x44.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/100x38.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/200x75.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/250x94.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/28x7.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/320x120.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/42x11.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/75x28.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/icon-32x22.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/icon-32x24.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/icon-48x32.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/icon-48x34.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/icon-64x42.png +0 -0
- data/app/assets/images/dm_event/payment_logos/sofort/uk/icon-64x44.png +0 -0
- data/app/assets/javascripts/dm_event/admin.js +94 -0
- data/app/assets/stylesheets/dm_event/admin.css +152 -0
- data/app/assets/stylesheets/dm_event/application.css +65 -0
- data/app/controllers/dm_event/admin/admin_controller.rb +13 -0
- data/app/controllers/dm_event/admin/registrations_controller.rb +411 -0
- data/app/controllers/dm_event/admin/workshop_prices_controller.rb +73 -0
- data/app/controllers/dm_event/admin/workshops_controller.rb +147 -0
- data/app/controllers/dm_event/application_controller.rb +23 -0
- data/app/controllers/dm_event/payments_controller.rb +83 -0
- data/app/controllers/dm_event/registrations_controller.rb +368 -0
- data/app/datatables/registration_datatable.rb +117 -0
- data/app/helpers/dm_event/application_helper.rb +4 -0
- data/app/helpers/dm_event/registrations_helper.rb +14 -0
- data/app/helpers/dm_event/workshops_helper.rb +41 -0
- data/app/mailers/payment_reminder_mailer.rb +25 -0
- data/app/mailers/registration_notify_mailer.rb +31 -0
- data/app/models/dm_event/concerns/ability.rb +38 -0
- data/app/models/dm_event/concerns/registration_state_email.rb +80 -0
- data/app/models/dm_event/concerns/registration_state_machine.rb +218 -0
- data/app/models/dm_event/concerns/user_profile.rb +20 -0
- data/app/models/dm_event/model_decorators.rb +6 -0
- data/app/models/dm_event/permitted_params.rb +35 -0
- data/app/models/payment.rb +48 -0
- data/app/models/registration.rb +297 -0
- data/app/models/workshop.rb +247 -0
- data/app/models/workshop_price.rb +118 -0
- data/app/presenters/event_common_presenter.rb +31 -0
- data/app/presenters/registration_presenter.rb +34 -0
- data/app/presenters/workshop_presenter.rb +22 -0
- data/app/views/dm_event/admin/registrations/_form.html.erb +297 -0
- data/app/views/dm_event/admin/registrations/action_state.js.erb +1 -0
- data/app/views/dm_event/admin/registrations/edit.html.erb +1 -0
- data/app/views/dm_event/admin/registrations/index.html.erb +0 -0
- data/app/views/dm_event/admin/workshop_prices/_form.html.erb +62 -0
- data/app/views/dm_event/admin/workshop_prices/edit.html.erb +2 -0
- data/app/views/dm_event/admin/workshop_prices/index.html.erb +31 -0
- data/app/views/dm_event/admin/workshop_prices/new.html.erb +2 -0
- data/app/views/dm_event/admin/workshops/_form.html.erb +61 -0
- data/app/views/dm_event/admin/workshops/_header_menu.html.erb +21 -0
- data/app/views/dm_event/admin/workshops/_registration_stats.html.erb +58 -0
- data/app/views/dm_event/admin/workshops/additional_configuration.html.erb +47 -0
- data/app/views/dm_event/admin/workshops/edit.html.erb +2 -0
- data/app/views/dm_event/admin/workshops/edit_system_email.html.erb +75 -0
- data/app/views/dm_event/admin/workshops/financials.html.erb +179 -0
- data/app/views/dm_event/admin/workshops/index.html.erb +100 -0
- data/app/views/dm_event/admin/workshops/lost_users.html.erb +44 -0
- data/app/views/dm_event/admin/workshops/new.html.erb +2 -0
- data/app/views/dm_event/admin/workshops/show.html.erb +47 -0
- data/app/views/dm_event/admin/workshops/user_outstanding_balances.html.erb +29 -0
- data/app/views/dm_event/liquid_tags/_funding_project_status.html.erb +27 -0
- data/app/views/dm_event/payments/_registrations_paypal_standard.html.erb +23 -0
- data/app/views/dm_event/payments/_registrations_sofort.html.erb +18 -0
- data/app/views/dm_event/registrations/_section_address.html.erb +30 -0
- data/app/views/dm_event/registrations/_section_custom_fields.html.erb +7 -0
- data/app/views/dm_event/registrations/_section_prices.html.erb +33 -0
- data/app/views/dm_event/registrations/_workshop_price.html.erb +18 -0
- data/app/views/dm_event/registrations/choose_payment.html.erb +5 -0
- data/app/views/dm_event/registrations/closed.html.erb +14 -0
- data/app/views/dm_event/registrations/new.html.erb +30 -0
- data/app/views/dm_event/registrations/success.html.erb +15 -0
- data/app/views/layouts/email_templates/dm_event_email_layout.html.erb +318 -0
- data/app/views/layouts/email_templates/dm_event_email_layout.text.erb +1 -0
- data/app/views/layouts/email_templates/dm_event_payment_reminder.html.erb +22 -0
- data/app/views/layouts/email_templates/dm_event_payment_reminder.text.erb +19 -0
- data/app/views/layouts/email_templates/dm_event_registration_notify.html.erb +21 -0
- data/app/views/layouts/email_templates/dm_event_registration_notify.text.erb +13 -0
- data/config/initializers/dm_event.rb +1 -0
- data/config/initializers/liquid_init.rb +2 -0
- data/config/locales/ems.cs.yml +51 -0
- data/config/locales/ems.de.yml +51 -0
- data/config/locales/ems.en.yml +51 -0
- data/config/locales/ems.fi.yml +51 -0
- data/config/locales/ems.ja.yml +51 -0
- data/config/routes.rb +40 -0
- data/db/migrate/20130510155617_create_events.rb +98 -0
- data/db/migrate/20130516124327_add_locale_to_registration.rb +5 -0
- data/db/migrate/20130516204454_add_user_profile_to_registration.rb +11 -0
- data/db/migrate/20130518092324_add_require_address.rb +7 -0
- data/db/migrate/20130609145812_add_workshop_published.rb +5 -0
- data/db/migrate/20130624134506_add_amount_currency.rb +16 -0
- data/db/migrate/20130703131515_add_workshop_currency.rb +5 -0
- data/db/migrate/20130913083529_add_event_funding_type.rb +6 -0
- data/db/migrate/20130914105736_add_enable_payments.rb +5 -0
- data/db/migrate/20130916160033_add_sidebar_to_workshop.rb +5 -0
- data/db/migrate/20130917161700_add_show_address.rb +5 -0
- data/db/migrate/20131116180719_add_default_funding_goal.rb +8 -0
- data/db/migrate/20131127165445_add_payment_reminder.rb +5 -0
- data/db/migrate/20140122204702_add_event_image.rb +5 -0
- data/db/migrate/20140523165342_add_workshop_summary.rb +5 -0
- data/db/migrate/20140605052208_add_uuid_to_registration.rb +10 -0
- data/db/migrate/20140707152124_add_registration_comment_count.rb +5 -0
- data/db/migrate/20140708142312_add_payment_comment.rb +20 -0
- data/db/migrate/20150709125105_add_payment_reminder_history.rb +16 -0
- data/db/migrate/20160810081542_add_bcc_contact_email.rb +5 -0
- data/db/migrate/20160821150120_index_foreign_keys_in_ems_registrations.rb +9 -0
- data/db/migrate/20160821150121_index_foreign_keys_in_ems_workshop_price_translations.rb +5 -0
- data/db/migrate/20160821150122_index_foreign_keys_in_ems_workshop_prices.rb +6 -0
- data/db/migrate/20160821150123_index_foreign_keys_in_ems_workshop_translations.rb +5 -0
- data/db/migrate/20160821150124_index_foreign_keys_in_ems_workshops.rb +6 -0
- data/lib/dm_event/engine.rb +20 -0
- data/lib/dm_event/liquid/tags/funding_project_status.rb +55 -0
- data/lib/dm_event.rb +4 -0
- data/lib/tasks/dm_event_tasks.rake +4 -0
- data/spec/controllers/registrations_controller_spec.rb +152 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/ability.rb +10 -0
- data/spec/dummy/app/models/user.rb +6 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config/application.rb +26 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +82 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/assets.rb +8 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +11 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20141114170927_add_globalize_countries.dm_core.rb +50 -0
- data/spec/dummy/db/migrate/20141114170928_devise_create_users.dm_core.rb +46 -0
- data/spec/dummy/db/migrate/20141114170929_add_user_fields.dm_core.rb +14 -0
- data/spec/dummy/db/migrate/20141114170930_rolify_create_roles.dm_core.rb +20 -0
- data/spec/dummy/db/migrate/20141114170931_add_last_access.dm_core.rb +10 -0
- data/spec/dummy/db/migrate/20141114170932_create_versions.dm_core.rb +19 -0
- data/spec/dummy/db/migrate/20141114170933_add_object_changes_column_to_versions.dm_core.rb +12 -0
- data/spec/dummy/db/migrate/20141114170934_create_dm_core_accounts.dm_core.rb +13 -0
- data/spec/dummy/db/migrate/20141114170935_add_account_to_users.dm_core.rb +9 -0
- data/spec/dummy/db/migrate/20141114170936_create_preferences.dm_core.rb +13 -0
- data/spec/dummy/db/migrate/20141114170937_create_comments.dm_core.rb +22 -0
- data/spec/dummy/db/migrate/20141114170938_add_activity.dm_core.rb +21 -0
- data/spec/dummy/db/migrate/20141114170939_add_type_to_comments.dm_core.rb +9 -0
- data/spec/dummy/db/migrate/20141114170940_add_category.dm_core.rb +28 -0
- data/spec/dummy/db/migrate/20141114170941_create_email_table.dm_core.rb +26 -0
- data/spec/dummy/db/migrate/20141114170942_add_user_profile.dm_core.rb +46 -0
- data/spec/dummy/db/migrate/20141114170943_add_profile_email.dm_core.rb +14 -0
- data/spec/dummy/db/migrate/20141114170944_create_payment_history.dm_core.rb +37 -0
- data/spec/dummy/db/migrate/20141114170945_change_anchor_field.dm_core.rb +10 -0
- data/spec/dummy/db/migrate/20141114170946_create_user_site_profile.dm_core.rb +27 -0
- data/spec/dummy/db/migrate/20141114170947_add_avatar.dm_core.rb +12 -0
- data/spec/dummy/db/migrate/20141114170948_add_notify_to_payment_history.dm_core.rb +8 -0
- data/spec/dummy/db/migrate/20141114170949_acts_as_votable_migration.dm_core.rb +28 -0
- data/spec/dummy/db/migrate/20141114170950_add_user_site_profile_uuid.dm_core.rb +19 -0
- data/spec/dummy/db/migrate/20141114170951_add_invoice_id.dm_core.rb +7 -0
- data/spec/dummy/db/migrate/20141114170952_acts_as_follower_migration.dm_core.rb +18 -0
- data/spec/dummy/db/migrate/20141114170953_rename_invoice_id.dm_core.rb +12 -0
- data/spec/dummy/db/migrate/20141114170954_add_core_addresses.dm_core.rb +18 -0
- data/spec/dummy/db/migrate/20141114170955_papertrail_increase_column.dm_core.rb +9 -0
- data/spec/dummy/db/migrate/20141114170956_acts_as_taggable_on_migration.dm_core.rb +32 -0
- data/spec/dummy/db/migrate/20141114170957_add_missing_unique_indices.dm_core.rb +23 -0
- data/spec/dummy/db/migrate/20141114170958_add_taggings_counter_cache_to_tags.dm_core.rb +16 -0
- data/spec/dummy/db/migrate/20141114170959_create_custom_fields.dm_core.rb +40 -0
- data/spec/dummy/db/migrate/20141114170960_add_missing_taggable_index.dm_core.rb +11 -0
- data/spec/dummy/db/migrate/20141119103740_create_cms.dm_cms.rb +92 -0
- data/spec/dummy/db/migrate/20141119103741_add_account_to_cms.dm_cms.rb +11 -0
- data/spec/dummy/db/migrate/20141119103742_create_blog.dm_cms.rb +62 -0
- data/spec/dummy/db/migrate/20141119103743_add_notification_sent.dm_cms.rb +6 -0
- data/spec/dummy/db/migrate/20141119103744_add_blog_comment.dm_cms.rb +8 -0
- data/spec/dummy/db/migrate/20141119103745_add_blog_image.dm_cms.rb +6 -0
- data/spec/dummy/db/migrate/20141119103746_rename_snippet_slug.dm_cms.rb +14 -0
- data/spec/dummy/db/migrate/20141119103747_add_requires_subscription_blog.dm_cms.rb +8 -0
- data/spec/dummy/db/migrate/20141119103748_add_pages_ranked_model.dm_cms.rb +23 -0
- data/spec/dummy/db/migrate/20141119103749_add_blog_owner.dm_cms.rb +7 -0
- data/spec/dummy/db/migrate/20141119103750_create_media_files.dm_cms.rb +30 -0
- data/spec/dummy/db/migrate/20141119103751_add_cmspage_summary.dm_cms.rb +7 -0
- data/spec/dummy/db/migrate/20141119103752_add_blog_image_email_header.dm_cms.rb +6 -0
- data/spec/dummy/db/migrate/20141119103753_add_header_image.dm_cms.rb +10 -0
- data/spec/dummy/db/migrate/20160128154135_add_favored_locale.dm_core.rb +17 -0
- data/spec/dummy/db/migrate/20160128154136_update_papertrail_v4.dm_core.rb +41 -0
- data/spec/dummy/db/schema.rb +677 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/factories/account_factory.rb +7 -0
- data/spec/factories/registration_factory.rb +13 -0
- data/spec/factories/workshop_factory.rb +25 -0
- data/spec/factories/workshop_price_factory.rb +19 -0
- data/spec/models/registration_spec.rb +83 -0
- data/spec/models/workshop_spec.rb +26 -0
- data/spec/rails_helper.rb +70 -0
- data/spec/spec_helper.rb +85 -0
- data/spec/support/accounts.rb +17 -0
- data/spec/support/devise.rb +44 -0
- data/spec/support/fix_locale.rb +57 -0
- metadata +520 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
# Define presentation-specific methods here. Helpers are accessed through
|
2
|
+
# `helpers` (aka `h`).
|
3
|
+
#
|
4
|
+
# This class is used to contain some common presenter functions
|
5
|
+
#------------------------------------------------------------------------------
|
6
|
+
class EventCommonPresenter < BasePresenter
|
7
|
+
presents :model
|
8
|
+
|
9
|
+
#------------------------------------------------------------------------------
|
10
|
+
# Admin presenter methods
|
11
|
+
|
12
|
+
#------------------------------------------------------------------------------
|
13
|
+
def label_published
|
14
|
+
# model.published? ? h.colored_label('Published', :success) : h.colored_label('Draft')
|
15
|
+
end
|
16
|
+
|
17
|
+
#
|
18
|
+
# #------------------------------------------------------------------------------
|
19
|
+
# # Front-end presenter methods
|
20
|
+
#
|
21
|
+
# # Run content through a standard Textile/Liquid renderer
|
22
|
+
# #------------------------------------------------------------------------------
|
23
|
+
# def render_content(arguments = {})
|
24
|
+
# doc = RedCloth.new(Liquid::Template.parse(model.content).render(arguments, :filters => [LiquidFilters],
|
25
|
+
# :registers => {:controller => controller, :view => self, :account_site_assets => '/site_assets', :current_user => current_user}))
|
26
|
+
# #doc.hard_breaks = false
|
27
|
+
#
|
28
|
+
# return doc.to_html.html_safe
|
29
|
+
# end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#------------------------------------------------------------------------------
|
2
|
+
class RegistrationPresenter < EventCommonPresenter
|
3
|
+
presents :model
|
4
|
+
|
5
|
+
#------------------------------------------------------------------------------
|
6
|
+
# Admin presenter methods
|
7
|
+
|
8
|
+
#------------------------------------------------------------------------------
|
9
|
+
def label_published
|
10
|
+
!model.registration_closed? ? h.colored_label(start_end_date, :success) : h.colored_label(start_end_date)
|
11
|
+
end
|
12
|
+
|
13
|
+
#------------------------------------------------------------------------------
|
14
|
+
def start_end_date
|
15
|
+
format_date_range(model.starting_on, model.ending_on)
|
16
|
+
end
|
17
|
+
|
18
|
+
#------------------------------------------------------------------------------
|
19
|
+
def admin_status_label
|
20
|
+
h.colored_label(model.current_state.to_s.titlecase, "#{model.current_state}")
|
21
|
+
end
|
22
|
+
|
23
|
+
#------------------------------------------------------------------------------
|
24
|
+
def balance_or_paid
|
25
|
+
if model.workshop_price && model.workshop_price.price
|
26
|
+
color = (model.balance_owed.positive?) ? 'balance_owed' : 'balance_paid'
|
27
|
+
amount = (model.balance_owed.zero?) ? 'paid' : model.balance_owed.format(:no_cents_if_whole => true)
|
28
|
+
"<span data-placement='left' class='hovertip #{color}' title='#{model.workshop_price.price.format(:no_cents_if_whole => true)} — #{model.workshop_price.price_description}'>#{amount}</span>".html_safe
|
29
|
+
else
|
30
|
+
'-'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Define presentation-specific methods here. Helpers are accessed through
|
2
|
+
# `helpers` (aka `h`).
|
3
|
+
#
|
4
|
+
# This class is used to contain some common presenter functions
|
5
|
+
#------------------------------------------------------------------------------
|
6
|
+
class WorkshopPresenter < EventCommonPresenter
|
7
|
+
presents :model
|
8
|
+
|
9
|
+
#------------------------------------------------------------------------------
|
10
|
+
# Admin presenter methods
|
11
|
+
|
12
|
+
#------------------------------------------------------------------------------
|
13
|
+
def label_published
|
14
|
+
!model.registration_closed? ? h.colored_label(start_end_date, :success) : h.colored_label(start_end_date)
|
15
|
+
end
|
16
|
+
|
17
|
+
#------------------------------------------------------------------------------
|
18
|
+
def start_end_date
|
19
|
+
format_date_range(model.starting_on, model.ending_on)
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,297 @@
|
|
1
|
+
<% content_for :content_title, "#{h(@registration.full_name)} <small>#{h(@workshop.title)}</small>".html_safe %>
|
2
|
+
<% content_for :content_title_extra do %>
|
3
|
+
<%= page_header_buttons do %>
|
4
|
+
<%= present(@registration).admin_status_label %>
|
5
|
+
<%= link_to icon_label(:view, 'Registrations'), [:admin, @workshop], class: 'btn btn-xs btn-default' %>
|
6
|
+
<% end %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<div class="tabbable">
|
10
|
+
<ul class="nav nav-tabs">
|
11
|
+
<li class="active"><a href="#overview_tab" data-toggle="tab">Overview</a></li>
|
12
|
+
<li><a href="#update_registration_tab" data-toggle="tab">Update Registration</a></li>
|
13
|
+
<li><a href="#payment_tab" data-toggle="tab">Payments</a></li>
|
14
|
+
<li><a href="#private_comments" data-toggle="tab">Comments <%= colored_label(@registration.comments_count, :info) %></a></li>
|
15
|
+
</ul>
|
16
|
+
|
17
|
+
<div class="tab-content with-padding">
|
18
|
+
|
19
|
+
<%#--- Overview Tab %>
|
20
|
+
<div class="tab-pane fade in active" id="overview_tab">
|
21
|
+
<div class="row">
|
22
|
+
<div class="col-md-3 col-sm-3">
|
23
|
+
|
24
|
+
<div class="thumbnail">
|
25
|
+
<div class="thumb">
|
26
|
+
<%= avatar_for(@registration.user_profile.user, '100%') %>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div class="caption text-center">
|
30
|
+
<h6>
|
31
|
+
<%= @registration.full_name %><small><%= @registration.user_profile.country.english_name %></small>
|
32
|
+
<small><%= @registration.user_profile.email %></small>
|
33
|
+
<%= "<small>no user account</small>".html_safe unless @registration.user_profile.user %>
|
34
|
+
</h6>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
<div class="col-md-6 col-sm-6">
|
39
|
+
<% if @registration.workshop_price %>
|
40
|
+
<dl class="block">
|
41
|
+
<dt class="text-info">Price</dt>
|
42
|
+
<dd><%= price_details(@registration.workshop_price) %></dd>
|
43
|
+
<% if @registration.payment_comment %>
|
44
|
+
<dt class="text-info">Reason for Discount</dt>
|
45
|
+
<dd><%= @registration.payment_comment.body %></dd>
|
46
|
+
<% end %>
|
47
|
+
</dl>
|
48
|
+
<% end %>
|
49
|
+
<%= subsection title: "Previous Event Registrations" do %>
|
50
|
+
<table class="table table-condensed table-striped">
|
51
|
+
<thead>
|
52
|
+
<tr>
|
53
|
+
<th width=20></th>
|
54
|
+
<th class="name">Workshop Title</th>
|
55
|
+
<th class="name">Paid</th>
|
56
|
+
</tr>
|
57
|
+
</thead>
|
58
|
+
<tbody>
|
59
|
+
<%# outstanding = Money.new(0) %>
|
60
|
+
<% Registration.where(user_profile_id: @registration.user_profile).each do |registration| %>
|
61
|
+
<% unless registration == @registration %>
|
62
|
+
<tr>
|
63
|
+
<td>
|
64
|
+
<button class='btn btn-xs btn-<%= registration.current_state %> hovertip' data-placement='right' title='<%= "#{registration.current_state.capitalize} on #{format_date(registration.process_changed_on)}" %>'></button>
|
65
|
+
</td>
|
66
|
+
<td class="name"><%= link_to registration.workshop.title, edit_admin_registration_path(registration) %></td>
|
67
|
+
<td class="name"><%= present(registration).balance_or_paid %></td>
|
68
|
+
</tr>
|
69
|
+
<%# outstanding += registration.balance_owed %>
|
70
|
+
<% end %>
|
71
|
+
<% end %>
|
72
|
+
</tbody>
|
73
|
+
<% if false # [todo] Unfortunately, this code did not work since each workshop could be in a different currency. Revisit %>
|
74
|
+
<tfooter>
|
75
|
+
<tr>
|
76
|
+
<td></td>
|
77
|
+
<td><strong>Outstanding Balance</strong></td>
|
78
|
+
<td><%= outstanding.format %></td>
|
79
|
+
</tr>
|
80
|
+
</tfooter>
|
81
|
+
<% end %>
|
82
|
+
</table>
|
83
|
+
<% end %>
|
84
|
+
</div>
|
85
|
+
<div class="col-md-3 col-sm-3">
|
86
|
+
<ul class="statistics">
|
87
|
+
<% color = @registration.balance_owed.positive? ? :danger : :success %>
|
88
|
+
<li><%= stat_block_small label: 'Balance', number: @registration.balance_owed.format(no_cents_if_whole: true), color_type: color, icon: 'icon-coin', percent: 100 %></li>
|
89
|
+
</ul>
|
90
|
+
<table class="accounting" style="width: 100%">
|
91
|
+
<tr>
|
92
|
+
<th>Price</th>
|
93
|
+
<td><%= @registration.price.format %></td>
|
94
|
+
</tr>
|
95
|
+
<tr>
|
96
|
+
<th>Discount</th>
|
97
|
+
<td class="text-danger"> - <%= @registration.discount.format %></td>
|
98
|
+
</tr>
|
99
|
+
<tr class="section">
|
100
|
+
<th>Total</th>
|
101
|
+
<td><strong><%= @registration.discounted_price.format %></strong></td>
|
102
|
+
</tr>
|
103
|
+
<tr>
|
104
|
+
<th>Paid</th>
|
105
|
+
<td class="text-success"><%= @registration.amount_paid.format %></td>
|
106
|
+
</tr>
|
107
|
+
<% if @registration.payment_owed.positive? %>
|
108
|
+
<tr class="section">
|
109
|
+
<th>Next Payment Amount
|
110
|
+
<% if @registration.workshop_price.recurring_payments? %>
|
111
|
+
<span style="font-weight: normal"></br>On a payment plan</span>
|
112
|
+
<% end %>
|
113
|
+
</th>
|
114
|
+
<td class="text-info"><%= @registration.payment_owed.format %></td>
|
115
|
+
</tr>
|
116
|
+
<% end %>
|
117
|
+
</table>
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
</div>
|
121
|
+
|
122
|
+
<%#--- Update Registration Tab %>
|
123
|
+
<div class="tab-pane fade" id="update_registration_tab">
|
124
|
+
<%= simple_form_for @registration, url: admin_registration_path,
|
125
|
+
html: { class: 'form-horizontal' }, wrapper: :bs3_horizontal_form, wrapper_mappings: DmAdmin::FormWrapperMappings do |f| %>
|
126
|
+
|
127
|
+
<%= subsection title: 'Price' do %>
|
128
|
+
<%= f.error_notification message: "Please review the problems below" %>
|
129
|
+
|
130
|
+
<% if @workshop.workshop_prices.empty? %>
|
131
|
+
<h5>No workshop prices / options defined</h5>
|
132
|
+
<% else %>
|
133
|
+
<div class="workshop_price_list">
|
134
|
+
<%= f.input :workshop_price_id, collection: @workshop.workshop_prices.map { |r| [price_details(r), r.id] } %>
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<% if @registration.workshop_price && @registration.workshop_price.price %>
|
138
|
+
<% discount_currency = @registration.workshop_price.price.currency.symbol %>
|
139
|
+
|
140
|
+
<%= f.input :discount_value, label: 'Discount', wrapper: :bs3_horizontal_group, input_wrapper_html: {class: 'col-sm-4'} do %>
|
141
|
+
<%= f.input_field :discount_value, as: :string, class: "form-control" %>
|
142
|
+
<span class="input-group-addon">
|
143
|
+
<%= f.select :discount_use_percent, [['%', true], [discount_currency, false]] %>
|
144
|
+
</span>
|
145
|
+
<% end %>
|
146
|
+
|
147
|
+
|
148
|
+
<% end %>
|
149
|
+
|
150
|
+
<% if @registration.payment_comment %>
|
151
|
+
<%= f.input :payment_comment_text, label: 'Reason for discount', as: :text_full_width, rows: 3, hint: 'Used for justifcation of discount. Will then be available in comment section.', disabled: true, input_html: {value: @registration.payment_comment.body} %>
|
152
|
+
<% else %>
|
153
|
+
<%= f.input 'payment_comment_text', label: 'Reason for discount', as: :text_full_width, rows: 3, hint: 'Used for justifcation of discount. Will then be available in comment section.' %>
|
154
|
+
<% end %>
|
155
|
+
<% end %>
|
156
|
+
<% end %>
|
157
|
+
|
158
|
+
<% unless @workshop.custom_field_defs.empty? %>
|
159
|
+
<%= subsection title: 'Custom Fields' do %>
|
160
|
+
<% f.object.build_missing_fields @workshop %>
|
161
|
+
<%= f.simple_fields_for :custom_fields do |builder| %>
|
162
|
+
<% field = builder.object %>
|
163
|
+
<%= render "dm_core/admin/custom_fields/#{field.field_type}", field: field, f: builder %>
|
164
|
+
<% end %>
|
165
|
+
<% end %>
|
166
|
+
<% end %>
|
167
|
+
|
168
|
+
<%= subsection title: 'Payment Reminders' do %>
|
169
|
+
<%= f.input :preferred_payment_reminder_hold_until, label: 'No reminder until', as: :date_picker, input_wrapper_html: {class: 'col-sm-4'},
|
170
|
+
hint: 'When sending reminders in batch, this persons reminder will not be sent unless after the specified date' %>
|
171
|
+
<% end %>
|
172
|
+
|
173
|
+
<%= submit_or_cancel cancel_url: admin_workshop_path(@workshop), delete_url: [:admin, @registration], delete_confirm: 'Are you sure you wish to delete this registration? Any associated payments will also be deleted!' %>
|
174
|
+
<% end %>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
<%#--- Payments Tab %>
|
178
|
+
<div class="tab-pane fade" id="payment_tab">
|
179
|
+
<%= subsection title: 'Recorded Payments' do %>
|
180
|
+
<table class="table table-condensed table-gradient table-hover" style="margin-bottom: 20px;">
|
181
|
+
<thead>
|
182
|
+
<tr>
|
183
|
+
<th width="100">Date</th>
|
184
|
+
<th>Description</th>
|
185
|
+
<th width="75">Paid</th>
|
186
|
+
<th width="100">Method</th>
|
187
|
+
<th width="18"><%= icons(:edit) %></th>
|
188
|
+
</tr>
|
189
|
+
</thead>
|
190
|
+
<tbody>
|
191
|
+
<% @registration.payment_histories.order('created_on ASC').each do |payment| %>
|
192
|
+
<tr>
|
193
|
+
<td><%= format_date(payment.payment_date) %></td>
|
194
|
+
<td><%= payment.item_ref %></td>
|
195
|
+
<td><%= payment.total.format(no_cents_if_whole: true, symbol: true) %></td>
|
196
|
+
<td><%= payment.payment_method %></td>
|
197
|
+
<td>
|
198
|
+
<% if payment.user_profile #--- only allow editing of manual payments %>
|
199
|
+
<%= link_to(icons('icon-pencil3'), '#', data: { toggle: "modal", target: "#edit_payment_#{payment.id}"}, title: 'Edit Payment') %>
|
200
|
+
<% end %>
|
201
|
+
</td>
|
202
|
+
</tr>
|
203
|
+
<% end %>
|
204
|
+
</tbody>
|
205
|
+
</table>
|
206
|
+
<%= link_to 'Add Payment', '#', data: { toggle: "modal", target: "#enter_new_payment"}, title: 'Add Payment', class: "btn btn-xs btn-primary" %>
|
207
|
+
<%= link_to 'Customer Payment Page', @registration.payment_url, target: '_blank', class: 'btn btn-xs btn-default' %>
|
208
|
+
<% if @registration.payment_owed.positive? %>
|
209
|
+
Next payment should be: <span class="text-info"><%= @registration.payment_owed.format %></span>
|
210
|
+
<% end %>
|
211
|
+
<% end %>
|
212
|
+
|
213
|
+
<%= subsection title: 'Payment Reminders' do %>
|
214
|
+
|
215
|
+
<table class="table table-condensed table-gradient table-hover" style="margin-bottom: 20px;">
|
216
|
+
<thead>
|
217
|
+
<tr>
|
218
|
+
<th width="100">Last Sent On</th>
|
219
|
+
</tr>
|
220
|
+
</thead>
|
221
|
+
<tbody>
|
222
|
+
<% if @registration.payment_reminder_sent_on.nil? %>
|
223
|
+
<tr><td>not yet</td></tr>
|
224
|
+
<% else %>
|
225
|
+
<% @registration.payment_reminder_history.each do |date| %>
|
226
|
+
<tr>
|
227
|
+
<td><%= format_date(date) %></td>
|
228
|
+
</tr>
|
229
|
+
<% end %>
|
230
|
+
<% end %>
|
231
|
+
</tbody>
|
232
|
+
</table>
|
233
|
+
|
234
|
+
<%= link_to 'Send', send_payment_reminder_emails_admin_workshop_path(@registration.workshop, registration_id: @registration.id), title: 'Send reminder now', class: 'btn btn-xs btn-default', method: :patch, data: {confirm: "Are you sure you wish to send a reminder email to this person?"} %>
|
235
|
+
<% if @registration.preferred_payment_reminder_hold_until && @registration.preferred_payment_reminder_hold_until > Time.now %>
|
236
|
+
<span> Requested not to send reminder until <strong><%= format_date(@registration.preferred_payment_reminder_hold_until) %></strong></span>
|
237
|
+
<% end %>
|
238
|
+
<% end %>
|
239
|
+
</div>
|
240
|
+
|
241
|
+
<%#--- Comments Tab %>
|
242
|
+
<div class="tab-pane fade" id="private_comments">
|
243
|
+
<%= subsection title: 'Private Comments' do %>
|
244
|
+
<%= render partial: 'dm_core/admin/comments/comment_section', locals: {commenting_on: @registration, comments: @registration.private_comments, name: 'private_comments'} %>
|
245
|
+
<% end %>
|
246
|
+
</div>
|
247
|
+
|
248
|
+
</div>
|
249
|
+
|
250
|
+
|
251
|
+
<%= simple_form_for :payment_history, url: ajax_payment_admin_registration_path(@registration),
|
252
|
+
html: { class: 'form-horizontal' }, wrapper: :bs3_horizontal_form, wrapper_mappings: DmAdmin::FormWrapperMappings do |f| %>
|
253
|
+
|
254
|
+
<%= modal_dialog title: 'Enter New Payment', id: 'enter_new_payment', include_save: true do %>
|
255
|
+
<% if @registration.workshop_price.nil? %>
|
256
|
+
<p><em>They must be registered for some type of payment first</em></p>
|
257
|
+
<% else %>
|
258
|
+
|
259
|
+
<%= f.input :payment_date, label: 'Paid On', as: :date_picker, input_wrapper_html: {class: 'col-sm-4'}, input_html: {value: Date.today.strftime("%Y/%m/%d")} %>
|
260
|
+
<%= f.input :cost, label: 'Amount', wrapper: :bs3_horizontal_group, input_wrapper_html: {class: 'col-sm-4'} do %>
|
261
|
+
<%= f.input_field :cost, as: :string, class: "form-control", value: @registration.payment_owed.amount %>
|
262
|
+
<span class="input-group-addon">
|
263
|
+
<%= f.select :total_currency, @registration.workshop_price.currency_list, {} %>
|
264
|
+
</span>
|
265
|
+
<% end %>
|
266
|
+
|
267
|
+
<%= f.input :payment_method, label: 'Method', as: 'select', collection: WorkshopPrice::PAYMENT_METHODS, include_blank: false, input_wrapper_html: {class: 'col-sm-4'} %>
|
268
|
+
<%= f.input :item_ref, label: 'Description', required: false %>
|
269
|
+
<%= f.input :bill_to_name, label: 'Payed By', required: false %>
|
270
|
+
<%= f.input :receipt_requested, as: 'boolean', label: false, inline_label: 'Customer would like a receipt', required: false %>
|
271
|
+
<% end %>
|
272
|
+
<% end %>
|
273
|
+
<% end %>
|
274
|
+
|
275
|
+
<% @registration.payment_histories.order('created_on ASC').each do |payment_history| %>
|
276
|
+
<% #--- only allow editing of manual payments %>
|
277
|
+
<% if payment_history.user_profile %>
|
278
|
+
<%= simple_form_for payment_history, url: ajax_edit_payment_admin_registration_path(locale: I18n.locale, id: @registration, payment_id: payment_history.id),
|
279
|
+
html: { class: 'form-horizontal' }, wrapper: :bs3_horizontal_form, wrapper_mappings: DmAdmin::FormWrapperMappings do |f| %>
|
280
|
+
|
281
|
+
<%= modal_dialog title: 'Enter New Payment', id: "edit_payment_#{payment_history.id}", include_save: true,
|
282
|
+
delete_url: ajax_delete_payment_admin_registration_path(locale: I18n.locale, id: @registration, payment_id: payment_history.id),
|
283
|
+
delete_msg: 'Are you sure you want to delete this payment?' do %>
|
284
|
+
<%= f.input :payment_date, label: 'Paid On', as: :date_picker, input_wrapper_html: {class: 'col-sm-4'} %>
|
285
|
+
<%= f.input :cost, label: 'Amount', wrapper: :bs3_horizontal_group, input_wrapper_html: {class: 'col-sm-4'} do %>
|
286
|
+
<%= f.input_field :cost, as: :string, class: "form-control" %>
|
287
|
+
<span class="input-group-addon">
|
288
|
+
<%= f.select :total_currency, @registration.workshop_price.currency_list, {} %>
|
289
|
+
</span>
|
290
|
+
<% end %>
|
291
|
+
<%= f.input :payment_method, label: 'Method', as: 'select', collection: WorkshopPrice::PAYMENT_METHODS, include_blank: false, input_html: {style: "width: 200px"} %>
|
292
|
+
<%= f.input :item_ref, label: 'Description', required: false %>
|
293
|
+
<%= f.input :bill_to_name, label: 'Payed By', required: false %>
|
294
|
+
<% end %>
|
295
|
+
<% end %>
|
296
|
+
<% end %>
|
297
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
$('#registration_table').dataTable().fnDraw();
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render 'form' %>
|
File without changes
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<% submit_url = (@workshop_price.new_record? ? admin_workshop_workshop_prices_path(@workshop) : admin_workshop_workshop_price_path(@workshop, @workshop_price)) %>
|
2
|
+
<%= simple_form_for @workshop_price, url: submit_url,
|
3
|
+
html: { class: 'form-horizontal' }, wrapper: :bs3_horizontal_form, wrapper_mappings: DmAdmin::FormWrapperMappings do |f| %>
|
4
|
+
|
5
|
+
<%= f.error_notification message: "Please review the problems below" %>
|
6
|
+
<%= panel header: false do %>
|
7
|
+
|
8
|
+
<div class="callout callout-info">
|
9
|
+
<p class="explanation">Define a price for the workshop. When registering, the user will see a list of possible prices.
|
10
|
+
The payment details field can be formatted using <a href="http://daringfireball.net/projects/markdown/basics">Markdown</a>. You can use the following variables:</p>
|
11
|
+
<ul class="explanation">
|
12
|
+
<li><code>{{price}}</code> → price of the workshop</li>
|
13
|
+
<li><code>{{receipt_code}}</code> → receipt/ticket number</li>
|
14
|
+
<li><code>{{price_description}}</code> → title</li>
|
15
|
+
</ul>
|
16
|
+
<p class="explanation">In your email receipts, you can use <code>{{payment_details}}</code> to include the details for the particular price that was chosen.</p>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<%= locale_tabs do |locale| %>
|
20
|
+
<%= f.input "price_description_#{locale}", label: 'Title', required: true %>
|
21
|
+
<%= f.input "sub_description_#{locale}", label: 'Sub-title' %>
|
22
|
+
<div class="col-sm-12">
|
23
|
+
<%= f.input "payment_details_#{locale}", label: 'Payment Details', hint: 'Markdown format', wrapper: :bs3_vertical_form, as: :code_editor, input_html: {style: "height: 200px;"},
|
24
|
+
hint: 'Any special details/instructions for this price (Markdown)' %>
|
25
|
+
</div>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
<%= f.input :price, wrapper: :bs3_horizontal_group, input_wrapper_html: {class: 'col-sm-4'} do %>
|
29
|
+
<%= f.input_field :price, as: :string, class: "form-control" %>
|
30
|
+
<span class="input-group-addon">
|
31
|
+
<%= @workshop_price.price_currency %>
|
32
|
+
</span>
|
33
|
+
<% end %>
|
34
|
+
<%= f.input :valid_until, as: :date_picker, input_wrapper_html: {class: 'col-sm-4'} %>
|
35
|
+
<%= f.input :total_available, input_wrapper_html: {class: 'col-sm-4'} %>
|
36
|
+
<%= f.input :disabled, as: :toggle_checked, label: 'Disable?' %>
|
37
|
+
|
38
|
+
<% if false %>
|
39
|
+
<div class="semi-block">
|
40
|
+
<h6 class="subtitle">Alternate Price/Currenies</h6>
|
41
|
+
<p class="explanation">Specify different currencies. Each currency should be unique (don't choose to Euro based countries). Payments in a different currency will be
|
42
|
+
converted to the base currency. Note that discounts are applied to the base currency value.</p>
|
43
|
+
<div class="well">
|
44
|
+
<%= f.input :alt1_price, label: 'Price 2' %>
|
45
|
+
<%= f.input :alt1_price_currency, label: 'Currency 2', collection: Account::CURRENCY_TYPES %>
|
46
|
+
<%= f.input :alt2_price, label: 'Price 3' %>
|
47
|
+
<%= f.input :alt2_price_currency, label: 'Currency 3', collection: Account::CURRENCY_TYPES %>
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
<% end %>
|
51
|
+
|
52
|
+
<%= subsection title: 'Recurring Payments' do %>
|
53
|
+
<p class="explanation">This is for indicating a regularly scheduled payment, such as a monthly payment plan.</p>
|
54
|
+
<%= f.input :recurring_number, label: 'Number of Periods', hint: 'Number of Periods (Payments)', input_wrapper_html: {class: 'col-sm-4'} %>
|
55
|
+
<%= f.input :recurring_period, label: 'Number of Days', hint: 'Number of Days in Period', input_wrapper_html: {class: 'col-sm-4'} %>
|
56
|
+
<% end %>
|
57
|
+
|
58
|
+
<%= submit_or_cancel cancel_url: admin_workshop_workshop_prices_path(@workshop), delete_url: (@workshop_price.new_record? ? nil : admin_workshop_price_path), delete_confirm: 'Delete the price?' %>
|
59
|
+
|
60
|
+
<% end %>
|
61
|
+
|
62
|
+
<% end %>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<% content_for :content_title, "Manage Prices <small>#{@workshop.title}</small>".html_safe %>
|
2
|
+
<% content_for :sidebar do %>
|
3
|
+
<ul class="navigation-light block">
|
4
|
+
<li><%= link_to 'Back to Workshop', edit_admin_workshop_url(@workshop) %></li>
|
5
|
+
</ul>
|
6
|
+
<% end %>
|
7
|
+
<%= render partial: 'dm_event/admin/workshops/header_menu' %>
|
8
|
+
|
9
|
+
<% toolbar = toolbar_btn(icons(:new), new_admin_workshop_workshop_price_path(@workshop), title: 'New Forum', class: "btn btn-link btn-icon") %>
|
10
|
+
<%= panel body: false, title: 'Workshop Prices', toolbar: toolbar do %>
|
11
|
+
<table id="drag_sort" class="table table-striped table-bordered table-block" data-update_url="<%= dm_event.admin_workshop_price_sort_path %>">
|
12
|
+
<thead>
|
13
|
+
<tr>
|
14
|
+
<th class="sort_handle"></th>
|
15
|
+
<th>Description</th>
|
16
|
+
<th width="50">Price</th>
|
17
|
+
</tr>
|
18
|
+
</thead>
|
19
|
+
<tbody>
|
20
|
+
<% @workshop_prices.each do |workshop_price| %>
|
21
|
+
<tr class="item" data-item_id="<%= workshop_price.id %>">
|
22
|
+
<td class="sort_handle"></td>
|
23
|
+
<td>
|
24
|
+
<%= link_to workshop_price.price_description, [:edit, :admin, workshop_price] %>
|
25
|
+
</td>
|
26
|
+
<td><%= humanized_money_with_symbol workshop_price.price %></td>
|
27
|
+
</tr>
|
28
|
+
<% end %>
|
29
|
+
</tbody>
|
30
|
+
</table>
|
31
|
+
<% end %>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<%= render partial: 'header_menu' %>
|
2
|
+
<%= render partial: 'dm_cms/admin/shared/liquid_tags_ref' %>
|
3
|
+
|
4
|
+
<% submit_url = (@workshop.new_record? ? admin_workshops_path : admin_workshop_path) %>
|
5
|
+
<%= simple_form_for @workshop, url: submit_url,
|
6
|
+
html: { class: 'form-horizontal' }, wrapper: :bs3_horizontal_form, wrapper_mappings: DmAdmin::FormWrapperMappings do |f| %>
|
7
|
+
|
8
|
+
<%= f.error_notification message: "Please review the problems below" %>
|
9
|
+
<% toolbar = capture do %>
|
10
|
+
<%= link_to icons(:help), '#', class: 'btn btn-link btn-icon', data: { toggle: 'modal', target: '#tag_reference' } %>
|
11
|
+
<%= link_to icons(:cancel), (@workshop.new_record? ? admin_workshops_url : admin_workshop_path(@workshop)), class: 'btn btn-link btn-icon' %>
|
12
|
+
<% end %>
|
13
|
+
<%= panel title: 'Main Settings for Workshop', toolbar: toolbar do %>
|
14
|
+
<%= locale_tabs do |locale| %>
|
15
|
+
<%= f.input "title_#{locale}", label: 'Title', id: 'title_error', required: true %>
|
16
|
+
<div class="col-sm-12">
|
17
|
+
<%= f.input "description_#{locale}", label: 'Description', hint: 'Markdown format', wrapper: :bs3_vertical_form, as: :code_editor, input_html: {style: "height: 500px;"} %>
|
18
|
+
</div>
|
19
|
+
<div class="col-sm-12">
|
20
|
+
<%= f.input "sidebar_#{locale}", label: 'Sidebar', hint: 'Markdown format', wrapper: :bs3_vertical_form, as: :code_editor, input_html: {style: "height: 200px;"} %>
|
21
|
+
</div>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<%= subsection do %>
|
25
|
+
<%= f.input :slug, label: 'Slug', hint: 'Leave blank to have auto-generated based on title.', input_html: {class: 'width_50_percent'} %>
|
26
|
+
<%= f.input :event_style, label: 'Event Style', required: true, collection: Workshop::EVENT_STYLES,
|
27
|
+
hint: 'Is this a workshop or a crowdfunding/donation type of event', input_html: {class: 'width_50_percent'} %>
|
28
|
+
<% end %>
|
29
|
+
|
30
|
+
<%= subsection do %>
|
31
|
+
<%= f.input :published, as: :toggle_checked, label: 'Publish', hint: 'Make available for registrations' %>
|
32
|
+
<%= f.input :country_id, required: true, wrapper_html: { class: 'searchDrop' }, input_html: { class: 'chosen_select width_50_percent' },
|
33
|
+
collection: ut_country_select_collection, label_method: lambda {|t| t[0]}, value_method: lambda {|t| t[1]},
|
34
|
+
label: 'Country' %>
|
35
|
+
<%= f.input :base_currency, label: 'Currency', required: true, collection: Account::CURRENCY_TYPES,
|
36
|
+
hint: 'Currency used for this workshop', input_html: {class: 'width_50_percent'},
|
37
|
+
disabled: !(@workshop.workshop_prices.empty?) %>
|
38
|
+
<%= f.input :starting_on, label: 'Starting on', as: :datetime_picker, required: true, input_wrapper_html: {class: 'col-sm-4'}, hint: format_datetime(@workshop.starting_on, full_date: true) %>
|
39
|
+
<%= f.input :ending_on, label: 'Ending on', as: :datetime_picker, required: true, input_wrapper_html: {class: 'col-sm-4'}, hint: format_datetime(@workshop.ending_on, full_date: true) %>
|
40
|
+
<%= f.input :deadline_on, label: 'Deadline', as: :date_picker, input_wrapper_html: {class: 'col-sm-4'}, hint: format_date(@workshop.deadline_on, full_date: true) %>
|
41
|
+
|
42
|
+
<%= f.input :contact_email, label: 'Contact Email', input_html: {class: 'width_50_percent'} %>
|
43
|
+
<%= f.input :bcc_contact_email, as: :boolean, label: 'bcc Emails', hint: 'Send copy of registration emails to the contact email address' %>
|
44
|
+
<%= f.input :contact_phone, label: 'Contact Phone', input_html: {class: 'width_50_percent'} %>
|
45
|
+
<%= f.input :require_account, as: :boolean, label: 'Require Account', hint: 'Must have a user account to register - necessary for forum/blog access' %>
|
46
|
+
<%= f.input :show_address, as: :boolean, label: 'Show Address', hint: 'Show address fields (only if user is not logged in)' %>
|
47
|
+
<%= f.input :require_address, as: :boolean, label: 'Require Address', hint: 'Address in profile must be filled out (only if Show Address is checked)' %>
|
48
|
+
<%#= f.input :require_photo, as: :boolean, label: 'Require Photo', hint: 'A photo must be uploaded into profile' %>
|
49
|
+
<%= f.input :require_review, as: :boolean, label: 'Review Registrations', hint: 'All new registrations become "Pending", waiting for approval' %>
|
50
|
+
<%= f.input :payments_enabled, as: :boolean, label: 'Enable Payments', hint: 'Should payment processing be enabled?' %>
|
51
|
+
<% end %>
|
52
|
+
|
53
|
+
<%= subsection do %>
|
54
|
+
<%= f.input :funding_goal, label: 'Funding Goal', hint: 'Goal (in the currency above) of this funding project', input_html: {class: 'width_25_percent'} %>
|
55
|
+
<% end %>
|
56
|
+
|
57
|
+
<%= submit_or_cancel cancel_url: (@workshop.new_record? ? admin_workshops_url : admin_workshop_path(@workshop)), delete_url: (@workshop.new_record? ? nil : admin_workshop_url), delete_confirm: 'Delete the workshop and ALL related registrations and payments?' %>
|
58
|
+
<% end %>
|
59
|
+
<% end %>
|
60
|
+
|
61
|
+
<%= render partial: 'dm_cms/admin/shared/liquid_tags_ref' %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<% unless @workshop.new_record? %>
|
2
|
+
<%= content_for :content_title_extra do %>
|
3
|
+
<%= page_header_buttons do %>
|
4
|
+
<%= link_to "View Registrations", [:admin, @workshop], class: 'btn btn-xs btn-default' %>
|
5
|
+
<div class="btn-group">
|
6
|
+
<button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">Configuration <span class="caret"></span></button>
|
7
|
+
<ul class="dropdown-menu dropdown-menu-right icons-right">
|
8
|
+
<li><%= link_to 'Main Configuration', edit_admin_workshop_url(@workshop) %></li>
|
9
|
+
<li><%= link_to "Additional Configuration", additional_configuration_admin_workshop_path(@workshop) %></li>
|
10
|
+
<li><%= link_to "Workshop Prices", admin_workshop_workshop_prices_path(@workshop) %></li>
|
11
|
+
<li class="dropdown-header">Email Notifications</li>
|
12
|
+
<li><%= link_to "Pending Email", edit_system_email_admin_workshop_path(@workshop, :email_type => 'pending') %></li>
|
13
|
+
<li><%= link_to "Accepted Email", edit_system_email_admin_workshop_path(@workshop, :email_type => 'accepted') %></li>
|
14
|
+
<li><%= link_to "Paid Email", edit_system_email_admin_workshop_path(@workshop, :email_type => 'paid') %></li>
|
15
|
+
<li><%= link_to "Waitlisted Email", edit_system_email_admin_workshop_path(@workshop, :email_type => 'waitlisted') %></li>
|
16
|
+
<li><%= link_to "Rejected Email", edit_system_email_admin_workshop_path(@workshop, :email_type => 'rejected') %></li>
|
17
|
+
</ul>
|
18
|
+
</div>
|
19
|
+
<% end %>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|