spina-admin-conferences-fork 2.1.2 → 3.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/spina_admin_conferences_manifest.js +3 -3
  3. data/app/assets/javascripts/spina/admin/conferences/application.js +0 -4
  4. data/app/assets/javascripts/{controllers/spina/admin/conferences → spina/admin/conferences/controllers}/select_options_controller.js +1 -1
  5. data/app/assets/stylesheets/spina/admin/conferences/application.tailwind.css +0 -0
  6. data/app/controllers/spina/admin/conferences/application_controller.rb +8 -1
  7. data/app/controllers/spina/admin/conferences/conferences_controller.rb +13 -25
  8. data/app/controllers/spina/admin/conferences/delegates_controller.rb +12 -24
  9. data/app/controllers/spina/admin/conferences/dietary_requirements_controller.rb +12 -24
  10. data/app/controllers/spina/admin/conferences/institutions_controller.rb +12 -24
  11. data/app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb +12 -24
  12. data/app/controllers/spina/admin/conferences/presentation_types_controller.rb +12 -26
  13. data/app/controllers/spina/admin/conferences/presentations_controller.rb +12 -24
  14. data/app/controllers/spina/admin/conferences/rooms_controller.rb +12 -26
  15. data/app/controllers/spina/admin/conferences/sessions_controller.rb +12 -26
  16. data/app/jobs/spina/admin/conferences/import_job.rb +2 -2
  17. data/app/models/spina/admin/conferences/conference.rb +1 -1
  18. data/app/models/spina/admin/conferences/delegate.rb +3 -3
  19. data/app/models/spina/admin/conferences/presentation.rb +1 -1
  20. data/app/views/spina/admin/conferences/application/_conferences.html.haml +10 -11
  21. data/app/views/spina/admin/conferences/application/_delegates.html.haml +9 -10
  22. data/app/views/spina/admin/conferences/application/_dietary_requirements.html.haml +7 -8
  23. data/app/views/spina/admin/conferences/application/_institutions.html.haml +8 -9
  24. data/app/views/spina/admin/conferences/application/_presentation_attachment_types.html.haml +8 -9
  25. data/app/views/spina/admin/conferences/application/_presentation_types.html.haml +9 -10
  26. data/app/views/spina/admin/conferences/application/_presentations.html.haml +9 -10
  27. data/app/views/spina/admin/conferences/application/_rooms.html.haml +9 -10
  28. data/app/views/spina/admin/conferences/application/_sessions.html.haml +9 -10
  29. data/app/views/spina/admin/conferences/conferences/_conference.html.haml +13 -9
  30. data/app/views/spina/admin/conferences/conferences/_event_fields.html.haml +18 -25
  31. data/app/views/spina/admin/conferences/conferences/_form.html.haml +24 -22
  32. data/app/views/spina/admin/conferences/conferences/_form_conference_details.html.haml +28 -22
  33. data/app/views/spina/admin/conferences/conferences/_form_delegates.html.haml +1 -0
  34. data/app/views/spina/admin/conferences/conferences/_form_parts.html.haml +5 -7
  35. data/app/views/spina/admin/conferences/conferences/_form_presentation_types.html.haml +1 -0
  36. data/app/views/spina/admin/conferences/conferences/_form_presentations.html.haml +1 -0
  37. data/app/views/spina/admin/conferences/conferences/_form_rooms.html.haml +1 -0
  38. data/app/views/spina/admin/conferences/conferences/index.html.haml +22 -4
  39. data/app/views/spina/admin/conferences/delegates/_delegate.html.haml +10 -12
  40. data/app/views/spina/admin/conferences/delegates/_form.html.haml +23 -19
  41. data/app/views/spina/admin/conferences/delegates/_form_conferences.html.haml +1 -0
  42. data/app/views/spina/admin/conferences/delegates/_form_delegate_details.html.haml +29 -53
  43. data/app/views/spina/admin/conferences/delegates/_form_presentations.html.haml +1 -0
  44. data/app/views/spina/admin/conferences/delegates/index.html.haml +14 -10
  45. data/app/views/spina/admin/conferences/dietary_requirements/_dietary_requirement.html.haml +7 -6
  46. data/app/views/spina/admin/conferences/dietary_requirements/_form.html.haml +23 -18
  47. data/app/views/spina/admin/conferences/dietary_requirements/_form_delegates.html.haml +1 -0
  48. data/app/views/spina/admin/conferences/dietary_requirements/_form_dietary_requirement_details.html.haml +3 -8
  49. data/app/views/spina/admin/conferences/dietary_requirements/index.html.haml +6 -4
  50. data/app/views/spina/admin/conferences/institutions/_form.html.haml +23 -19
  51. data/app/views/spina/admin/conferences/institutions/_form_delegates.html.haml +1 -0
  52. data/app/views/spina/admin/conferences/institutions/_form_institution_details.html.haml +24 -25
  53. data/app/views/spina/admin/conferences/institutions/_form_rooms.html.haml +1 -0
  54. data/app/views/spina/admin/conferences/institutions/_institution.html.haml +9 -7
  55. data/app/views/spina/admin/conferences/institutions/index.html.haml +19 -4
  56. data/app/views/spina/admin/conferences/presentation_attachment_types/_form.html.haml +15 -20
  57. data/app/views/spina/admin/conferences/presentation_attachment_types/_presentation_attachment_type.html.haml +7 -6
  58. data/app/views/spina/admin/conferences/presentation_attachment_types/index.html.haml +6 -4
  59. data/app/views/spina/admin/conferences/presentation_types/_form.html.haml +23 -19
  60. data/app/views/spina/admin/conferences/presentation_types/_form_presentation_type_details.html.haml +7 -16
  61. data/app/views/spina/admin/conferences/presentation_types/_form_presentations.html.haml +1 -0
  62. data/app/views/spina/admin/conferences/presentation_types/_form_sessions.html.haml +1 -0
  63. data/app/views/spina/admin/conferences/presentation_types/_presentation_type.html.haml +11 -8
  64. data/app/views/spina/admin/conferences/presentation_types/index.html.haml +22 -4
  65. data/app/views/spina/admin/conferences/presentations/_attachment_fields.html.haml +10 -16
  66. data/app/views/spina/admin/conferences/presentations/_form.html.haml +23 -18
  67. data/app/views/spina/admin/conferences/presentations/_form_presentation_details.html.haml +59 -55
  68. data/app/views/spina/admin/conferences/presentations/_form_presenters.html.haml +1 -0
  69. data/app/views/spina/admin/conferences/presentations/_presentation.html.haml +10 -8
  70. data/app/views/spina/admin/conferences/presentations/index.html.haml +15 -10
  71. data/app/views/spina/admin/conferences/rooms/_form.html.haml +23 -18
  72. data/app/views/spina/admin/conferences/rooms/_form_presentations.html.haml +1 -0
  73. data/app/views/spina/admin/conferences/rooms/_form_room_details.html.haml +7 -16
  74. data/app/views/spina/admin/conferences/rooms/_room.html.haml +11 -8
  75. data/app/views/spina/admin/conferences/rooms/index.html.haml +19 -4
  76. data/app/views/spina/admin/conferences/sessions/_form.html.haml +23 -18
  77. data/app/views/spina/admin/conferences/sessions/_form_presentations.html.haml +1 -0
  78. data/app/views/spina/admin/conferences/sessions/_form_session_details.html.haml +13 -19
  79. data/app/views/spina/admin/conferences/sessions/_session.html.haml +11 -8
  80. data/app/views/spina/admin/conferences/sessions/index.html.haml +22 -4
  81. data/app/views/spina/admin/hooks/conferences/_head.html.haml +0 -6
  82. data/app/views/spina/admin/hooks/conferences/_primary_navigation.html.haml +25 -19
  83. data/app/views/spina/admin/hooks/conferences/_settings_secondary_navigation.html.haml +0 -6
  84. data/app/views/spina/admin/parts/admin/conferences/dates/_form.html.haml +2 -2
  85. data/app/views/spina/admin/parts/admin/conferences/email_addresses/_form.html.haml +4 -2
  86. data/app/views/spina/admin/parts/admin/conferences/times/_form.html.haml +2 -2
  87. data/app/views/spina/admin/parts/admin/conferences/urls/_form.html.haml +4 -2
  88. data/config/locales/en.yml +31 -9
  89. data/config/routes.rb +1 -4
  90. data/db/migrate/20180907141242_add_type_to_spina_pages.rb +1 -1
  91. data/db/migrate/20180907141243_create_spina_conferences_conference_page_parts.rb +1 -1
  92. data/db/migrate/20181017155705_add_dependent_option_to_foreign_keys.rb +1 -1
  93. data/db/migrate/20190408131354_change_spina_resources.rb +10 -10
  94. data/db/migrate/20190701174807_remove_spina_conference_pages.rb +15 -15
  95. data/db/migrate/20190704135524_add_constraints_to_columns.rb +1 -1
  96. data/db/migrate/20200126213718_create_spina_conferences_presentation_attachments.rb +1 -1
  97. data/db/migrate/20200802184921_create_spina_conferences_event_name_description_and_location_translations.rb +1 -1
  98. data/db/migrate/20200911161739_move_conference_parts.rb +3 -3
  99. data/db/migrate/20201002122517_remove_spina_conferences_conference_page_parts.rb +1 -1
  100. data/db/migrate/20201007125625_add_timestamps_to_spina_conferences_parts.rb +2 -2
  101. data/db/migrate/20210315164411_convert_partables_to_json.rb +10 -18
  102. data/db/migrate/20210417102513_add_locale_to_action_text_rich_texts.rb +1 -1
  103. data/lib/spina/admin/conferences/engine.rb +13 -0
  104. data/lib/spina/admin/conferences/migration/renaming.rb +4 -4
  105. data/lib/spina/admin/conferences/railtie.rb +1 -0
  106. data/lib/spina/admin/conferences/version.rb +1 -1
  107. data/lib/spina/admin/conferences.rb +1 -2
  108. metadata +60 -82
  109. data/app/assets/javascripts/controllers/spina/admin/conferences/conference_events_form_controller.js +0 -174
  110. data/app/assets/javascripts/controllers/spina/admin/conferences/presentation_attachments_form_controller.js +0 -174
  111. data/app/assets/javascripts/importmap.json.erb +0 -6
  112. data/app/assets/stylesheets/spina/admin/conferences/application.sass +0 -3
  113. data/app/controllers/spina/admin/conferences/events_controller.rb +0 -24
  114. data/app/controllers/spina/admin/conferences/presentation_attachments_controller.rb +0 -24
  115. data/app/views/layouts/spina/admin/conferences/application.html.haml +0 -6
  116. data/app/views/layouts/spina/admin/conferences/conferences.html.haml +0 -17
  117. data/app/views/layouts/spina/admin/conferences/delegates.html.haml +0 -8
  118. data/app/views/layouts/spina/admin/conferences/dietary_requirements.html.haml +0 -8
  119. data/app/views/layouts/spina/admin/conferences/institutions.html.haml +0 -15
  120. data/app/views/layouts/spina/admin/conferences/presentation_attachment_types.html.haml +0 -8
  121. data/app/views/layouts/spina/admin/conferences/presentations.html.haml +0 -8
  122. data/app/views/spina/admin/conferences/conferences/_event_row.html.haml +0 -5
  123. data/app/views/spina/admin/conferences/conferences/_form_structure.html.haml +0 -19
  124. data/app/views/spina/admin/conferences/conferences/_form_structure_item.html.haml +0 -13
  125. data/app/views/spina/admin/conferences/events/new.js.erb +0 -21
  126. data/app/views/spina/admin/conferences/presentation_attachments/new.js.erb +0 -21
  127. data/app/views/spina/admin/conferences/presentations/_attachment_row.html.haml +0 -2
  128. data/config/initializers/assets.rb +0 -13
  129. data/vendor/assets/javascripts/spina/trix.js +0 -21
  130. data/vendor/assets/stylesheets/spina/trix.css +0 -375
