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,27 +1,34 @@
1
- .page-form{ data: { controller: 'spina--admin--conferences--select-options', 'spina--admin--conferences--select_options': { config_value: '{ "admin_conferences_conference_institution_id": { "value": "id", "text": "name" }, "admin_conferences_conference_room_ids": { "trigger": "admin_conferences_conference_institution_id", "key": "rooms", "value": "id", "text": "name" } }', record_value: @institutions } } }
2
- .page-form-group
3
- .page-form-label= Spina::Admin::Conferences::Conference.human_attribute_name :name
4
- .page-form-control= f.text_field :name, placeholder: Spina::Admin::Conferences::Conference.human_attribute_name(:name), required: true, class: 'input-large'
1
+ .-mt-6
2
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Conference.human_attribute_name(:name)) do
3
+ = render Spina::Forms::TextFieldComponent.new(f, :name)
4
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Conference.human_attribute_name(:start_date)) do
5
+ = f.date_field :start_date, value: (@conference.start_date.strftime("%Y-%m-%d") if @conference.start_date.present?), placeholder: Spina::Admin::Conferences::Conference.human_attribute_name(:start_date), class: 'form-input'
6
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Conference.human_attribute_name(:finish_date)) do
7
+ = f.date_field :finish_date, value: (@conference.finish_date.strftime("%Y-%m-%d") if @conference.finish_date.present?), placeholder: Spina::Admin::Conferences::Conference.human_attribute_name(:finish_date), class: 'form-input'
5
8
 
6
- .page-form-group
7
- .page-form-label= Spina::Admin::Conferences::Conference.human_attribute_name :start_date
8
- .page-form-control= f.date_field :start_date, value: (@conference.start_date.strftime("%Y-%m-%d") if @conference.start_date.present?), placeholder: Spina::Admin::Conferences::Conference.human_attribute_name(:start_date), required: true
9
9
 
10
- .page-form-group
11
- .page-form-label= Spina::Admin::Conferences::Conference.human_attribute_name :finish_date
12
- .page-form-control= f.date_field :finish_date, value: (@conference.finish_date.strftime("%Y-%m-%d") if @conference.finish_date.present?), placeholder: Spina::Admin::Conferences::Conference.human_attribute_name(:finish_date), required: true
10
+ .mt-6{ 'data-controller': 'repeater' }
11
+ %label.block.text-sm.leading-5.font-medium.text-gray-700= Spina::Admin::Conferences::Conference.human_attribute_name :events
12
+ .-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' } }
13
+ .md:w-64.md:pr-6
13
14
 
14
- .page-form-group{ class: dom_class(@conference.events) }
15
- .page-form-label= Spina::Admin::Conferences::Conference.human_attribute_name :events
16
- .page-form-control
17
- .structure-form{ data: { controller: 'spina--admin--conferences--conference-events-form', 'spina--admin--conferences--conference_events_form': { active_class: 'active' } } }
18
- .structure-form-menu
19
- %ul= render partial: 'event_row', collection: f.object.events, as: :event
20
- = link_to icon('plus'), @conference.new_record? ? new_admin_conferences_event_path : new_admin_conferences_conference_event_path(@conference, index: @conference.events.size), remote: true, class: %w[button button-link icon], data: { 'spina--admin--conferences--conference_events_form_target': 'addFormLink', disable_with: '' }
15
+ -# Fields for new event
16
+ - new_event = Spina::Admin::Conferences::Event.new
17
+ - fields = f.fields_for(:events, [new_event], child_index: new_event.object_id) { |ff| render('event_fields', f: ff) }.gsub('\n', '')
21
18
 
22
- .structure-form-content{ data: { action: 'conferenceEventFieldsAdded->spina--admin--conferences--conference-events-form#updateURL' } }
23
- = f.fields_for :events do |event_fields|
24
- = render 'event_fields', f: event_fields
19
+ -# Tabs
20
+ .pt-6.-ml-3
21
+ %div{ data: { action: 'exists->tabs#added', 'repeater-target' => 'list', 'tabs-target' => 'list' } }
22
+ - (f.object.events || []).each.with_index do |event, index|
23
+ %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_#{event.object_id}", 'repeater-target': 'listItem', 'tabs-target': 'button' }, type: 'button' }
24
+ %svg.w-4.h-4.mr-2{ fill: 'currentColor', viewbox: '0 0 448 512', xmlns: 'http://www.w3.org/2000/svg' }
25
+ %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' }
26
+ = event&.name
27
+ %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_event.object_id}", 'fields': fields }, type: 'button' }
28
+ = heroicon 'plus', style: :solid, class: 'w-6 h-6 mr-1'
29
+ = t 'spina.ui.new_entry'
25
30
 
