spina-admin-conferences-fork 2.1.1 → 3.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +40 -57
  3. data/app/assets/config/spina_admin_conferences_manifest.js +3 -3
  4. data/app/assets/javascripts/spina/admin/conferences/application.js +0 -4
  5. data/app/assets/javascripts/{controllers/spina/admin/conferences → spina/admin/conferences/controllers}/select_options_controller.js +1 -1
  6. data/app/assets/stylesheets/spina/admin/conferences/application.tailwind.css +0 -0
  7. data/app/components/spina/admin/conferences/application_component.rb +11 -0
  8. data/app/components/spina/admin/conferences/form_group_component.html.haml +4 -0
  9. data/app/components/spina/admin/conferences/form_group_component.rb +17 -0
  10. data/app/controllers/spina/admin/conferences/application_controller.rb +8 -1
  11. data/app/controllers/spina/admin/conferences/conferences_controller.rb +13 -25
  12. data/app/controllers/spina/admin/conferences/delegates_controller.rb +12 -24
  13. data/app/controllers/spina/admin/conferences/dietary_requirements_controller.rb +12 -24
  14. data/app/controllers/spina/admin/conferences/institutions_controller.rb +12 -24
  15. data/app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb +12 -24
  16. data/app/controllers/spina/admin/conferences/presentation_types_controller.rb +12 -26
  17. data/app/controllers/spina/admin/conferences/presentations_controller.rb +12 -24
  18. data/app/controllers/spina/admin/conferences/rooms_controller.rb +12 -26
  19. data/app/controllers/spina/admin/conferences/sessions_controller.rb +12 -26
  20. data/app/jobs/spina/admin/conferences/import_job.rb +2 -2
  21. data/app/models/spina/admin/conferences/conference.rb +1 -1
  22. data/app/models/spina/admin/conferences/delegate.rb +3 -3
  23. data/app/models/spina/admin/conferences/presentation.rb +1 -1
  24. data/app/views/spina/admin/conferences/application/_conferences.html.haml +10 -11
  25. data/app/views/spina/admin/conferences/application/_delegates.html.haml +9 -10
  26. data/app/views/spina/admin/conferences/application/_dietary_requirements.html.haml +7 -8
  27. data/app/views/spina/admin/conferences/application/_empty_list.html.haml +1 -1
  28. data/app/views/spina/admin/conferences/application/_institutions.html.haml +8 -9
  29. data/app/views/spina/admin/conferences/application/_presentation_attachment_types.html.haml +8 -9
  30. data/app/views/spina/admin/conferences/application/_presentation_types.html.haml +9 -10
  31. data/app/views/spina/admin/conferences/application/_presentations.html.haml +9 -10
  32. data/app/views/spina/admin/conferences/application/_rooms.html.haml +9 -10
  33. data/app/views/spina/admin/conferences/application/_sessions.html.haml +9 -10
  34. data/app/views/spina/admin/conferences/conferences/_conference.html.haml +13 -9
  35. data/app/views/spina/admin/conferences/conferences/_event_fields.html.haml +18 -25
  36. data/app/views/spina/admin/conferences/conferences/_form.html.haml +24 -22
  37. data/app/views/spina/admin/conferences/conferences/_form_conference_details.html.haml +29 -22
  38. data/app/views/spina/admin/conferences/conferences/_form_delegates.html.haml +1 -0
  39. data/app/views/spina/admin/conferences/conferences/_form_parts.html.haml +6 -7
  40. data/app/views/spina/admin/conferences/conferences/_form_presentation_types.html.haml +1 -0
  41. data/app/views/spina/admin/conferences/conferences/_form_presentations.html.haml +1 -0
  42. data/app/views/spina/admin/conferences/conferences/_form_rooms.html.haml +1 -0
  43. data/app/views/spina/admin/conferences/conferences/index.html.haml +25 -5
  44. data/app/views/spina/admin/conferences/delegates/_delegate.html.haml +10 -12
  45. data/app/views/spina/admin/conferences/delegates/_form.html.haml +23 -19
  46. data/app/views/spina/admin/conferences/delegates/_form_conferences.html.haml +1 -0
  47. data/app/views/spina/admin/conferences/delegates/_form_delegate_details.html.haml +24 -53
  48. data/app/views/spina/admin/conferences/delegates/_form_presentations.html.haml +1 -0
  49. data/app/views/spina/admin/conferences/delegates/index.html.haml +17 -11
  50. data/app/views/spina/admin/conferences/dietary_requirements/_dietary_requirement.html.haml +7 -6
  51. data/app/views/spina/admin/conferences/dietary_requirements/_form.html.haml +23 -18
  52. data/app/views/spina/admin/conferences/dietary_requirements/_form_delegates.html.haml +1 -0
  53. data/app/views/spina/admin/conferences/dietary_requirements/_form_dietary_requirement_details.html.haml +4 -8
  54. data/app/views/spina/admin/conferences/dietary_requirements/index.html.haml +9 -5
  55. data/app/views/spina/admin/conferences/institutions/_form.html.haml +23 -19
  56. data/app/views/spina/admin/conferences/institutions/_form_delegates.html.haml +1 -0
  57. data/app/views/spina/admin/conferences/institutions/_form_institution_details.html.haml +25 -25
  58. data/app/views/spina/admin/conferences/institutions/_form_rooms.html.haml +1 -0
  59. data/app/views/spina/admin/conferences/institutions/_institution.html.haml +9 -7
  60. data/app/views/spina/admin/conferences/institutions/index.html.haml +22 -5
  61. data/app/views/spina/admin/conferences/presentation_attachment_types/_form.html.haml +17 -20
  62. data/app/views/spina/admin/conferences/presentation_attachment_types/_presentation_attachment_type.html.haml +7 -6
  63. data/app/views/spina/admin/conferences/presentation_attachment_types/index.html.haml +9 -5
  64. data/app/views/spina/admin/conferences/presentation_types/_form.html.haml +23 -19
  65. data/app/views/spina/admin/conferences/presentation_types/_form_presentation_type_details.html.haml +8 -16
  66. data/app/views/spina/admin/conferences/presentation_types/_form_presentations.html.haml +1 -0
  67. data/app/views/spina/admin/conferences/presentation_types/_form_sessions.html.haml +1 -0
  68. data/app/views/spina/admin/conferences/presentation_types/_presentation_type.html.haml +11 -8
  69. data/app/views/spina/admin/conferences/presentation_types/index.html.haml +25 -5
  70. data/app/views/spina/admin/conferences/presentations/_attachment_fields.html.haml +10 -16
  71. data/app/views/spina/admin/conferences/presentations/_form.html.haml +23 -18
  72. data/app/views/spina/admin/conferences/presentations/_form_presentation_details.html.haml +56 -55
  73. data/app/views/spina/admin/conferences/presentations/_form_presenters.html.haml +1 -0
  74. data/app/views/spina/admin/conferences/presentations/_presentation.html.haml +10 -8
  75. data/app/views/spina/admin/conferences/presentations/index.html.haml +18 -11
  76. data/app/views/spina/admin/conferences/rooms/_form.html.haml +23 -18
  77. data/app/views/spina/admin/conferences/rooms/_form_presentations.html.haml +1 -0
  78. data/app/views/spina/admin/conferences/rooms/_form_room_details.html.haml +8 -16
  79. data/app/views/spina/admin/conferences/rooms/_room.html.haml +11 -8
  80. data/app/views/spina/admin/conferences/rooms/index.html.haml +22 -5
  81. data/app/views/spina/admin/conferences/sessions/_form.html.haml +23 -18
  82. data/app/views/spina/admin/conferences/sessions/_form_presentations.html.haml +1 -0
  83. data/app/views/spina/admin/conferences/sessions/_form_session_details.html.haml +14 -19
  84. data/app/views/spina/admin/conferences/sessions/_session.html.haml +11 -8
  85. data/app/views/spina/admin/conferences/sessions/index.html.haml +25 -5
  86. data/app/views/spina/admin/hooks/conferences/_head.html.haml +0 -6
  87. data/app/views/spina/admin/hooks/conferences/_primary_navigation.html.haml +25 -19
  88. data/app/views/spina/admin/hooks/conferences/_settings_secondary_navigation.html.haml +0 -6
  89. data/app/views/spina/admin/parts/admin/conferences/dates/_form.html.haml +2 -2
  90. data/app/views/spina/admin/parts/admin/conferences/email_addresses/_form.html.haml +2 -2
  91. data/app/views/spina/admin/parts/admin/conferences/times/_form.html.haml +2 -2
  92. data/app/views/spina/admin/parts/admin/conferences/urls/_form.html.haml +2 -2
  93. data/config/locales/en.yml +31 -40
  94. data/config/routes.rb +1 -4
  95. data/db/migrate/20180907141242_add_type_to_spina_pages.rb +1 -1
  96. data/db/migrate/20180907141243_create_spina_conferences_conference_page_parts.rb +1 -1
  97. data/db/migrate/20181017155705_add_dependent_option_to_foreign_keys.rb +1 -1
  98. data/db/migrate/20190408131354_change_spina_resources.rb +10 -10
  99. data/db/migrate/20190701174807_remove_spina_conference_pages.rb +15 -15
  100. data/db/migrate/20190704135524_add_constraints_to_columns.rb +1 -1
  101. data/db/migrate/20200126213718_create_spina_conferences_presentation_attachments.rb +1 -1
  102. data/db/migrate/20200802184921_create_spina_conferences_event_name_description_and_location_translations.rb +1 -1
  103. data/db/migrate/20200911161739_move_conference_parts.rb +3 -3
  104. data/db/migrate/20201002122517_remove_spina_conferences_conference_page_parts.rb +1 -1
  105. data/db/migrate/20201007125625_add_timestamps_to_spina_conferences_parts.rb +2 -2
  106. data/db/migrate/20210315164411_convert_partables_to_json.rb +10 -18
  107. data/db/migrate/20210417102513_add_locale_to_action_text_rich_texts.rb +1 -1
  108. data/lib/spina/admin/conferences/engine.rb +13 -0
  109. data/lib/spina/admin/conferences/migration/renaming.rb +4 -4
  110. data/lib/spina/admin/conferences/railtie.rb +1 -0
  111. data/lib/spina/admin/conferences/version.rb +1 -1
  112. data/lib/spina/admin/conferences.rb +1 -2
  113. metadata +65 -82
  114. data/app/assets/javascripts/controllers/spina/admin/conferences/conference_events_form_controller.js +0 -174
  115. data/app/assets/javascripts/controllers/spina/admin/conferences/presentation_attachments_form_controller.js +0 -174
  116. data/app/assets/javascripts/importmap.json.erb +0 -6
  117. data/app/assets/stylesheets/spina/admin/conferences/application.sass +0 -3
  118. data/app/controllers/spina/admin/conferences/events_controller.rb +0 -24
  119. data/app/controllers/spina/admin/conferences/presentation_attachments_controller.rb +0 -24
  120. data/app/views/layouts/spina/admin/conferences/application.html.haml +0 -6
  121. data/app/views/layouts/spina/admin/conferences/conferences.html.haml +0 -17
  122. data/app/views/layouts/spina/admin/conferences/delegates.html.haml +0 -8
  123. data/app/views/layouts/spina/admin/conferences/dietary_requirements.html.haml +0 -8
  124. data/app/views/layouts/spina/admin/conferences/institutions.html.haml +0 -15
  125. data/app/views/layouts/spina/admin/conferences/presentation_attachment_types.html.haml +0 -8
  126. data/app/views/layouts/spina/admin/conferences/presentations.html.haml +0 -8
  127. data/app/views/spina/admin/conferences/conferences/_event_row.html.haml +0 -5
  128. data/app/views/spina/admin/conferences/conferences/_form_structure.html.haml +0 -19
  129. data/app/views/spina/admin/conferences/conferences/_form_structure_item.html.haml +0 -13
  130. data/app/views/spina/admin/conferences/events/new.js.erb +0 -21
  131. data/app/views/spina/admin/conferences/presentation_attachments/new.js.erb +0 -21
  132. data/app/views/spina/admin/conferences/presentations/_attachment_row.html.haml +0 -2
  133. data/config/initializers/assets.rb +0 -13