@@ -1,8 +1,11 @@
1
- %tr{ data: { presentation_type_id: presentation_type.id } }
2
- %td= presentation_type.conference.name
3
- %td= link_to presentation_type.name, edit_admin_conferences_presentation_type_path(presentation_type)
4
- %td= time_tag presentation_type.duration, t('datetime.distance_in_words.x_minutes', count: presentation_type.minutes)
5
- %td.align-right
6
- = link_to edit_admin_conferences_presentation_type_path(presentation_type), class: %w[button button-small button-link] do
7
- = icon 'pencil-outline'
8
- = t 'spina.edit'
1
+ %tr.border-b{ data: { presentation_type_id: presentation_type.id } }
2
+ %td
3
+ .block.font-light.text-sm.p-4= presentation_type.conference.name
4
+ %td= link_to presentation_type.name, edit_admin_conferences_presentation_type_path(presentation_type), class: 'block text-spina font-medium text-sm p-4 hover:text-spina-dark'
5
+ %td
6
+ .block.font-light.text-sm.p-4= time_tag presentation_type.duration, t('datetime.distance_in_words.x_minutes', count: presentation_type.minutes)
7
+ %td
8
+ = link_to edit_admin_conferences_presentation_type_path(presentation_type), 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,25 @@
1
- - content_for(:header_actions) do
2
- = link_to new_admin_conferences_presentation_type_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_presentation_type_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: 'presentation_types', object: @presentation_types
7
25
  = link_to_next_page @presentation_types, 'Next'
