spina-admin-conferences 1.3.6 → 2.0.0.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -10
  3. data/app/assets/config/spina_admin_conferences_manifest.js +2 -2
  4. data/app/assets/javascripts/{spina/admin/conferences/controllers/conference_events_form_controller.es6 → controllers/spina/admin/conferences/conference_events_form_controller.js} +3 -4
  5. data/app/assets/javascripts/{spina/admin/conferences/controllers/presentation_attachments_form_controller.es6 → controllers/spina/admin/conferences/presentation_attachments_form_controller.js} +3 -4
  6. data/app/assets/javascripts/{spina/admin/conferences/controllers/select_options_controller.es6 → controllers/spina/admin/conferences/select_options_controller.js} +8 -9
  7. data/app/assets/javascripts/importmap.json.erb +6 -0
  8. data/app/assets/javascripts/spina/admin/conferences/application.js +4 -0
  9. data/app/assets/stylesheets/spina/admin/conferences/application.sass +3 -14
  10. data/app/controllers/spina/admin/conferences/application_controller.rb +6 -3
  11. data/app/controllers/spina/admin/conferences/conferences_controller.rb +21 -30
  12. data/app/controllers/spina/admin/conferences/delegates_controller.rb +5 -7
  13. data/app/controllers/spina/admin/conferences/dietary_requirements_controller.rb +4 -4
  14. data/app/controllers/spina/admin/conferences/institutions_controller.rb +4 -4
  15. data/app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb +4 -4
  16. data/app/controllers/spina/admin/conferences/presentation_types_controller.rb +4 -4
  17. data/app/controllers/spina/admin/conferences/presentations_controller.rb +7 -8
  18. data/app/controllers/spina/admin/conferences/rooms_controller.rb +4 -4
  19. data/app/controllers/spina/admin/conferences/sessions_controller.rb +4 -4
  20. data/app/jobs/spina/admin/conferences/presentation_import_job.rb +2 -3
  21. data/app/models/spina/admin/conferences/conference.rb +4 -7
  22. data/app/models/spina/admin/conferences/event.rb +21 -58
  23. data/app/models/spina/admin/conferences/presentation.rb +15 -33
  24. data/app/models/spina/parts/admin/conferences/date.rb +14 -0
  25. data/app/models/spina/parts/admin/conferences/email_address.rb +20 -0
  26. data/app/models/spina/parts/admin/conferences/time.rb +14 -0
  27. data/app/models/spina/parts/admin/conferences/url.rb +20 -0
  28. data/app/views/layouts/spina/admin/conferences/application.html.haml +6 -0
  29. data/app/views/layouts/spina/admin/conferences/conferences.html.haml +2 -4
  30. data/app/views/layouts/spina/admin/conferences/delegates.html.haml +2 -4
  31. data/app/views/layouts/spina/admin/conferences/dietary_requirements.html.haml +2 -4
  32. data/app/views/layouts/spina/admin/conferences/institutions.html.haml +2 -4
  33. data/app/views/layouts/spina/admin/conferences/presentation_attachment_types.html.haml +2 -4
  34. data/app/views/layouts/spina/admin/conferences/presentations.html.haml +2 -4
  35. data/app/views/spina/admin/conferences/{delegates/_form_conferences.html.haml → application/_conferences.html.haml} +2 -4
  36. data/app/views/spina/admin/conferences/{conferences/_form_delegates.html.haml → application/_delegates.html.haml} +2 -3
  37. data/app/views/spina/admin/conferences/application/_dietary_requirements.html.haml +9 -0
  38. data/app/views/spina/admin/conferences/application/_errors.turbo_stream.haml +1 -0
  39. data/app/views/spina/admin/conferences/application/_institutions.html.haml +10 -0
  40. data/app/views/spina/admin/conferences/application/_presentation_attachment_types.html.haml +10 -0
  41. data/app/views/spina/admin/conferences/{conferences/_form_presentation_types.html.haml → application/_presentation_types.html.haml} +2 -3
  42. data/app/views/spina/admin/conferences/{rooms/_form_presentations.html.haml → application/_presentations.html.haml} +2 -3
  43. data/app/views/spina/admin/conferences/{conferences/_form_rooms.html.haml → application/_rooms.html.haml} +2 -3
  44. data/app/views/spina/admin/conferences/{presentation_types/_form_sessions.html.haml → application/_sessions.html.haml} +2 -3
  45. data/app/views/spina/admin/conferences/conferences/_event_fields.html.haml +18 -25
  46. data/app/views/spina/admin/conferences/conferences/_event_row.html.haml +2 -2
  47. data/app/views/spina/admin/conferences/conferences/_form.html.haml +7 -3
  48. data/app/views/spina/admin/conferences/conferences/_form_conference_details.html.haml +22 -24
  49. data/app/views/spina/admin/conferences/conferences/_form_parts.html.haml +7 -14
  50. data/app/views/spina/admin/conferences/conferences/index.html.haml +1 -13
  51. data/app/views/spina/admin/conferences/delegates/_form.html.haml +4 -3
  52. data/app/views/spina/admin/conferences/delegates/_form_delegate_details.html.haml +47 -32
  53. data/app/views/spina/admin/conferences/delegates/index.html.haml +1 -12
  54. data/app/views/spina/admin/conferences/dietary_requirements/_form.html.haml +3 -3
  55. data/app/views/spina/admin/conferences/dietary_requirements/_form_dietary_requirement_details.html.haml +7 -8
  56. data/app/views/spina/admin/conferences/dietary_requirements/index.html.haml +1 -10
  57. data/app/views/spina/admin/conferences/events/new.js.erb +3 -9
  58. data/app/views/spina/admin/conferences/institutions/_form.html.haml +4 -3
  59. data/app/views/spina/admin/conferences/institutions/_form_institution_details.html.haml +29 -35
  60. data/app/views/spina/admin/conferences/institutions/index.html.haml +1 -11
  61. data/app/views/spina/admin/conferences/presentation_attachment_types/_form.html.haml +3 -3
  62. data/app/views/spina/admin/conferences/presentation_attachment_types/index.html.haml +1 -10
  63. data/app/views/spina/admin/conferences/presentation_attachments/new.js.erb +3 -3
  64. data/app/views/spina/admin/conferences/presentation_types/_form.html.haml +4 -3
  65. data/app/views/spina/admin/conferences/presentation_types/_form_presentation_type_details.html.haml +13 -17
  66. data/app/views/spina/admin/conferences/presentation_types/index.html.haml +1 -12
  67. data/app/views/spina/admin/conferences/presentations/_attachment_fields.html.haml +10 -19
  68. data/app/views/spina/admin/conferences/presentations/_attachment_row.html.haml +2 -2
  69. data/app/views/spina/admin/conferences/presentations/_form.html.haml +3 -3
  70. data/app/views/spina/admin/conferences/presentations/_form_presentation_details.html.haml +56 -55
  71. data/app/views/spina/admin/conferences/presentations/index.html.haml +1 -12
  72. data/app/views/spina/admin/conferences/rooms/_form.html.haml +3 -3
  73. data/app/views/spina/admin/conferences/rooms/_form_room_details.html.haml +13 -15
  74. data/app/views/spina/admin/conferences/rooms/index.html.haml +1 -12
  75. data/app/views/spina/admin/conferences/sessions/_form.html.haml +3 -3
  76. data/app/views/spina/admin/conferences/sessions/_form_session_details.html.haml +18 -20
  77. data/app/views/spina/admin/conferences/sessions/_session.html.haml +1 -1
  78. data/app/views/spina/admin/conferences/sessions/index.html.haml +1 -12
  79. data/app/views/spina/admin/hooks/conferences/_head.html.haml +5 -0
  80. data/app/views/spina/admin/hooks/conferences/_primary_navigation.html.haml +15 -14
  81. data/app/views/spina/admin/hooks/conferences/_settings_secondary_navigation.html.haml +4 -2
  82. data/app/views/spina/admin/parts/admin/conferences/dates/_form.html.haml +2 -0
  83. data/app/views/spina/admin/parts/admin/conferences/email_addresses/_form.html.haml +2 -0
  84. data/app/views/spina/admin/parts/admin/conferences/times/_form.html.haml +2 -0
  85. data/app/views/spina/admin/parts/admin/conferences/urls/_form.html.haml +2 -0
  86. data/config/initializers/assets.rb +1 -1
  87. data/config/locales/en.yml +26 -29
  88. data/db/migrate/20200911161739_move_conference_parts.rb +10 -8
  89. data/db/migrate/20201007125625_add_timestamps_to_spina_conferences_parts.rb +4 -3
  90. data/db/migrate/20210315164409_add_json_attributes_to_spina_conferences_presentations.rb +7 -0
  91. data/db/migrate/20210315164410_add_json_attributes_to_spina_conferences_conferences.rb +7 -0
  92. data/db/migrate/20210315164411_convert_partables_to_json.rb +407 -0
  93. data/lib/spina/admin/conferences.rb +2 -0
  94. data/lib/spina/admin/conferences/engine.rb +7 -0
  95. data/lib/spina/admin/conferences/version.rb +1 -1
  96. data/lib/tasks/spina/admin/conferences_tasks.rake +11 -1
  97. metadata +87 -63
  98. data/app/assets/javascripts/spina/admin/conferences/application.es6 +0 -20
  99. data/app/helpers/spina/admin/conferences/conferences_helper.rb +0 -44
  100. data/app/models/spina/admin/conferences/date_part.rb +0 -15
  101. data/app/models/spina/admin/conferences/email_address_part.rb +0 -21
  102. data/app/models/spina/admin/conferences/part.rb +0 -20
  103. data/app/models/spina/admin/conferences/time_part.rb +0 -53
  104. data/app/models/spina/admin/conferences/url_part.rb +0 -21
  105. data/app/views/spina/admin/conferences/application/_errors.js.erb +0 -2
  106. data/app/views/spina/admin/conferences/conferences/_form_presentations.html.haml +0 -12
  107. data/app/views/spina/admin/conferences/delegates/_form_presentations.html.haml +0 -12
  108. data/app/views/spina/admin/conferences/dietary_requirements/_form_delegates.html.haml +0 -12
  109. data/app/views/spina/admin/conferences/institutions/_form_delegates.html.haml +0 -12
  110. data/app/views/spina/admin/conferences/institutions/_form_rooms.html.haml +0 -12
  111. data/app/views/spina/admin/conferences/presentation_types/_form_presentations.html.haml +0 -12
  112. data/app/views/spina/admin/conferences/presentations/_form_presenters.html.haml +0 -12
  113. data/app/views/spina/admin/conferences/sessions/_form_presentations.html.haml +0 -12
  114. data/app/views/spina/admin/partables/admin/conferences/date_parts/_form.html.haml +0 -5
  115. data/app/views/spina/admin/partables/admin/conferences/email_address_parts/_form.html.haml +0 -5
  116. data/app/views/spina/admin/partables/admin/conferences/time_parts/_form.html.haml +0 -7
  117. data/app/views/spina/admin/partables/admin/conferences/url_parts/_form.html.haml +0 -5
  118. data/config/initializers/types.rb +0 -13
  119. data/lib/spina/admin/conferences/types/interval_type.rb +0 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c30ccae98052b11d0de343a6db12d48a3a584da68a0c2dc8226813a3559e783