26
- - unless @conference.new_record?
27
- .pull-right= link_to t('spina.permanently_delete'), admin_conferences_conference_path(@conference), method: :delete, data: { confirm: t('.delete_confirmation', name: @conference.name) }, class: %w[button button-link button-danger]
31
+ -# Content
32
+ .flex-1.pl-6.md:pl-0{ 'data-repeater-target': 'content' }
33
+ = f.fields_for :events do |event_fields|
34
+ = render 'event_fields', f: event_fields
@@ -0,0 +1 @@
1
+ = render partial: 'delegates', object: @conference.delegates
@@ -1,8 +1,7 @@
1
- .page-form
2
- = f.fields_for :"#{@locale}_content", @parts do |ff|
3
- = ff.hidden_field :type, value: ff.object.class.name
4
- = ff.hidden_field :title
5
- = ff.hidden_field :name
1
+ .-mt-6
2
+ = f.fields_for :"#{@locale}_content", @parts do |ff|
3
+ = ff.hidden_field :type, value: ff.object.class
4
+ = ff.hidden_field :title
5
+ = ff.hidden_field :name
6
6
 
7
- .page-form-group.page-part{ data: { name: ff.object.name } }
8
- = render "spina/admin/parts/#{parts_partial_namespace(ff.object.class.name)}/form", f: ff
7
+ = render "spina/admin/parts/#{parts_partial_namespace(ff.object.class.to_s)}/form", f: ff
@@ -0,0 +1 @@
1
+ = render partial: 'presentation_types', object: @conference.presentation_types
@@ -0,0 +1 @@
1
+ = render partial: 'presentations', object: @conference.presentations
@@ -0,0 +1 @@
1
+ = render partial: 'rooms', object: @conference.rooms
@@ -1,7 +1,27 @@
1
- - content_for(:header_actions) do
2
- = link_to new_admin_conferences_conference_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_conference_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: 'conferences', object: @conferences
7
- = link_to_next_page @conferences, 'Next'
25
+ .ml-8.inline-flex
26
+ .btn.btn-primary= link_to_prev_page @conferences, 'Previous'
27
+ .btn.btn-primary= link_to_next_page @conferences, 'Next'
@@ -1,13 +1,11 @@
1
- %tr{ data: { delegate_id: delegate.id } }
2
- %td= link_to delegate.full_name, edit_admin_conferences_delegate_path(delegate)
1
+ %tr.border-b{ data: { delegate_id: delegate.id } }
2
+ %td= link_to delegate.full_name, edit_admin_conferences_delegate_path(delegate), class: 'block text-spina font-medium text-sm p-4 hover:text-spina-dark'
3
3
  %td
4
- = delegate.email_address
5
- - unless delegate.email_address.blank?
6
- = mail_to delegate.email_address, class: %w[button button-small button-link] do
7
- = icon 'mail'
8
- = t 'spina.email'
9
- %td= delegate.institution.name
10
- %td.align-right
11
- = link_to edit_admin_conferences_delegate_path(delegate), class: %w[button button-small button-link] do
12
- = icon 'pencil-outline'
13
- = t 'spina.edit'
4
+ .block.font-light.text-sm.p-4= delegate.email_address
5
+ %td
6
+ .block.font-light.text-sm.p-4= delegate.institution.name
7
+ %td
8
+ = link_to edit_admin_conferences_delegate_path(delegate), 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,24 +1,28 @@
1
- - if @delegate.errors.any?
2
- - content_for :notifications do
3
- = render 'errors', errors: @delegate.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 @delegate.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, @delegate], 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_delegate_path(@delegate), 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', delegate: @delegate.full_name) } }
8
13
 
