spina-conferences-primer_theme 0.1.17 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/spina_conferences_primer_theme_manifest.js +0 -1
  3. data/app/assets/stylesheets/spina/conferences/primer_theme/application.sass +11 -8
  4. data/app/controllers/spina/conferences/primer_theme/conferences_controller.rb +6 -1
  5. data/app/helpers/spina/conferences/primer_theme/application_helper.rb +3 -14
  6. data/app/views/conferences_primer_theme/pages/about.html.haml +89 -19
  7. data/app/views/conferences_primer_theme/pages/committee.html.haml +41 -9
  8. data/app/views/conferences_primer_theme/pages/events.html.haml +57 -10
  9. data/app/views/conferences_primer_theme/pages/homepage.html.haml +29 -4
  10. data/app/views/conferences_primer_theme/pages/information.html.haml +4 -5
  11. data/app/views/conferences_primer_theme/pages/show.html.haml +1 -1
  12. data/app/views/layouts/spina/conferences/primer_theme/application.html.haml +7 -6
  13. data/app/views/spina/application/_cookies.html.haml +1 -1
  14. data/app/views/spina/application/_current_conference_alert.html.haml +1 -1
  15. data/app/views/spina/application/_footer.html.haml +2 -2
  16. data/app/views/spina/application/_footer_content.html.haml +3 -3
  17. data/app/views/spina/application/_list_item.html.haml +1 -1
  18. data/app/views/spina/application/_logo.html.haml +1 -1
  19. data/app/views/spina/application/_navigation.html.haml +9 -10
  20. data/app/views/spina/application/_navigation_item.html.haml +9 -10
  21. data/app/views/spina/application/_navigation_items.html.haml +3 -0
  22. data/app/views/spina/conferences/primer_theme/conferences/_conference.html.haml +4 -4
  23. data/app/views/spina/conferences/primer_theme/conferences/_event.html.haml +4 -4
  24. data/app/views/spina/conferences/primer_theme/conferences/_events.html.haml +1 -1
  25. data/app/views/spina/conferences/primer_theme/conferences/_header.html.haml +34 -15
  26. data/app/views/spina/conferences/primer_theme/conferences/_presentation.html.haml +5 -5
  27. data/app/views/spina/conferences/primer_theme/conferences/_presentations.html.haml +2 -1
  28. data/app/views/spina/conferences/primer_theme/conferences/_submission_flash.html.haml +10 -14
  29. data/app/views/spina/conferences/primer_theme/conferences/index.html.haml +3 -4
  30. data/app/views/spina/conferences/primer_theme/conferences/show.html.haml +17 -18
  31. data/app/views/spina/conferences/primer_theme/kaminari/_gap.html.haml +2 -0
  32. data/app/views/spina/conferences/primer_theme/kaminari/_next_page.html.haml +9 -0
  33. data/app/views/spina/conferences/primer_theme/kaminari/_page.html.haml +10 -0
  34. data/app/views/spina/conferences/primer_theme/kaminari/_paginator.html.haml +17 -0
  35. data/app/views/spina/conferences/primer_theme/kaminari/_prev_page.html.haml +9 -0
  36. data/app/views/spina/conferences/primer_theme/presentations/_attachment.html.haml +1 -1
  37. data/app/views/spina/conferences/primer_theme/presentations/show.html.haml +4 -4
  38. data/config/initializers/primer.rb +1 -1
  39. data/config/initializers/themes/conferences_primer_theme.rb +95 -178
  40. data/config/locales/en.yml +52 -56
  41. data/db/migrate/20210206170704_change_current_conference_alert_to_text.rb +17 -0
  42. data/lib/spina/conferences/primer_theme/version.rb +1 -1
  43. metadata +14 -31
  44. data/app/assets/stylesheets/spina/conferences/primer_theme/_admin.sass +0 -4
  45. data/app/assets/stylesheets/spina/conferences/primer_theme/_github.sass +0 -2
  46. data/app/assets/stylesheets/spina/conferences/primer_theme/_primer.sass +0 -4
  47. data/app/assets/stylesheets/spina/conferences/primer_theme/_turbolinks.sass +0 -3
  48. data/app/views/spina/application/_image_collection.html.haml +0 -19
  49. data/app/views/spina/application/_mobile_navigation_item.html.haml +0 -11
  50. data/app/views/spina/conferences/primer_theme/conferences/_information.html.haml +0 -4
  51. data/app/views/spina/conferences/primer_theme/conferences/_sponsor.html.haml +0 -8
  52. data/app/views/spina/conferences/primer_theme/conferences/_sponsors.html.haml +0 -6
  53. data/app/views/spina/pages/_committee_bio.html.haml +0 -36
  54. data/app/views/spina/pages/_committee_bios.html.haml +0 -7
  55. data/app/views/spina/pages/_constitution.html.haml +0 -12
  56. data/app/views/spina/pages/_contact.html.haml +0 -4
  57. data/app/views/spina/pages/_document.html.haml +0 -13
  58. data/app/views/spina/pages/_documents.html.haml +0 -7
  59. data/app/views/spina/pages/_event.html.haml +0 -18
  60. data/app/views/spina/pages/_events_list.html.haml +0 -19
  61. data/app/views/spina/pages/_homepage_content.html.haml +0 -14
  62. data/app/views/spina/pages/_jumbotron.html.haml +0 -2
  63. data/app/views/spina/pages/_minutes.html.haml +0 -9
  64. data/app/views/spina/pages/_minutes_entry.html.haml +0 -14
  65. data/app/views/spina/pages/_partner_societies.html.haml +0 -10
  66. data/app/views/spina/pages/_partner_society.html.haml +0 -28
@@ -1,6 +1,6 @@
1
1
  = render Primer::DetailsComponent.new(overlay: :dark, reset: true, mb: [2, 0, nil, nil], mr: [nil, 2, nil, nil]) do |component|