@@ -1,18 +1,12 @@
1
- .structure-form-pane{ class: ('active' if (local_assigns[:active] == true) || (f.index == 0)), id: "structure_form_pane_#{f.index}", data: { 'spina--admin--conferences--presentation_attachments_form': { target: 'formPane' } } }
2
- .structure-form-part
3
- .page-form-label
4
- = Spina::Admin::Conferences::PresentationAttachment.human_attribute_name :attachment_type
5
- .page-form-control
6
- .select-dropdown
7
- = f.collection_select :attachment_type_id, Spina::Admin::Conferences::PresentationAttachmentType.all, :id, :name, {}, data: { action: 'spina--admin--conferences--presentation-attachments-form#updateType' }
8
- .structure-form-part
9
- .page-form-label
10
- = Spina::Admin::Conferences::PresentationAttachment.human_attribute_name :attachment
11
- .page-form-content{ data: { controller: "attachment-picker" } }
12
- .select-dropdown
13
- = f.collection_select :attachment_id, Spina::Attachment.sorted, :id, :name, { include_blank: t("spina.attachments.choose_attachment") }
14
-
1
+ %div{ data: { 'part-id': "#{f.object.object_id}", 'tabs-target': 'pane' }, id: "pane_#{f.object.object_id}" }
15
2
  = f.hidden_field :id
