spina-admin-conferences 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +101 -0
- data/Rakefile +40 -0
- data/app/assets/config/spina_admin_conferences_manifest.js +4 -0
- data/app/assets/javascripts/spina/admin/conferences/application.es6 +20 -0
- data/app/assets/javascripts/spina/admin/conferences/controllers/conference_events_form_controller.es6 +175 -0
- data/app/assets/javascripts/spina/admin/conferences/controllers/presentation_attachments_form_controller.es6 +175 -0
- data/app/assets/javascripts/spina/admin/conferences/controllers/select_options_controller.es6 +216 -0
- data/app/assets/stylesheets/spina/admin/conferences/application.sass +14 -0
- data/app/controllers/spina/admin/conferences/application_controller.rb +20 -0
- data/app/controllers/spina/admin/conferences/conferences_controller.rb +148 -0
- data/app/controllers/spina/admin/conferences/delegates_controller.rb +116 -0
- data/app/controllers/spina/admin/conferences/dietary_requirements_controller.rb +106 -0
- data/app/controllers/spina/admin/conferences/events_controller.rb +24 -0
- data/app/controllers/spina/admin/conferences/institutions_controller.rb +106 -0
- data/app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb +104 -0
- data/app/controllers/spina/admin/conferences/presentation_attachments_controller.rb +24 -0
- data/app/controllers/spina/admin/conferences/presentation_types_controller.rb +109 -0
- data/app/controllers/spina/admin/conferences/presentations_controller.rb +124 -0
- data/app/controllers/spina/admin/conferences/rooms_controller.rb +109 -0
- data/app/controllers/spina/admin/conferences/sessions_controller.rb +118 -0
- data/app/helpers/spina/admin/conferences/conferences_helper.rb +44 -0
- data/app/jobs/spina/admin/conferences/application_job.rb +11 -0
- data/app/jobs/spina/admin/conferences/delegate_import_job.rb +37 -0
- data/app/jobs/spina/admin/conferences/import_job.rb +26 -0
- data/app/jobs/spina/admin/conferences/presentation_import_job.rb +38 -0
- data/app/mailers/spina/admin/conferences/application_mailer.rb +13 -0
- data/app/models/spina/admin/conferences.rb +11 -0
- data/app/models/spina/admin/conferences/application_record.rb +14 -0
- data/app/models/spina/admin/conferences/conference.rb +152 -0
- data/app/models/spina/admin/conferences/date_part.rb +15 -0
- data/app/models/spina/admin/conferences/delegate.rb +89 -0
- data/app/models/spina/admin/conferences/dietary_requirement.rb +33 -0
- data/app/models/spina/admin/conferences/email_address_part.rb +21 -0
- data/app/models/spina/admin/conferences/event.rb +120 -0
- data/app/models/spina/admin/conferences/institution.rb +46 -0
- data/app/models/spina/admin/conferences/part.rb +20 -0
- data/app/models/spina/admin/conferences/presentation.rb +143 -0
- data/app/models/spina/admin/conferences/presentation_attachment.rb +27 -0
- data/app/models/spina/admin/conferences/presentation_attachment_type.rb +35 -0
- data/app/models/spina/admin/conferences/presentation_type.rb +60 -0
- data/app/models/spina/admin/conferences/room.rb +52 -0
- data/app/models/spina/admin/conferences/session.rb +56 -0
- data/app/models/spina/admin/conferences/time_part.rb +53 -0
- data/app/models/spina/admin/conferences/url_part.rb +21 -0
- data/app/validators/spina/admin/conferences/conference_date_validator.rb +20 -0
- data/app/validators/spina/admin/conferences/email_address_validator.rb +28 -0
- data/app/validators/spina/admin/conferences/finish_date_validator.rb +20 -0
- data/app/validators/spina/admin/conferences/finish_time_validator.rb +20 -0
- data/app/validators/spina/admin/conferences/http_url_validator.rb +28 -0
- data/app/views/layouts/spina/admin/conferences/conferences.html.haml +19 -0
- data/app/views/layouts/spina/admin/conferences/delegates.html.haml +10 -0
- data/app/views/layouts/spina/admin/conferences/dietary_requirements.html.haml +10 -0
- data/app/views/layouts/spina/admin/conferences/institutions.html.haml +17 -0
- data/app/views/layouts/spina/admin/conferences/presentation_attachment_types.html.haml +10 -0
- data/app/views/layouts/spina/admin/conferences/presentations.html.haml +10 -0
- data/app/views/spina/admin/conferences/application/_empty_list.html.haml +3 -0
- data/app/views/spina/admin/conferences/application/_errors.html.haml +11 -0
- data/app/views/spina/admin/conferences/application/_errors.js.erb +2 -0
- data/app/views/spina/admin/conferences/conferences/_conference.html.haml +9 -0
- data/app/views/spina/admin/conferences/conferences/_event_fields.html.haml +39 -0
- data/app/views/spina/admin/conferences/conferences/_event_row.html.haml +5 -0
- data/app/views/spina/admin/conferences/conferences/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/conferences/_form_conference_details.html.haml +29 -0
- data/app/views/spina/admin/conferences/conferences/_form_delegates.html.haml +12 -0
- data/app/views/spina/admin/conferences/conferences/_form_parts.html.haml +15 -0
- data/app/views/spina/admin/conferences/conferences/_form_presentation_types.html.haml +12 -0
- data/app/views/spina/admin/conferences/conferences/_form_presentations.html.haml +12 -0
- data/app/views/spina/admin/conferences/conferences/_form_rooms.html.haml +12 -0
- data/app/views/spina/admin/conferences/conferences/_form_structure.html.haml +19 -0
- data/app/views/spina/admin/conferences/conferences/_form_structure_item.html.haml +13 -0
- data/app/views/spina/admin/conferences/conferences/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/conferences/index.html.haml +18 -0
- data/app/views/spina/admin/conferences/conferences/new.html.haml +1 -0
- data/app/views/spina/admin/conferences/delegates/_delegate.html.haml +13 -0
- data/app/views/spina/admin/conferences/delegates/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/delegates/_form_conferences.html.haml +14 -0
- data/app/views/spina/admin/conferences/delegates/_form_delegate_details.html.haml +38 -0
- data/app/views/spina/admin/conferences/delegates/_form_presentations.html.haml +12 -0
- data/app/views/spina/admin/conferences/delegates/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/delegates/index.html.haml +23 -0
- data/app/views/spina/admin/conferences/delegates/new.html.haml +1 -0
- data/app/views/spina/admin/conferences/dietary_requirements/_dietary_requirement.html.haml +6 -0
- data/app/views/spina/admin/conferences/dietary_requirements/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/dietary_requirements/_form_delegates.html.haml +12 -0
- data/app/views/spina/admin/conferences/dietary_requirements/_form_dietary_requirement_details.html.haml +9 -0
- data/app/views/spina/admin/conferences/dietary_requirements/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/dietary_requirements/index.html.haml +15 -0
- data/app/views/spina/admin/conferences/dietary_requirements/new.html.haml +1 -0
- data/app/views/spina/admin/conferences/events/new.js.erb +27 -0
- data/app/views/spina/admin/conferences/institutions/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/institutions/_form_delegates.html.haml +12 -0
- data/app/views/spina/admin/conferences/institutions/_form_institution_details.html.haml +35 -0
- data/app/views/spina/admin/conferences/institutions/_form_rooms.html.haml +12 -0
- data/app/views/spina/admin/conferences/institutions/_institution.html.haml +7 -0
- data/app/views/spina/admin/conferences/institutions/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/institutions/index.html.haml +16 -0
- data/app/views/spina/admin/conferences/institutions/new.html.haml +1 -0
- data/app/views/spina/admin/conferences/presentation_attachment_types/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/presentation_attachment_types/_presentation_attachment_type.html.haml +6 -0
- data/app/views/spina/admin/conferences/presentation_attachment_types/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/presentation_attachment_types/index.html.haml +15 -0
- data/app/views/spina/admin/conferences/presentation_attachment_types/new.html.haml +1 -0
- data/app/views/spina/admin/conferences/presentation_attachments/new.js.erb +21 -0
- data/app/views/spina/admin/conferences/presentation_types/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/presentation_types/_form_presentation_type_details.html.haml +20 -0
- data/app/views/spina/admin/conferences/presentation_types/_form_presentations.html.haml +12 -0
- data/app/views/spina/admin/conferences/presentation_types/_form_sessions.html.haml +12 -0
- data/app/views/spina/admin/conferences/presentation_types/_presentation_type.html.haml +8 -0
- data/app/views/spina/admin/conferences/presentation_types/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/presentation_types/index.html.haml +17 -0
- data/app/views/spina/admin/conferences/presentation_types/new.html.haml +1 -0
- data/app/views/spina/admin/conferences/presentations/_attachment_fields.html.haml +27 -0
- data/app/views/spina/admin/conferences/presentations/_attachment_row.html.haml +2 -0
- data/app/views/spina/admin/conferences/presentations/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/presentations/_form_presentation_details.html.haml +55 -0
- data/app/views/spina/admin/conferences/presentations/_form_presenters.html.haml +12 -0
- data/app/views/spina/admin/conferences/presentations/_presentation.html.haml +11 -0
- data/app/views/spina/admin/conferences/presentations/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/presentations/index.html.haml +23 -0
- data/app/views/spina/admin/conferences/presentations/new.html.haml +1 -0
- data/app/views/spina/admin/conferences/rooms/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/rooms/_form_presentations.html.haml +12 -0
- data/app/views/spina/admin/conferences/rooms/_form_room_details.html.haml +18 -0
- data/app/views/spina/admin/conferences/rooms/_room.html.haml +8 -0
- data/app/views/spina/admin/conferences/rooms/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/rooms/index.html.haml +17 -0
- data/app/views/spina/admin/conferences/rooms/new.html.haml +1 -0
- data/app/views/spina/admin/conferences/sessions/_form.html.haml +23 -0
- data/app/views/spina/admin/conferences/sessions/_form_presentations.html.haml +12 -0
- data/app/views/spina/admin/conferences/sessions/_form_session_details.html.haml +23 -0
- data/app/views/spina/admin/conferences/sessions/_session.html.haml +8 -0
- data/app/views/spina/admin/conferences/sessions/edit.html.haml +1 -0
- data/app/views/spina/admin/conferences/sessions/index.html.haml +17 -0
- data/app/views/spina/admin/conferences/sessions/new.html.haml +1 -0
- data/app/views/spina/admin/hooks/conferences/_head.html.haml +2 -0
- data/app/views/spina/admin/hooks/conferences/_primary_navigation.html.haml +20 -0
- data/app/views/spina/admin/hooks/conferences/_settings_secondary_navigation.html.haml +4 -0
- data/app/views/spina/admin/partables/admin/conferences/date_parts/_form.html.haml +5 -0
- data/app/views/spina/admin/partables/admin/conferences/email_address_parts/_form.html.haml +5 -0
- data/app/views/spina/admin/partables/admin/conferences/time_parts/_form.html.haml +7 -0
- data/app/views/spina/admin/partables/admin/conferences/url_parts/_form.html.haml +5 -0
- data/config/initializers/assets.rb +13 -0
- data/config/initializers/types.rb +13 -0
- data/config/locales/en.yml +354 -0
- data/config/routes.rb +27 -0
- data/db/migrate/20180907141228_create_spina_dates.rb +11 -0
- data/db/migrate/20180907141229_create_spina_email_addresses.rb +11 -0
- data/db/migrate/20180907141230_create_spina_urls.rb +11 -0
- data/db/migrate/20180907141231_create_spina_conferences_institutions.rb +12 -0
- data/db/migrate/20180907141232_create_spina_conferences_delegates.rb +15 -0
- data/db/migrate/20180907141234_create_spina_conferences_dietary_requirements.rb +11 -0
- data/db/migrate/20180907141235_create_spina_conferences_conferences.rb +12 -0
- data/db/migrate/20180907141236_create_spina_conferences_presentation_types.rb +13 -0
- data/db/migrate/20180907141238_create_join_table_spina_conferences_conference_delegate.rb +7 -0
- data/db/migrate/20180907141239_create_join_table_spina_conferences_delegate_presentation.rb +7 -0
- data/db/migrate/20180907141240_create_join_table_spina_conferences_delegate_dietary_requirement.rb +7 -0
- data/db/migrate/20180907141242_add_type_to_spina_pages.rb +7 -0
- data/db/migrate/20180907141243_create_spina_conferences_conference_page_parts.rb +14 -0
- data/db/migrate/20180914121905_add_logo_ref_to_spina_conferences_institutions.rb +7 -0
- data/db/migrate/20180916135431_create_spina_conferences_rooms.rb +13 -0
- data/db/migrate/20180916135432_create_spina_conferences_room_possessions.rb +10 -0
- data/db/migrate/20180916135433_create_spina_conferences_room_uses.rb +10 -0
- data/db/migrate/20180916135434_create_spina_conferences_presentations.rb +15 -0
- data/db/migrate/20181009122503_create_spina_times.rb +11 -0
- data/db/migrate/20181009130631_rename_spina_page_parts.rb +10 -0
- data/db/migrate/20181012190811_rename_spina_conferences_page_parts.rb +10 -0
- data/db/migrate/20181012213049_change_start_time_in_spina_conferences_conferences.rb +15 -0
- data/db/migrate/20181012214813_rename_start_time_in_spina_conferences_conferences.rb +7 -0
- data/db/migrate/20181017155705_add_dependent_option_to_foreign_keys.rb +36 -0
- data/db/migrate/20190408131354_change_spina_resources.rb +56 -0
- data/db/migrate/20190622131423_create_spina_conferences_parts.rb +12 -0
- data/db/migrate/20190701174807_remove_spina_conference_pages.rb +199 -0
- data/db/migrate/20190704135524_add_constraints_to_columns.rb +24 -0
- data/db/migrate/20200126034441_create_spina_conferences_presentation_attachment_types.rb +11 -0
- data/db/migrate/20200126213718_create_spina_conferences_presentation_attachments.rb +19 -0
- data/db/migrate/20200420104603_create_spina_conferences_dietary_requirement_name_translations.rb +19 -0
- data/db/migrate/20200420104740_create_spina_conferences_institution_name_and_city_translations.rb +20 -0
- data/db/migrate/20200420105057_create_spina_conferences_presentation_title_and_abstract_translations.rb +20 -0
- data/db/migrate/20200420105144_create_spina_conferences_presentation_attachment_type_name_translations.rb +20 -0
- data/db/migrate/20200420105201_create_spina_conferences_presentation_type_name_translations.rb +19 -0
- data/db/migrate/20200420105458_create_spina_conferences_room_building_and_number_translations.rb +20 -0
- data/db/migrate/20200420110407_move_attributes_to_translation_tables.rb +161 -0
- data/db/migrate/20200420120706_remove_name_from_spina_conferences_dietary_requirements.rb +7 -0
- data/db/migrate/20200420120759_remove_name_and_city_from_spina_conferences_institutions.rb +8 -0
- data/db/migrate/20200420120946_remove_title_and_abstract_from_spina_conferences_presentations.rb +8 -0
- data/db/migrate/20200420121310_remove_name_from_spina_conferences_presentation_attachment_types.rb +7 -0
- data/db/migrate/20200420121321_remove_name_from_spina_conferences_presentation_types.rb +7 -0
- data/db/migrate/20200420121443_remove_building_and_number_from_spina_conferences_rooms.rb +8 -0
- data/db/migrate/20200502133408_create_spina_conferences_conference_name_translations.rb +19 -0
- data/db/migrate/20200502183409_set_name_for_spina_conferences_conferences.rb +47 -0
- data/db/migrate/20200502183410_remove_institution_from_spina_conferences_conferences.rb +8 -0
- data/db/migrate/20200502183719_remove_spina_conferences_room_possessions.rb +60 -0
- data/db/migrate/20200503230732_rename_spina_conferences_room_uses.rb +8 -0
- data/db/migrate/20200510125131_create_spina_conferences_session_name_translations.rb +19 -0
- data/db/migrate/20200802165242_create_spina_conferences_events.rb +13 -0
- data/db/migrate/20200802184921_create_spina_conferences_event_name_description_and_location_translations.rb +21 -0
- data/db/migrate/20200911161632_update_spina_conferences_parts.rb +23 -0
- data/db/migrate/20200911161651_update_spina_parts.rb +37 -0
- data/db/migrate/20200911161726_move_presentation_parts.rb +101 -0
- data/db/migrate/20200911161739_move_conference_parts.rb +219 -0
- data/db/migrate/20201002122517_remove_spina_conferences_conference_page_parts.rb +14 -0
- data/db/migrate/20201007125625_add_timestamps_to_spina_conferences_parts.rb +9 -0
- data/lib/spina/admin/conferences.rb +20 -0
- data/lib/spina/admin/conferences/engine.rb +26 -0
- data/lib/spina/admin/conferences/migration/renaming.rb +81 -0
- data/lib/spina/admin/conferences/railtie.rb +34 -0
- data/lib/spina/admin/conferences/types/interval_type.rb +29 -0
- data/lib/spina/admin/conferences/version.rb +10 -0
- data/lib/tasks/spina/admin/conferences_tasks.rake +4 -0
- metadata +561 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class AddConstraintsToColumns < ActiveRecord::Migration[6.0] # :nodoc:
|
|
4
|
+
def change # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
|
5
|
+
change_column_null :spina_conferences_conferences, :dates, false
|
|
6
|
+
change_column_null :spina_conferences_conferences, :institution_id, false
|
|
7
|
+
change_column_null :spina_conferences_delegates, :first_name, false
|
|
8
|
+
change_column_null :spina_conferences_delegates, :last_name, false
|
|
9
|
+
change_column_null :spina_conferences_delegates, :institution_id, false
|
|
10
|
+
change_column_null :spina_conferences_dietary_requirements, :name, false
|
|
11
|
+
change_column_null :spina_conferences_institutions, :name, false
|
|
12
|
+
change_column_null :spina_conferences_institutions, :city, false
|
|
13
|
+
change_column_null :spina_conferences_presentation_types, :name, false
|
|
14
|
+
change_column_null :spina_conferences_presentation_types, :duration, false
|
|
15
|
+
change_column_null :spina_conferences_presentation_types, :conference_id, false
|
|
16
|
+
change_column_null :spina_conferences_presentations, :title, false
|
|
17
|
+
change_column_null :spina_conferences_presentations, :abstract, false
|
|
18
|
+
change_column_null :spina_conferences_presentations, :start_datetime, false
|
|
19
|
+
change_column_null :spina_conferences_presentations, :room_use_id, false
|
|
20
|
+
change_column_null :spina_conferences_rooms, :number, false
|
|
21
|
+
change_column_null :spina_conferences_rooms, :building, false
|
|
22
|
+
change_column_null :spina_conferences_rooms, :institution_id, false
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class CreateSpinaConferencesPresentationAttachmentTypes < ActiveRecord::Migration[6.0] # :nodoc:
|
|
4
|
+
def change
|
|
5
|
+
create_table :spina_conferences_presentation_attachment_types do |t|
|
|
6
|
+
t.string :name
|
|
7
|
+
|
|
8
|
+
t.timestamps null: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class CreateSpinaConferencesPresentationAttachments < ActiveRecord::Migration[6.0] # :nodoc:
|
|
4
|
+
def change # rubocop:disable Metrics/MethodLength
|
|
5
|
+
create_table :spina_conferences_presentation_attachments do |t|
|
|
6
|
+
t.references :presentation,
|
|
7
|
+
null: false, foreign_key: { to_table: :spina_conferences_presentations, on_delete: :cascade },
|
|
8
|
+
index: { name: 'index_conferences_presentation_attachments_on_presentation_id' }
|
|
9
|
+
t.references :attachment_type,
|
|
10
|
+
null: false,
|
|
11
|
+
foreign_key: { to_table: :spina_conferences_presentation_attachment_types, on_delete: :cascade },
|
|
12
|
+
index: { name: 'index_conferences_presentation_attachments_on_type_id' }
|
|
13
|
+
t.references :attachment, foreign_key: { to_table: :spina_attachments, on_delete: :nullify },
|
|
14
|
+
index: { name: 'index_conferences_presentation_attachments_on_attachment_id' }
|
|
15
|
+
|
|
16
|
+
t.timestamps null: false
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
data/db/migrate/20200420104603_create_spina_conferences_dietary_requirement_name_translations.rb
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class CreateSpinaConferencesDietaryRequirementNameTranslations < ActiveRecord::Migration[6.0] # :nodoc:
|
|
4
|
+
def change
|
|
5
|
+
create_table :spina_conferences_dietary_requirement_translations do |t|
|
|
6
|
+
# Translated attribute(s)
|
|
7
|
+
t.string :name
|
|
8
|
+
|
|
9
|
+
t.string :locale, null: false
|
|
10
|
+
t.references :spina_conferences_dietary_requirement, null: false, foreign_key: { on_delete: :cascade }, index: false
|
|
11
|
+
|
|
12
|
+
t.timestamps null: false
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
add_index :spina_conferences_dietary_requirement_translations, :locale, name: :index_e52faf9b7cbf3a3d55057c84094a3a10b5de6fdd
|
|
16
|
+
add_index :spina_conferences_dietary_requirement_translations, %i[spina_conferences_dietary_requirement_id locale],
|
|
17
|
+
name: :index_70c4d45aefa2ef2619dd91b976391c1025d86e89, unique: true
|
|
18
|
+
end
|
|
19
|
+
end
|
data/db/migrate/20200420104740_create_spina_conferences_institution_name_and_city_translations.rb
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class CreateSpinaConferencesInstitutionNameAndCityTranslations < ActiveRecord::Migration[6.0] # :nodoc:
|
|
4
|
+
def change
|
|
5
|
+
create_table :spina_conferences_institution_translations do |t|
|
|
6
|
+
# Translated attribute(s)
|
|
7
|
+
t.string :name
|
|
8
|
+
t.string :city
|
|
9
|
+
|
|
10
|
+
t.string :locale, null: false
|
|
11
|
+
t.references :spina_conferences_institution, null: false, foreign_key: { on_delete: :cascade }, index: false
|
|
12
|
+
|
|
13
|
+
t.timestamps null: false
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
add_index :spina_conferences_institution_translations, :locale, name: :index_9bff91c74e064cdc801502a3787ebe9a10fdecd1
|
|
17
|
+
add_index :spina_conferences_institution_translations, %i[spina_conferences_institution_id locale],
|
|
18
|
+
name: :index_28cf5cb308f9303c2ac50856f314ece46e11d90e, unique: true
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class CreateSpinaConferencesPresentationTitleAndAbstractTranslations < ActiveRecord::Migration[6.0] # :nodoc:
|
|
4
|
+
def change
|
|
5
|
+
create_table :spina_conferences_presentation_translations do |t|
|
|
6
|
+
# Translated attribute(s)
|
|
7
|
+
t.string :title
|
|
8
|
+
t.text :abstract
|
|
9
|
+
|
|
10
|
+
t.string :locale, null: false
|
|
11
|
+
t.references :spina_conferences_presentation, null: false, foreign_key: { on_delete: :cascade }, index: false
|
|
12
|
+
|
|
13
|
+
t.timestamps null: false
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
add_index :spina_conferences_presentation_translations, :locale, name: :index_0cda3821bc3be79968f9671e2a1d655e2307ad5b
|
|
17
|
+
add_index :spina_conferences_presentation_translations, %i[spina_conferences_presentation_id locale],
|
|
18
|
+
name: :index_a9e38adc19b163962a915fe8d3d1f2415f0c83a0, unique: true
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class CreateSpinaConferencesPresentationAttachmentTypeNameTranslations < ActiveRecord::Migration[6.0] # :nodoc:
|
|
4
|
+
def change
|
|
5
|
+
create_table :spina_conferences_presentation_attachment_type_translations do |t|
|
|
6
|
+
# Translated attribute(s)
|
|
7
|
+
t.string :name
|
|
8
|
+
|
|
9
|
+
t.string :locale, null: false
|
|
10
|
+
t.references :spina_conferences_presentation_attachment_type,
|
|
11
|
+
null: false, foreign_key: { on_delete: :cascade }, index: false
|
|
12
|
+
|
|
13
|
+
t.timestamps null: false
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
add_index :spina_conferences_presentation_attachment_type_translations, :locale, name: :index_f3417b08c78b5a87825d3f14b49fb06e76b8bed4
|
|
17
|
+
add_index :spina_conferences_presentation_attachment_type_translations, %i[spina_conferences_presentation_attachment_type_id locale],
|
|
18
|
+
name: :index_1b650dff92fcf8462275bfd83c507ea5c40b3ebb, unique: true
|
|
19
|
+
end
|
|
20
|
+
end
|
data/db/migrate/20200420105201_create_spina_conferences_presentation_type_name_translations.rb
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class CreateSpinaConferencesPresentationTypeNameTranslations < ActiveRecord::Migration[6.0] # :nodoc:
|
|
4
|
+
def change
|
|
5
|
+
create_table :spina_conferences_presentation_type_translations do |t|
|
|
6
|
+
# Translated attribute(s)
|
|
7
|
+
t.string :name
|
|
8
|
+
|
|
9
|
+
t.string :locale, null: false
|
|
10
|
+
t.references :spina_conferences_presentation_type, null: false, foreign_key: { on_delete: :cascade }, index: false
|
|
11
|
+
|
|
12
|
+
t.timestamps null: false
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
add_index :spina_conferences_presentation_type_translations, :locale, name: :index_22c39c0f300797c95ab75d46960dc27730d2065f
|
|
16
|
+
add_index :spina_conferences_presentation_type_translations, %i[spina_conferences_presentation_type_id locale],
|
|
17
|
+
name: :index_fa3b8cb99b12895308e3fc943d6db212ce4408d0, unique: true
|
|
18
|
+
end
|
|
19
|
+
end
|
data/db/migrate/20200420105458_create_spina_conferences_room_building_and_number_translations.rb
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class CreateSpinaConferencesRoomBuildingAndNumberTranslations < ActiveRecord::Migration[6.0] # :nodoc:
|
|
4
|
+
def change
|
|
5
|
+
create_table :spina_conferences_room_translations do |t|
|
|
6
|
+
# Translated attribute(s)
|
|
7
|
+
t.string :building
|
|
8
|
+
t.string :number
|
|
9
|
+
|
|
10
|
+
t.string :locale, null: false
|
|
11
|
+
t.references :spina_conferences_room, null: false, foreign_key: { on_delete: :cascade }, index: false
|
|
12
|
+
|
|
13
|
+
t.timestamps null: false
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
add_index :spina_conferences_room_translations, :locale, name: :index_spina_conferences_room_translations_on_locale
|
|
17
|
+
add_index :spina_conferences_room_translations, %i[spina_conferences_room_id locale],
|
|
18
|
+
name: :index_a83edb40b92a36d42b882b3a9adf6d2be543dee7, unique: true
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class MoveAttributesToTranslationTables < ActiveRecord::Migration[6.0] # :nodoc:
|
|
4
|
+
def up
|
|
5
|
+
insert_dietary_requirement_translations
|
|
6
|
+
insert_institution_translations
|
|
7
|
+
insert_presentation_translations
|
|
8
|
+
insert_presentation_attachment_type_translations
|
|
9
|
+
insert_presentation_type_translations
|
|
10
|
+
insert_room_translations
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def down
|
|
14
|
+
update_dietary_requirements
|
|
15
|
+
update_institutions
|
|
16
|
+
update_presentations
|
|
17
|
+
update_presentation_attachment_types
|
|
18
|
+
update_presentation_types
|
|
19
|
+
update_rooms
|
|
20
|
+
add_null_constraints
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
def add_null_constraints
|
|
26
|
+
change_column_null :spina_conferences_dietary_requirements, :name, false
|
|
27
|
+
change_column_null :spina_conferences_institutions, :name, false
|
|
28
|
+
change_column_null :spina_conferences_institutions, :city, false
|
|
29
|
+
change_column_null :spina_conferences_presentation_types, :name, false
|
|
30
|
+
change_column_null :spina_conferences_presentation_attachment_types, :name, false
|
|
31
|
+
change_column_null :spina_conferences_presentations, :title, false
|
|
32
|
+
change_column_null :spina_conferences_presentations, :abstract, false
|
|
33
|
+
change_column_null :spina_conferences_rooms, :number, false
|
|
34
|
+
change_column_null :spina_conferences_rooms, :building, false
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def update_dietary_requirements
|
|
38
|
+
binds = [ActiveRecord::Relation::QueryAttribute.new('locale', I18n.default_locale, ActiveRecord::Type::String.new)]
|
|
39
|
+
update <<-SQL.squish, 'Add dietary requirement attributes', binds
|
|
40
|
+
UPDATE spina_conferences_dietary_requirements SET name = translations.name
|
|
41
|
+
FROM spina_conferences_dietary_requirement_translations AS translations
|
|
42
|
+
WHERE spina_conferences_dietary_requirement_id = spina_conferences_dietary_requirements.id AND locale = $1
|
|
43
|
+
SQL
|
|
44
|
+
delete <<-SQL.squish, 'Delete translations'
|
|
45
|
+
DELETE FROM spina_conferences_dietary_requirement_translations
|
|
46
|
+
SQL
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def update_institutions
|
|
50
|
+
binds = [ActiveRecord::Relation::QueryAttribute.new('locale', I18n.default_locale, ActiveRecord::Type::String.new)]
|
|
51
|
+
update <<-SQL.squish, 'Add institution attributes', binds
|
|
52
|
+
UPDATE spina_conferences_institutions SET (name, city) = (translations.name, translations.city)
|
|
53
|
+
FROM spina_conferences_institution_translations AS translations
|
|
54
|
+
WHERE translations.spina_conferences_institution_id = spina_conferences_institutions.id AND locale = $1
|
|
55
|
+
SQL
|
|
56
|
+
delete <<-SQL.squish, 'Delete translations'
|
|
57
|
+
DELETE FROM spina_conferences_institution_translations
|
|
58
|
+
SQL
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def update_presentations
|
|
62
|
+
binds = [ActiveRecord::Relation::QueryAttribute.new('locale', I18n.default_locale, ActiveRecord::Type::String.new)]
|
|
63
|
+
update <<-SQL.squish, 'Add presentation attributes', binds
|
|
64
|
+
UPDATE spina_conferences_presentations SET (title, abstract) = (translations.title, translations.abstract)
|
|
65
|
+
FROM spina_conferences_presentation_translations AS translations
|
|
66
|
+
WHERE spina_conferences_presentation_id = spina_conferences_presentations.id AND locale = $1
|
|
67
|
+
SQL
|
|
68
|
+
delete <<-SQL.squish, 'Delete translations'
|
|
69
|
+
DELETE FROM spina_conferences_presentation_translations
|
|
70
|
+
SQL
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def update_presentation_attachment_types
|
|
74
|
+
binds = [ActiveRecord::Relation::QueryAttribute.new('locale', I18n.default_locale, ActiveRecord::Type::String.new)]
|
|
75
|
+
update <<-SQL.squish, 'Add presentation attachment type attributes', binds
|
|
76
|
+
UPDATE spina_conferences_presentation_attachment_types SET name = translations.name
|
|
77
|
+
FROM spina_conferences_presentation_attachment_type_translations AS translations
|
|
78
|
+
WHERE spina_conferences_presentation_attachment_type_id = spina_conferences_presentation_attachment_types.id AND locale = $1
|
|
79
|
+
SQL
|
|
80
|
+
delete <<-SQL.squish, 'Delete translations'
|
|
81
|
+
DELETE FROM spina_conferences_presentation_attachment_type_translations
|
|
82
|
+
SQL
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def update_presentation_types
|
|
86
|
+
binds = [ActiveRecord::Relation::QueryAttribute.new('locale', I18n.default_locale, ActiveRecord::Type::String.new)]
|
|
87
|
+
update <<-SQL.squish, 'Add presentation type attributes', binds
|
|
88
|
+
UPDATE spina_conferences_presentation_types SET name = translations.name
|
|
89
|
+
FROM spina_conferences_presentation_type_translations AS translations
|
|
90
|
+
WHERE spina_conferences_presentation_type_id = spina_conferences_presentation_types.id AND locale = $1
|
|
91
|
+
SQL
|
|
92
|
+
delete <<-SQL.squish, 'Delete translations'
|
|
93
|
+
DELETE FROM spina_conferences_presentation_type_translations
|
|
94
|
+
SQL
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def update_rooms
|
|
98
|
+
binds = [ActiveRecord::Relation::QueryAttribute.new('locale', I18n.default_locale, ActiveRecord::Type::String.new)]
|
|
99
|
+
update <<-SQL.squish, 'Add room attributes', binds
|
|
100
|
+
UPDATE spina_conferences_rooms SET (building, number) = (translations.building, translations.number)
|
|
101
|
+
FROM spina_conferences_room_translations AS translations
|
|
102
|
+
WHERE spina_conferences_room_id = spina_conferences_rooms.id AND locale = $1
|
|
103
|
+
SQL
|
|
104
|
+
delete <<-SQL.squish, 'Delete translations'
|
|
105
|
+
DELETE FROM spina_conferences_room_translations
|
|
106
|
+
SQL
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def insert_dietary_requirement_translations
|
|
110
|
+
binds = [ActiveRecord::Relation::QueryAttribute.new('locale', I18n.default_locale, ActiveRecord::Type::String.new)]
|
|
111
|
+
insert <<-SQL.squish, 'Insert dietary requirement translations', nil, nil, nil, binds
|
|
112
|
+
INSERT INTO spina_conferences_dietary_requirement_translations
|
|
113
|
+
(name, locale, created_at, updated_at, spina_conferences_dietary_requirement_id)
|
|
114
|
+
SELECT name, $1, created_at, updated_at, id FROM spina_conferences_dietary_requirements
|
|
115
|
+
SQL
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def insert_institution_translations
|
|
119
|
+
binds = [ActiveRecord::Relation::QueryAttribute.new('locale', I18n.default_locale, ActiveRecord::Type::String.new)]
|
|
120
|
+
insert <<-SQL.squish, 'Insert institution translations', nil, nil, nil, binds
|
|
121
|
+
INSERT INTO spina_conferences_institution_translations
|
|
122
|
+
(name, city, locale, created_at, updated_at, spina_conferences_institution_id)
|
|
123
|
+
SELECT name, city, $1, created_at, updated_at, id FROM spina_conferences_institutions
|
|
124
|
+
SQL
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def insert_presentation_translations
|
|
128
|
+
binds = [ActiveRecord::Relation::QueryAttribute.new('locale', I18n.default_locale, ActiveRecord::Type::String.new)]
|
|
129
|
+
insert <<-SQL.squish, 'Insert presentation translations', nil, nil, nil, binds
|
|
130
|
+
INSERT INTO spina_conferences_presentation_translations
|
|
131
|
+
(title, abstract, locale, created_at, updated_at, spina_conferences_presentation_id)
|
|
132
|
+
SELECT title, abstract, $1, created_at, updated_at, id FROM spina_conferences_presentations
|
|
133
|
+
SQL
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def insert_presentation_attachment_type_translations
|
|
137
|
+
binds = [ActiveRecord::Relation::QueryAttribute.new('locale', I18n.default_locale, ActiveRecord::Type::String.new)]
|
|
138
|
+
insert <<-SQL.squish, 'Insert presentation attachment type translations', nil, nil, nil, binds
|
|
139
|
+
INSERT INTO spina_conferences_presentation_attachment_type_translations
|
|
140
|
+
(name, locale, created_at, updated_at, spina_conferences_presentation_attachment_type_id)
|
|
141
|
+
SELECT name, $1, created_at, updated_at, id FROM spina_conferences_presentation_attachment_types
|
|
142
|
+
SQL
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
def insert_presentation_type_translations
|
|
146
|
+
binds = [ActiveRecord::Relation::QueryAttribute.new('locale', I18n.default_locale, ActiveRecord::Type::String.new)]
|
|
147
|
+
insert <<-SQL.squish, 'Insert presentation type translations', nil, nil, nil, binds
|
|
148
|
+
INSERT INTO spina_conferences_presentation_type_translations
|
|
149
|
+
(name, locale, created_at, updated_at, spina_conferences_presentation_type_id)
|
|
150
|
+
SELECT name, $1, created_at, updated_at, id FROM spina_conferences_presentation_types
|
|
151
|
+
SQL
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def insert_room_translations
|
|
155
|
+
binds = [ActiveRecord::Relation::QueryAttribute.new('locale', I18n.default_locale, ActiveRecord::Type::String.new)]
|
|
156
|
+
insert <<-SQL.squish, 'Insert room translations', nil, nil, nil, binds
|
|
157
|
+
INSERT INTO spina_conferences_room_translations (building, number, locale, created_at, updated_at, spina_conferences_room_id)
|
|
158
|
+
SELECT building, number, $1, created_at, updated_at, id FROM spina_conferences_rooms
|
|
159
|
+
SQL
|
|
160
|
+
end
|
|
161
|
+
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class RemoveNameAndCityFromSpinaConferencesInstitutions < ActiveRecord::Migration[6.0] # :nodoc:
|
|
4
|
+
def change
|
|
5
|
+
remove_column :spina_conferences_institutions, :name, :string
|
|
6
|
+
remove_column :spina_conferences_institutions, :city, :string
|
|
7
|
+
end
|
|
8
|
+
end
|
data/db/migrate/20200420120946_remove_title_and_abstract_from_spina_conferences_presentations.rb
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class RemoveTitleAndAbstractFromSpinaConferencesPresentations < ActiveRecord::Migration[6.0] # :nodoc:
|
|
4
|
+
def change
|
|
5
|
+
remove_column :spina_conferences_presentations, :title, :string
|
|
6
|
+
remove_column :spina_conferences_presentations, :abstract, :text
|
|
7
|
+
end
|
|
8
|
+
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class RemoveBuildingAndNumberFromSpinaConferencesRooms < ActiveRecord::Migration[6.0] # :nodoc:
|
|
4
|
+
def change
|
|
5
|
+
remove_column :spina_conferences_rooms, :building, :string
|
|
6
|
+
remove_column :spina_conferences_rooms, :number, :string
|
|
7
|
+
end
|
|
8
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class CreateSpinaConferencesConferenceNameTranslations < ActiveRecord::Migration[6.0] # :nodoc:
|
|
4
|
+
def change
|
|
5
|
+
create_table :spina_conferences_conference_translations do |t|
|
|
6
|
+
# Translated attribute(s)
|
|
7
|
+
t.string :name
|
|
8
|
+
|
|
9
|
+
t.string :locale, null: false
|
|
10
|
+
t.references :spina_conferences_conference, null: false, foreign_key: true, index: false
|
|
11
|
+
|
|
12
|
+
t.timestamps null: false
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
add_index :spina_conferences_conference_translations, :locale, name: :index_b1ed8f417185e6e49c50c1f2119c86824e3e3a22
|
|
16
|
+
add_index :spina_conferences_conference_translations, %i[spina_conferences_conference_id locale],
|
|
17
|
+
name: :index_0022b227e0816c00e61de831f2d638f1b305868e, unique: true
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class SetNameForSpinaConferencesConferences < ActiveRecord::Migration[6.0] # :nodoc:
|
|
4
|
+
def up
|
|
5
|
+
add_translations
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def down
|
|
9
|
+
set_institution_from_room
|
|
10
|
+
delete_translations
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
private
|
|
14
|
+
|
|
15
|
+
def set_institution_from_room
|
|
16
|
+
update <<-SQL.squish, 'Set institution from room'
|
|
17
|
+
UPDATE spina_conferences_conferences SET (institution_id) = (
|
|
18
|
+
SELECT spina_conferences_rooms.institution_id
|
|
19
|
+
FROM spina_conferences_presentation_types
|
|
20
|
+
INNER JOIN spina_conferences_room_uses ON spina_conferences_presentation_types.id = presentation_type_id
|
|
21
|
+
INNER JOIN spina_conferences_room_possessions ON spina_conferences_room_possessions.id = room_possession_id
|
|
22
|
+
INNER JOIN spina_conferences_rooms ON spina_conferences_rooms.id = room_id
|
|
23
|
+
WHERE spina_conferences_conferences.id = spina_conferences_presentation_types.conference_id
|
|
24
|
+
ORDER BY room_id
|
|
25
|
+
LIMIT 1
|
|
26
|
+
)
|
|
27
|
+
SQL
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def delete_translations
|
|
31
|
+
delete <<-SQL.squish, 'Delete translations'
|
|
32
|
+
DELETE FROM spina_conferences_conference_translations
|
|
33
|
+
SQL
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def add_translations
|
|
37
|
+
binds = [ActiveRecord::Relation::QueryAttribute.new('locale', I18n.default_locale, ActiveRecord::Type::String.new)]
|
|
38
|
+
insert <<-SQL.squish, 'Add translations', nil, nil, nil, binds
|
|
39
|
+
INSERT INTO spina_conferences_conference_translations (locale, spina_conferences_conference_id, name, created_at, updated_at)
|
|
40
|
+
SELECT $1, spina_conferences_conferences.id,
|
|
41
|
+
concat_ws(' ', spina_conferences_institution_translations.name, date_part('year', lower(dates))),
|
|
42
|
+
spina_conferences_conferences.created_at, spina_conferences_conferences.updated_at
|
|
43
|
+
FROM spina_conferences_conferences
|
|
44
|
+
INNER JOIN spina_conferences_institution_translations ON spina_conferences_institution_id = institution_id AND locale = $1
|
|
45
|
+
SQL
|
|
46
|
+
end
|
|
47
|
+
end
|