4
- data.tar.gz: 6a4fe3a6af558192125fdb2a0162a32d58b4e51739208876afa33a3d33bbb2e2
3
+ metadata.gz: f2cf050f26e9a9367a69e05ba199802f16edbd573cdc56edf1c2b120e2baf0e6
4
+ data.tar.gz: 6b0288820aef5a159e4f9662dbc1a89e8b9ad627e9788898da8cac4353b193ce
5
5
  SHA512:
6
- metadata.gz: fddf46fd731f71914f279a8ec253f797aee685ef31c14b7f652bd934fd9736e86196adccd24ae08b6140ae41a870fa34d788acdaf93b480282bd0c18b2b008e3
7
- data.tar.gz: be324272b7adcf0cdc00968ead3f3dabfe3a9ce9a2ac5a8512389ebfd2d98af9575c7eee39d8e6f572dfcc9424c1e49041fa43dd714727b62d8f8c873b4bb9da
6
+ metadata.gz: 760273d0393107bd95e41dbd2c4dddb94cd971d826afb69bb09aced1775814ebbd354d79254ada1d567a325ab62d50e6b3becfb17e81480b97247407e7231c79
7
+ data.tar.gz: 24cf127eacd47cff18bfd50170b4954c5250a5b2cd89f78af9a46aad69062496a342571beb9b2dd77ab2959d6c81c0c0b72d4e40ad048c4a21b2cb984e6bca3b
data/README.md CHANGED
@@ -1,13 +1,12 @@
1
1
  # Conferences