@@ -1,7 +1,24 @@
1
- - content_for(:header_actions) do
2
- = link_to new_admin_conferences_room_path, class: %w[button button-primary], style: 'margin-right: 0' do
3
- = icon 'plus'
4
- = t '.new'
1
+ = render Spina::UserInterface::HeaderComponent.new do |header|
2
+ - header.actions do
3
+ .ml-3
4
+ = link_to new_admin_conferences_room_path, class: 'btn btn-primary w-full' do
5
+ = heroicon 'plus', style: :solid, class: 'w-7 h-7 -m1-2'
6
+ = t '.new'
7
+
8
+ - header.navigation do
9
+ %nav.-mb-1.md:-mb-3.mt-4
10
+ %ul.inline-flex.w-auto.rounded-md.bg-white
11
+ %li
12
+ = render Spina::UserInterface::TabLinkComponent.new(Spina::Admin::Conferences::Institution.model_name.human(count: 0),
13
+ admin_conferences_institutions_path,
14
+ active: controller_name == 'institutions')
15
+ %li
16
+ = render Spina::UserInterface::TabLinkComponent.new(Spina::Admin::Conferences::Room.model_name.human(count: 0),
17
+ admin_conferences_rooms_path,
18
+ active: controller_name == 'rooms')
19
+
5
20
 