2
- = component.summary(button: true, button_type: :outline, variant: :small, aria: { haspopup: 'dialog' }) do
3
- = render Primer::OcticonComponent.new(icon: 'info')
2
+ = component.summary(button_type: :outline, variant: :small, aria: { haspopup: 'dialog' }) do
3
+ = render Primer::OcticonComponent.new('info')
4
4
  = t :'.cookies'
5
5
  = component.body(tag: :'details-dialog') do
6
6
  %include-fragment{ src: frontend_cookies_info_path, loading: :lazy }
@@ -8,6 +8,6 @@
8
8
  = box_component.body do
9
9
  = button_tag(data: { 'close-dialog': true }, aria: { label: t(:'spina.close') }, type: 'button',
10
10
  class: %w[Box-btn-octicon btn-octicon m-0 position-absolute right-0 top-0]) do
11
- = render Primer::OcticonComponent.new(icon: 'x')
11
+ = render Primer::OcticonComponent.new('x')
12
12
  = render Primer::BlankslateComponent.new(title: t('.loading')) do |blankslate_component|
13
13
  = blankslate_component.spinner(size: :large)
@@ -1 +1 @@
1
- %li.list-style-none.py-4.border-bottom{ id: local_assigns[:list_item_id]&.call(local_assigns) }= yield
1
+ %li.list-style-none.py-4.border-bottom= yield
@@ -1 +1 @@
1
- = render Primer::OcticonComponent.new(icon: 'home', mr: 2, height: 24)
1
+ = render Primer::OcticonComponent.new('home', mr: 2, height: 24)
@@ -1,11 +1,10 @@
1
- .Header.bg-blue.px-3.px-md-4.px-lg-5
1
+ .Header.px-3.px-md-4.px-lg-5.flex-wrap.flex-lg-nowrap
2
2
  .Header-item.mt-n1.mb-n1= link_to render('logo'), root_path, class: 'Header-link'
3
- .Header-item.Header-item--full.d-flex.d-lg-none{ aria: { hidden: true } }
4
- %details.details-reset
5
- %summary.btn-link.Header-link= octicon 'three-bars', height: 24
6
- .px-3.px-md-4.px-lg-5.bg-blue.Popover.left-0.right-0.mt-3
7
- = render partial: 'mobile_navigation_item', collection: main_navigation_items, cached: true
8
- = link_to 'Conferences', frontend_conferences_url, class: %w[d-block py-2 border-top border-white-fade text-white]
9
- = render partial: 'navigation_item', collection: main_navigation_items, cached: true
10
- .Header-item.d-none.d-lg-flex
11
- = link_to Spina::Admin::Conferences::Conference.model_name.human(count: 0), frontend_conferences_path, class: 'Header-link'
3
+ %details.details-reset.d-lg-none{ style: 'display: contents' }
4
+ %summary.Header-item
5
+ %button.Header-link.btn-link{ type: 'button' }
6
+ = render Primer::OcticonComponent.new('three-bars', height: 24)
7
+ .Header-item.Header-item--full.flex-column.width-full.flex-order-1.mr-0.mt-3
8
+ = render partial: 'navigation_items'
9
+ .Header-item.Header-item--full.flex-row.width-full.d-none.d-lg-flex
10
+ = render partial: 'navigation_items'
@@ -1,12 +1,11 @@
1
1
  - if navigation_item.has_children?
2
- .Header-item.d-none.d-lg-flex
3
- %details.dropdown.details-reset.details-overlay
4
- %summary.Header-link
5
- = navigation_item.menu_title
6
- %span.dropdown-caret
7
- %details-menu.dropdown-menu.dropdown-menu-se.mt-3{ role: 'menu' }
8
- - navigation_item.children.in_menu.sorted.each do |child|
9
- %li= link_to child.menu_title, child.materialized_path, class: 'dropdown-item'
2
+ %details.details-reset
3
+ %summary.btn-link.d-block.py-2.border-top.border-white-fade.text-white
4
+ = navigation_item.menu_title
5
+ = render Primer::OcticonComponent.new('chevron-down')
6
+ %ul.list-style-none
7
+ - navigation_item.children.each do |child|
8
+ %li= link_to child.menu_title, child.materialized_path, class: %w[d-block py-2 pl-3 border-top border-white-fade text-white]
10
9
  - elsif navigation_item.is_root?
11
- .Header-item.d-none.d-lg-flex
12
- = link_to navigation_item.menu_title, navigation_item.materialized_path, class: 'Header-link'
10
+ = link_to navigation_item.menu_title, navigation_item.materialized_path,
11
+ class: %w[Header-link mt-lg-n3 mb-lg-n3 py-2 py-lg-3 mr-0 mr-lg-3 border-top border-lg-top-0 border-white-fade-15]
@@ -0,0 +1,3 @@
1
+ %nav.d-flex.flex-column.flex-lg-row.flex-self-stretch.flex-lg-self-auto
2
+ = render partial: 'navigation_item', collection: main_navigation_items, cached: true
3
+ = link_to 'Conferences', frontend_conferences_url, class: %w[Header-link mt-lg-n3 mb-lg-n3 py-2 py-lg-3 mr-0 mr-lg-3 border-top border-lg-top-0 border-white-fade-15]
@@ -1,15 +1,15 @@
1
1
  = render Primer::FlexComponent.new(direction: [:column, nil, :row_reverse, nil]) do
2
- %ul.list-style-none.d-flex.flex-wrap.flex-md-justify-end.pl-md-2.pb-2.pb-md-0{ class: dom_class(conference.institutions) }
2
+ %ul.list-style-none.d-flex.flex-wrap.flex-md-justify-end.pl-md-2.pb-2.pb-md-0
3
3
  = render partial: 'institution', collection: conference.institutions, cached: -> institution { [institution, institution.logo] }
4
4
  = render Primer::FlexItemComponent.new(flex_auto: true) do
5
5
  = render(Primer::HeadingComponent.new(tag: :h3, mb: 1)) { link_to conference.name, frontend_conference_path(conference) }
