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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/app/components/spina/admin/conferences/application_component.rb +11 -0
  3. data/app/components/spina/admin/conferences/form_group_component.html.haml +4 -0
  4. data/app/components/spina/admin/conferences/form_group_component.rb +17 -0
  5. data/app/views/spina/admin/conferences/application/_empty_list.html.haml +1 -1
  6. data/app/views/spina/admin/conferences/conferences/_event_fields.html.haml +7 -7
  7. data/app/views/spina/admin/conferences/conferences/_form.html.haml +1 -1
  8. data/app/views/spina/admin/conferences/conferences/_form_conference_details.html.haml +6 -5
  9. data/app/views/spina/admin/conferences/conferences/_form_parts.html.haml +1 -0
  10. data/app/views/spina/admin/conferences/delegates/_form.html.haml +1 -1
  11. data/app/views/spina/admin/conferences/delegates/_form_delegate_details.html.haml +18 -23
  12. data/app/views/spina/admin/conferences/dietary_requirements/_form.html.haml +1 -1
  13. data/app/views/spina/admin/conferences/dietary_requirements/_form_dietary_requirement_details.html.haml +2 -1
  14. data/app/views/spina/admin/conferences/institutions/_form.html.haml +1 -1
  15. data/app/views/spina/admin/conferences/institutions/_form_institution_details.html.haml +3 -2
  16. data/app/views/spina/admin/conferences/presentation_attachment_types/_form.html.haml +5 -3
  17. data/app/views/spina/admin/conferences/presentation_types/_form.html.haml +1 -1
  18. data/app/views/spina/admin/conferences/presentation_types/_form_presentation_type_details.html.haml +4 -3
  19. data/app/views/spina/admin/conferences/presentations/_attachment_fields.html.haml +5 -5
  20. data/app/views/spina/admin/conferences/presentations/_form.html.haml +1 -1
  21. data/app/views/spina/admin/conferences/presentations/_form_presentation_details.html.haml +18 -21
  22. data/app/views/spina/admin/conferences/rooms/_form.html.haml +1 -1
  23. data/app/views/spina/admin/conferences/rooms/_form_room_details.html.haml +4 -3
  24. data/app/views/spina/admin/conferences/sessions/_form.html.haml +1 -1
  25. data/app/views/spina/admin/conferences/sessions/_form_session_details.html.haml +6 -5
  26. data/app/views/spina/admin/parts/admin/conferences/dates/_form.html.haml +2 -2
  27. data/app/views/spina/admin/parts/admin/conferences/email_addresses/_form.html.haml +2 -4
  28. data/app/views/spina/admin/parts/admin/conferences/times/_form.html.haml +2 -2
  29. data/app/views/spina/admin/parts/admin/conferences/urls/_form.html.haml +2 -4
  30. data/config/locales/en.yml +0 -31
  31. data/lib/spina/admin/conferences/version.rb +1 -1
  32. metadata +7 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d4f99ddd9bb98f040badcd6932efa9488a3942f493695351af340161d8d41f8
4
- data.tar.gz: 962d1f8d378591cacb509cde4b95de75b0070031d35cdcf9fa8eac33f6568c8d
3
+ metadata.gz: d2069cad41a5e1fa9f40f6b8ca9be7b946105af40c65583c50029299a1ed355f
4
+ data.tar.gz: f0acfe5219d447618b3a5c483a9083f5cc119e5986823b948930ab5cbcae4d8d
5
5
  SHA512:
6
- metadata.gz: b170baf53afa700552aa77180d312b53fd607d39f523a7d3b00db1d22817209f6b57102787c13eebef7557961a0a678571bffecc0a018653eb9058c568b46a89
7
- data.tar.gz: 8629259d8564b8ff94f8e9c9e48213cb27c85c9413682a7571624565aae405d5a79dc9884f8cd8dddf5787163d26a98a0e5156a3bd03bbdaf398d04fb98d8929
6
+ metadata.gz: c2a1b90a47c802b67c44c97df7c0baa7f97c5a845e7c7b9cc6665d4ba278c08dd0d5f3d243ea170d41fe35c9f2a6337071916f70faca05f32f3655da6255cd8a
7
+ data.tar.gz: ba33885b606f4d54e469e3f528d8a2e9e997cbf22755cbfa0b090472aa4f495592c292a5c3dfb7a6e084b15fd9c4ee3beb0780692c69638490edfe93825083f3
@@ -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
@@ -1,3 +1,3 @@
1
1
  %tr