16
3
 
17
- = f.hidden_field :_destroy, data: { 'spina--admin--conferences--presentation_attachments_form_target': 'destroyField' }
18
- = button_tag t('spina.delete'), type: 'button', class: %w[button button-mini button-link pull-right], data: { action: 'spina--admin--conferences--presentation-attachments-form#removeForm' }
4
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::PresentationAttachment.human_attribute_name(:attachment_type)) do
5
+ = f.collection_select :attachment_type_id, Spina::Admin::Conferences::PresentationAttachmentType.all, :id, :name
6
+
7
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::PresentationAttachment.human_attribute_name(:attachment)) do
8
+ .mt-6{ data: { controller: 'attachment-picker' } }
9
+ = f.collection_select :attachment_id, Spina::Attachment.sorted, :id, :name, { include_blank: t('spina.attachments.choose_attachment') }, { class: 'form-select mt-1', data: { action: 'attachment-picker#pick' } }
10
+
11
+ .text-right
12
+ = button_tag t('spina.ui.delete'), type: :button, class: 'btn btn-default bg-transparent hover:bg-white hover:text-red-500 h-8 px-3 inline-block mt-3', data: { action: 'repeater#removeFields', id: "pane_#{f.object.object_id}" }
@@ -1,23 +1,28 @@
1
- - if @presentation.errors.any?
2
- - content_for :notifications do
3
- = render 'errors', errors: @presentation.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 @presentation.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, @presentation], 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_presentation_path(@presentation), 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', presentation: @presentation.title) } }
8
13
 