6
21
  = render partial: 'rooms', object: @rooms
7
- = link_to_next_page @rooms, 'Next'
22
+ .ml-8.inline-flex
23
+ .btn.btn-primary= link_to_prev_page @rooms, 'Previous'
24
+ .btn.btn-primary= link_to_next_page @rooms, 'Next'
@@ -1,23 +1,28 @@
1
- - if @session.errors.any?
2
- - content_for :notifications do
3
- = render 'errors', errors: @session.errors
1
+ %div{ data: { controller: 'tabs',
2
+ tabs: { active: 'cursor-default text-gray-900 bg-spina-dark bg-opacity-10',
3
+ inactive: 'cursor-pointer bg-transparent text-gray-400 border-transparent' } } }
4
+ = render Spina::UserInterface::HeaderComponent.new do |header|
5
+ - header.actions do
6
+ - if @session.persisted?
7
+ = render Spina::UserInterface::DropdownComponent.new do |dropdown|
8
+ - dropdown.button(classes: "btn btn-default px-3") do
9
+ = heroicon('dots-horizontal', style: :solid, class: "w-5 h-5 text-gray-600")
4
10
 
5
- = form_for [:admin_conferences, @session], html: { autocomplete: 'off' } do |f|
6
- %header#header
7
- = render partial: 'spina/admin/shared/breadcrumbs'
11
+ - dropdown.menu do
12
+ = button_to t('spina.permanently_delete'), admin_conferences_session_path(@session), method: :delete, class: "block w-full text-left px-4 py-2 text-sm leading-5 font-medium text-red-500 cursor-pointer bg-white hover:bg-red-100 hover:bg-opacity-50 hover:text-red-500 focus:outline-none focus:bg-gray-100 focus:text-gray-900", form: {data: { controller: 'confirm', confirm_message: t('.delete_confirmation', session: @session.name) } }
8
13
 
9
- #header_actions
10
- %button.button.button-primary{ type: 'submit' }
11
- = icon 'check'
14
+ = button_tag type: :submit, form: dom_id(@session), class: 'btn btn-primary', data: { controller: 'button', action: 'button#loading', loading_message: t('spina.ui.saving')} do
15
+ = heroicon('check', style: :solid, class: 'w-5 h-5 mr-1 -ml-2')
12
16
  = t '.save'
13
17
 
14
- = link_to t('spina.cancel'), admin_conferences_sessions_path, class: 'button', style: 'margin-right: 0'
18
+ - header.navigation do
19
+ %nav.-mb-3.mt-4
20
+ %ul.inline-flex.w-auto.rounded-md.bg-white
21
+ - @tabs.each do |tab|
22
+ %button.block.px-3.leading-relaxed.py-1.hover:text-gray-800.rounded-md.text-gray-400.font-medium.text-sm.flex.items-center.whitespace-nowrap{ type: 'button', data: { action: 'tabs#show', 'tabs-target': 'button', 'pane-id': "#{tab}" } }
23
+ = t ".#{tab}"
15
24
 
16
- %nav#secondary.tabs
17
- %ul
18
- - @tabs.each_with_index do |tab, i|
19
- %li{ class: ('active'if i == 0)}
20
- = link_to t(".#{tab}"), "##{tab}"
21
-
22
- #session_details.tab-content.active= render 'form_session_details', f: f
23
- #presentations.tab-content= render partial: 'presentations', object: @session.presentations
25
+ .p-4.md:p-8
26
+ - @tabs.each_with_index do |tab, i|
27
+ %div{ 'data-tabs-target': 'pane', id: tab, hidden: i != 0 }
28
+ .max-w-5xl= render "form_#{tab}"
@@ -0,0 +1 @@
1
+ = render partial: 'presentations', object: @session.presentations
@@ -1,21 +1,16 @@
1
- .page-form
2
- .page-form-group
3
- .page-form-label= Spina::Admin::Conferences::Session.human_attribute_name :name
4
- .page-form-control= f.text_field :name, placeholder: Spina::Admin::Conferences::Session.human_attribute_name(:name), required: true
1
+ = form_with model: [spina, :admin_conferences, @session], id: dom_id(@session), html: { autocomplete: 'off' } do |f|
2
+ .-mt-6
3
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:name)) do
4
+ = render Spina::Forms::TextFieldComponent.new(f, :name)
5
5
 
