spina-admin-conferences 1.3.10 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/spina/admin/conferences/application.sass +0 -15
  3. data/app/controllers/spina/admin/conferences/application_controller.rb +6 -3
  4. data/app/controllers/spina/admin/conferences/conferences_controller.rb +19 -28
  5. data/app/controllers/spina/admin/conferences/delegates_controller.rb +3 -5
  6. data/app/controllers/spina/admin/conferences/dietary_requirements_controller.rb +2 -2
  7. data/app/controllers/spina/admin/conferences/institutions_controller.rb +2 -2
  8. data/app/controllers/spina/admin/conferences/presentation_attachment_types_controller.rb +2 -2
  9. data/app/controllers/spina/admin/conferences/presentation_types_controller.rb +2 -2
  10. data/app/controllers/spina/admin/conferences/presentations_controller.rb +5 -6
  11. data/app/controllers/spina/admin/conferences/rooms_controller.rb +2 -2
  12. data/app/controllers/spina/admin/conferences/sessions_controller.rb +2 -2
  13. data/app/jobs/spina/admin/conferences/presentation_import_job.rb +2 -3
  14. data/app/models/spina/admin/conferences/conference.rb +132 -15
  15. data/app/models/spina/admin/conferences/event.rb +30 -65
  16. data/app/models/spina/admin/conferences/presentation.rb +29 -38
  17. data/app/models/spina/parts/admin/conferences/date.rb +14 -0
  18. data/app/models/spina/parts/admin/conferences/email_address.rb +20 -0
  19. data/app/models/spina/parts/admin/conferences/time.rb +14 -0
  20. data/app/models/spina/parts/admin/conferences/url.rb +20 -0
  21. data/app/views/spina/admin/conferences/{delegates/_form_conferences.html.haml → application/_conferences.html.haml} +2 -4
  22. data/app/views/spina/admin/conferences/{conferences/_form_delegates.html.haml → application/_delegates.html.haml} +2 -3
  23. data/app/views/spina/admin/conferences/application/_dietary_requirements.html.haml +9 -0
  24. data/app/views/spina/admin/conferences/application/_institutions.html.haml +10 -0
  25. data/app/views/spina/admin/conferences/application/_presentation_attachment_types.html.haml +10 -0
  26. data/app/views/spina/admin/conferences/{conferences/_form_presentation_types.html.haml → application/_presentation_types.html.haml} +2 -3
  27. data/app/views/spina/admin/conferences/{rooms/_form_presentations.html.haml → application/_presentations.html.haml} +2 -3
  28. data/app/views/spina/admin/conferences/{conferences/_form_rooms.html.haml → application/_rooms.html.haml} +2 -3
  29. data/app/views/spina/admin/conferences/{presentation_types/_form_sessions.html.haml → application/_sessions.html.haml} +2 -3
  30. data/app/views/spina/admin/conferences/conferences/_event_fields.html.haml +14 -21
  31. data/app/views/spina/admin/conferences/conferences/_form.html.haml +7 -3
  32. data/app/views/spina/admin/conferences/conferences/_form_conference_details.html.haml +22 -24
  33. data/app/views/spina/admin/conferences/conferences/_form_parts.html.haml +7 -14
  34. data/app/views/spina/admin/conferences/conferences/index.html.haml +2 -13
  35. data/app/views/spina/admin/conferences/delegates/_form.html.haml +4 -3
  36. data/app/views/spina/admin/conferences/delegates/_form_delegate_details.html.haml +47 -32
  37. data/app/views/spina/admin/conferences/delegates/index.html.haml +2 -12
  38. data/app/views/spina/admin/conferences/dietary_requirements/_form.html.haml +3 -3
  39. data/app/views/spina/admin/conferences/dietary_requirements/_form_dietary_requirement_details.html.haml +7 -8
  40. data/app/views/spina/admin/conferences/dietary_requirements/index.html.haml +2 -10
  41. data/app/views/spina/admin/conferences/institutions/_form.html.haml +4 -3
  42. data/app/views/spina/admin/conferences/institutions/_form_institution_details.html.haml +29 -35
  43. data/app/views/spina/admin/conferences/institutions/index.html.haml +2 -11
  44. data/app/views/spina/admin/conferences/presentation_attachment_types/_form.html.haml +2 -2
  45. data/app/views/spina/admin/conferences/presentation_attachment_types/index.html.haml +2 -10
  46. data/app/views/spina/admin/conferences/presentation_types/_form.html.haml +4 -3
  47. data/app/views/spina/admin/conferences/presentation_types/_form_presentation_type_details.html.haml +13 -17
  48. data/app/views/spina/admin/conferences/presentation_types/index.html.haml +2 -12
  49. data/app/views/spina/admin/conferences/presentations/_attachment_fields.html.haml +6 -15
  50. data/app/views/spina/admin/conferences/presentations/_form.html.haml +3 -3
  51. data/app/views/spina/admin/conferences/presentations/_form_presentation_details.html.haml +55 -55
  52. data/app/views/spina/admin/conferences/presentations/index.html.haml +2 -12
  53. data/app/views/spina/admin/conferences/rooms/_form.html.haml +3 -3
  54. data/app/views/spina/admin/conferences/rooms/_form_room_details.html.haml +13 -15
  55. data/app/views/spina/admin/conferences/rooms/index.html.haml +2 -12
  56. data/app/views/spina/admin/conferences/sessions/_form.html.haml +3 -3
  57. data/app/views/spina/admin/conferences/sessions/_form_session_details.html.haml +18 -20
  58. data/app/views/spina/admin/conferences/sessions/_session.html.haml +1 -1
  59. data/app/views/spina/admin/conferences/sessions/index.html.haml +2 -12
  60. data/app/views/spina/admin/hooks/conferences/_primary_navigation.html.haml +4 -4
  61. data/app/views/spina/admin/hooks/conferences/_settings_secondary_navigation.html.haml +2 -2
  62. data/app/views/spina/admin/parts/admin/conferences/dates/_form.html.haml +2 -0
  63. data/app/views/spina/admin/parts/admin/conferences/email_addresses/_form.html.haml +2 -0
  64. data/app/views/spina/admin/parts/admin/conferences/times/_form.html.haml +2 -0
  65. data/app/views/spina/admin/parts/admin/conferences/urls/_form.html.haml +2 -0
  66. data/config/locales/en.yml +26 -29
  67. data/db/migrate/20210315164409_add_json_attributes_to_spina_conferences_presentations.rb +7 -0
  68. data/db/migrate/20210315164410_add_json_attributes_to_spina_conferences_conferences.rb +7 -0
  69. data/db/migrate/20210315164411_convert_partables_to_json.rb +407 -0
  70. data/db/migrate/20210417102513_add_locale_to_action_text_rich_texts.rb +11 -0
  71. data/db/migrate/20210417102514_move_texts_to_action_text_rich_texts.rb +82 -0
  72. data/lib/spina/admin/conferences.rb +1 -0
  73. data/lib/spina/admin/conferences/engine.rb +10 -5
  74. data/lib/spina/admin/conferences/version.rb +1 -1
  75. data/lib/tasks/spina/admin/conferences_tasks.rake +11 -1
  76. metadata +47 -46
  77. data/app/helpers/spina/admin/conferences/conferences_helper.rb +0 -44
  78. data/app/models/spina/admin/conferences/date_part.rb +0 -15
  79. data/app/models/spina/admin/conferences/email_address_part.rb +0 -21
  80. data/app/models/spina/admin/conferences/part.rb +0 -20
  81. data/app/models/spina/admin/conferences/time_part.rb +0 -53
  82. data/app/models/spina/admin/conferences/url_part.rb +0 -21
  83. data/app/views/spina/admin/conferences/conferences/_form_presentations.html.haml +0 -12
  84. data/app/views/spina/admin/conferences/delegates/_form_presentations.html.haml +0 -12
  85. data/app/views/spina/admin/conferences/dietary_requirements/_form_delegates.html.haml +0 -12
  86. data/app/views/spina/admin/conferences/institutions/_form_delegates.html.haml +0 -12
  87. data/app/views/spina/admin/conferences/institutions/_form_rooms.html.haml +0 -12
  88. data/app/views/spina/admin/conferences/presentation_types/_form_presentations.html.haml +0 -12
  89. data/app/views/spina/admin/conferences/presentations/_form_presenters.html.haml +0 -12
  90. data/app/views/spina/admin/conferences/sessions/_form_presentations.html.haml +0 -12
  91. data/app/views/spina/admin/partables/admin/conferences/date_parts/_form.html.haml +0 -5
  92. data/app/views/spina/admin/partables/admin/conferences/email_address_parts/_form.html.haml +0 -5
  93. data/app/views/spina/admin/partables/admin/conferences/time_parts/_form.html.haml +0 -7
  94. data/app/views/spina/admin/partables/admin/conferences/url_parts/_form.html.haml +0 -5
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Spina
4
- module Admin
5
- module Conferences
6
- # Date parts, without associated times.
7
- class DatePart < ApplicationRecord
8
- has_many :page_parts, as: :page_partable
9
- has_many :parts, as: :partable
10
- has_many :layout_parts, as: :layout_partable
11
- has_many :structure_parts, as: :structure_partable
12
- end
13
- end
14
- end
15
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Spina
4
- module Admin
5
- module Conferences
6
- # Email address parts. The format is validated.
7
- #
8
- # = Validators
9
- # Email address (using {EmailAddressValidator}):: {#content}.
10
- # @see EmailAddressValidator
11
- class EmailAddressPart < ApplicationRecord
12
- has_many :page_parts, as: :page_partable
13
- has_many :parts, as: :partable
14
- has_many :layout_parts, as: :layout_partable
15
- has_many :structure_parts, as: :structure_partable
16
-
17
- validates :content, 'spina/admin/conferences/email_address': true, allow_blank: true
18
- end
19
- end
20
- end
21
- end
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Spina
4
- module Admin
5
- module Conferences
6
- # Join records between partables and pageables.
7
- class Part < ApplicationRecord
8
- include Spina::Part
9
- include Spina::Optionable
10
-
11
- belongs_to :pageable, inverse_of: :parts, polymorphic: true, touch: true
12
- belongs_to :partable, polymorphic: true, optional: true
13
-
14
- accepts_nested_attributes_for :partable
15
-
16
- validates :name, uniqueness: { scope: :pageable_id }
17
- end
18
- end
19
- end
20
- end
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Spina
4
- module Admin
5
- module Conferences
6
- # Time parts.
7
- class TimePart < ApplicationRecord
8
- has_many :page_parts, as: :page_partable
9
- has_many :parts, as: :partable
10
- has_many :layout_parts, as: :layout_partable
11
- has_many :structure_parts, as: :structure_partable
12
-
13
- # @return [Date, nil] the date of the time part. Nil if the time part has no date and time
14
- def date
15
- return if content.blank?
16
-
17
- content.to_date
18
- end
19
-
20
- # Sets the date of the time part.
21
- # @param date [Date] the new date
22
- # @return [void]
23
- def date=(date)
24
- if date.blank? || date.to_date.blank?
25
- self.content = nil
26
- return
27
- end
28
-
29
- self.content = date.to_date + (content.try(:seconds_since_midnight) || 0).seconds
30
- end
31
-
32
- # @return [ActiveSupport::TimeWithZone, nil] the time of the time part. Nil if the time part has no date and time
33
- def time
34
- return if content.blank?
35
-
36
- content
37
- end
38
-
39
- # Sets the start time of the time part.
40
- # @param time [ActiveSupport::TimeWithZone] the new time
41
- # @return [void]
42
- def time=(time)
43
- if time.blank?
44
- self.content = nil
45
- return
46
- end
47
-
48
- self.content = Time.parse(time, date).to_datetime.in_time_zone
49
- end
50
- end
51
- end
52
- end
53
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Spina
4
- module Admin
5
- module Conferences
6
- # URL parts. The format is validated.
7
- #
8
- # = Validators
9
- # HTTP(S) URL (using {HttpUrlValidator}):: {#content}.
10
- # @see HttpUrlValidator
11
- class UrlPart < ApplicationRecord
12
- has_many :page_parts, as: :page_partable
13
- has_many :parts, as: :partable
14
- has_many :layout_parts, as: :layout_partable
15
- has_many :structure_parts, as: :structure_partable
16
-
17
- validates :content, 'spina/admin/conferences/http_url': true, allow_blank: true
18
- end
19
- end
20
- end
21
- end
@@ -1,12 +0,0 @@
1
- #presentations.tab-content.well
2
- .table-container
3
- %table.table
4
- %thead
5
- %tr
6
- %th= Spina::Admin::Conferences::Presentation.human_attribute_name :conference
7
- %th= Spina::Admin::Conferences::Presentation.human_attribute_name :title
8
- %th= Spina::Admin::Conferences::Presentation.human_attribute_name :presenters
9
- %th
10
-
11
- %tbody
12
- = render @conference.presentations.any? ? @conference.presentations : 'empty_list', message: t('spina.admin.conferences.presentations.index.no_presentations')
@@ -1,12 +0,0 @@
1
- #presentations.tab-content.well
2
- .table-container
3
- %table.table
4
- %thead
5
- %tr
6
- %th= Spina::Admin::Conferences::Presentation.human_attribute_name :conference
7
- %th= Spina::Admin::Conferences::Presentation.human_attribute_name :title
8
- %th= Spina::Admin::Conferences::Presentation.human_attribute_name :presenters
9
- %th
10
-
11
- %tbody
12
- = render @delegate.presentations.any? ? @delegate.presentations : 'empty_list', message: t('spina.admin.conferences.presentations.index.no_presentations')
@@ -1,12 +0,0 @@
1
- #delegates.tab-content.well
2
- .table-container
3
- %table.table
4
- %thead
5
- %tr
6
- %th= Spina::Admin::Conferences::Delegate.human_attribute_name :name
7
- %th= Spina::Admin::Conferences::Delegate.human_attribute_name :email_address
8
- %th= Spina::Admin::Conferences::Delegate.human_attribute_name :institution
9
- %th
10
-
11
- %tbody
12
- = render @dietary_requirement.delegates.any? ? @dietary_requirement.delegates : 'empty_list', message: t('spina.admin.conferences.delegates.index.no_delegates')
@@ -1,12 +0,0 @@
1
- #delegates.tab-content.well
2
- .table-container
3
- %table.table
4
- %thead
5
- %tr
6
- %th= Spina::Admin::Conferences::Delegate.human_attribute_name :name
7
- %th= Spina::Admin::Conferences::Delegate.human_attribute_name :email_address
8
- %th= Spina::Admin::Conferences::Delegate.human_attribute_name :institution
9
- %th
10
-
11
- %tbody
12
- = render @institution.delegates.any? ? @institution.delegates : 'empty_list', message: t('spina.admin.conferences.delegates.index.no_delegates')
@@ -1,12 +0,0 @@
1
- #rooms.tab-content.well
2
- .table-container
3
- %table.table
4
- %thead
5
- %tr
6
- %th= Spina::Admin::Conferences::Room.human_attribute_name :institution
7
- %th= Spina::Admin::Conferences::Room.human_attribute_name :building
8
- %th= Spina::Admin::Conferences::Room.human_attribute_name :number
9
- %th
10
-
11
- %tbody
12
- = render @institution.rooms.any? ? @institution.rooms : 'empty_list', message: t('spina.admin.conferences.rooms.index.no_rooms')
@@ -1,12 +0,0 @@
1
- #presentations.tab-content.well
2
- .table-container
3
- %table.table
4
- %thead
5
- %tr
6
- %th= Spina::Admin::Conferences::Presentation.human_attribute_name :conference
7
- %th= Spina::Admin::Conferences::Presentation.human_attribute_name :title
8
- %th= Spina::Admin::Conferences::Presentation.human_attribute_name :presenters
9
- %th
10
-
11
- %tbody
12
- = render @presentation_type.presentations.any? ? @presentation_type.presentations : 'empty_list', message: t('spina.admin.conferences.presentations.index.no_presentations')
@@ -1,12 +0,0 @@
1
- #presenters.tab-content.well
2
- .table-container
3
- %table.table
4
- %thead
5
- %tr
6
- %th= Spina::Admin::Conferences::Delegate.human_attribute_name :name
7
- %th= Spina::Admin::Conferences::Delegate.human_attribute_name :email_address
8
- %th= Spina::Admin::Conferences::Delegate.human_attribute_name :institution
9
- %th
10
-
11
- %tbody
12
- = render @presentation.presenters.any? ? @presentation.presenters : 'empty_list', message: t('spina.admin.conferences.presenters.no_presenters')
@@ -1,12 +0,0 @@
1
- #presentations.tab-content.well
2
- .table-container
3
- %table.table
4
- %thead
5
- %tr
6
- %th= Spina::Admin::Conferences::Presentation.human_attribute_name :conference
7
- %th= Spina::Admin::Conferences::Presentation.human_attribute_name :title
8
- %th= Spina::Admin::Conferences::Presentation.human_attribute_name :presenters
9
- %th
10
-
11
- %tbody
12
- = render @session.presentations.any? ? @session.presentations : 'empty_list', message: t('spina.admin.conferences.presentations.index.no_presentations')
@@ -1,5 +0,0 @@
1
- .horizontal-form-label
2
- = f.object.title
3
- .horizontal-form-content
4
- = f.fields_for :partable, f.object.partable do |ff|
5
- = ff.date_field :content
@@ -1,5 +0,0 @@
1
- .horizontal-form-label
2
- = f.object.title
3
- .horizontal-form-content
4
- = f.fields_for :partable, f.object.partable do |ff|
5
- = ff.email_field :content
@@ -1,7 +0,0 @@
1
- .horizontal-form-label
2
- = f.object.title
3
- = f.fields_for :partable, f.object.partable do |ff|
4
- .horizontal-form-content
5
- .input-group
6
- = ff.date_field :date
7
- = ff.time_field :time
@@ -1,5 +0,0 @@
1
- .horizontal-form-label
2
- = f.object.title
3
- .horizontal-form-content
4
- = f.fields_for :partable, f.object.partable do |ff|
5
- = ff.url_field :content