2
- %td.align-center{ colspan: 1000 }
2
+ %td.text-center.text-lg.text-medium.text-gray-700.py-8{ colspan: 10 }
3
3
  %em= message
@@ -1,16 +1,16 @@
1
1
  %div{ data: { 'part-id': "#{f.object.object_id}", 'tabs-target': 'pane' }, id: "pane_#{f.object.object_id}" }
2
2
  = f.hidden_field :id
3
3
 
4
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Event.human_attribute_name(:name)) do
4
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Event.human_attribute_name(:name)) do
5
5
  = render Spina::Forms::TextFieldComponent.new(f, :name)
6
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Event.human_attribute_name(:start_datetime)) do
7
- = f.datetime_field :start_datetime
8
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Event.human_attribute_name(:finish_datetime)) do
9
- = f.datetime_field :finish_datetime
10
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Event.human_attribute_name(:location)) do
6
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Event.human_attribute_name(:start_datetime)) do
7
+ = f.datetime_field :start_datetime, class: 'form-input'
8
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Event.human_attribute_name(:finish_datetime)) do
9
+ = f.datetime_field :finish_datetime, class: 'form-input'
10
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Event.human_attribute_name(:location)) do
11
11
  = render Spina::Forms::TextFieldComponent.new(f, :location)
12
12
 
13
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Event.human_attribute_name(:description)) do
13
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Event.human_attribute_name(:description)) do
14
14
  .mt-1.relative
15
15
  = f.hidden_field :description, id: "#{f.object.object_id}_input"
16
16
 
@@ -26,4 +26,4 @@
26
26
  = form_with model: [spina, :admin_conferences, @conference], id: dom_id(@conference), html: { autocomplete: 'off' } do |f|
27
27
  - @tabs.each_with_index do |tab, i|
28
28
  %div{ 'data-tabs-target': 'pane', id: tab, hidden: i != 0 }
29
- = render "form_#{tab}", f: f
29
+ .max-w-5xl= render "form_#{tab}", f: f
@@ -1,9 +1,10 @@
1
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Conference.human_attribute_name(:name)) do
1
+ .-mt-6
2
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Conference.human_attribute_name(:name)) do
2
3
  = render Spina::Forms::TextFieldComponent.new(f, :name)
3
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Conference.human_attribute_name(:start_date)) do
4
- = 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)
5
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Conference.human_attribute_name(:finish_date)) do
6
- = 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)
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'
7
8
 
8
9
 
9
10
  .mt-6{ 'data-controller': 'repeater' }
@@ -1,3 +1,4 @@
1
+ .-mt-6
1
2
  = f.fields_for :"#{@locale}_content", @parts do |ff|
2
3
  = ff.hidden_field :type, value: ff.object.class
3
4
  = ff.hidden_field :title
@@ -25,4 +25,4 @@
25
25
  .p-4.md:p-8
26
26
  - @tabs.each_with_index do |tab, i|
27
27
  %div{ 'data-tabs-target': 'pane', id: tab, hidden: i != 0 }
28
- = render "form_#{tab}"
28
+ .max-w-5xl= render "form_#{tab}"
@@ -1,29 +1,24 @@
1
1
  = form_with model: [spina, :admin_conferences, @delegate], id: dom_id(@delegate), html: { autocomplete: 'off' } do |f|
2
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Delegate.human_attribute_name(:first_name)) do
2
+ .-mt-6
3
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Delegate.human_attribute_name(:first_name)) do
3
4
  = render Spina::Forms::TextFieldComponent.new(f, :first_name)
4
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Delegate.human_attribute_name(:last_name)) do
5
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Delegate.human_attribute_name(:last_name)) do
5
6
  = render Spina::Forms::TextFieldComponent.new(f, :last_name)