6
- .page-form-group
7
- .page-form-label= Spina::Admin::Conferences::Session.human_attribute_name :presentation_type
8
- .page-form-control
9
- .input-group{ data: { controller: 'spina--admin--conferences--select-options', 'spina--admin--conferences--select_options': { record_value: @conferences } } }
10
- .select-dropdown= select_tag :conference_id, options_from_collection_for_select(Spina::Admin::Conferences::Conference.all, :id, :name, (@session.conference.id unless @session.conference.blank?)), include_blank: true, required: true, data: { action: 'spina--admin--conferences--select-options#setVisibility','spina--admin--conferences--select_options_target': 'select', text_key: 'name' }
11
- .select-dropdown= f.collection_select :presentation_type_id, @session.conference.present? ? @session.conference.presentation_types : Spina::Admin::Conferences::Conference.first.presentation_types, :id, :name, { include_blank: true }, required: true, data: {'spina--admin--conferences--select_options_target': 'select', text_key: 'name', key_path: 'presentation_types' }
6
+ %div{ data: { controller: 'select-options', 'select_options': { record_value: @conferences } } }
7
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:conference)) do
8
+ = select_tag :conference_id, options_from_collection_for_select(Spina::Admin::Conferences::Conference.all, :id, :name, (@session.conference.id unless @session.conference.blank?)), include_blank: true, data: { action: 'select-options#setVisibility','select_options_target': 'select', text_key: 'name' }
9
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:presentation_type)) do
10
+ = f.collection_select :presentation_type_id, @session.conference.present? ? @session.conference.presentation_types : Spina::Admin::Conferences::Conference.first.presentation_types, :id, :name, { include_blank: true }, data: {'select_options_target': 'select', text_key: 'name', key_path: 'presentation_types' }
12
11
 
13
- .page-form-group
14
- .page-form-label= Spina::Admin::Conferences::Session.human_attribute_name :room
15
- .page-form-control
16
- .input-group{ data: { controller: 'spina--admin--conferences--select-options', 'spina--admin--conferences--select_options': { record_value: @institutions } } }
17
- .select-dropdown= select_tag :institution_id, options_from_collection_for_select(Spina::Admin::Conferences::Institution.all, :id, :name, (@session.institution.id unless @session.institution.blank?)), include_blank: true, required: true, data: { action: 'spina--admin--conferences--select-options#setVisibility','spina--admin--conferences--select_options_target': 'select', text_key: 'name' }
18
- .select-dropdown= f.collection_select :room_id, @session.institution.present? ? @session.institution.rooms : Spina::Admin::Conferences::Institution.first.rooms, :id, :name, { include_blank: true }, required: true, data: {'spina--admin--conferences--select_options_target': 'select', text_key: 'name', key_path: 'rooms' }
19
-
20
- - unless @session.new_record?
21
- .pull-right= link_to t('spina.permanently_delete'), admin_conferences_session_path(@session), method: :delete, data: { confirm: t('.delete_confirmation', session: @session.name) }, class: %w[button button-link button-danger]
12
+ %div{ data: { controller: 'select-options', 'select_options': { record_value: @institutions } } }
13
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:institution)) do
14
+ = select_tag :institution_id, options_from_collection_for_select(Spina::Admin::Conferences::Institution.all, :id, :name, (@session.institution.id unless @session.institution.blank?)), include_blank: true, data: { action: 'select-options#setVisibility','select_options_target': 'select', text_key: 'name' }
15
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:room)) do
16
+ = f.collection_select :room_id, @session.institution.present? ? @session.institution.rooms : Spina::Admin::Conferences::Institution.first.rooms, :id, :name, { include_blank: true }, data: {'select_options_target': 'select', text_key: 'name', key_path: 'rooms' }
@@ -1,8 +1,11 @@
1
- %tr{ data: { session_id: session.id } }
2
- %td= link_to session.name, edit_admin_conferences_session_path(session)
3
- %td= session.presentation_type_name
4
- %td= session.room_name
5
- %td.align-right
6
- = link_to edit_admin_conferences_session_path(session), class: %w[button button-small button-link] do
7
- = icon 'pencil-outline'
8
- = t 'spina.edit'
1
+ %tr.border-b{ data: { session_id: session.id } }
2
+ %td= link_to session.name, edit_admin_conferences_session_path(session), class: 'block text-spina font-medium text-sm p-4 hover:text-spina-dark'
3
+ %td
4
+ .block.font-light.text-sm.p-4= session.presentation_type_name
5
+ %td
6
+ .block.font-light.text-sm.p-4= session.room_name
7
+ %td
8
+ = link_to edit_admin_conferences_session_path(session), class: 'btn btn-default mx-4 w-max' do
9
+ .flex.flex-nowrap.items-center.px-8.py-1
10
+ = heroicon 'pencil-alt', style: :outline, class: 'w-4 h-4'
11
+ .ml-2= t 'spina.edit'
@@ -1,7 +1,27 @@
1
- - content_for(:header_actions) do
2
- = link_to new_admin_conferences_session_path, class: %w[button button-primary], style: 'margin-right: 0' do
3
- = icon 'plus'
4
- = t '.new'
1
+ = render Spina::UserInterface::HeaderComponent.new do |header|
2
+ - header.actions do
3
+ .ml-3
4
+ = link_to new_admin_conferences_session_path, class: 'btn btn-primary w-full' do
5
+ = heroicon 'plus', style: :solid, class: 'w-7 h-7 -m1-2'
6
+ = t '.new'
7
+
8
+ - header.navigation do
9
+ %nav.-mb-1.md:-mb-3.mt-4
10
+ %ul.inline-flex.w-auto.rounded-md.bg-white
11
+ %li
12
+ = render Spina::UserInterface::TabLinkComponent.new(Spina::Admin::Conferences::Conference.model_name.human(count: 0),
13
+ admin_conferences_conferences_path,
14
+ active: controller_name == 'conferences')
15
+ %li
16
+ = render Spina::UserInterface::TabLinkComponent.new(Spina::Admin::Conferences::PresentationType.model_name.human(count: 0),
17
+ admin_conferences_presentation_types_path,
18
+ active: controller_name == 'presentation_types')
19
+ %li
20
+ = render Spina::UserInterface::TabLinkComponent.new(Spina::Admin::Conferences::Session.model_name.human(count: 0),
21
+ admin_conferences_sessions_path,
22
+ active: controller_name == 'sessions')
5
23
 