6
- %ul.text-gray.list-style-none.d-flex.flex-column.flex-sm-row.flex-wrap
6
+ %ul.text-secondary.list-style-none.d-flex.flex-column.flex-sm-row.flex-wrap
7
7
  %li.mr-sm-3
8
- = render Primer::OcticonComponent.new(icon: 'calendar')
8
+ = render Primer::OcticonComponent.new('calendar')
9
9
  = t :'.dates_html', start_date: time_tag(conference.start_date, format: :date), finish_date: time_tag(conference.finish_date)
10
10
  - if conference.institutions.any?
11
11
  %li
12
- = render Primer::OcticonComponent.new(icon: 'location')
12
+ = render Primer::OcticonComponent.new('location')
13
13
  = render Primer::BaseComponent.new(tag: :address, display: :inline) do
14
14
  = t :'.locations', institutions: conference.institutions.pluck(:name).to_sentence,
15
15
  cities: conference.institutions.pluck(:city).uniq.to_sentence
@@ -1,11 +1,11 @@
1
1
  = render Primer::FlexComponent.new(direction: [:column, nil, :row, nil]) do
2
2
  = render Primer::FlexItemComponent.new(mr: [nil, nil, 3, nil], mb: [3, nil, 0, nil], col: [nil, nil, 4, nil]) do
3
3
  = render Primer::TextComponent.new(tag: :div, font_size: 3, font_weight: :light, mb: 1) do
4
- = render Primer::OcticonComponent.new(icon: 'clock', vertical_align: :baseline)
4
+ = render Primer::OcticonComponent.new('clock', vertical_align: :baseline)
5
5
  = t :'.times_html', start_time: time_tag(event.start_time, format: :short), finish_time: time_tag(event.finish_time, format: :time)
6
- = render Primer::TextComponent.new(tag: :div, color: :gray) do
7
- = render Primer::OcticonComponent.new(icon: 'location')
6
+ = render Primer::TextComponent.new(tag: :div, color: :text_secondary) do
7
+ = render Primer::OcticonComponent.new('location')
8
8
  = render(Primer::BaseComponent.new(tag: :address, display: :inline)) { event.location }
9
9
  = render Primer::FlexItemComponent.new(flex_auto: true, col: [nil, nil, 8, nil]) do
10
10
  = render(Primer::HeadingComponent.new(tag: :h3, mb: 1)) { event.name }
11
- = render(Primer::TextComponent.new(tag: :div, color: :gray)) { event.description.try(:html_safe) }
11
+ = render(Primer::TextComponent.new(tag: :div, color: :text_secondary)) { event.description.try(:html_safe) }
@@ -8,7 +8,7 @@
8
8
  = octicon 'search', class: 'subnav-search-icon'
9
9
  %div{ id: 'event_list' }
10
10
  - if events.any?
11
- %ul{ class: dom_class(events), data: { filter: { list: true } } }
11
+ %ul{ data: { filter: { list: true } } }
12
12
  = render partial: 'event', collection: events.sorted, layout: 'list_item', cached: true
13
13
  - else
14
14
  = render Primer::BlankslateComponent.new(title: t(:'.no_events'), icon: 'calendar')
@@ -1,27 +1,46 @@
1
- - cache [@conference, @conference.institutions, @conference.parts.collect(&:partable), @conference.content(:gallery)&.images,
2
- @conference.content(:sponsors)&.structure_items,
3
- @conference.content(:sponsors)&.structure_items&.collect_concat(&:structure_parts)&.collect(&:structure_partable)] do
4
- .container-lg.p-responsive.mb-4{ class: dom_class(@conference), id: dom_id(@conference) }
1
+ - cache [@conference, @conference.institutions] do
2
+ .container-lg.p-responsive.mb-4
5
3
  = render(Primer::HeadingComponent.new( mb: [1, nil, 2, nil])) { @conference.name }
6
- %ul.text-gray-dark.list-style-none.d-flex.flex-column.flex-sm-row.flex-wrap
4
+ %ul.text-secondary.list-style-none.d-flex.flex-column.flex-sm-row.flex-wrap
7
5
  %li.mr-sm-3.mb-1
8
- = render Primer::OcticonComponent.new(icon: 'calendar')
6
+ = render Primer::OcticonComponent.new('calendar')
9
7
  = t :'.dates_html', start_date: time_tag(@conference.start_date, format: :date), finish_date: time_tag(@conference.finish_date)
10
8
  - if @conference.institutions.any?
11
9
  - cache @conference.institutions do
12
10
  %li.mb-1
13
- = render Primer::OcticonComponent.new(icon: 'location')
11
+ = render Primer::OcticonComponent.new('location')
14
12
  = render Primer::BaseComponent.new(tag: :address, display: :inline) do
15
13
  = t :'.locations', institutions: @conference.institutions.pluck(:name).to_sentence,
16
14
  cities: @conference.institutions.pluck(:city).uniq.to_sentence
17
15
  - if @conference.institutions.any?
18
- %ul.list-style-none.d-flex.flex-wrap.mt-4{ class: dom_class(@conference.institutions) }
16
+ %ul.list-style-none.d-flex.flex-wrap.mt-4
19
17
  = render partial: 'institution', collection: @conference.institutions,
20
18
  cached: -> institution { [institution, institution.logo] }