6
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Room.human_attribute_name(:institution)) do
7
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Room.human_attribute_name(:institution)) do
7
8
  = f.collection_select :institution_id, Spina::Admin::Conferences::Institution.all, :id, :name, {}, class: 'form-select'
8
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Room.human_attribute_name(:email_address)) do
9
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Room.human_attribute_name(:email_address)) do
9
10
  = f.email_field :email_address, class: 'form-input block w-full max-w-5xl sm:text-sm sm:leading-5'
10
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Room.human_attribute_name(:url)) do
11
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Room.human_attribute_name(:url)) do
11
12
  = f.url_field :url, class: 'form-input block w-full max-w-5xl sm:text-sm sm:leading-5'
12
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Delegate.human_attribute_name(:dietary_requirements)) do
13
- %table.table{ style: 'margin: 0' }
14
- %tbody.collection-check-boxes
15
- = f.collection_check_boxes :dietary_requirement_ids, Spina::Admin::Conferences::DietaryRequirement.all, :id, :name do |builder|
16
- %tr
17
- %td{ style: "padding-left: 16px" }
18
- .form-checkbox
19
- = builder.check_box
20
- = builder.label
21
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Delegate.human_attribute_name(:conferences)) do
22
- %table.table{ style: 'margin: 0' }
23
- %tbody.collection-check-boxes
24
- = f.collection_check_boxes :conference_ids, Spina::Admin::Conferences::Conference.all, :id, :name do |builder|
25
- %tr
26
- %td{ style: "padding-left: 16px" }
27
- .form-checkbox
28
- = builder.check_box
29
- = builder.label
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
@@ -25,4 +25,4 @@
25
25
  .p-4.md:p-8
26
26
  - @tabs.each_with_index do |tab, i|
27
27
  %div{ 'data-tabs-target': 'pane', id: tab, hidden: i != 0 }
28
- = render "form_#{tab}"
28
+ .max-w-5xl= render "form_#{tab}"
@@ -1,3 +1,4 @@
1
1
  = form_with model: [spina, :admin_conferences, @dietary_requirement], id: dom_id(@dietary_requirement), html: { autocomplete: 'off' } do |f|
2
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::DietaryRequirement.human_attribute_name(:name)) do
2
+ .-mt-6
3
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::DietaryRequirement.human_attribute_name(:name)) do
3
4
  = render Spina::Forms::TextFieldComponent.new(f, :name)
@@ -25,4 +25,4 @@
25
25
  .p-4.md:p-8
26
26
  - @tabs.each_with_index do |tab, i|
27
27
  %div{ 'data-tabs-target': 'pane', id: tab, hidden: i != 0 }
28
- = render "form_#{tab}"
28
+ .max-w-5xl= render "form_#{tab}"
@@ -1,7 +1,8 @@
1
1
  = form_with model: [spina, :admin_conferences, @institution], id: dom_id(@institution), html: { autocomplete: 'off' } do |f|
2
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Institution.human_attribute_name(:name)) do
2
+ .-mt-6
3
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Institution.human_attribute_name(:name)) do
3
4
  = render Spina::Forms::TextFieldComponent.new(f, :name)
4
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Institution.human_attribute_name(:city)) do
5
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Institution.human_attribute_name(:city)) do
5
6
  = render Spina::Forms::TextFieldComponent.new(f, :city)
6
7
 
7
8
 
@@ -13,6 +13,8 @@
13
13
  = t '.save'
14
14
 
15
15
  .p-4.md:p-8
16
- = form_with model: [spina, :admin_conferences, @presentation_attachment_type], id: dom_id(@presentation_attachment_type), html: { autocomplete: 'off' } do |f|
17
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::DietaryRequirement.human_attribute_name(:name)) do
18
- = render Spina::Forms::TextFieldComponent.new(f, :name)
16
+ .max-w-5xl
17
+ = form_with model: [spina, :admin_conferences, @presentation_attachment_type], id: dom_id(@presentation_attachment_type), html: { autocomplete: 'off' } do |f|
18
+ .-mt-6
19
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::DietaryRequirement.human_attribute_name(:name)) do
20
+ = render Spina::Forms::TextFieldComponent.new(f, :name)
@@ -25,4 +25,4 @@
25
25
  .p-4.md:p-8