6
24
  = render partial: 'sessions', object: @sessions
7
- = link_to_next_page @sessions, 'Next'
25
+ .ml-8.inline-flex
26
+ .btn.btn-primary= link_to_prev_page @sessions, 'Previous'
27
+ .btn.btn-primary= link_to_next_page @sessions, 'Next'
@@ -1,7 +1 @@
1
- %meta{ name: 'turbo-root', content: '/admin/conferences' }
2
- %meta{name: 'turbo-cache-control', content: 'no-preview'}
3
- = stylesheet_link_tag 'spina/admin/conferences/application', media: 'all', data: { turbolinks_track: true }
4
- = stimulus_include_tags
5
- = javascript_include_tag 'turbo', type: 'module-shim'
6
1
  = javascript_include_tag 'spina/admin/conferences/application'
7
- = yield :head
@@ -1,21 +1,27 @@
1
- %li#conferences-primary-navigation{ data: { turbolinks: 'false', turbo: 'permanent' },
2
- class: ('active' if %w[conferences delegates presentations presentation_types institutions rooms].include? controller_name) }
3
- = link_to spina.admin_conferences_presentations_path do
4
- = icon('comment')
5
- = t("spina.admin.conferences.title")
6
- = icon('caret-right')
1
+ = render Spina::MainNavigation::SubNavComponent.new(:conferences) do |nav|
2
+ - nav.icon do
3
+ = heroicon 'chat-alt-2', style: :solid, class: 'w-8 h-8 text-white md:mr-3'
4
+ .text-white.font-semibold.hidden{class: 'md:block transform -translate-x-2 ease-in-out duration-300 absolute md:relative opacity-0 transition-all', 'data-navigation-target': 'label'}
5
+ = Spina::Admin::Conferences::Conference.model_name.human(count: :many)
6
+
7
+ - nav.links do
8
+ = render Spina::MainNavigation::LinkComponent.new(Spina::Admin::Conferences::Institution.model_name.human(count: :many),
9
+ spina.admin_conferences_institutions_path,
10
+ active: %w[institutions rooms].include?(controller_name))
11
+ = render Spina::MainNavigation::LinkComponent.new(Spina::Admin::Conferences::Conference.model_name.human(count: :many),
12
+ spina.admin_conferences_conferences_path,
13
+ active: %w[conferences presentation_types sessions].include?(controller_name))
14
+ = render Spina::MainNavigation::LinkComponent.new(Spina::Admin::Conferences::Delegate.model_name.human(count: :many),
15
+ spina.admin_conferences_delegates_path,
16
+ active: %w[delegates].include?(controller_name))
17
+ = render Spina::MainNavigation::LinkComponent.new(Spina::Admin::Conferences::Presentation.model_name.human(count: :many),
18
+ spina.admin_conferences_presentations_path,
19
+ active: %w[presentations].include?(controller_name))
20
+ = render Spina::MainNavigation::LinkComponent.new(Spina::Admin::Conferences::DietaryRequirement.model_name.human(count: 0),
21
+ spina.admin_conferences_dietary_requirements_path,
22
+ active: controller_name == 'dietary_requirements')
23
+ = render Spina::MainNavigation::LinkComponent.new(Spina::Admin::Conferences::PresentationAttachmentType.model_name.human(count: 0),
24
+ spina.admin_conferences_presentation_attachment_types_path,
25
+ active: controller_name == 'presentation_attachment_types')
7
26
 
8
- %ul
9
- %li{ class: ('active' if %w[institutions rooms].include? controller_name) }
10
- = link_to Spina::Admin::Conferences::Institution.model_name.human(count: 0), spina.admin_conferences_institutions_path
11
- %li{ class: ('active' if %w[conferences presentation_types sessions].include? controller_name) }
12
- = link_to Spina::Admin::Conferences::Conference.model_name.human(count: 0), spina.admin_conferences_conferences_path
13
- %li{ class: ('active' if %w[delegates].include? controller_name) }
14
- = link_to Spina::Admin::Conferences::Delegate.model_name.human(count: 0), spina.admin_conferences_delegates_path
15
- %li{ class: ('active' if %w[presentations].include? controller_name) }
16
- = link_to Spina::Admin::Conferences::Presentation.model_name.human(count: 0), spina.admin_conferences_presentations_path
17
27
 