9
- #header_actions
10
- %button.button.button-primary{ type: 'submit' }
11
- = icon('check')
14
+ = button_tag type: :submit, form: dom_id(@delegate), 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_delegates_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
- #delegate_details.tab-content.active= render 'form_delegate_details', f: f
23
- #conferences.tab-content= render partial: 'conferences', object: @delegate.conferences
24
- #presentations.tab-content= render partial: 'presentations', object: @delegate.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: 'conferences', object: @delegate.conferences
@@ -1,53 +1,24 @@
1
- .page-form
2
- .page-form-group
3
- .page-form-label= Spina::Admin::Conferences::Delegate.human_attribute_name :name
4
- .page-form-control
5
- .input-group
6
- = f.text_field :first_name, placeholder: Spina::Admin::Conferences::Delegate.human_attribute_name(:first_name), required: true, class: 'input-large'
7
- = f.text_field :last_name, placeholder: Spina::Admin::Conferences::Delegate.human_attribute_name(:last_name), required: true, class: 'input-large'
8
-
9
- .page-form-group
10
- .page-form-label= Spina::Admin::Conferences::Delegate.human_attribute_name :institution
11
- .page-form-control
12
- .select-dropdown= f.collection_select :institution_id, Spina::Admin::Conferences::Institution.all, :id, :name, {}, required: true
13
-
14
- .page-form-group
15
- .page-form-label= Spina::Admin::Conferences::Delegate.human_attribute_name :email_address
16
- .page-form-control= f.email_field :email_address, placeholder: Spina::Admin::Conferences::Delegate.human_attribute_name(:email_address), required: true
17
-
18
- .page-form-group
19
- .page-form-label= Spina::Admin::Conferences::Delegate.human_attribute_name :url
20
- .page-form-control= f.url_field :url, placeholder: Spina::Admin::Conferences::Delegate.human_attribute_name(:url)
21
-
22
- .page-form-group
23
- .page-form-label
24
- = Spina::Admin::Conferences::Delegate.human_attribute_name :dietary_requirements
25
- .page-form-content
26
- .well{ style: 'margin: 0' }
27
- .table-container
28
- %table.table{ style: 'margin: 0' }
29
- %tbody
30
- = f.collection_check_boxes :dietary_requirement_ids, Spina::Admin::Conferences::DietaryRequirement.all, :id, :name do |builder|
31
- %tr
32
- %td{ style: "padding-left: 16px" }
33
- .form-checkbox
34
- = builder.check_box
35
- = builder.label
36
-
37
- .page-form-group
38
- .page-form-label
39
- = Spina::Admin::Conferences::Delegate.human_attribute_name :conferences
40
- .page-form-content
41
- .well{ style: 'margin: 0' }
42
- .table-container
43
- %table.table{ style: 'margin: 0' }
44
- %tbody
45
- = f.collection_check_boxes :conference_ids, Spina::Admin::Conferences::Conference.all, :id, :name, {} do |builder|
46
- %tr
47
- %td{ style: "padding-left: 16px" }
48
- .form-checkbox
49
- = builder.check_box
50
- = builder.label
51
-
52
- - unless @delegate.new_record?
53
- .pull-right= link_to t('spina.permanently_delete'), admin_conferences_delegate_path(@delegate), method: :delete, data: { confirm: t('.delete_confirmation', delegate: @delegate.full_name) }, class: %w[button button-link button-danger]
1
+ = form_with model: [spina, :admin_conferences, @delegate], id: dom_id(@delegate), html: { autocomplete: 'off' } do |f|
2
+ .-mt-6
3
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Delegate.human_attribute_name(:first_name)) do
4
+ = render Spina::Forms::TextFieldComponent.new(f, :first_name)
5
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Delegate.human_attribute_name(:last_name)) do
6
+ = render Spina::Forms::TextFieldComponent.new(f, :last_name)
7
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Room.human_attribute_name(:institution)) do
8
+ = f.collection_select :institution_id, Spina::Admin::Conferences::Institution.all, :id, :name, {}, class: 'form-select'
9
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Room.human_attribute_name(:email_address)) do
10
+ = f.email_field :email_address, class: 'form-input block w-full max-w-5xl sm:text-sm sm:leading-5'
11
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Room.human_attribute_name(:url)) do
12
+ = f.url_field :url, class: 'form-input block w-full max-w-5xl sm:text-sm sm:leading-5'
13
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Delegate.human_attribute_name(:dietary_requirements)) do
14
+ %ul.list-none.ml-4
15
+ = f.collection_check_boxes :dietary_requirement_ids, Spina::Admin::Conferences::DietaryRequirement.all, :id, :name, {}, class: 'form-checkbox rounded' do |builder|
16
+ %li
17
+ = builder.check_box
18
+ %span.text-sm.font-medium.text-gray-600= builder.label
19
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Delegate.human_attribute_name(:conferences)) do |builder|
20
+ %ul.list-none.ml-4
21
+ = f.collection_check_boxes :conference_ids, Spina::Admin::Conferences::Conference.all, :id, :name, {}, class: 'form-checkbox rounded' do |builder|
22
+ %li
23
+ = builder.check_box
24
+ %span.text-sm.font-medium.text-gray-600= builder.label
@@ -0,0 +1 @@
1
+ = render partial: 'presentations', object: @delegate.presentations
@@ -1,13 +1,19 @@
1
- - content_for(:header_actions) do
2
- %label.button{ for: 'file' }
3
- = icon 'cog'
4
- = t '.import'
5
- = form_with url: import_admin_conferences_delegates_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_delegate_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_delegates_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_delegate_path, class: 'btn btn-primary w-full' do
13
+ = heroicon 'plus', style: :solid, class: 'w-7 h-7 -m1-2'
14
+ = t '.new'
11
15
 