26
26
  - @tabs.each_with_index do |tab, i|
27
27
  %div{ 'data-tabs-target': 'pane', id: tab, hidden: i != 0 }
28
- = render "form_#{tab}"
28
+ .max-w-5xl= render "form_#{tab}"
@@ -1,7 +1,8 @@
1
1
  = form_with model: [spina, :admin_conferences, @presentation_type], id: dom_id(@presentation_type), html: { autocomplete: 'off' } do |f|
2
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::PresentationType.human_attribute_name(:conference)) do
2
+ .-mt-6
3
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::PresentationType.human_attribute_name(:conference)) do
3
4
  = f.collection_select :conference_id, Spina::Admin::Conferences::Conference.order(:dates).reverse_order, :id, :name
4
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::PresentationType.human_attribute_name(:name)) do
5
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::PresentationType.human_attribute_name(:name)) do
5
6
  = render Spina::Forms::TextFieldComponent.new(f, :name)
6
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::PresentationType.human_attribute_name(:duration)) do
7
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::PresentationType.human_attribute_name(:duration)) do
7
8
  = f.number_field :minutes, value: @presentation_type.minutes, placeholder: Spina::Admin::Conferences::PresentationType.human_attribute_name(:duration), required: true, step: 5, min: 5
@@ -1,12 +1,12 @@
1
1
  %div{ data: { 'part-id': "#{f.object.object_id}", 'tabs-target': 'pane' }, id: "pane_#{f.object.object_id}" }
2
2
  = f.hidden_field :id
3
3
 
4
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::PresentationAttachment.human_attribute_name(:attachment_type)) do
5
- = f.collection_select :attachment_type_id, Spina::Admin::Conferences::PresentationAttachmentType.all, :id, :name
4
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::PresentationAttachment.human_attribute_name(:attachment_type)) do
5
+ = f.collection_select :attachment_type_id, Spina::Admin::Conferences::PresentationAttachmentType.all, :id, :name, {}, class: 'form-select'
6
6
 
7
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::PresentationAttachment.human_attribute_name(:attachment)) do
8
- .mt-6{ data: { controller: 'attachment-picker' } }
9
- = f.collection_select :attachment_id, Spina::Attachment.sorted, :id, :name, { include_blank: t('spina.attachments.choose_attachment') }, { class: 'form-select mt-1', data: { action: 'attachment-picker#pick' } }
7
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::PresentationAttachment.human_attribute_name(:attachment)) do
8
+ %div{ data: { controller: 'attachment-picker' } }
9
+ = f.collection_select :attachment_id, Spina::Attachment.sorted, :id, :name, { include_blank: t('spina.attachments.choose_attachment') }, { class: 'form-select', data: { action: 'attachment-picker#pick' } }
10
10
 
11
11
  .text-right
12
12
  = button_tag t('spina.ui.delete'), type: :button, class: 'btn btn-default bg-transparent hover:bg-white hover:text-red-500 h-8 px-3 inline-block mt-3', data: { action: 'repeater#removeFields', id: "pane_#{f.object.object_id}" }
@@ -25,4 +25,4 @@
25
25
  .p-4.md:p-8
26
26
  - @tabs.each_with_index do |tab, i|
27
27
  %div{ 'data-tabs-target': 'pane', id: tab, hidden: i != 0 }
28
- = render "form_#{tab}"
28
+ .max-w-5xl= render "form_#{tab}"
@@ -1,18 +1,19 @@
1
1
  = form_with model: [spina, :admin_conferences, @presentation], id: dom_id(@presentation), html: { autocomplete: 'off' } do |f|
2
2
  %div{ data: { controller: 'select-options', select_options: { record_value: @conferences } } }
