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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c49d67e54dfe8e122eb4fc4ca6e7d333408739c25ce9bc8f4bb1e425af16240
4
- data.tar.gz: c33f5d5d1ec3807dd692dea90a507017af41f50ec7381ced7bc1d9ebe8ecca5c
3
+ metadata.gz: '0924918c23bbaf05550c4f245a658955dc8116dfbdda3e9fe17abfc59576dc97'
4
+ data.tar.gz: 201b0680cad2c8c4b16a922c11784c1ca170d534288eed0d44c438fe141f2a56
5
5
  SHA512:
6
- metadata.gz: 3d60e46c9dd93b243fd48c2ffd6bed97eef83d95742d3b011423e273db1c27071c6f5c0e5ddb7c0b5f5baa748bec43c86b1fd2cdde1fd973f7a8e897cb0cf6fc
7
- data.tar.gz: 2785f5d514a75333ba1190724fd1bb3444b949478bf7aa9859d09327e90885f7a46bacf76b893454e7a51ff16ef6e3bdb7a108802272fd533460dde43d44d1e5
6
+ metadata.gz: 71f9d163f9a0e96c5b7202143df4a49e1dc6945fc200fd427c1e3f356aed5f7e04d373916f5a59d9a7827f1c0b4a53ac1a31d554997e507b33b0651c47fefff3
7
+ data.tar.gz: 805deb378c7202842bf7bbbfaf1bf256341386e978f4566b1a2d71aaaf555fea4bddd5ea6eaa7866f0d8ba08ba51d687981bcccb96f275723c5c1ba353381a2a
data/README.md CHANGED
@@ -1,33 +1,34 @@
1
1
  # Conferences