12
16
  = render partial: 'delegates', object: @delegates
13
- = link_to_next_page @delegates, 'Next'
17
+ .ml-8.inline-flex
18
+ .btn.btn-primary= link_to_prev_page @delegates, 'Previous'
19
+ .btn.btn-primary= link_to_next_page @delegates, 'Next'
@@ -1,6 +1,7 @@
1
- %tr{ data: { dietary_requirement_id: dietary_requirement.id } }
2
- %td= link_to dietary_requirement.name, edit_admin_conferences_dietary_requirement_path(dietary_requirement)
3
- %td.align-right
4
- = link_to edit_admin_conferences_dietary_requirement_path(dietary_requirement), class: %w[button button-small button-link] do
5
- = icon 'pencil-outline'
6
- = t 'spina.edit'
1
+ %tr.border-b{ data: { dietary_requirement_id: dietary_requirement.id } }
2
+ %td= link_to dietary_requirement.name, edit_admin_conferences_dietary_requirement_path(dietary_requirement), class: 'block text-spina font-medium text-sm p-4 hover:text-spina-dark'
3
+ %td
4
+ = link_to edit_admin_conferences_dietary_requirement_path(dietary_requirement), class: 'btn btn-default mx-4 w-max' do
5
+ .flex.flex-nowrap.items-center.px-8.py-1
6
+ = heroicon 'pencil-alt', style: :outline, class: 'w-4 h-4'
7
+ .ml-2= t 'spina.edit'
@@ -1,23 +1,28 @@
1
- - if @dietary_requirement.errors.any?
2
- - content_for :notifications do
3
- = render 'errors', errors: @dietary_requirement.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 @dietary_requirement.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, @dietary_requirement], 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_dietary_requirement_path(@dietary_requirement), 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', dietary_requirement: @dietary_requirement.name) } }
8
13
 
9
- #header_actions
10
- %button.button.button-primary{ type: 'submit' }
11
- = icon 'check'
14
+ = button_tag type: :submit, form: dom_id(@dietary_requirement), 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_dietary_requirements_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
- #dietary_requirement_details.tab-content.active= render 'form_dietary_requirement_details', f: f
23
- #delegates.tab-content= render partial: 'delegates', object: @dietary_requirement.delegates
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: 'delegates', object: @dietary_requirement.delegates
@@ -1,8 +1,4 @@
1
- %div{ style: 'margin-top: 40px' }
2
- .horizontal-form
3
- .horizontal-form-group
4
- .horizontal-form-label= Spina::Admin::Conferences::DietaryRequirement.human_attribute_name :name
5
- .horizontal-form-content= f.text_field :name, placeholder: Spina::Admin::Conferences::DietaryRequirement.human_attribute_name(:name), required: true
6
-
7
- - unless @dietary_requirement.new_record?
8
- .pull-right= link_to t('spina.permanently_delete'), admin_conferences_dietary_requirement_path(@dietary_requirement), method: :delete, data: { confirm: t('.delete_confirmation', dietary_requirement: @dietary_requirement.name) }, class: %w[button button-link button-danger]
1
+ = form_with model: [spina, :admin_conferences, @dietary_requirement], id: dom_id(@dietary_requirement), html: { autocomplete: 'off' } do |f|
2
+ .-mt-6
3
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::DietaryRequirement.human_attribute_name(:name)) do
4
+ = render Spina::Forms::TextFieldComponent.new(f, :name)
@@ -1,7 +1,11 @@
1
- - content_for(:header_actions) do
2
- = link_to new_admin_conferences_dietary_requirement_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_dietary_requirement_path, class: 'btn btn-primary w-full' do
5
+ = heroicon 'plus', style: :solid, class: 'w-7 h-7 -m1-2'
6
+ = t '.new'
5
7
 