3
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:conference)) do
4
- = select_tag :conference_id, options_from_collection_for_select(Spina::Admin::Conferences::Conference.all, :id, :name, (@presentation.conference.id unless @presentation.conference.blank?)), include_blank: true, required: true, data: { action: 'spina--admin--conferences--select-options#setVisibility', 'spina--admin--conferences--select_options_target': 'select', text_key: 'name' }
5
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:presentation_type)) do
6
- = select_tag :presentation_type_id, options_from_collection_for_select((@presentation.conference || Spina::Admin::Conferences::Conference.first).presentation_types, :id, :name, (@presentation.presentation_type.id unless @presentation.presentation_type.blank?)), include_blank: true, required: true, data: { action: 'spina--admin--conferences--select-options#setVisibility','spina--admin--conferences--select_options_target': 'select', key_path: 'presentation_types', text_key: 'name' }
7
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:session)) do
8
- = f.collection_select :session_id, (@presentation.presentation_type || Spina::Admin::Conferences::Conference.first).sessions, :id, :name, { include_blank: true }, required: true, data: {'spina--admin--conferences--select_options_target': 'select', key_path: 'presentation_types:sessions', text_key: 'name' }
9
-
10
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:start_datetime)) do
11
- = f.datetime_field :start_datetime
12
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:title)) do
3
+ .-mt-6
4
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:conference)) do
5
+ = select_tag :conference_id, options_from_collection_for_select(Spina::Admin::Conferences::Conference.all, :id, :name, (@presentation.conference.id unless @presentation.conference.blank?)), include_blank: true, required: true, data: { action: 'select-options#setVisibility', 'select_options_target': 'select', text_key: 'name' }, class: 'form-select'
6
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:presentation_type)) do
7
+ = select_tag :presentation_type_id, options_from_collection_for_select((@presentation.conference || Spina::Admin::Conferences::Conference.first).presentation_types, :id, :name, (@presentation.presentation_type.id unless @presentation.presentation_type.blank?)), include_blank: true, required: true, data: { action: 'select-options#setVisibility','select_options_target': 'select', key_path: 'presentation_types', text_key: 'name' }, class: 'form-select'
8
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:session)) do
9
+ = f.collection_select :session_id, (@presentation.presentation_type || Spina::Admin::Conferences::Conference.first).sessions, :id, :name, { include_blank: true }, required: true, data: {'select_options_target': 'select', key_path: 'presentation_types:sessions', text_key: 'name' }, class: 'form-select'
10
+
11
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:start_datetime)) do
12
+ = f.datetime_field :start_datetime, class: 'form-input'
13
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:title)) do
13
14
  = render Spina::Forms::TextFieldComponent.new(f, :title)
14
15
 
15
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:abstract)) do
16
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:abstract)) do
16
17
  .mt-1.relative
17
18
  = f.hidden_field :abstract, id: "#{f.object.object_id}_input"
18
19
 
@@ -21,16 +22,12 @@
21
22
 
22
23
  %trix-editor(class='prose prose-sm focus:outline-none max-w-3xl xl:border-r border-dashed border-gray-200 pr-3' toolbar="#{f.object.object_id}_trix-toolbar" input="#{f.object.object_id}_input" data-trix-target='editor' data-action='trix-file-accept->trix#preventDefault')
23
24
 
24
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:presenters)) do
25
- %table.table{ style: 'margin: 0' }
26
- %tbody
27
- = f.collection_check_boxes :presenter_ids, Spina::Admin::Conferences::Delegate.order(:last_name, :first_name), :id, :reversed_name_and_institution do |builder|
28
- %tr
29
- %td{ style: "padding-left: 16px" }
30
- .form-checkbox
31
- = builder.check_box
32
- = builder.label
33
-
25
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Presentation.human_attribute_name(:presenters)) do
26
+ %ul.list-none.ml-4
27
+ = f.collection_check_boxes :presenter_ids, Spina::Admin::Conferences::Delegate.order(:last_name, :first_name), :id, :reversed_name_and_institution, {}, class: 'form-checkbox rounded' do |builder|
28
+ %li
29
+ = builder.check_box
30
+ %span.text-sm.font-medium.text-gray-600= builder.label
34
31
 
35
32
  .mt-6{ 'data-controller': 'repeater' }