2
2
 
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)
10
-
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.
12
- With the plugin, you'll be able to manage details of conferences, delegates, and presentations.
13
- See the wiki for details of the types of data supported.
3
+ *Conferences* is a plugin for [Spina](https://www.spinacms.com/) that provides conference management functionality. With the plugin, you'll be able to manage details of conferences, delegates, and presentations.
4
+
5
+ Spina is a content management system built in [Ruby on Rails](http://rubyonrails.org/). *Conferences* augments Spina by providing an admin interface for managing conferences.
6
+
7
+ ![Rails tests](https://github.com/louis-vs/spina-admin-conferences-fork/workflows/Verify/badge.svg?branch=main&event=push)
8
+ [![CodeFactor](https://www.codefactor.io/repository/github/louis-vs/spina-admin-conferences-fork/badge)](https://www.codefactor.io/repository/github/louis-vs/spina-admin-conferences-fork)
9
+
10
+ ## Features
11
+
12
+ The conferences plugin covers many important aspects of managing a conferences, including:
13
+
14
+ - Simple interface that builds upon Spina's own.
15
+ - Manage details about delegates, including dietary requirements.
16
+ - Manage conferences, supporting conferences with multiple host institutions.
17
+ - Manage presentations, including presentation types.
18
+
19
+ Currently, a submissions management system is not included, but this is planned for a future release. This will allow you to manage the submissions process for conferences in a manner integrated with the CMS.
14
20
 
15
21
  ## Usage
16
22
 
17
23
  The plugin will add a **Conferences** item to Spina's primary navigation menu.
18
24
  The menu structure will then be as follows:
19
25
 
20
- * *Other menu items*
21
-
22
- * Conferences
23
-
24
- * Institutions
25
-
26
- * Conferences
27
-
28
- * Delegates
29
-
30
- * Presentations
26
+ - *Other menu items*
27
+ - Conferences
28
+ - Institutions
29
+ - Conferences
30
+ - Delegates
31
+ - Presentations
31
32
 
32
33
  After installing the plugin, you just need to start your server in the usual way:
33
34
  ```bash
@@ -37,63 +38,45 @@ $ rails s
37
38
  ## Installation
38
39
 
39
40
  ### From scratch
41
+ Make sure you have a working installation of Ruby on Rails 7. You can find a setup guide [here](https://guides.rubyonrails.org/getting_started.html).
40
42
 
41
- You'll need [Rails](http://rubyonrails.org 'Ruby on Rails website') installed if it isn't already.
42
- Read how to do this in the [Rails getting started guide](https://guides.rubyonrails.org/getting_started.html 'Getting Started with Rails').
43
+ You then need to install Spina, following the guide [on the Spina website](https://spinacms.com/docs).
43
44
 
44
- Then run:
45
- ```bash
46
- $ rails new your_app --database postgresql
47
- $ rails db:create
48
- $ rails active_storage:install
49
- ```
50
-
51
- Add this line to your application's Gemfile:
45
+ To install the plugin, add this line to your application's Gemfile:
52
46
 
53
47
  ```ruby
54
- gem 'spina'
48
+ gem 'spina-admin-conferences-fork', '~> 3.0'
55
49
  ```
56
50
 
57
- And then execute:
58
- ```bash
59
- $ bundle:install
60
- ```
51
+ Then execute:
61
52
 
62
- Run the Spina install generator:
63
53
  ```bash
64
- $ rails g spina:install
54
+ $ bundle install
65
55
  ```
66
56
 
67
- And follow the prompts.
68
- Then follow the instructions below.
69
-
70
- ### For existing Spina installations
71
-
72
- Add this line to your application's Gemfile:
57
+ You'll then need to install and run the migrations from the plugin:
73
58
 
74
- ```ruby
75
- gem 'spina-admin-conferences'
59
+ ```bash
60
+ $ bin/rails spina_admin_conferences:install:migrations
61
+ $ bin/rails db:migrate
76
62
  ```
77
63
 
78
- You'll then need to install and run the migrations from Conferences (the Spina install generator does this for Spina).
64
+ You can then start a local server to test that everything's working.
79
65
 
80
- First install the migrations and then migrate the database:
81
66
  ```bash
82
- $ rake spina_admin_conferences:install:migrations
83
- $ rake db:migrate
67
+ $ bin/rails s
84
68
  ```
85
69
 
70
+ You can manually populate the database from within the app, or alternatively you can use seed data for testing. A sample `seeds.rb` file can be found [here](../master/test/dummy/db/seeds.rb).
71
+
72
+
86
73
  ### Configuring the main Rails app
87
74
 
88
- Conferences requires a job queueing backend for import functionality, and you'll also want to cache pages listing
89
- presentations, conferences, and so on. Read about this in the Rails guides covering
90
- [Active Job](https://guides.rubyonrails.org/active_job_basics.html) and
91
- [caching](https://guides.rubyonrails.org/caching_with_rails.html).
75
+ Conferences requires a job queueing backend for import functionality, and you'll also want to cache pages listing presentations, conferences, and so on. Read about this in the Rails guides covering [Active Job](https://guides.rubyonrails.org/active_job_basics.html) and [caching](https://guides.rubyonrails.org/caching_with_rails.html).
92
76
 
93
77
  ## Contributing
94
78
 
95
- You're very welcome to contribute, particularly to translations.
96
- If there's a bug, or you have a feature request, make an issue on GitHub first.
79
+ Bug reports and feature requests are welcome in the [Issues](https://github.com/louis-vs/spina-admin-conferences-fork/issues) section. Translations are also very welcome!
97
80
 
98
81
  ## License
99
82
 
@@ -1,3 +1,3 @@
1
- //= link spina_manifest.js
2
- //= link spina/admin/conferences/application.css
3
- //= link_tree ../javascripts
1
+ //= link_directory ../javascripts/spina/admin/conferences/controllers
2
+
3
+ //= link spina/admin/conferences/application.js
@@ -1,4 +0,0 @@
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
- })
@@ -2,7 +2,7 @@
2
2
  * @external Controller
3
3
  * @see {@link https://stimulusjs.org}
4
4
  */
5
- import { Controller } from 'stimulus'
5
+ import { Controller } from '@hotwired/stimulus'
6
6
 
7
7
  /**
8
8
  * @classdesc Controller that links related select elements.
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spina
4
+ module Admin
5
+ module Conferences
6
+ # Base class for components.
7
+ class ApplicationComponent < Spina::ApplicationComponent
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,4 @@
1
+ .mt-6
2
+ %label.block.text-sm.leading-5.font-medium.text-gray-700= label
3
+ .text-gray-400.text-sm= description
4
+ .mt-1= content
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spina
4
+ module Admin
5
+ module Conferences
6
+ # Correctly styles label, description and content of form fields.
7
+ class FormGroupComponent < ApplicationComponent
8
+ attr_reader :label, :description
9
+
10
+ def initialize(label:, description: '')
11
+ @label = label
12
+ @description = description
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -9,11 +9,18 @@ module Spina
9
9
 
10
10
  add_flash_types :success
11
11
 
12
- layout 'spina/admin/conferences/application', only: %i[new edit]
12
+ layout :admin_layout
13
+
13
14
  before_action :set_locale
14
15
 
16
+ admin_section :conferences
17
+
15
18
  private
16
19
 
20
+ def admin_layout
21
+ 'spina/admin/admin'
22
+ end
23
+
17
24
  def set_locale
18
25
  @locale = params[:locale] || I18n.default_locale
19
26
  end
@@ -19,7 +19,7 @@ module Spina
19
19
  ].freeze
20
20
  CONTENT_PARAMS = Spina.config.locales.inject({}) { |params, locale| params.merge("#{locale}_content_attributes": [*PARTS_PARAMS]) }
21
21
  PARAMS = [:start_date, :finish_date, :name, **CONTENT_PARAMS,
22
- events_attributes: %i[id name start_datetime finish_datetime description location] ].freeze
22
+ events_attributes: %i[id name start_datetime finish_datetime description location]].freeze
23
23
  PARTS = %w[text submission_url submission_email_address submission_date submission_text gallery sponsors].freeze
24
24
 
25
25
  before_action :set_conference, only: %i[edit update destroy]
@@ -52,51 +52,39 @@ module Spina
52
52
 
53
53
  # Creates a conference.
54
54
  # @return [void]
55
- def create # rubocop:disable Metrics/MethodLength
55
+ def create
56
56
  @conference = Conference.new(conference_params)
57
57
 
58
58
  if @conference.save
59
59
  redirect_to admin_conferences_conferences_path, success: t('.saved')
60
60
  else
61
- respond_to do |format|
62
- format.html do
63
- add_breadcrumb t('.new')
64
- render :new
65
- end
66
- format.turbo_stream { render partial: 'errors', locals: { errors: @conference.errors } }
67
- end
61
+ add_breadcrumb t('.new')
62
+ flash.now[:alert] = t('.failed')
63
+ render :new, status: :unprocessable_entity
68
64
  end
69
65
  end
70
66
 
71
67
  # Updates a conference.
72
68
  # @return [void]
73
- def update # rubocop:disable Metrics/MethodLength
69
+ def update
74
70
  if @conference.update(conference_params)
75
71
  redirect_to admin_conferences_conferences_path, success: t('.saved')
76
72
  else
77
- respond_to do |format|
78
- format.html do
79
- add_breadcrumb @conference.name
80
- render :edit
81
- end
82
- format.turbo_stream { render partial: 'errors', locals: { errors: @conference.errors } }
83
- end
73
+ add_breadcrumb @conference.name
74
+ flash.now[:alert] = t('.failed')
75
+ render :edit, status: :unprocessable_entity
84
76
  end
85
77
  end
86
78
 
87
79
  # Destroys a conference.
88
80
  # @return [void]
89
- def destroy # rubocop:disable Metrics/MethodLength
81
+ def destroy
90
82
  if @conference.destroy
91
83
  redirect_to admin_conferences_conferences_path, success: t('.destroyed')
92
84
  else
93
- respond_to do |format|
94
- format.html do
95
- add_breadcrumb @conference.name
96
- render :edit
97
- end
98
- format.turbo_stream { render partial: 'errors', locals: { errors: @conference.errors } }
99
- end
85
+ add_breadcrumb @conference.name
86
+ flash.now[:alert] = t('.failed')
87
+ render :edit, status: :unprocessable_entity
100
88
  end
101
89
  end
102
90
 
@@ -33,51 +33,39 @@ module Spina
33
33
 
34
34
  # Creates a delegate.
35
35
  # @return [void]
36
- def create # rubocop:disable Metrics/MethodLength
36
+ def create
37
37
  @delegate = Delegate.new(delegate_params)
38
38
 
39
39
  if @delegate.save
40
40
  redirect_to admin_conferences_delegates_path, success: t('.saved')
41
41
  else
42
- respond_to do |format|
43
- format.html do
44
- add_breadcrumb t('.new')
45
- render :new
46
- end
47
- format.turbo_stream { render partial: 'errors', locals: { errors: @delegate.errors } }
48
- end
42
+ add_breadcrumb t('.new')
43
+ flash.now[:alert] = t('.failed')
44
+ render :new, status: :unprocessable_entity
49
45
  end
50
46
  end
51
47
 
52
48
  # Updates a delegate.
53
49
  # @return [void]
54
- def update # rubocop:disable Metrics/MethodLength
50
+ def update
55
51
  if @delegate.update(delegate_params)
56
52
  redirect_to admin_conferences_delegates_path, success: t('.saved')
57
53
  else
58
- respond_to do |format|
59
- format.html do
60
- add_breadcrumb @delegate.full_name
61
- render :edit
62
- end
63
- format.turbo_stream { render partial: 'errors', locals: { errors: @delegate.errors } }
64
- end
54
+ add_breadcrumb @delegate.full_name
55
+ flash.now[:alert] = t('.failed')
56
+ render :edit, status: :unprocessable_entity
65
57
  end
66
58
  end
67
59
 
68
60
  # Destroys a delegate.
69
61
  # @return [void]
70
- def destroy # rubocop:disable Metrics/MethodLength
62
+ def destroy
71
63
  if @delegate.destroy
72
64
  redirect_to admin_conferences_delegates_path, success: t('.destroyed')
73
65
  else
74
- respond_to do |format|
75
- format.html do
76
- add_breadcrumb @delegate.full_name
77
- render :edit
78
- end
79
- format.turbo_stream { render partial: 'errors', locals: { errors: @delegate.errors } }
80
- end
66
+ add_breadcrumb @delegate.full_name
67
+ flash.now[:alert] = t('.failed')
68
+ render :edit, status: :unprocessable_entity
81
69
  end
82
70
  end
83
71
 
@@ -33,51 +33,39 @@ module Spina
33
33
 
34
34
  # Creates a dietary requirement.
35
35
  # @return [void]
36
- def create # rubocop:disable Metrics/MethodLength
36
+ def create
37
37
  @dietary_requirement = DietaryRequirement.new dietary_requirement_params
38
38
 
39
39
  if @dietary_requirement.save
40
40
  redirect_to admin_conferences_dietary_requirements_path, success: t('.saved')
41
41
  else
42
- respond_to do |format|
43
- format.html do
44
- add_breadcrumb t('.new')
45
- render :new
46
- end
47
- format.turbo_stream { render partial: 'errors', locals: { errors: @dietary_requirement.errors } }
48
- end
42
+ add_breadcrumb t('.new')
43
+ flash.now[:alert] = t('.failed')
44
+ render :new, status: :unprocessable_entity
49
45
  end
50
46
  end
51
47
 
52
48
  # Updates a dietary requirement.
53
49
  # @return [void]
54
- def update # rubocop:disable Metrics/MethodLength
50
+ def update
55
51
  if @dietary_requirement.update(dietary_requirement_params)
56
52
  redirect_to admin_conferences_dietary_requirements_path, success: t('.saved')
57
53
  else
58
- respond_to do |format|
59
- format.html do
60
- add_breadcrumb @dietary_requirement.name
61
- render :edit
62
- end
63
- format.turbo_stream { render partial: 'errors', locals: { errors: @dietary_requirement.errors } }
64
- end
54
+ add_breadcrumb @dietary_requirement.name
55
+ flash.now[:alert] = t('.failed')
56
+ render :edit, status: :unprocessable_entity
65
57
  end
66
58
  end
67
59
 
68
60
  # Destroys a dietary requirement.
69
61
  # @return [void]
70
- def destroy # rubocop:disable Metrics/MethodLength
62
+ def destroy
71
63
  if @dietary_requirement.destroy
72
64
  redirect_to admin_conferences_dietary_requirements_path, success: t('.destroyed')
73
65
  else
74
- respond_to do |format|
75
- format.html do
76
- add_breadcrumb @dietary_requirement.name
77
- render :edit
78
- end
79
- format.turbo_stream { render partial: 'errors', locals: { errors: @dietary_requirement.errors } }
80
- end
66
+ add_breadcrumb @dietary_requirement.name
67
+ flash.now[:alert] = t('.failed')
68
+ render :edit, status: :unprocessable_entity
81
69
  end
82
70
  end
83
71
 
@@ -33,51 +33,39 @@ module Spina
33
33
 
34
34
  # Creates an institution.
35
35
  # @return [void]
36
- def create # rubocop:disable Metrics/MethodLength
36
+ def create
37
37
  @institution = Institution.new(conference_params)
38
38
 
39
39
  if @institution.save
40
40
  redirect_to admin_conferences_institutions_path, success: t('.saved')
41
41
  else
42
- respond_to do |format|
43
- format.html do
44
- add_breadcrumb t('.new')
45
- render :new
46
- end
47
- format.turbo_stream { render partial: 'errors', locals: { errors: @institution.errors } }
48
- end
42
+ add_breadcrumb t('.new')
43
+ flash.now[:alert] = t('.failed')
44
+ render :new, status: :unprocessable_entity
49
45
  end
50
46
  end
51
47
 
52
48
  # Updates an institution.
53
49
  # @return [void]
54
- def update # rubocop:disable Metrics/MethodLength
50
+ def update
55
51
  if @institution.update(conference_params)
56
52
  redirect_to admin_conferences_institutions_path, success: t('.saved')
57
53
  else
58
- respond_to do |format|
59
- format.html do
60
- add_breadcrumb @institution.name
61
- render :edit
62
- end
63
- format.turbo_stream { render partial: 'errors', locals: { errors: @institution.errors } }
64
- end
54
+ add_breadcrumb @institution.name
55
+ flash.now[:alert] = t('.failed')
56
+ render :edit, status: :unprocessable_entity
65
57
  end
66
58
  end
67
59
 
68
60
  # Destroys an institution.
69
61
  # @return [void]
70
- def destroy # rubocop:disable Metrics/MethodLength
62
+ def destroy
71
63
  if @institution.destroy
72
64
  redirect_to admin_conferences_institutions_path, success: t('.destroyed')
73
65
  else
74
- respond_to do |format|
75
- format.html do
76
- add_breadcrumb @institution.name
77
- render :edit
78
- end
79
- format.turbo_stream { render partial: 'errors', locals: { errors: @institution.errors } }
80
- end
66
+ add_breadcrumb @institution.name
67
+ flash.now[:alert] = t('.failed')
68
+ render :edit, status: :unprocessable_entity
81
69
  end
82
70
  end
83
71
 
@@ -32,51 +32,39 @@ module Spina
32
32
 
33
33
  # Creates a presentation attachment type.
34
34
  # @return [void]
35
- def create # rubocop:disable Metrics/MethodLength
35
+ def create
36
36
  @presentation_attachment_type = PresentationAttachmentType.new presentation_attachment_type_params
37
37
 
38
38
  if @presentation_attachment_type.save
39
39
  redirect_to admin_conferences_presentation_attachment_types_path, success: t('.saved')
40
40
  else
41
- respond_to do |format|
42
- format.html do
43
- add_breadcrumb t('.new')
44
- render :new
45
- end
46
- format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } }
47
- end
41
+ add_breadcrumb t('.new')
42
+ flash.now[:alert] = t('.failed')
43
+ render :new, status: :unprocessable_entity
48
44
  end
49
45
  end
50
46
 
51
47
  # Updates a presentation attachment type.
52
48
  # @return [void]
53
- def update # rubocop:disable Metrics/MethodLength
49
+ def update
54
50
  if @presentation_attachment_type.update(presentation_attachment_type_params)
55
51
  redirect_to admin_conferences_presentation_attachment_types_path, success: t('.saved')
56
52
  else
57
- respond_to do |format|
58
- format.html do
59
- add_breadcrumb @presentation_attachment_type.name
60
- render :edit
61
- end
62
- format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } }
63
- end
53
+ add_breadcrumb @presentation_attachment_type.name
54
+ flash.now[:alert] = t('.failed')
55
+ render :edit, status: :unprocessable_entity
64
56
  end
65
57
  end
66
58
 
67
59
  # Destroys a presentation attachment type.
68
60
  # @return [void]
69
- def destroy # rubocop:disable Metrics/MethodLength
61
+ def destroy
70
62
  if @presentation_attachment_type.destroy
71
63
  redirect_to admin_conferences_presentation_attachment_types_path, success: t('.destroyed')
72
64
  else
73
- respond_to do |format|
74
- format.html do
75
- add_breadcrumb @presentation_attachment_type.name
76
- render :edit
77
- end
78
- format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } }
79
- end
65
+ add_breadcrumb @presentation_attachment_type.name
66
+ flash.now[:alert] = t('.failed')
67
+ render :edit, status: :unprocessable_entity
80
68
  end
81
69
  end
82
70
 
@@ -10,8 +10,6 @@ module Spina
10
10
  before_action :set_breadcrumbs
11
11
  before_action :set_tabs
12
12
 
13
- layout 'spina/admin/conferences/conferences'
14
-
15
13
  # @!group Actions
16
14
 
17
15
  # Renders a list of presentation types.
@@ -35,51 +33,39 @@ module Spina
35
33
 
36
34
  # Creates a presentation type.
37
35
  # @return [void]
38
- def create # rubocop:disable Metrics/MethodLength
36
+ def create
39
37
  @presentation_type = PresentationType.new presentation_type_params
40
38
 
41
39
  if @presentation_type.save
42
40
  redirect_to admin_conferences_presentation_types_path, success: t('.saved')
43
41
  else
44
- respond_to do |format|
45
- format.html do
46
- add_breadcrumb t('.new')
47
- render :new
48
- end
49
- format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_type.errors } }
50
- end
42
+ add_breadcrumb t('.new')
43
+ flash.now[:alert] = t('.failed')
44
+ render :new, status: :unprocessable_entity
51
45
  end
52
46
  end
53
47
 
54
48
  # Updates a presentation type.
55
49
  # @return [void]
56
- def update # rubocop:disable Metrics/MethodLength
50
+ def update
57
51
  if @presentation_type.update(presentation_type_params)
58
52
  redirect_to admin_conferences_presentation_types_path, success: t('.saved')
59
53
  else
60
- respond_to do |format|
61
- format.html do
62
- add_breadcrumb @presentation_type.name
63
- render :edit
64
- end
65
- format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_type.errors } }
66
- end
54
+ add_breadcrumb @presentation_type.name
55
+ flash.now[:alert] = t('.failed')
56
+ render :edit, status: :unprocessable_entity
67
57
  end
68
58
  end
69
59
 
70
60
  # Destroys a presentation type.
71
61
  # @return [void]
72
- def destroy # rubocop:disable Metrics/MethodLength
62
+ def destroy
73
63
  if @presentation_type.destroy
74
64
  redirect_to admin_conferences_presentation_types_path, success: t('.destroyed')
75
65
  else
76
- respond_to do |format|
77
- format.html do
78
- add_breadcrumb @presentation_type.name
79
- render :edit
80
- end
81
- format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_type.errors } }
82
- end
66
+ add_breadcrumb @presentation_type.name
67
+ flash.now[:alert] = t('.failed')
68
+ render :edit, status: :unprocessable_entity
83
69
  end
84
70
  end
85
71