21
- - cache [partable_for(:sponsors, parent: @conference), @conference.content(:sponsors)&.structure_items,
22
- @conference.content(:sponsors)&.structure_items&.collect_concat(&:structure_parts)&.collect(&:structure_partable)] do
23
- - if @conference.has_content?(:sponsors) && @conference.content(:sponsors).structure_items.any?
24
- = render partial: 'sponsors', object: @conference.content(:sponsors)
25
- - cache [partable_for(:gallery, parent: @conference), @conference.content(:gallery)&.images] do
26
- - if @conference.has_content? :gallery
27
- .mb-4= render partial: 'image_collection', object: @conference.content(:gallery), locals: { controls: true }
19
+ - if @conference.content(:sponsors).present?
20
+ = render Primer::SubheadComponent.new(spacious: true) do |component|
21
+ = component.heading(tag: :h2) { t :'.sponsors.title' }
22
+ = render Primer::FlexComponent.new(flex_wrap: true, ml: -2, mr: -2, mt: -2, mb: -2) do
23
+ - repeater @conference.content(:sponsors) do |sponsor|
24
+ = render Primer::FlexItemComponent.new(m: 2, vertical_align: :middle) do
25
+ - if sponsor.content(:logo).present?
26
+ = link_to sponsor.content(:website) do
27
+ = sponsor.content.image_tag(:logo, { resize_to_limit: [200, 60] }, draggable: false,
28
+ srcset: srcset(sponsor.content(:logo), variant: { resize_to_limit: [200, 60] }))
29
+ - else
30
+ = render(Primer::LinkComponent.new(href: sponsor.content(:website) || '')) { sponsor.content(:name) }
31
+
32
+ - if @conference.content(:gallery).present?
33
+ .mb-4.position-relative{ data: { controller: :slideshow, slideshow: { incrementer: 0, advance: true } } }
34
+ - @conference.content(:gallery).each_with_index do |image, index|
35
+ = @conference.content.image_tag(image, { resize_to_fill: [1680, 600] }, draggable: false, data: { 'slideshow-target': 'slide' },
36
+ srcset: srcset(image, variant: { resize_to_fill: [1680, 600] }), hidden: index != 0,
37
+ class: %w[d-block mx-auto])
38
+ .position-absolute.top-0.left-0.right-0.bottom-0.container-lg.p-responsive
39
+ - if @conference.content(:gallery).many?
40
+ .d-none.d-sm-flex.flex-justify-between.flex-items-center.height-full
41
+ = render Primer::ButtonComponent.new(data: { action: :'slideshow#previous' }) do
42
+ = render Primer::OcticonComponent.new('arrow-left')
43
+ = t(:'.gallery.previous')
44
+ = render Primer::ButtonComponent.new(data: { action: :'slideshow#next' }) do
45
+ = t(:'.gallery.next')
46
+ = render Primer::OcticonComponent.new('arrow-right')
@@ -1,15 +1,15 @@
1
1
  = render Primer::FlexComponent.new(direction: [:column, nil, :row, nil]) do
2
2
  = render Primer::BaseComponent.new(tag: :div, flex_shrink: 0, mr: [nil, nil, 3, nil], mb: [3, nil, 0, nil], col: [nil, nil, 3, nil]) do
3
3
  = render Primer::TextComponent.new(tag: :div, font_size: 3, font_weight: :light, mb: 1) do
4
- = render Primer::OcticonComponent.new(icon: 'clock', vertical_align: :baseline)
4
+ = render Primer::OcticonComponent.new('clock', vertical_align: :baseline)
5
5
  = time_tag presentation.start_datetime, format: :short
6
- = render Primer::TextComponent.new(tag: :div, color: :gray) do
7
- = render Primer::OcticonComponent.new(icon: 'location')
6
+ = render Primer::TextComponent.new(tag: :div, color: :text_secondary) do
7
+ = render Primer::OcticonComponent.new('location')
8
8
  = render(Primer::BaseComponent.new(tag: :address, display: :inline)) { presentation.session.room_name }
9
9
  = render Primer::BaseComponent.new(tag: :div, flex: :auto) do
10
10
  = render Primer::HeadingComponent.new(tag: :h3, mb: 1) do
11
11
  = render(Primer::LinkComponent.new(href: frontend_conference_presentation_path(conference, presentation), data: { turbo_frame: '_top' })) { presentation.title }
12
- = render Primer::TextComponent.new(tag: :div, color: :gray) do
13
- = render Primer::OcticonComponent.new(icon: presentation.presenters.many? ? 'people' : 'person')
12
+ = render Primer::TextComponent.new(tag: :div, color: :text_secondary) do
13
+ = render Primer::OcticonComponent.new(presentation.presenters.many? ? 'people' : 'person')
14
14
  = render Primer::BaseComponent.new(tag: :address, display: :inline) do
15
15
  = presentation.presenters.collect(&:full_name_and_institution).to_sentence
@@ -19,9 +19,10 @@
19
19
  = octicon 'search', class: 'subnav-search-icon'
20
20
  %div{ id: 'presentation_list' }
21
21
  - if @presentations.any?
22
- %ul{ class: dom_class(@presentations), data: { filter: { list: true } } }
22
+ %ul{ data: { filter: { list: true } } }
23
23
  = render partial: 'presentation', collection: @presentations.sorted.reverse_order, layout: 'list_item',
24
24
  locals: { conference: @conference }, cached: -> presentation { [presentation, presentation.presenters] }
25
+ = paginate @presentations.sorted, views_prefix: 'spina/conferences/primer_theme'
25
26
  - else
26
27
  = render Primer::BlankslateComponent.new(title: t(:'.no_presentations'), icon: 'mortar-board')