36
33
  %label.block.text-sm.leading-5.font-medium.text-gray-700= Spina::Admin::Conferences::Presentation.human_attribute_name :attachments
@@ -25,4 +25,4 @@
25
25
  .p-4.md:p-8
26
26
  - @tabs.each_with_index do |tab, i|
27
27
  %div{ 'data-tabs-target': 'pane', id: tab, hidden: i != 0 }
28
- = render "form_#{tab}"
28
+ .max-w-5xl= render "form_#{tab}"
@@ -1,7 +1,8 @@
1
1
  = form_with model: [spina, :admin_conferences, @room], id: dom_id(@room), html: { autocomplete: 'off' } do |f|
2
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Room.human_attribute_name(:institution)) do
2
+ .-mt-6
3
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Room.human_attribute_name(:institution)) do
3
4
  = f.collection_select :institution_id, Spina::Admin::Conferences::Institution.all, :id, :name, {}, class: 'form-select'
4
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Institution.human_attribute_name(:building)) do
5
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Institution.human_attribute_name(:building)) do
5
6
  = render Spina::Forms::TextFieldComponent.new(f, :building)
6
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Institution.human_attribute_name(:number)) do
7
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Institution.human_attribute_name(:number)) do
7
8
  = render Spina::Forms::TextFieldComponent.new(f, :number)
@@ -25,4 +25,4 @@
25
25
  .p-4.md:p-8
26
26
  - @tabs.each_with_index do |tab, i|
27
27
  %div{ 'data-tabs-target': 'pane', id: tab, hidden: i != 0 }
28
- = render "form_#{tab}"
28
+ .max-w-5xl= render "form_#{tab}"
@@ -1,15 +1,16 @@
1
1
  = form_with model: [spina, :admin_conferences, @session], id: dom_id(@session), html: { autocomplete: 'off' } do |f|
2
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:name)) do
2
+ .-mt-6
3
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:name)) do
3
4
  = render Spina::Forms::TextFieldComponent.new(f, :name)
4
5
 
5
6
  %div{ data: { controller: 'select-options', 'select_options': { record_value: @conferences } } }
6
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:conference)) do
7
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:conference)) do
7
8
  = select_tag :conference_id, options_from_collection_for_select(Spina::Admin::Conferences::Conference.all, :id, :name, (@session.conference.id unless @session.conference.blank?)), include_blank: true, data: { action: 'select-options#setVisibility','select_options_target': 'select', text_key: 'name' }
8
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:presentation_type)) do
9
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:presentation_type)) do
9
10
  = f.collection_select :presentation_type_id, @session.conference.present? ? @session.conference.presentation_types : Spina::Admin::Conferences::Conference.first.presentation_types, :id, :name, { include_blank: true }, data: {'select_options_target': 'select', text_key: 'name', key_path: 'presentation_types' }
10
11
 
11
12
  %div{ data: { controller: 'select-options', 'select_options': { record_value: @institutions } } }
12
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:institution)) do
13
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:institution)) do
13
14
  = select_tag :institution_id, options_from_collection_for_select(Spina::Admin::Conferences::Institution.all, :id, :name, (@session.institution.id unless @session.institution.blank?)), include_blank: true, data: { action: 'select-options#setVisibility','select_options_target': 'select', text_key: 'name' }
14
- = render Spina::Forms::GroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:room)) do
15
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: Spina::Admin::Conferences::Session.human_attribute_name(:room)) do
15
16
  = f.collection_select :room_id, @session.institution.present? ? @session.institution.rooms : Spina::Admin::Conferences::Institution.first.rooms, :id, :name, { include_blank: true }, data: {'select_options_target': 'select', text_key: 'name', key_path: 'rooms' }