18
- %li
19
- = link_to '#', class: 'back-to-main-menu' do
20
- = icon('caret-left')
21
- =t 'spina.main_menu'
@@ -1,6 +0,0 @@
1
- %li{ class: ('active' if %w[dietary_requirements].include? controller_name) }
2
- = link_to Spina::Admin::Conferences::DietaryRequirement.model_name.human(count: 0), spina.admin_conferences_dietary_requirements_path,
3
- data: { turbolinks: 'false' }
4
- %li{ class: ('active' if %w[presentation_attachment_types].include? controller_name) }
5
- = link_to Spina::Admin::Conferences::PresentationAttachmentType.model_name.human(count: 0), spina.admin_conferences_presentation_attachment_types_path,
6
- data: { turbolinks: 'false' }
@@ -1,2 +1,2 @@
1
- .page-form-label= f.object.title
2
- .page-form-control= f.date_field :content, placeholder: f.object.title
1
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: f.object.title) do
2
+ = f.date_field :content, placeholder: f.object.title, class: 'form-select'
@@ -1,2 +1,2 @@
1
- .page-form-label= f.object.title
2
- .page-form-control= f.email_field :content, placeholder: f.object.title
1
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: f.object.title) do
2
+ = f.email_field :content, class: 'form-input block w-full max-w-5xl sm:text-sm sm:leading-5'
@@ -1,2 +1,2 @@
1
- .page-form-label= f.object.title
2
- .page-form-control= f.datetime_field :content, placeholder: f.object.title
1
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: f.object.title) do
2
+ = f.datetime_field :content, placeholder: f.object.title, class: 'form-select'
@@ -1,2 +1,2 @@
1
- .page-form-label= f.object.title
2
- .page-form-control= f.url_field :content, placeholder: f.object.title
1
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: f.object.title) do
2
+ = f.url_field :content, class: 'form-input block w-full max-w-5xl sm:text-sm sm:leading-5'
@@ -1,34 +1,3 @@
1
- # Files in the config/locales directory are used for internationalization
2
- # and are automatically loaded by Rails. If you want to use locales other
3
- # than English, add the necessary files in this directory.
4
- #
5
- # To use the locales, use `I18n.t`:
6
- #
7
- # I18n.t 'hello'
8
- #
9
- # In views, this is aliased to just `t`:
10
- #
11
- # <%= t('hello') %>
12
- #
13
- # To use a different locale, set it with `I18n.locale`:
14
- #
15
- # I18n.locale = :es
16
- #
17
- # This would use the information in config/locales/es.yml.
18
- #
19
- # The following keys must be escaped otherwise they will not be retrieved by
20
- # the default I18n backend:
21
- #
22
- # true, false, on, off, yes, no
23
- #
24
- # Instead, surround them with single quotes.
25
- #
26
- # en:
27
- # 'true': 'foo'
28
- #
29
- # To learn more, please read the Rails Internationalization guide
30
- # available at http://guides.rubyonrails.org/i18n.html.
31
-
32
1
  en:
33
2
  spina:
34
3
  show: Show
@@ -52,10 +21,13 @@ en:
52
21
  create:
53
22
  new: New conference
54
23
  saved: Conference saved
24
+ failed: Failed to save conference! Check the form for missing or invalid fields.
55
25
  update:
56
26
  saved: Conference saved
27
+ failed: Failed to save conference! Check the form for missing or invalid fields.
57
28
  destroy:
58
29
  destroyed: Conference deleted
30
+ failed: Failed to delete conference. Make sure to delete all dependent records first.
59
31
  form:
60
32
  save: Save conference
61
33
  conference_details: Conference details
@@ -64,9 +36,8 @@ en:
64
36
  presentations: Presentations
65
37
  presentation_types: Presentation types
66
38
  rooms: Rooms
67
- form_conference_details:
68
39
  delete_confirmation:
69
- "Are you sure you want to delete the conference <strong>%{name}</strong>?"
40
+ "Are you sure you want to delete the conference <strong>%{conference}</strong>?"
70
41
  delegates:
71
42
  index:
72
43
  new: New delegate
@@ -76,16 +47,18 @@ en:
76
47
  create:
77
48
  new: New delegate
78
49
  saved: Delegate saved
50
+ failed: Failed to save delegate! Check the form for missing or invalid fields.
79
51
  update:
80
52
  saved: Delegate saved
53
+ failed: Failed to save delegate! Check the form for missing or invalid fields.
81
54
  destroy:
82
55
  destroyed: Delegate deleted
56
+ failed: Failed to delete delegate. Make sure to delete all dependent records first.
83
57
  form:
84
58
  save: Save delegate
85
59
  delegate_details: Delegate details
86
60
  conferences: Conferences
87
61
  presentations: Presentations
88
- form_delegate_details:
89
62
  delete_confirmation: "Are you sure you want to delete the delegate <strong>%{delegate}</strong>?"
90
63
  presenters:
91
64
  new: New presenter
@@ -104,15 +77,17 @@ en:
104
77
  create:
105
78
  new: New presentation
106
79
  saved: Presentation saved
80
+ failed: Failed to save presentation! Check the form for missing or invalid fields.
107
81
  update:
108
82
  saved: Presentation saved
83
+ failed: Failed to save presentation! Check the form for missing or invalid fields.
109
84
  destroy:
110
85
  destroyed: Presentation deleted
86
+ failed: Failed to delete presentation. Make sure to delete all dependent records first.
111
87
  form:
112
88
  save: Save presentation
113
89
  presentation_details: Presentation details
114
90
  presenters: Presenters
115
- form_presentation_details:
116
91
  delete_confirmation: "Are you sure you want to delete the presentation <strong>%{presentation}</strong>?"
117
92
  presentation_types:
118
93
  index:
@@ -123,16 +98,18 @@ en:
123
98
  create:
124
99
  new: New presentation type
125
100
  saved: Presentation type saved
101
+ failed: Failed to save presentation type! Check the form for missing or invalid fields.
126
102
  update:
127
103
  saved: Presentation type saved