27
28
  = render Primer::BlankslateComponent.new(title: t(:'.no_matching_presentations'), icon: 'mortar-board', hidden: true,
@@ -1,14 +1,10 @@
1
- - cache partable_for(:submission_url, :submission_date, :submission_text, parent: @conference) do
2
- = render Primer::FlashComponent.new(variant: :warning, full: true, icon: 'clock', classes: dom_class(@conference)) do |component|
3
- - cache partable_for(:submission_date, parent: @conference) do
4
- = render Primer::TextComponent.new(tag: :div, display: :inline) do
5
- = t :'.submit_by_html', date: time_tag(@conference.content(:submission_date), format: :full)
6
- - cache partable_for(:submission_text, parent: @conference) do
7
- - if @conference.content(:submission_text).present?
8
- = render(Primer::TextComponent.new(tag: :div, color: :gray, display: :inline)) { @conference.content(:submission_text).html_safe }
9
- - cache partable_for(:submission_url, parent: @conference) do
10
- - if @conference.content(:submission_url).present?
11
- - component.action do
12
- = render Primer::ButtonComponent.new(tag: :a, href: @conference.content(:submission_url), button_type: :primary,
13
- variant: :small) do
14
- = t :'.submit_abstract'
1
+ = render Primer::FlashComponent.new(variant: :warning, full: true, icon: 'clock') do |component|
2
+ = render Primer::TextComponent.new(tag: :div, display: :inline) do
3
+ = t :'.submit_by_html', date: time_tag(@conference.content(:submission_date), format: :full)
4
+ - if @conference.content(:submission_text).present?
5
+ = render(Primer::TextComponent.new(tag: :div, color: :text_secondary, display: :inline)) { @conference.content.html(:submission_text) }
6
+ - if @conference.content(:submission_url).present?
7
+ - component.action do
8
+ = render Primer::ButtonComponent.new(tag: :a, href: @conference.content.html(:submission_url), button_type: :primary,
9
+ variant: :small) do
10
+ = t :'.submit_abstract'
@@ -5,18 +5,17 @@
5
5
  .subnav.subnav-flush
6
6
  .subnav-search.float-left.ml-0
7
7
  = search_field_tag 'search', nil, class: %w[form-control subnav-search-input], aria: { label: t(:'.search') }
8
- = render Primer::OcticonComponent.new(icon: 'search', classes: 'subnav-search-icon')
8
+ = render Primer::OcticonComponent.new('search', classes: 'subnav-search-icon')
9
9
  = render Primer::FlexItemComponent.new(mb: [4, nil, 0, nil]) do
10
10
  = render Primer::ButtonComponent.new(tag: :a, href: frontend_conferences_url(protocol: :webcal, format: :ics), button_type: :primary,
11
11
  ml: [0, nil, 6, nil]) do
12
- = render Primer::OcticonComponent.new(icon: 'calendar')
12
+ = render Primer::OcticonComponent.new('calendar')
13
13
  = t(:'.subscribe')
14
14
 
15
15
  %div{ id: 'conference_list' }
16
16
  - if @conferences.any?
17
- %ul{ class: dom_class(@conferences), data: { filter: { list: true } } }
17
+ %ul{ data: { filter: { list: true } } }
18
18
  = render partial: 'conference', collection: @conferences, layout: 'list_item',
19
- locals: { list_item_id: ->(local_assigns) { dom_id(local_assigns[:conference]) } },
20
19
  cached: -> conference { [conference, conference.institutions, conference.institutions.collect(&:logo)] }
21
20
  - else
22
21
  = render Primer::BlankslateComponent.new(title: t(:'.no_conferences'), icon: 'mortar-board')
@@ -1,32 +1,31 @@
1
- - if @conference.has_content?(:submission_date) && @conference.content(:submission_date) >= Date.today
1
+ - if @conference.content(:submission_date).present? && @conference.content(:submission_date) >= Date.today
2
2
  - content_for(:flash) { render 'submission_flash' }
3
3
 
4
4
  - content_for(:header) { render 'header' }
5
5
 
6
6
  = turbo_frame_tag 'conference_tabs' do
7
- = render Primer::UnderlineNavComponent.new do |component|
8
- - component.body(role: 'tablist') do
9
- = render Primer::LinkComponent.new(href: frontend_conference_url(@conference, tab: 'information',
10
- presentation_type: @presentation_type&.id),
11
- aria: { selected: (@tab == 'information').to_s }, classes: 'UnderlineNav-item', role: 'tab') do
12
- = t(:'.tabs.information')
13
- = render Primer::LinkComponent.new(href: frontend_conference_url(@conference, tab: 'presentations',
14
- presentation_type: @presentation_type&.id),
15
- aria: { selected: (@tab == 'presentations').to_s }, classes: 'UnderlineNav-item', role: 'tab') do
16
- = t(:'.tabs.presentations')
17
- = render Primer::LinkComponent.new(href: frontend_conference_url(@conference, tab: 'events',
18
- presentation_type: @presentation_type&.id),
19
- aria: { selected: (@tab == 'events').to_s }, classes: 'UnderlineNav-item', role: 'tab') do
20
- = t(:'.tabs.events')
7
+ = render Primer::UnderlineNavComponent.new(label: t(:'.conference_navigationcle')) do |component|
8
+ - component.tab(href: frontend_conference_url(@conference, tab: 'information', presentation_type: @presentation_type&.id),
9
+ aria: { selected: (@tab == 'information').to_s }, classes: 'UnderlineNav-item', role: 'tab') do
10
+ = t(:'.tabs.information')
11
+ - component.tab(href: frontend_conference_url(@conference, tab: 'presentations', presentation_type: @presentation_type&.id),
12
+ saria: { selected: (@tab == 'presentations').to_s }, classes: 'UnderlineNav-item', role: 'tab') do
13
+ = t(:'.tabs.presentations')
14
+ - component.tab(href: frontend_conference_url(@conference, tab: 'events', presentation_type: @presentation_type&.id),
15
+ aria: { selected: (@tab == 'events').to_s }, classes: 'UnderlineNav-item', role: 'tab') do
16
+ = t(:'.tabs.events')
21
17
  - component.actions do
22
18
  = render Primer::ButtonComponent.new(tag: :a, href: frontend_conference_url(@conference, protocol: :webcal, format: :ics),
23
19
  button_type: :primary, variant: :small) do
24
- = render Primer::OcticonComponent.new(icon: 'calendar')
20
+ = render Primer::OcticonComponent.new('calendar')
25
21
  = t(:'.subscribe')
26
22
  - case @tab
27
23
  - when 'information'
28
- - cache [partable_for(:text, parent: @conference), @tab] do
29
- = render partial: 'information', locals: { text: (@conference.content(:text) if @conference.has_content? :text) }
24
+ - cache [@conference, @tab] do
25
+ - if @conference.content(:text).present?
26
+ = render(Primer::MarkdownComponent.new(my: 4)) { @conference.content.html(:text) }
27
+ - else
28
+ = render Primer::BlankslateComponent.new(title: t(:'.no_information'), icon: 'info', my: 4)
30
29
  - when 'presentations'
31
30
  - cache [@conference.presentations, @presentation_type, @presentations, @presentations.collect(&:presenters), @tab] do
32
31
  = render partial: 'presentations'
@@ -0,0 +1,9 @@
1
+ -# Link to the "Previous" page
2
+ -# - available local variables
3
+ -# url: url to the previous page
4
+ -# current_page: a page object for the currently displayed page
5
+ -# total_pages: total number of pages
6
+ -# per_page: number of items to fetch per page
7
+ -# remote: data-remote
8
+ = link_to_unless current_page.last?, t(:'.next'), url, rel: 'next', class: 'next_page', aria: { label: t('.next_page') } do
9
+ %span.next_page{ aria: { disabled: 'true' } }= t('.next')
@@ -0,0 +1,10 @@
1
+ -# Link showing page number
2
+ -# - available local variables
3
+ -# page: a page object for "this" page
4
+ -# url: url to this page
5
+ -# current_page: a page object for the currently displayed page
6
+ -# total_pages: total number of pages
7
+ -# per_page: number of items to fetch per page
8
+ -# remote: data-remote
9
+ = link_to_unless page.current?, page, url, aria: { label: t(:'.page', number: page) } do
10
+ %em{ aria: { current: 'page' } }= page
@@ -0,0 +1,17 @@
1
+ -# The container tag
2
+ -# - available local variables
3
+ -# current_page: a page object for the currently displayed page
4
+ -# total_pages: total number of pages
5
+ -# per_page: number of items to fetch per page
6
+ -# remote: data-remote
7
+ -# paginator: the paginator that renders the pagination tags inside
8
+ = paginator.render do
9
+ %nav.paginate-container{ aria: { label: 'Pagination' } }
10
+ .pagination
11
+ = prev_page_tag
12
+ - each_page do |page|
13
+ - if page.display_tag?
14
+ = page_tag page
15
+ - elsif !page.was_truncated?
16
+ = gap_tag
17
+ = next_page_tag
@@ -0,0 +1,9 @@
1
+ -# Link to the "Previous" page
2
+ -# - available local variables
3
+ -# url: url to the previous page
4
+ -# current_page: a page object for the currently displayed page
5
+ -# total_pages: total number of pages
6
+ -# per_page: number of items to fetch per page
7
+ -# remote: data-remote
8
+ = link_to_unless current_page.first?, t(:'.previous'), url, rel: 'prev', class: 'previous_page', aria: { label: t('.previous_page') } do
9
+ %span.previous_page{ aria: { disabled: 'true' } }= t('.previous')
@@ -1,5 +1,5 @@
1
1
  - cache [attachment, attachment.attachment] do
2
2
  - unless attachment.attachment.blank?
3
3
  = component.button(tag: :a, href: main_app.rails_blob_path(attachment.attachment.file, disposition: :attachment)) do
4
- = render Primer::OcticonComponent.new(icon: 'download')
4
+ = render Primer::OcticonComponent.new('download')
5
5
  = attachment.name
@@ -1,16 +1,16 @@
1
1
  - cache [@presentation, @presentation.presenters, @presentation.attachments.collect(&:attachment)] do
2
2
  - cache [@presentation, @presentation.presenters] do
3
3
  = render(Primer::HeadingComponent.new(mb: [1, nil, 2, nil])) { @presentation.title }
4
- %ul.text-gray-dark.list-style-none.d-flex.flex-column.flex-sm-row.flex-wrap
4
+ %ul.text-secondary-dark.list-style-none.d-flex.flex-column.flex-sm-row.flex-wrap
5
5
  %li.mr-sm-3.mb-1
6
- = render Primer::OcticonComponent.new(icon: @presentation.presenters.many? ? 'people' : 'person')
6
+ = render Primer::OcticonComponent.new(@presentation.presenters.many? ? 'people' : 'person')
7
7
  = render Primer::TextComponent.new(tag: :address, display: :inline) do
8
8
  = @presentation.presenters.collect(&:full_name_and_institution).to_sentence
9
9
  %li.mr-sm-3.mb-1
10
- = render Primer::OcticonComponent.new(icon: 'clock')
10
+ = render Primer::OcticonComponent.new('clock')
11
11
  = time_tag @presentation.start_datetime, format: :short
12
12
  %li.mb-1
13
- = render Primer::OcticonComponent.new(icon: 'location')
13
+ = render Primer::OcticonComponent.new('location')
14
14
  = render Primer::TextComponent.new(tag: :address, display: :inline) do
15
15
  = t :'.room_and_institution', room: @presentation.session.room_name, institution: @presentation.room.institution.name
16
16
 
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- Rails.application.config.primer_view_components.force_functional_colors = false
3
+ Rails.application.config.primer_view_components.silence_deprecations = true
@@ -4,274 +4,191 @@
4
4
  theme.name = 'conferences_primer_theme'
5
5
  theme.title = 'Conferences Primer theme'
6
6
 
7
- theme.page_parts = [{
7
+ theme.layout_parts = %w[current_conference_alert]
8
+
9
+ theme.parts = [{
8
10
  name: 'text',
9
11
  title: 'Text',
10
- partable_type: 'Spina::Text'
12
+ part_type: 'Spina::Parts::Text'
11
13
  }, {
12
14
  name: 'gallery',
13
15
  title: 'Gallery',
14
- partable_type: 'Spina::ImageCollection'
16
+ part_type: 'Spina::Parts::ImageCollection'
15
17
  }, {
16
18
  name: 'constitution',
17
19
  title: 'Constitution',
18
- partable_type: 'Spina::Attachment'
20
+ part_type: 'Spina::Parts::Attachment'
19
21
  }, {
20
22
  name: 'slides',
21
23
  title: 'Slides',
22
- partable_type: 'Spina::Attachment'
24
+ part_type: 'Spina::Parts::Attachment'
23
25
  }, {
24
26
  name: 'handout',
25
27
  title: 'Handout',
26
- partable_type: 'Spina::Attachment'
28
+ part_type: 'Spina::Parts::Attachment'
27
29
  }, {
28
30
  name: 'poster',
29
31
  title: 'Poster',
30
- partable_type: 'Spina::Attachment'
32
+ part_type: 'Spina::Parts::Attachment'
31
33
  }, {
32
34
  name: 'partner_societies',
33
35
  title: 'Partner societies',
34
- partable_type: 'Spina::Structure'
36
+ part_type: 'Spina::Parts::Repeater',
37
+ parts: %w[name logo email_address website description]
35
38
  }, {
36
39
  name: 'minutes',
37
40
  title: 'Minutes',
38
- partable_type: 'Spina::Structure'
41
+ part_type: 'Spina::Parts::Repeater',
42
+ parts: %w[date attachment]
39
43
  }, {
40
44
  name: 'documents',
41
45
  title: 'Documents',
42
- partable_type: 'Spina::Structure'
46
+ part_type: 'Spina::Parts::Repeater',
47
+ parts: %w[name attachment]
43
48
  }, {
44
49
  name: 'contact',
45
50
  title: 'Contact',
46
- partable_type: 'Spina::Text'
51
+ part_type: 'Spina::Parts::Text'
47
52
  }, {
48
53
  name: 'socials',
49
54
  title: 'Socials',
50
- partable_type: 'Spina::Structure'
55
+ part_type: 'Spina::Parts::Repeater',
56
+ parts: %w[name location description]
51
57
  }, {
52
58
  name: 'meetings',
53
59
  title: 'Meetings',
54
- partable_type: 'Spina::Structure'
60
+ part_type: 'Spina::Parts::Repeater',
61
+ parts: %w[name location description]
55
62
  }, {
56
63
  name: 'submission_url',
57
64
  title: 'Submission URL',
58
- partable_type: 'Spina::Admin::Conferences::UrlPart'
65
+ part_type: 'Spina::Parts::Admin::Conferences::Url'
59
66
  }, {
60
67
  name: 'submission_date',
61
68
  title: 'Submission date',
62
- partable_type: 'Spina::Admin::Conferences::DatePart'
69
+ part_type: 'Spina::Parts::Admin::Conferences::Date'
63
70
  }, {
64
71
  name: 'submission_text',
65
72
  title: 'Submission text',
66
- partable_type: 'Spina::Line'
73
+ part_type: 'Spina::Parts::Line'
67
74
  }, {
68
75
  name: 'committee_bios',
69
76
  title: 'Committee bios',
70
- partable_type: 'Spina::Structure'
77
+ part_type: 'Spina::Parts::Repeater',
78
+ parts: %w[name role bio profile_picture]
71
79
  }, {
72
80
  name: 'sponsors',
73
81
  title: 'Sponsors',
74
- partable_type: 'Spina::Structure'
82
+ part_type: 'Spina::Parts::Repeater',
83
+ parts: %w[name website logo]
75
84
  }, {
76
85
  name: 'events_list',
77
86
  title: 'Events',
78
- partable_type: 'Spina::Structure'
79
- }]
80
-
81
- theme.layout_parts = [{
87
+ part_type: 'Spina::Parts::Repeater',
88
+ parts: %w[name start_time location description url]
89
+ }, {
82
90
  name: 'current_conference_alert',
83
91
  title: 'Alert',
84
- partable_type: 'Spina::Text'
92
+ part_type: 'Spina::Parts::Text'
85
93
  }, {
86
94
  name: 'github_url',
87
95
  title: 'GitHub URL',
88
- partable_type: 'Spina::Line'
89
- }]
90
-
91
- theme.structures = [{
92
- name: 'partner_societies',
93
- structure_parts: [{
94
- name: 'name',
95
- title: 'Name',
96
- partable_type: 'Spina::Line'
97
- }, {
98
- name: 'logo',
99
- title: 'Logo',
100
- partable_type: 'Spina::Image'
101
- }, {
102
- name: 'description',
103
- title: 'Description',
104
- partable_type: 'Spina::Text'
105
- }, {
106
- name: 'website',
107
- title: 'Website',
108
- partable_type: 'Spina::Admin::Conferences::UrlPart'
109
- }, {
110
- name: 'email_address',
111
- title: 'Email address',
112
- partable_type: 'Spina::Admin::Conferences::EmailAddressPart'
113
- }]
96
+ part_type: 'Spina::Parts::Line'
114
97
  }, {
115
- name: 'minutes',
116
- structure_parts: [{
117
- name: 'date',
118
- title: 'Date',
119
- partable_type: 'Spina::Admin::Conferences::DatePart'
120
- }, {
121
- name: 'attachment',
122
- title: 'Attachment',
123
- partable_type: 'Spina::Attachment'
124
- }]
98
+ name: 'name',
99
+ title: 'Name',
100
+ part_type: 'Spina::Parts::Line'
125
101
  }, {
126
- name: 'documents',
127
- structure_parts: [{
128
- name: 'name',
129
- title: 'Name',
130
- partable_type: 'Spina::Line'
131
- }, {
132
- name: 'attachment',
133
- title: 'Attachment',
134
- partable_type: 'Spina::Attachment'
135
- }]
102
+ name: 'logo',
103
+ title: 'Logo',
104
+ part_type: 'Spina::Parts::Image'
136
105
  }, {
137
- name: 'socials',
138
- structure_parts: [{
139
- name: 'name',
140
- title: 'Name',
141
- partable_type: 'Spina::Line'
142
- }, {
143
- name: 'start_time',
144
- title: 'Time',
145
- partable_type: 'Spina::Admin::Conferences::TimePart'
146
- }, {
147
- name: 'location',
148
- title: 'Location',
149
- partable_type: 'Spina::Line'
150
- }, {
151
- name: 'description',
152
- title: 'Description',
153
- partable_type: 'Spina::Text'
154
- }]
106
+ name: 'description',
107
+ title: 'Description',
108
+ part_type: 'Spina::Parts::Text'
155
109
  }, {
156
- name: 'meetings',
157
- structure_parts: [{
158
- name: 'name',
159
- title: 'Name',
160
- partable_type: 'Spina::Line'
161
- }, {
162
- name: 'start_time',
163
- title: 'Time',
164
- partable_type: 'Spina::Admin::Conferences::TimePart'
165
- }, {
166
- name: 'location',
167
- title: 'Location',
168
- partable_type: 'Spina::Line'
169
- }, {
170
- name: 'description',
171
- title: 'Description',
172
- partable_type: 'Spina::Text'
173
- }]
110
+ name: 'website',
111
+ title: 'Website',
112
+ part_type: 'Spina::Parts::Admin::Conferences::Url'
174
113
  }, {
175
- name: 'committee_bios',
176
- structure_parts: [{
177
- name: 'name',
178
- title: 'Name',
179
- partable_type: 'Spina::Line'
180
- }, {
181
- name: 'institution',
182
- title: 'Institution',
183
- partable_type: 'Spina::Line'
184
- }, {
185
- name: 'role',
186
- title: 'Role',
187
- partable_type: 'Spina::Line'
188
- }, {
189
- name: 'bio',
190
- title: 'Bio',
191
- partable_type: 'Spina::Text'
192
- }, {
193
- name: 'profile_picture',
194
- title: 'Profile picture',
195
- partable_type: 'Spina::Image'
196
- }, {
197
- name: 'facebook_profile',
198
- title: 'Facebook profile',
199
- partable_type: 'Spina::Admin::Conferences::UrlPart'
200
- }, {
201
- name: 'twitter_profile',
202
- title: 'Twitter profile',
203
- partable_type: 'Spina::Admin::Conferences::UrlPart'
204
- }]
114
+ name: 'email_address',
115
+ title: 'Email address',
116
+ part_type: 'Spina::Parts::Admin::Conferences::EmailAddress'
205
117
  }, {
206
- name: 'sponsors',
207
- structure_parts: [{
208
- name: 'name',
209
- title: 'Name',
210
- partable_type: 'Spina::Line'
211
- }, {
212
- name: 'logo',
213
- title: 'Logo',
214
- partable_type: 'Spina::Image'
215
- }, {
216
- name: 'website',
217
- title: 'Website',
218
- partable_type: 'Spina::Admin::Conferences::UrlPart'
219
- }]
118
+ name: 'date',
119
+ title: 'Date',
120
+ part_type: 'Spina::Parts::Admin::Conferences::Date'
220
121
  }, {
221
- name: 'events_list',
222
- title: 'Events',
223
- structure_parts: [{
224
- name: 'name',
225
- title: 'Name',
226
- partable_type: 'Spina::Line'
227
- }, {
228
- name: 'start_time',
229
- title: 'Time',
230
- partable_type: 'Spina::Admin::Conferences::TimePart'
231
- }, {
232
- name: 'location',
233
- title: 'Location',
234
- partable_type: 'Spina::Line'
235
- }, {
236
- name: 'description',
237
- title: 'Description',
238
- partable_type: 'Spina::Text'
239
- }, {
240
- name: 'url',
241
- title: 'Link',
242
- partable_type: 'Spina::Admin::Conferences::UrlPart'
243
- }]
122
+ name: 'attachment',
123
+ title: 'Attachment',
124
+ part_type: 'Spina::Parts::Attachment'
125
+ }, {
126
+ name: 'start_time',
127
+ title: 'Time',
128
+ part_type: 'Spina::Parts::Admin::Conferences::Time'
129
+ }, {
130
+ name: 'location',
131
+ title: 'Location',
132
+ part_type: 'Spina::Parts::Line'
133
+ }, {
134
+ name: 'institution',
135
+ title: 'Institution',
136
+ part_type: 'Spina::Parts::Line'
137
+ }, {
138
+ name: 'role',
139
+ title: 'Role',
140
+ part_type: 'Spina::Parts::Line'
141
+ }, {
142
+ name: 'bio',
143
+ title: 'Bio',
144
+ part_type: 'Spina::Parts::Text'
145
+ }, {
146
+ name: 'profile_picture',
147
+ title: 'Profile picture',
148
+ part_type: 'Spina::Parts::Image'
149
+ }, {
150
+ name: 'facebook_profile',
151
+ title: 'Facebook profile',
152
+ part_type: 'Spina::Parts::Admin::Conferences::Url'
153
+ }, {
154
+ name: 'twitter_profile',
155
+ title: 'Twitter profile',
156
+ part_type: 'Spina::Parts::Admin::Conferences::Url'
157
+ }, {
158
+ name: 'url',
159
+ title: 'Link',
160
+ part_type: 'Spina::Parts::Admin::Conferences::Url'
244
161
  }]
245
162
 
246
163
  theme.view_templates = [{
247
164
  name: 'homepage',
248
165
  title: 'Homepage',
249
- page_parts: %w[gallery text]
166
+ parts: %w[gallery text]
250
167
  }, {
251
168
  name: 'information',
252
169
  title: 'Information',
253
170
  description: 'Contains general information',
254
- page_parts: %w[text]
171
+ parts: %w[text]
255
172
  }, {
256
173
  name: 'committee',
257
174
  title: 'Committee',
258
175
  description: 'Contains committee bios',
259
- page_parts: %w[text committee_bios]
176
+ parts: %w[text committee_bios]
260
177
  }, {
261
178
  name: 'about',
262
179
  title: 'About',
263
180
  description: 'Contains information about the society',
264
- page_parts: %w[text constitution minutes documents partner_societies contact]
181
+ parts: %w[text constitution minutes documents partner_societies contact]
265
182
  }, {
266
183
  name: 'events',
267
184
  title: 'Events',
268
185
  description: 'Contains details of past and upcoming events',
269
- page_parts: %w[text events_list]
186
+ parts: %w[text events_list]
270
187
  }, {
271
188
  name: 'show',
272
189
  title: 'Blank',
273
190
  description: 'Blank template',
274
- page_parts: []
191
+ parts: []
275
192
  }]
276
193
 
277
194
  theme.custom_pages = [{