9
- #header_actions
10
- %button.button.button-primary{ type: 'submit' }
11
- = icon 'check'
14
+ = button_tag type: :submit, form: dom_id(@presentation), 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_presentations_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
- #presentation_details.tab-content.active= render 'form_presentation_details', f: f
23
- #presenters.tab-content= render partial: 'delegates', object: @presentation.presenters
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
+ = render "form_#{tab}"
@@ -1,55 +1,59 @@
1
- .page-form{ data: { controller: 'spina--admin--conferences--select-options', 'spina--admin--conferences--select_options': { record_value: @conferences } } }
2
- .page-form-group
3
- .page-form-label= Spina::Admin::Conferences::Presentation.human_attribute_name :conference
4
- .page-form-control
5
- .select-dropdown= select_tag :conference_id, options_from_collection_for_select(Spina::Admin::Conferences::Conference.all, :id, :name, (@presentation.conference.id unless @presentation.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' }
6
-
7
- .page-form-group
8
- .page-form-label= Spina::Admin::Conferences::Presentation.human_attribute_name :session
9
- .page-form-control
10
- .input-group
11
- .select-dropdown= select_tag :presentation_type_id, options_from_collection_for_select((@presentation.conference || Spina::Admin::Conferences::Conference.first).presentation_types, :id, :name, (@presentation.presentation_type.id unless @presentation.presentation_type.blank?)), include_blank: true, required: true, data: { action: 'spina--admin--conferences--select-options#setVisibility','spina--admin--conferences--select_options_target': 'select', key_path: 'presentation_types', text_key: 'name' }
12
- .select-dropdown= f.collection_select :session_id, (@presentation.presentation_type || Spina::Admin::Conferences::Conference.first).sessions, :id, :name, { include_blank: true }, required: true, data: {'spina--admin--conferences--select_options_target': 'select', key_path: 'presentation_types:sessions', text_key: 'name' }
13
-
14
- .page-form-group
15
- .page-form-label
16
- = Spina::Admin::Conferences::Presentation.human_attribute_name :start_datetime
17
- .page-form-control= f.datetime_field :start_datetime, required: true
18
-
19
- .page-form-group
20
- .page-form-label= Spina::Admin::Conferences::Presentation.human_attribute_name :title
21
- .page-form-control= f.text_field :title, placeholder: Spina::Admin::Conferences::Presentation.human_attribute_name(:title), required: true, class: 'input-large'
22
-
23
- .page-form-group
24
- .page-form-label= Spina::Admin::Conferences::Presentation.human_attribute_name :abstract
25
- .page-form-content
26
- .page-form-rich-text= f.rich_text_area :abstract
27
-
28
- .page-form-group
29
- .page-form-label= Spina::Admin::Conferences::Presentation.human_attribute_name :presenters
30
- .page-form-content
31
- .well{ style: 'margin: 0' }
32
- .table-container
33
- %table.table{ style: 'margin: 0' }
34
- %tbody
35
- = f.collection_check_boxes :presenter_ids, Spina::Admin::Conferences::Delegate.order(:last_name, :first_name), :id, :reversed_name_and_institution do |builder|
36
- %tr
37
- %td{ style: "padding-left: 16px" }
38
- .form-checkbox
39
- = builder.check_box
40
- = builder.label
41
-
42
- .page-form-group{ class: dom_class(@presentation.attachments) }
43
- .page-form-label= Spina::Admin::Conferences::Presentation.human_attribute_name :attachments
44
- .page-form-control
45
- .structure-form{ data: { controller: 'spina--admin--conferences--presentation-attachments-form', 'spina--admin--conferences--presentation_attachments_form': { active_class: 'active' } } }
46
- .structure-form-menu
47
- %ul= render partial: 'attachment_row', collection: f.object.attachments, as: :attachment
48
- = link_to icon('plus'), @presentation.new_record? ? new_admin_conferences_presentation_attachment_path : new_admin_conferences_presentation_presentation_attachment_path(@presentation, index: @presentation.attachments.size), remote: true, class: %w[button button-link icon], data: { 'spina--admin--conferences--presentation_attachments_form_target': 'addFormLink', disable_with: '' }
49
-
50
- .structure-form-content{ data: { action: 'presentationAttachmentFieldsAdded->spina--admin--conferences--presentation-attachments-form#updateURL' } }
51
- = f.fields_for :attachments do |attachment_fields|
52
- = render 'attachment_fields', f: attachment_fields
53
-
54
- - unless @presentation.new_record?
55
- .pull-right= link_to t('spina.permanently_delete'), admin_conferences_presentation_path(@presentation), method: :delete, data: { confirm: t('.delete_confirmation', presentation: @presentation.title) }, class: %w[button button-link button-danger]
1
+ = form_with model: [spina, :admin_conferences, @presentation], id: dom_id(@presentation), html: { autocomplete: 'off' } do |f|
2
+ %div{ data: { controller: 'select-options', select_options: { record_value: @conferences } } }
3
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:conference)) do
4
+ = select_tag :conference_id, options_from_collection_for_select(Spina::Admin::Conferences::Conference.all, :id, :name, (@presentation.conference.id unless @presentation.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' }
5
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:presentation_type)) do
6
+ = select_tag :presentation_type_id, options_from_collection_for_select((@presentation.conference || Spina::Admin::Conferences::Conference.first).presentation_types, :id, :name, (@presentation.presentation_type.id unless @presentation.presentation_type.blank?)), include_blank: true, required: true, data: { action: 'spina--admin--conferences--select-options#setVisibility','spina--admin--conferences--select_options_target': 'select', key_path: 'presentation_types', text_key: 'name' }
7
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:session)) do
8
+ = f.collection_select :session_id, (@presentation.presentation_type || Spina::Admin::Conferences::Conference.first).sessions, :id, :name, { include_blank: true }, required: true, data: {'spina--admin--conferences--select_options_target': 'select', key_path: 'presentation_types:sessions', text_key: 'name' }
9
+
10
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:start_datetime)) do
11
+ = f.datetime_field :start_datetime
12
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:title)) do
13
+ = render Spina::Forms::TextFieldComponent.new(f, :title)
14
+
15
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:abstract)) do
16
+ .mt-1.relative
17
+ = f.hidden_field :abstract, id: "#{f.object.object_id}_input"
18
+
19
+ .relative.form-textarea.p-4.pt-0.shadow-sm.max-w-5xl(data-controller='trix' id="insert_#{f.object.object_id}_trix-toolbar" data-action='media-picker:done->trix#insertAttachment')
20
+ = render Spina::Forms::TrixToolbarComponent.new("#{f.object.object_id}_trix-toolbar")
21
+
22
+ %trix-editor(class='prose prose-sm focus:outline-none max-w-3xl xl:border-r border-dashed border-gray-200 pr-3' toolbar="#{f.object.object_id}_trix-toolbar" input="#{f.object.object_id}_input" data-trix-target='editor' data-action='trix-file-accept->trix#preventDefault')
23
+
24
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:presenters)) do
25
+ %table.table{ style: 'margin: 0' }
26
+ %tbody
27
+ = f.collection_check_boxes :presenter_ids, Spina::Admin::Conferences::Delegate.order(:last_name, :first_name), :id, :reversed_name_and_institution do |builder|
28
+ %tr
29
+ %td{ style: "padding-left: 16px" }
30
+ .form-checkbox
31
+ = builder.check_box
32
+ = builder.label
33
+
34
+
35
+ .mt-6{ 'data-controller': 'repeater' }
36
+ %label.block.text-sm.leading-5.font-medium.text-gray-700= Spina::Admin::Conferences::Presentation.human_attribute_name :attachments
37
+ .-mt-4.flex.flex-col.md:flex-row{ data: { 'controller': 'tabs', 'tabs-active': 'bg-spina-dark bg-opacity-10 text-gray-900', 'tabs-inactive': 'text-gray-500' } }
38
+ .md:w-64.md:pr-6
39
+
40
+ -# Fields for new attachment
41
+ - new_attachment = Spina::Admin::Conferences::PresentationAttachment.new
42
+ - fields = f.fields_for(:attachments, [new_attachment], child_index: new_attachment.object_id) { |ff| render('attachment_fields', f: ff) }.gsub('\n', '')
43
+
44
+ -# Tabs
45
+ .pt-6.-ml-3
46
+ %div{ data: { action: 'exists->tabs#added', 'repeater-target' => 'list', 'tabs-target' => 'list' } }
47
+ - (f.object.attachments || []).each.with_index do |attachment, index|
48
+ %button.text-gray-500.hover:text-gray-900.rounded-md.px-3.truncate.text-sm.font-medium.flex.items-center.w-full.h-9{ data: { 'action': 'tabs#show', 'pane-id': "pane_#{attachment.object_id}", 'repeater-target': 'listItem', 'tabs-target': 'button' }, type: 'button' }
49
+ %svg.w-4.h-4.mr-2{ fill: 'currentColor', viewbox: '0 0 448 512', xmlns: 'http://www.w3.org/2000/svg' }
50
+ %path{ d: 'M432 288H16c-8.8 0-16 7.2-16 16v16c0 8.8 7.2 16 16 16h416c8.8 0 16-7.2 16-16v-16c0-8.8-7.2-16-16-16zm0-112H16c-8.8 0-16 7.2-16 16v16c0 8.8 7.2 16 16 16h416c8.8 0 16-7.2 16-16v-16c0-8.8-7.2-16-16-16z' }
51
+ = attachment&.attachment_type.name
52
+ %button.text-gray-400.pl-2.hover:text-gray-900.rounded-md.truncate.text-sm.font-medium.flex.items-center.w-full.h-10{ data: { 'action': 'repeater#addFields', 'child-index': "#{new_attachment.object_id}", 'fields': fields }, type: 'button' }
53
+ = heroicon 'plus', style: :solid, class: 'w-6 h-6 mr-1'
54
+ = t 'spina.ui.new_entry'
55
+
56
+ -# Content
57
+ .flex-1.pl-6.md:pl-0{ 'data-repeater-target': 'content' }
58
+ = f.fields_for :attachments do |attachment_fields|
59
+ = render 'attachment_fields', f: attachment_fields
@@ -0,0 +1 @@
1
+ = render partial: 'delegates', object: @presentation.presenters
@@ -1,11 +1,13 @@
1
- %tr{ data: { presentation_id: presentation.id } }
2
- %td= presentation.conference.name
3
- %td= link_to presentation.title, edit_admin_conferences_presentation_path(presentation)
1
+ %tr.border-b{ data: { presentation_id: presentation.id } }
2
+ %td
3
+ .block.font-light.text-sm.p-4= presentation.conference.name
4
+ %td= link_to presentation.title, edit_admin_conferences_presentation_path(presentation), class: 'block text-spina font-medium text-sm p-4 hover:text-spina-dark'
4
5
  %td