6
8
  = render partial: 'dietary_requirements', object: @dietary_requirements
7
- = link_to_next_page @dietary_requirements, 'Next'
9
+ .ml-8.inline-flex
10
+ .btn.btn-primary= link_to_prev_page @dietary_requirements, 'Previous'
11
+ .btn.btn-primary= link_to_next_page @dietary_requirements, 'Next'
@@ -1,24 +1,28 @@
1
- - if @institution.errors.any?
2
- - content_for :notifications do
3
- = render 'errors', errors: @institution.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 @institution.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, @institution], 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_institution_path(@institution), 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', institution: @institution.name) } }
8
13
 
9
- #header_actions
10
- %button.button.button-primary{ type: 'submit' }
11
- = icon 'check'
14
+ = button_tag type: :submit, form: dom_id(@institution), 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_institutions_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
- #institution_details.tab-content.active= render 'form_institution_details', f: f
23
- #rooms.tab-content= render partial: 'rooms', object: @institution.rooms
24
- #delegates.tab-content= render partial: 'delegates', object: @institution.delegates
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: 'delegates', object: @institution.delegates
@@ -1,29 +1,29 @@
1
- .page-form
2
- .page-form-group
3
- .page-form-label= Spina::Admin::Conferences::Institution.human_attribute_name :name
4
- .page-form-control= f.text_field :name, placeholder: Spina::Admin::Conferences::Institution.human_attribute_name(:name), required: true, class: 'input-large'
1
+ = form_with model: [spina, :admin_conferences, @institution], id: dom_id(@institution), html: { autocomplete: 'off' } do |f|
2
+ .-mt-6
3
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Institution.human_attribute_name(:name)) do
4
+ = render Spina::Forms::TextFieldComponent.new(f, :name)
5
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Institution.human_attribute_name(:city)) do
6
+ = render Spina::Forms::TextFieldComponent.new(f, :city)
5
7
 
6
- .page-form-group
7
- .page-form-label= Spina::Admin::Conferences::Institution.human_attribute_name :city
8
- .page-form-control= f.text_field :city, placeholder: Spina::Admin::Conferences::Institution.human_attribute_name(:city), required: true
9
8
 
10
- .page-form-group
11
- .page-form-label= Spina::Admin::Conferences::Institution.human_attribute_name :logo
12
- .page-form-content{ data: { controller: 'image-form' } }
13
- .page-form-media-picker
14
- %div{ style: 'width: 100%' }
15
- = link_to admin_media_picker_path(selected_ids: [f.object.logo_id], input: "media_picker_#{f.object.object_id}", mode: 'single'), remote: true, class: 'image', data: { target: 'image-form.image' } do
16
- .page-form-media-picker-placeholder= t 'spina.images.choose_image'
17
- %div{ id: "media_picker_#{f.object.object_id}" }
18
- = f.hidden_field :logo_id, data: { target: 'image-form.imageId' }
19
- = f.hidden_field :logo_signed_blob_id, value: f.object.logo&.file&.signed_id, data: {target: 'image-form.signedBlobId'}
20
- = f.hidden_field :logo_filename, value: f.object.logo&.file&.filename, data: {target: 'image-form.filename'}
21
- %div{ style: 'width: 200px; height: 150px; overflow: hidden' }
22
- - if f.object.logo.present?
23
- = image_tag main_app.url_for(f.object.logo.variant(resize: '400x300^', crop: '400x300+0+0')), width: 200, height: 150
9
+ %div(class="mt-6 relative" data-controller="media-picker unique-id" data-unique-id="#{dom_id(f.object, f.object.object_id)}" data-action="media-picker:done->media-picker#handleDone")
10
+ %label(class="block text-sm leading-5 font-medium text-gray-700")
11
+ = Spina::Admin::Conferences::Institution.human_attribute_name :logo
24
12
 