104
+ failed: Failed to save presentation type! Check the form for missing or invalid fields.
128
105
  destroy:
129
106
  destroyed: Presentation type deleted
107
+ failed: Failed to delete presentation type. Make sure to delete all dependent records first.
130
108
  form:
131
109
  save: Save presentation type
132
110
  presentation_type_details: Presentation type details
133
111
  presentations: Presentations
134
112
  sessions: Sessions
135
- form_presentation_type_details:
136
113
  delete_confirmation:
137
114
  "Are you sure you want to delete the presentation type <strong>%{presentation_type}</strong>?"
138
115
  dietary_requirements:
@@ -144,15 +121,17 @@ en:
144
121
  create:
145
122
  new: New dietary requirement
146
123
  saved: Dietary requirement saved
124
+ failed: Failed to save dietary requirement! Check the form for missing or invalid fields.
147
125
  update:
148
126
  saved: Dietary requirement saved
127
+ failed: Failed to save dietary requirement! Check the form for missing or invalid fields.
149
128
  destroy:
150
129
  destroyed: Dietary requirement deleted
130
+ failed: Failed to delete dietary requirement. Make sure to delete all dependent records first.
151
131
  form:
152
132
  save: Save dietary requirement
153
133
  dietary_requirement_details: Dietary requirement details
154
134
  delegates: Delegates
155
- form_dietary_requirement_details:
156
135
  delete_confirmation:
157
136
  "Are you sure you want to delete the dietary requirement <strong>%{dietary_requirement}</strong>?"
158
137
  presentation_attachment_types:
@@ -163,10 +142,13 @@ en:
163
142
  create:
164
143
  new: New presentation attachment type
165
144
  saved: Presentation attachment type saved
145
+ failed: Failed to save presentation attachment type! Check the form for missing or invalid fields.
166
146
  update:
167
147
  saved: Presentation attachment type saved
148
+ failed: Failed to save presentation attachment type! Check the form for missing or invalid fields.
168
149
  destroy:
169
150
  destroyed: Presentation attachment type deleted
151
+ failed: Failed to delete presentation attachment type. Make sure to delete all dependent records first.
170
152
  form:
171
153
  save: Save presentation attachment type
172
154
  delete_confirmation:
@@ -181,17 +163,19 @@ en:
181
163
  create:
182
164
  new: New institution
183
165
  saved: Institution saved
166
+ failed: Failed to save institution! Check the form for missing or invalid fields.
184
167
  update:
185
168
  saved: Institution saved
169
+ failed: Failed to save institution! Check the form for missing or invalid fields.
186
170
  destroy:
187
171
  destroyed: Institution deleted
172
+ failed: Failed to delete institution. Make sure to delete all dependent records first.
188
173
  form:
189
174
  save: Save institution
190
175
  institution_details: Institution details
191
176
  rooms: Rooms
192
177
  conferences: Conferences
193
178
  delegates: Delegates
194
- form_institution_details:
195
179
  delete_confirmation: "Are you sure you want to delete the institution <strong>%{institution}</strong>?"
196
180
  rooms:
197
181
  index:
@@ -202,15 +186,17 @@ en:
202
186
  create:
203
187
  new: New room
204
188
  saved: Room saved
189
+ failed: Failed to save room! Check the form for missing or invalid fields.
205
190
  update:
206
191
  saved: Room saved
192
+ failed: Failed to save room! Check the form for missing or invalid fields.
207
193
  destroy:
208
194
  destroyed: Room deleted
195
+ failed: Failed to delete room. Make sure to delete all dependent records first.
209
196
  form:
210
197
  save: Save room
211
198
  room_details: Room details
212
199
  presentations: Presentations
213
- form_room_details:
214
200
  delete_confirmation: "Are you sure you want to delete the room <strong>%{room}</strong>?"
215
201
  sessions:
216
202
  index:
@@ -220,15 +206,17 @@ en:
220
206
  create:
221
207
  new: New session
222
208
  saved: Session saved
209
+ failed: Failed to save session! Check the form for missing or invalid fields.
223
210
  update:
224
211
  saved: Session saved
212
+ failed: Failed to save session! Check the form for missing or invalid fields.
225
213
  destroy:
226
214
  destroyed: Session deleted
215
+ failed: Failed to delete session. Make sure to delete all dependent records first.
227
216
  form:
228
217
  save: Save session
229
218
  session_details: Session details
230
219
  presentations: Presentations
231
- form_session_details:
232
220
  delete_confirmation: "Are you sure you want to delete the session <strong>%{session}</strong>?"
233
221
  application:
234
222
  conferences:
@@ -317,6 +305,7 @@ en:
317
305
  presenters: Presenters
318
306
  conference: Conference
319
307
  session: Session
308
+ presentation_type: Presentation type
320
309
  attachments: Attachments
321
310
  spina/admin/conferences/presentation_attachment:
322
311
  type: Type
@@ -340,6 +329,8 @@ en:
340
329
  name: Name
341
330
  presentation_type: Presentation type
342
331
  room: Room
332
+ conference: Conference
333
+ institution: Institution
343
334
  errors:
344
335
  messages:
345
336
  outside_conference: is not during the selected conference
data/config/routes.rb CHANGED
@@ -4,10 +4,7 @@ Spina::Engine.routes.draw do
4
4
  namespace :admin, path: Spina.config.backend_path do
5
5
  namespace :conferences do
6
6
  root to: 'conferences#index'
7
- resources :conferences, except: [:show] do
8
- resources :events, only: [:new]
9
- end
10
- resources :events, only: [:new]
7
+ resources :conferences, except: [:show]
11
8
  resources :institutions, except: [:show]
12
9
  resources :rooms, except: [:show]