5
6
  %ul
6
7
  - presentation.presenters.each do |presenter|
7
- %li= link_to presenter.full_name, edit_admin_conferences_delegate_path(presenter)
8
- %td.align-right
9
- = link_to edit_admin_conferences_presentation_path(presentation), class: %w[button button-small button-link] do
10
- = icon 'pencil-outline'
11
- = t 'spina.edit'
8
+ %li= link_to presenter.full_name, edit_admin_conferences_delegate_path(presenter), class: 'block text-spina font-medium text-sm p-4 hover:text-spina-dark'
9
+ %td
10
+ = link_to edit_admin_conferences_presentation_path(presentation), class: 'btn btn-default mx-4 w-max' do
11
+ .flex.flex-nowrap.items-center.px-8.py-1
12
+ = heroicon 'pencil-alt', style: :outline, class: 'w-4 h-4'
13
+ .ml-2= t 'spina.edit'
@@ -1,13 +1,18 @@
1
- - content_for(:header_actions) do
2
- %label.button{ for: 'file' }
3
- = icon('cog')
4
- = t '.import'
5
- = form_with url: import_admin_conferences_presentations_path do |f|
6
- = f.submit style: 'display: none'
7
- = f.file_field :file, multiple: false, style: 'display: none'
8
- = link_to new_admin_conferences_presentation_path, class: %w[button button-primary], style: 'margin-right: 0' do
9
- = icon 'plus'
10
- = t '.new'
1
+ = render Spina::UserInterface::HeaderComponent.new do |header|
2
+ - header.actions do
3
+ .ml-3
4
+ %label.btn.btn-primary.w-full{ for: 'file' }
5
+ = heroicon 'cog', style: :solid, class: 'w-7 h-7 -m1-2'
6
+ = t '.import'
7
+ = form_with url: import_admin_conferences_presentations_path do |f|
8
+ = f.submit style: 'display: none'
9
+ = f.file_field :file, multiple: false, style: 'display: none'
10
+
11
+ .ml-3
12
+ = link_to new_admin_conferences_presentation_path, class: 'btn btn-primary w-full' do
13
+ = heroicon 'plus', style: :solid, class: 'w-7 h-7 -m1-2'
14
+ = t '.new'
15
+
11
16
 