@@ -1,2 +1,2 @@
1
- = render Spina::Forms::GroupComponent.new(label: f.object.title) do
2
- = f.date_field :content, placeholder: f.object.title
1
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: f.object.title) do
2
+ = f.date_field :content, placeholder: f.object.title, class: 'form-select'
@@ -1,4 +1,2 @@
1
- .mt-6
2
- %label.block.text-sm.leading-5.font-medium.text-gray-700= f.object.title
3
- .mt-1
4
- = f.email_field :content, class: 'form-input block w-full max-w-5xl sm:text-sm sm:leading-5'
1
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: f.object.title) do
2
+ = f.email_field :content, class: 'form-input block w-full max-w-5xl sm:text-sm sm:leading-5'
@@ -1,2 +1,2 @@
1
- = render Spina::Forms::GroupComponent.new(label: f.object.title) do
2
- = f.datetime_field :content, placeholder: f.object.title
1
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: f.object.title) do
2
+ = f.datetime_field :content, placeholder: f.object.title, class: 'form-select'
@@ -1,4 +1,2 @@
1
- .mt-6
2
- %label.block.text-sm.leading-5.font-medium.text-gray-700= f.object.title
3
- .mt-1
4
- = f.url_field :content, class: 'form-input block w-full max-w-5xl sm:text-sm sm:leading-5'
1
+ = render Spina::Admin::Conferences::FormGroupComponent.new(label: f.object.title) do
2
+ = f.url_field :content, class: 'form-input block w-full max-w-5xl sm:text-sm sm:leading-5'
@@ -1,34 +1,3 @@
1
- # Files in the config/locales directory are used for internationalization
2
- # and are automatically loaded by Rails. If you want to use locales other
3
- # than English, add the necessary files in this directory.
4
- #
5
- # To use the locales, use `I18n.t`:
6
- #
7
- # I18n.t 'hello'
8
- #
9
- # In views, this is aliased to just `t`:
10
- #
11
- # <%= t('hello') %>
12
- #
13
- # To use a different locale, set it with `I18n.locale`:
14
- #
15
- # I18n.locale = :es
16
- #
17
- # This would use the information in config/locales/es.yml.
18
- #
19
- # The following keys must be escaped otherwise they will not be retrieved by
20
- # the default I18n backend:
21
- #
22
- # true, false, on, off, yes, no
23
- #
24
- # Instead, surround them with single quotes.
25
- #
26
- # en:
27
- # 'true': 'foo'
28
- #
29
- # To learn more, please read the Rails Internationalization guide
30
- # available at http://guides.rubyonrails.org/i18n.html.
31
-
32
1
  en:
33
2
  spina:
34
3
  show: Show
@@ -4,7 +4,7 @@ module Spina
4
4
  module Admin
5
5
  module Conferences
6
6
  # Version number.
7
- VERSION = '3.0.0.rc1'
7
+ VERSION = '3.0.0.rc2'
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spina-admin-conferences-fork
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.rc1
4
+ version: 3.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Louis Van Steene
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-01-27 00:00:00.000000000 Z
12
+ date: 2022-01-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: haml-rails
@@ -337,14 +337,14 @@ dependencies:
337
337
  requirements:
338
338
  - - "~>"
339
339
  - !ruby/object:Gem::Version
340
- version: '4.4'
340
+ version: '5.0'
341
341
  type: :development
342
342
  prerelease: false
343
343
  version_requirements: !ruby/object:Gem::Requirement
344
344
  requirements:
345
345
  - - "~>"
346
346
  - !ruby/object:Gem::Version
347
- version: '4.4'
347
+ version: '5.0'
348
348
  description: Keep track of conference attendees and presentations with this plugin.
349
349
  email:
350
350
  - louis@lvs.me.uk
@@ -360,6 +360,9 @@ files:
360
360
  - app/assets/javascripts/spina/admin/conferences/application.js
361
361
  - app/assets/javascripts/spina/admin/conferences/controllers/select_options_controller.js
362
362
  - app/assets/stylesheets/spina/admin/conferences/application.tailwind.css
363
+ - app/components/spina/admin/conferences/application_component.rb
364
+ - app/components/spina/admin/conferences/form_group_component.html.haml
365
+ - app/components/spina/admin/conferences/form_group_component.rb
363
366
  - app/controllers/spina/admin/conferences/application_controller.rb
364
367
  - app/controllers/spina/admin/conferences/conferences_controller.rb
365
368
  - app/controllers/spina/admin/conferences/delegates_controller.rb