2
2
 
3
- [![Build Status](https://travis-ci.com/jmalcic/spina-conferences.svg?branch=master)](https://travis-ci.com/jmalcic/spina-conferences)
4
- ![Rails tests](https://github.com/jmalcic/spina-conferences/workflows/Rails%20tests/badge.svg?branch=master&event=push)
5
- [![Coverage Status](https://coveralls.io/repos/github/jmalcic/spina-conferences/badge.svg?branch=master)](https://coveralls.io/github/jmalcic/spina-conferences?branch=master)
6
- [![Total alerts](https://img.shields.io/lgtm/alerts/g/jmalcic/spina-conferences.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/jmalcic/spina-conferences/alerts/)
7
- [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/jmalcic/spina-conferences.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/jmalcic/spina-conferences/context:javascript)
8
- [![Code quality](https://www.codefactor.io/repository/github/jmalcic/spina-conferences/badge)](https://www.codefactor.io/repository/github/jmalcic/spina-conferences)
9
- [![Inline docs](http://inch-ci.org/github/jmalcic/spina-conferences.svg?branch=master)](http://inch-ci.org/github/jmalcic/spina-conferences)
10
- [![Visual testing](https://percy.io/static/images/percy-badge.svg)](https://percy.io/Ulab/spina-conferences)
3
+ ![Rails tests](https://github.com/jmalcic/spina-admin-conferences/workflows/Rails%20tests/badge.svg?branch=master&event=push)
4
+ [![Coverage Status](https://coveralls.io/repos/github/jmalcic/spina-admin-conferences/badge.svg?branch=master)](https://coveralls.io/github/jmalcic/spina-admin-conferences?branch=master)
5
+ [![Total alerts](https://img.shields.io/lgtm/alerts/g/jmalcic/spina-admin-conferences.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/jmalcic/spina-admin-conferences/alerts/)
6
+ [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/jmalcic/spina-admin-conferences.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/jmalcic/spina-admin-conferences/context:javascript)
7
+ [![Code quality](https://www.codefactor.io/repository/github/jmalcic/spina-admin-conferences/badge)](https://www.codefactor.io/repository/github/jmalcic/spina-admin-conferences)
8
+ [![Inline docs](http://inch-ci.org/github/jmalcic/spina-admin-conferences.svg?branch=master)](http://inch-ci.org/github/jmalcic/spina-admin-conferences)
9
+ [![Visual testing](https://percy.io/static/images/percy-badge.svg)](https://percy.io/Ulab/spina-admin-conferences)
11
10
 
12
11
  *Conferences* is a plugin for [Spina](https://www.spinacms.com 'Spina website') (a [Rails](http://rubyonrails.org 'Ruby on Rails website') content management system) to add conference management functionality.
13
12
  With the plugin, you'll be able to manage details of conferences, delegates, and presentations.
@@ -73,14 +72,14 @@ Then follow the instructions below.
73
72
  Add this line to your application's Gemfile:
74
73
 
75
74
  ```ruby
76
- gem 'spina-conferences', github: 'jmalcic/spina-conferences'
75
+ gem 'spina-admin-conferences'
77
76
  ```
78
77
 
79
78
  You'll then need to install and run the migrations from Conferences (the Spina install generator does this for Spina).
80
79
 
81
80
  First install the migrations and then migrate the database:
82
81
  ```bash
83
- $ rake spina_conferences:install:migrations
82
+ $ rake spina_admin_conferences:install:migrations
84
83
  $ rake db:migrate
85
84
  ```
86
85
 
@@ -1,3 +1,3 @@
1
- //= link spina/admin/conferences/application.js
2
- //= link spina/admin/conferences/application.css
3
1
  //= link spina_manifest.js
2
+ //= link spina/admin/conferences/application.css
3
+ //= link_tree ../javascripts
@@ -1,14 +1,13 @@
1
- /* global Stimulus */
2
-
3
1
  /**
4
- * @external Stimulus
2
+ * @external Controller
5
3
  * @see {@link https://stimulusjs.org}
6
4
  */
5
+ import { Controller } from 'stimulus'
7
6
 
8
7
  /**
9
8
  * @classdesc Controller that manages conference event inputs.
10
9
  */
11
- class ConferenceEventsFormController extends Stimulus.Controller { // eslint-disable-line no-unused-vars
10
+ export default class extends Controller {
12
11
  // noinspection JSUnusedGlobalSymbols
13
12
  static get targets() {
14
13
  return [
@@ -1,14 +1,13 @@
1
- /* global Stimulus */
2
-
3
1
  /**
4
- * @external Stimulus
2
+ * @external Controller
5
3
  * @see {@link https://stimulusjs.org}
6
4
  */
5
+ import { Controller } from 'stimulus'
7
6
 
8
7
  /**
9
8
  * @classdesc Controller that manages presentation attachment inputs.
10
9
  */
11
- class PresentationAttachmentsFormController extends Stimulus.Controller { // eslint-disable-line no-unused-vars
10
+ export default class extends Controller {
12
11
  // noinspection JSUnusedGlobalSymbols
13
12
  static get targets() {
14
13
  return [
@@ -1,14 +1,13 @@
1
- /* global Stimulus */
2
-
3
1
  /**
4
- * @external Stimulus
2
+ * @external Controller
5
3
  * @see {@link https://stimulusjs.org}
6
4
  */
5
+ import { Controller } from 'stimulus'
7
6
 
8
7
  /**
9
8
  * @classdesc Controller that links related select elements.
10
9
  */
11
- class SelectOptionsController extends Stimulus.Controller { // eslint-disable-line no-unused-vars
10
+ export default class SelectOptionsController extends Controller {
12
11
  // noinspection JSUnusedGlobalSymbols
13
12
  static get targets() {
14
13
  return [
@@ -24,7 +23,7 @@ class SelectOptionsController extends Stimulus.Controller { // eslint-disable-li
24
23
  return {
25
24
  /**
26
25
  * @private
27
- * @property {Array} recordValues - The record values.
26
+ * @property {Array} recordValue - The record values.
28
27
  */
29
28
  record: Array,
30
29
  }
@@ -44,7 +43,7 @@ class SelectOptionsController extends Stimulus.Controller { // eslint-disable-li
44
43
  * Hook to update select targets when record values change.
45
44
  * @private
46
45
  */
47
- recordValuesChanged() {
46
+ recordValueChanged() {
48
47
  this.selectTargets.forEach(target => {
49
48
  if (!(target instanceof HTMLSelectElement)) return
50
49
  this.updateOptions(target)
@@ -59,8 +58,8 @@ class SelectOptionsController extends Stimulus.Controller { // eslint-disable-li
59
58
  setVisibility(event) {
60
59
  const target = event.currentTarget
61
60
  if (!(target instanceof HTMLSelectElement)) return
62
- const recordFilter = new SelectOptionsController.RecordFilter(this.recordValues, target)
63
- this.recordValues = recordFilter.setVisibility()
61
+ const recordFilter = new SelectOptionsController.RecordFilter(this.recordValue, target)
62
+ this.recordValue = recordFilter.setVisibility()
64
63
  }
65
64
 
66
65
  /**
@@ -69,7 +68,7 @@ class SelectOptionsController extends Stimulus.Controller { // eslint-disable-li
69
68
  * @param {HTMLSelectElement} target - The select element to update the options of.
70
69
  */
71
70
  updateOptions(target) {
72
- let newRecords = this.recordValues
71
+ let newRecords = this.recordValue
73
72
  if ('keyPath' in target.dataset) {
74
73
  const keyPath = new SelectOptionsController.KeyPath(target.dataset.keyPath)
75
74
  newRecords = keyPath.visibleObjectsAtKeyPath(newRecords)
@@ -0,0 +1,6 @@
1
+ {
2
+ "imports": {
3
+ "turbo": "<%= asset_path "turbo" %>",
4
+ <%= importmap_list_with_stimulus_from Spina::Admin::Conferences::Engine.root.join('app/assets/javascripts/controllers').relative_path_from(Rails.root) %>
5
+ }
6
+ }
@@ -0,0 +1,4 @@
1
+ document.addEventListener('turbo:load', (event) => {
2
+ const customEvent = new CustomEvent('turbolinks:load', { cancelable: event.cancelable, bubbles: true, detail: event.detail })
3
+ document.documentElement.dispatchEvent(customEvent)
4
+ })
@@ -1,14 +1,3 @@
1
- input::-webkit-calendar-picker-indicator
2
- display: none
3
- input[type="date"]::-webkit-outer-spin-button, input[type="date"]::-webkit-inner-spin-button, input[type="time"]::-webkit-inner-spin-button, input[type="time"]::-webkit-inner-spin-button
4
- display: none
5
- input[type="date"]
6
- padding-right: 30px
7
-
8
- .multiple.select-dropdown
9
- z-index: 0
10
- &:before
11
- content: none
12
- select
13
- padding: 11px 10px
14
- width: 100%
1
+ .turbo-progress-bar
2
+ @import spina/configuration
3
+ background-color: $primary-color
@@ -5,14 +5,17 @@ module Spina
5
5
  module Conferences
6
6
  # @abstract Subclass to implement a custom controller.
7
7
  class ApplicationController < ::Spina::Admin::AdminController
8
+ helper ::Spina::Engine.routes.url_helpers
9
+
8
10
  add_flash_types :success
9
11
 
10
- layout :admin_layout, only: %i[new edit]
12
+ layout 'spina/admin/conferences/application', only: %i[new edit]
13
+ before_action :set_locale
11
14
 
12
15
  private
13
16
 
14
- def admin_layout
15
- 'spina/admin/admin'
17
+ def set_locale
18
+ @locale = params[:locale] || I18n.default_locale
16
19
  end
17
20
  end
18
21
  end
@@ -6,16 +6,21 @@ module Spina
6
6
  # Controller for {Conference} objects.
7
7
  # @see Conference
8
8
  class ConferencesController < ApplicationController
9
- PARTS = [
10
- { name: 'text', title: 'Text', partable_type: 'Spina::Text' },
11
- { name: 'submission_url', title: 'Submission URL', partable_type: 'Spina::Admin::Conferences::UrlPart' },
12
- { name: 'submission_email_address', title: 'Submission email address',
13
- partable_type: 'Spina::Admin::Conferences::EmailAddressPart' },
14
- { name: 'submission_date', title: 'Submission date', partable_type: 'Spina::Admin::Conferences::DatePart' },
15
- { name: 'submission_text', title: 'Submission text', partable_type: 'Spina::Line' },
16
- { name: 'gallery', title: 'Gallery', partable_type: 'Spina::ImageCollection' },
17
- { name: 'sponsors', title: 'Sponsors', partable_type: 'Spina::Structure' }
9
+ PARTS_PARAMS = [
10
+ :name, :title, :type, :content, :filename, :signed_blob_id, :alt, :attachment_id, :image_id,
11
+ images_attributes: %i[filename signed_blob_id image_id alt],
12
+ content_attributes: [
13
+ :name, :title,
14
+ parts_attributes: [
15
+ :name, :title, :type, :content, :filename, :signed_blob_id, :alt, :attachment_id, :image_id,
16
+ images_attributes: %i[filename signed_blob_id image_id alt]
17
+ ]
18
+ ]
18
19
  ].freeze
20
+ CONTENT_PARAMS = Spina.config.locales.inject({}) { |params, locale| params.merge("#{locale}_content_attributes": [*PARTS_PARAMS]) }
21
+ PARAMS = [:start_date, :finish_date, :name, **CONTENT_PARAMS,
22
+ events_attributes: %i[id name start_datetime finish_datetime description location] ].freeze
23
+ PARTS = %w[text submission_url submission_email_address submission_date submission_text gallery sponsors].freeze
19
24
 
20
25
  before_action :set_conference, only: %i[edit update destroy]
21
26
  before_action :set_conferences_breadcrumb
@@ -58,7 +63,7 @@ module Spina
58
63
  add_breadcrumb t('.new')
59
64
  render :new
60
65
  end
61
- format.js { render partial: 'errors', locals: { errors: @conference.errors } }
66
+ format.turbo_stream { render partial: 'errors', locals: { errors: @conference.errors } }
62
67
  end
63
68
  end
64
69
  end
@@ -74,7 +79,7 @@ module Spina
74
79
  add_breadcrumb @conference.name
75
80
  render :edit
76
81
  end
77
- format.js { render partial: 'errors', locals: { errors: @conference.errors } }
82
+ format.turbo_stream { render partial: 'errors', locals: { errors: @conference.errors } }
78
83
  end
79
84
  end
80
85
  end
@@ -90,7 +95,7 @@ module Spina
90
95
  add_breadcrumb @conference.name
91
96
  render :edit
92
97
  end
93
- format.js { render partial: 'errors', locals: { errors: @conference.errors } }
98
+ format.turbo_stream { render partial: 'errors', locals: { errors: @conference.errors } }
94
99
  end
95
100
  end
96
101
  end
@@ -116,31 +121,17 @@ module Spina
116
121
  end
117
122
 
118
123
  def set_parts_attributes
119
- @parts_attributes = PARTS
124
+ @parts_attributes = current_theme.parts.select { |part| PARTS.include? part[:name] }
120
125
  end
121
126
 
122
127
  def build_parts
123
128
  return unless @parts_attributes.is_a? Array
124
129
 
125
- @conference.parts = @parts_attributes.collect do |part_attributes|
126
- @conference.parts.where(name: part_attributes[:name]).first_or_initialize(**part_attributes)
127
- .tap { |part| part.partable ||= part.partable_type.constantize.new }
128
- end
130
+ @parts = @parts_attributes.collect { |part_attributes| @conference.part(part_attributes) }
129
131
  end
130
132
 
131
- def conference_params # rubocop:disable Metrics/MethodLength
132
- params.require(:admin_conferences_conference).permit(:start_date, :finish_date, :name,
133
- events_attributes:
134
- %i[id name date start_time finish_time description location],
135
- parts_attributes:
136
- [:id, :title, :name, :partable_type, :partable_id,
137
- { partable_attributes:
138
- [:id, :content, :image_tokens, :image_positions, :date, :time,
139
- { structure_items_attributes:
140
- [:id, :position, :_destroy,
141
- { structure_parts_attributes:
142
- [:id, :title, :structure_partable_type, :name, :partable_id,
143
- { partable_attributes: {} }] }] }] }])
133
+ def conference_params
134
+ params.require(:conference).permit(PARAMS)
144
135
  end
145
136
  end
146
137
  end
@@ -44,7 +44,7 @@ module Spina
44
44
  add_breadcrumb t('.new')
45
45
  render :new
46
46
  end
47
- format.js { render partial: 'errors', locals: { errors: @delegate.errors } }
47
+ format.turbo_stream { render partial: 'errors', locals: { errors: @delegate.errors } }
48
48
  end
49
49
  end
50
50
  end
@@ -60,7 +60,7 @@ module Spina
60
60
  add_breadcrumb @delegate.full_name
61
61
  render :edit
62
62
  end
63
- format.js { render partial: 'errors', locals: { errors: @delegate.errors } }
63
+ format.turbo_stream { render partial: 'errors', locals: { errors: @delegate.errors } }
64
64
  end
65
65
  end
66
66
  end
@@ -76,7 +76,7 @@ module Spina
76
76
  add_breadcrumb @delegate.full_name
77
77
  render :edit
78
78
  end
79
- format.js { render partial: 'errors', locals: { errors: @delegate.errors } }
79
+ format.turbo_stream { render partial: 'errors', locals: { errors: @delegate.errors } }
80
80
  end
81
81
  end
82
82
  end
@@ -105,10 +105,8 @@ module Spina
105
105
  end
106
106
 
107
107
  def delegate_params
108
- params.require(:admin_conferences_delegate).permit(:first_name, :last_name, :email_address, :url,
109
- :institution_id,
110
- conference_ids: [],
111
- dietary_requirement_ids: [])
108
+ params.require(:delegate).permit(:first_name, :last_name, :email_address, :url, :institution_id,
109
+ conference_ids: [], dietary_requirement_ids: [])
112
110
  end
113
111
  end
114
112
  end
@@ -44,7 +44,7 @@ module Spina
44
44
  add_breadcrumb t('.new')
45
45
  render :new
46
46
  end
47
- format.js { render partial: 'errors', locals: { errors: @dietary_requirement.errors } }
47
+ format.turbo_stream { render partial: 'errors', locals: { errors: @dietary_requirement.errors } }
48
48
  end
49
49
  end
50
50
  end
@@ -60,7 +60,7 @@ module Spina
60
60
  add_breadcrumb @dietary_requirement.name
61
61
  render :edit
62
62
  end
63
- format.js { render partial: 'errors', locals: { errors: @dietary_requirement.errors } }
63
+ format.turbo_stream { render partial: 'errors', locals: { errors: @dietary_requirement.errors } }
64
64
  end
65
65
  end
66
66
  end
@@ -76,7 +76,7 @@ module Spina
76
76
  add_breadcrumb @dietary_requirement.name
77
77
  render :edit
78
78
  end
79
- format.js { render partial: 'errors', locals: { errors: @dietary_requirement.errors } }
79
+ format.turbo_stream { render partial: 'errors', locals: { errors: @dietary_requirement.errors } }
80
80
  end
81
81
  end
82
82
  end
@@ -98,7 +98,7 @@ module Spina
98
98
  end
99
99
 
100
100
  def dietary_requirement_params
101
- params.require(:admin_conferences_dietary_requirement).permit(:name)
101
+ params.require(:dietary_requirement).permit(:name)
102
102
  end
103
103
  end
104
104
  end
@@ -44,7 +44,7 @@ module Spina
44
44
  add_breadcrumb t('.new')
45
45
  render :new
46
46
  end
47
- format.js { render partial: 'errors', locals: { errors: @institution.errors } }
47
+ format.turbo_stream { render partial: 'errors', locals: { errors: @institution.errors } }
48
48
  end
49
49
  end
50
50
  end
@@ -60,7 +60,7 @@ module Spina
60
60
  add_breadcrumb @institution.name
61
61
  render :edit
62
62
  end
63
- format.js { render partial: 'errors', locals: { errors: @institution.errors } }
63
+ format.turbo_stream { render partial: 'errors', locals: { errors: @institution.errors } }
64
64
  end
65
65
  end
66
66
  end
@@ -76,7 +76,7 @@ module Spina
76
76
  add_breadcrumb @institution.name
77
77
  render :edit
78
78
  end
79
- format.js { render partial: 'errors', locals: { errors: @institution.errors } }
79
+ format.turbo_stream { render partial: 'errors', locals: { errors: @institution.errors } }
80
80
  end
81
81
  end
82
82
  end
@@ -98,7 +98,7 @@ module Spina
98
98
  end
99
99
 
100
100
  def conference_params
101
- params.require(:admin_conferences_institution).permit(:name, :city, :logo_id)
101
+ params.require(:institution).permit(:name, :city, :logo_id)
102
102
  end
103
103
  end
104
104
  end
@@ -43,7 +43,7 @@ module Spina
43
43
  add_breadcrumb t('.new')
44
44
  render :new
45
45
  end
46
- format.js { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } }
46
+ format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } }
47
47
  end
48
48
  end
49
49
  end
@@ -59,7 +59,7 @@ module Spina
59
59
  add_breadcrumb @presentation_attachment_type.name
60
60
  render :edit
61
61
  end
62
- format.js { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } }
62
+ format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } }
63
63
  end
64
64
  end
65
65
  end
@@ -75,7 +75,7 @@ module Spina
75
75
  add_breadcrumb @presentation_attachment_type.name
76
76
  render :edit
77
77
  end
78
- format.js { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } }
78
+ format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } }
79
79
  end
80
80
  end
81
81
  end
@@ -96,7 +96,7 @@ module Spina
96
96
 
97
97
  # noinspection RubyInstanceMethodNamingConvention
98
98
  def presentation_attachment_type_params
99
- params.require(:admin_conferences_presentation_attachment_type).permit(:name)
99
+ params.require(:presentation_attachment_type).permit(:name)
100
100
  end
101
101
  end
102
102
  end
@@ -46,7 +46,7 @@ module Spina
46
46
  add_breadcrumb t('.new')
47
47
  render :new
48
48
  end
49
- format.js { render partial: 'errors', locals: { errors: @presentation_type.errors } }
49
+ format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_type.errors } }
50
50
  end
51
51
  end
52
52
  end
@@ -62,7 +62,7 @@ module Spina
62
62
  add_breadcrumb @presentation_type.name
63
63
  render :edit
64
64
  end
65
- format.js { render partial: 'errors', locals: { errors: @presentation_type.errors } }
65
+ format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_type.errors } }
66
66
  end
67
67
  end
68
68
  end
@@ -78,7 +78,7 @@ module Spina
78
78
  add_breadcrumb @presentation_type.name
79
79
  render :edit
80
80
  end
81
- format.js { render partial: 'errors', locals: { errors: @presentation_type.errors } }
81
+ format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_type.errors } }
82
82
  end
83
83
  end
84
84
  end
@@ -101,7 +101,7 @@ module Spina
101
101
  end
102
102
 
103
103
  def presentation_type_params
104
- params.require(:admin_conferences_presentation_type).permit(:name, :conference_id, :minutes)
104
+ params.require(:presentation_type).permit(:name, :conference_id, :minutes)
105
105
  end
106
106
  end
107
107
  end