12
17
  = render partial: 'presentations', object: @presentations
13
18
  = link_to_next_page @presentations, 'Next'
@@ -1,23 +1,28 @@
1
- - if @room.errors.any?
2
- - content_for :notifications do
3
- = render 'errors', errors: @room.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 @room.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, @room], 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_room_path(@room), 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', room: @room.name) } }
8
13
 
9
- #header_actions
10
- %button.button.button-primary{ type: 'submit' }
11
- = icon 'check'
14
+ = button_tag type: :submit, form: dom_id(@room), 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_rooms_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
- #room_details.tab-content.active= render 'form_room_details', f: f
23
- #presentations.tab-content= render partial: 'presentations', object: @room.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
+ = render "form_#{tab}"
@@ -0,0 +1 @@
1
+ = render partial: 'presentations', object: @room.presentations
@@ -1,16 +1,7 @@
1
- .page-form
2
- .page-form-group
3
- .page-form-label= Spina::Admin::Conferences::Room.human_attribute_name :institution
4
- .page-form-control
5
- .select-dropdown= f.collection_select :institution_id, Spina::Admin::Conferences::Institution.all, :id, :name, {}, required: true
6
-
7
- .page-form-group
8
- .page-form-label= Spina::Admin::Conferences::Room.human_attribute_name :building
9
- .page-form-control= f.text_field :building, placeholder: Spina::Admin::Conferences::Room.human_attribute_name(:building), required: true
10
-
11
- .page-form-group
12
- .page-form-label= Spina::Admin::Conferences::Room.human_attribute_name :number
13
- .page-form-control= f.text_field :number, placeholder: Spina::Admin::Conferences::Room.human_attribute_name(:number), required: true
14
-
15
- - unless @room.new_record?
16
- .pull-right= link_to t('spina.permanently_delete'), admin_conferences_room_path(@room), method: :delete, data: { confirm: t('.delete_confirmation', room: @room.name) }, class: %w[button button-link button-danger]
1
+ = form_with model: [spina, :admin_conferences, @room], id: dom_id(@room), html: { autocomplete: 'off' } do |f|
2
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Room.human_attribute_name(:institution)) do
3
+ = f.collection_select :institution_id, Spina::Admin::Conferences::Institution.all, :id, :name, {}, class: 'form-select'
4
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Institution.human_attribute_name(:building)) do
5
+ = render Spina::Forms::TextFieldComponent.new(f, :building)
6
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Institution.human_attribute_name(:number)) do
7
+ = render Spina::Forms::TextFieldComponent.new(f, :number)
@@ -1,8 +1,11 @@
1
- %tr{ data: { room_id: room.id } }
2
- %td= room.institution.name
3
- %td= room.building
4
- %td= link_to room.number, edit_admin_conferences_room_path(room)
5
- %td.align-right
6
- = link_to edit_admin_conferences_room_path(room), class: %w[button button-small button-link] do
7
- = icon 'pencil-outline'
8
- = t 'spina.edit'
1
+ %tr.border-b{ data: { room_id: room.id } }
2
+ %td
3
+ .block.font-light.text-sm.p-4= room.institution.name
4
+ %td
5
+ .block.font-light.text-sm.p-4= room.building
6
+ %td= link_to room.number, edit_admin_conferences_room_path(room), class: 'block text-spina font-medium text-sm p-4 hover:text-spina-dark'
7
+ %td
8
+ = link_to edit_admin_conferences_room_path(room), 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,22 @@
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
22
  = 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
+ = render "form_#{tab}"
@@ -0,0 +1 @@
1
+ = render partial: 'presentations', object: @session.presentations
@@ -1,21 +1,15 @@
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
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:name)) do
3
+ = render Spina::Forms::TextFieldComponent.new(f, :name)
5
4
 
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' }
5
+ %div{ data: { controller: 'select-options', 'select_options': { record_value: @conferences } } }
6
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:conference)) do
7
+ = 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' }
8
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:presentation_type)) do
9
+ = 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
10
 
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]
11
+ %div{ data: { controller: 'select-options', 'select_options': { record_value: @institutions } } }
12
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:institution)) do
13
+ = 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' }
14
+ = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:room)) do
15
+ = 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,25 @@
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
25
  = 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