13
10
  resources :sessions, except: [:show]
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class AddTypeToSpinaPages < ActiveRecord::Migration[5.2] #:nodoc:
3
+ class AddTypeToSpinaPages < ActiveRecord::Migration[5.2] # :nodoc:
4
4
  def change
5
5
  add_column :spina_pages, :type, :string
6
6
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class CreateSpinaConferencesConferencePageParts < ActiveRecord::Migration[5.2] #:nodoc:
3
+ class CreateSpinaConferencesConferencePageParts < ActiveRecord::Migration[5.2] # :nodoc:
4
4
  def change
5
5
  create_table :spina_conferences_conference_page_parts do |t|
6
6
  t.belongs_to :conference_page, foreign_key: { to_table: :spina_pages, on_delete: :cascade },
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class AddDependentOptionToForeignKeys < ActiveRecord::Migration[5.2] # :nodoc:
4
- def change # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
4
+ def change # rubocop:disable Metrics/AbcSize
5
5
  remove_foreign_key :spina_conferences_delegates, :spina_conferences_institutions, column: :institution_id
6
6
  remove_foreign_key :spina_conferences_presentations, :spina_conferences_room_uses, column: :room_use_id
7
7
  remove_foreign_key :spina_conferences_room_uses, :spina_conferences_room_possessions, column: :room_possession_id
@@ -1,36 +1,36 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class ChangeSpinaResources < ActiveRecord::Migration[6.0] #:nodoc:
3
+ class ChangeSpinaResources < ActiveRecord::Migration[6.0] # :nodoc:
4
4
  def up
5
- insert <<-SQL, 'Insert conference pages resource if missing'
5
+ insert <<-SQL.squish, 'Insert conference pages resource if missing'
6
6
  INSERT INTO spina_resources (name, label, created_at, updated_at)
7
7
  SELECT 'conference_pages', 'Conference pages', current_timestamp, current_timestamp
8
8
  WHERE NOT EXISTS (SELECT name FROM spina_resources WHERE name = 'conference_pages')
9
9
  SQL
10
- update <<-SQL, 'Update conference conference pages'
10
+ update <<-SQL.squish, 'Update conference conference pages'
11
11
  WITH resources AS (SELECT id FROM spina_resources WHERE name = 'conference_pages' LIMIT 1)
12
12
  UPDATE spina_pages SET ancestry = null, resource_id = resources.id
13
13
  FROM spina_conferences_conference_page_parts, resources
14
14
  WHERE conference_page_id = spina_pages.id AND conference_page_partable_type = 'Spina::Conferences::Conference'
15
15
  SQL
16
- update <<-SQL, 'Update presentation conference pages'
16
+ update <<-SQL.squish, 'Update presentation conference pages'
17
17
  WITH resources AS (SELECT id FROM spina_resources WHERE name = 'conference_pages' LIMIT 1)
18
18
  UPDATE spina_pages SET resource_id = resources.id
19
19
  FROM spina_conferences_conference_page_parts, resources
20
20
  WHERE conference_page_id = spina_pages.id AND conference_page_partable_type = 'Spina::Conferences::Presentation'
21
21
  SQL
22
- delete <<-SQL, 'Delete resources'
22
+ delete <<-SQL.squish, 'Delete resources'
23
23
  DELETE FROM spina_resources WHERE name IN ('conferences', 'presentations')
24
24
  SQL
25
25
  end
26
26
 
27
27
  def down
28
- insert <<-SQL, 'Insert conferences resource if missing'
28
+ insert <<-SQL.squish, 'Insert conferences resource if missing'
29
29
  INSERT INTO spina_resources (name, label, view_template, created_at, updated_at)
30
30
  SELECT 'conferences', 'Conferences', 'conference', current_timestamp, current_timestamp
31
31
  WHERE NOT EXISTS (SELECT name FROM spina_resources WHERE name = 'conferences')
32
32
  SQL
33
- update <<-SQL, 'Update conference conference pages'
33
+ update <<-SQL.squish, 'Update conference conference pages'
34
34
  WITH
35
35
  conferences_resources AS (SELECT id FROM spina_resources WHERE name = 'conferences' LIMIT 1),
36
36
  conferences_pages AS (SELECT id FROM spina_pages WHERE view_template = 'conference' LIMIT 1)
@@ -38,18 +38,18 @@ class ChangeSpinaResources < ActiveRecord::Migration[6.0] #:nodoc:
38
38
  FROM spina_conferences_conference_page_parts, conferences_resources, conferences_pages
39
39
  WHERE conference_page_id = spina_pages.id AND conference_page_partable_type = 'Spina::Conferences::Conference'
40
40
  SQL
41
- insert <<-SQL, 'Insert presentations resource if missing'
41
+ insert <<-SQL.squish, 'Insert presentations resource if missing'
42
42
  INSERT INTO spina_resources (name, label, view_template, created_at, updated_at)
43
43
  SELECT 'presentations', 'Presentations', 'presentation', current_timestamp, current_timestamp
44
44
  WHERE NOT EXISTS (SELECT name FROM spina_resources WHERE name = 'presentations')
45
45
  SQL
46
- update <<-SQL, 'Update presentation conference pages'
46
+ update <<-SQL.squish, 'Update presentation conference pages'
47
47
  WITH presentations_resources AS (SELECT id FROM spina_resources WHERE name = 'presentations' LIMIT 1)
48
48
  UPDATE spina_pages SET resource_id = presentations_resources.id
49
49
  FROM spina_conferences_conference_page_parts, presentations_resources
50
50
  WHERE conference_page_id = spina_pages.id AND conference_page_partable_type = 'Spina::Conferences::Presentation'
51
51
  SQL
52
- delete <<-SQL, 'Delete resources'
52
+ delete <<-SQL.squish, 'Delete resources'
53
53
  DELETE FROM spina_resources WHERE name = 'conference_pages'
54
54
  SQL
55
55
  end