25
- = button_tag type: :default, class: 'button button-small button-default', data: { action: 'image-form#remove' } do
26
- %i.icon.icon-cross{ style: 'margin: 0; font-size: 10px' }
13
+ = f.hidden_field :logo_signed_blob_id, data: { media_picker_target: 'signedBlobId' }
14
+ = f.hidden_field :logo_filename, data: { media_picker_target: 'filename' }
15
+ = f.hidden_field :logo_id, data: { media_picker_target: 'imageId' }
27
16
 
28
- - unless @institution.new_record?
29
- .pull-right= link_to t('spina.permanently_delete'), admin_conferences_institution_path(@institution), method: :delete, data: { confirm: t('.delete_confirmation', institution: @institution.name) }, class: %w[button button-link button-danger]
17
+ %button(class="absolute mt-3 ml-2 z-10 cursor-pointer flex items-center h-9 px-2 rounded-md bg-gray-700 bg-opacity-50 border-gray-300 active:shadow-inner text-gray-200 hover:text-white text-sm font-medium leading-none leading-none shadow-sm" data-action="media-picker#removeImage" data-media-picker-target="clearButton" type="button")
18
+ %svg(class="w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor")
19
+ %path(stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16")
20
+
21
+ = link_to spina.admin_media_picker_path(target: dom_id(f.object, f.object.object_id)), class: "block relative mt-1 w-full", data: {turbo_frame: "modal"} do
22
+ %div{class:"w-36 h-36 bg-transparent border-2 border-dashed border-gray-300 rounded-lg flex items-center flex-col justify-center"}
23
+ %svg.mx-auto.h-12.w-12.text-gray-400{ stroke: 'currentColor', fill:'none', viewBox: '0 0 48 48' }
24
+ %path{d: 'M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02', 'stroke-width': '2', 'stroke-linecap': 'round', 'stroke-linejoin': 'round'}
25
+ .text-gray-400.font-medium.text-sm= t 'spina.images.choose_image'
26
+
27
+ %div(class="border absolute inset-0 w-36 h-36 bg-gray-100 rounded-lg shadow-md overflow-hidden" data-media-picker-target="thumbnail")
28
+ - if f.object.logo.present?
29
+ = image_tag thumbnail_url(f.object.logo), class: 'object-contain h-36 w-full', data: { controller: 'image-fade-in' }
@@ -0,0 +1 @@
1
+ = render partial: 'rooms', object: @institution.rooms
@@ -1,7 +1,9 @@
1
- %tr{ data: { institution_id: institution.id } }
2
- %td= link_to institution.name, edit_admin_conferences_institution_path(institution)
3
- %td= institution.city
4
- %td.align-right
5
- = link_to edit_admin_conferences_institution_path(institution), class: %w[button button-small button-link] do
6
- = icon 'pencil-outline'
7
- = t 'spina.edit'
1
+ %tr.border-b{ data: { institution_id: institution.id } }
2
+ %td= link_to institution.name, edit_admin_conferences_institution_path(institution), class: 'block text-spina font-medium text-sm p-4 hover:text-spina-dark'
3
+ %td
4
+ .block.font-light.text-sm.p-4= institution.city
5
+ %td
6
+ = link_to edit_admin_conferences_institution_path(institution), class: 'btn btn-default mx-4 w-max' do
7
+ .flex.flex-nowrap.items-center.px-8.py-1
8
+ = heroicon 'pencil-alt', style: :outline, class: 'w-4 h-4'
9
+ .ml-2= t 'spina.edit'
@@ -1,7 +1,24 @@
1
- - content_for(:header_actions) do
2
- = link_to new_admin_conferences_institution_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_institution_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: 'institutions', object: @institutions
7
- = link_to_next_page @institutions, 'Next'
22
+ .ml-8.inline-flex
23
+ .btn.btn-primary= link_to_prev_page @institutions, 'Previous'
24
+ .btn.btn-primary= link_to_next_page @institutions, 'Next'