spina-conferences-primer_theme 0.1.14 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/spina_conferences_primer_theme_manifest.js +0 -1
  3. data/app/assets/javascripts/spina/conferences/primer_theme/application.js +0 -1
  4. data/app/assets/stylesheets/spina/conferences/primer_theme/application.sass +11 -8
  5. data/app/controllers/spina/conferences/primer_theme/conferences_controller.rb +13 -6
  6. data/app/helpers/spina/conferences/primer_theme/application_helper.rb +5 -16
  7. data/app/views/conferences_primer_theme/pages/about.html.haml +89 -19
  8. data/app/views/conferences_primer_theme/pages/committee.html.haml +41 -9
  9. data/app/views/conferences_primer_theme/pages/events.html.haml +57 -10
  10. data/app/views/conferences_primer_theme/pages/homepage.html.haml +29 -4
  11. data/app/views/conferences_primer_theme/pages/information.html.haml +4 -5
  12. data/app/views/conferences_primer_theme/pages/show.html.haml +1 -1
  13. data/app/views/layouts/spina/conferences/primer_theme/application.html.haml +8 -6
  14. data/app/views/spina/application/_cookies.html.haml +3 -10
  15. data/app/views/spina/application/_current_conference_alert.html.haml +1 -1
  16. data/app/views/spina/application/_footer.html.haml +6 -15
  17. data/app/views/spina/application/_footer_content.html.haml +13 -0
  18. data/app/views/spina/application/_list_item.html.haml +1 -1
  19. data/app/views/spina/application/_logo.html.haml +1 -1
  20. data/app/views/spina/application/_mobile_navigation_item.html.haml +12 -11
  21. data/app/views/spina/application/_mobile_navigation_items.html.haml +3 -0
  22. data/app/views/spina/application/_navigation.html.haml +8 -9
  23. data/app/views/spina/application/_navigation_item.html.haml +9 -10
  24. data/app/views/spina/application/_text.html.haml +1 -1
  25. data/app/views/spina/conferences/primer_theme/conferences/_conference.html.haml +10 -10
  26. data/app/views/spina/conferences/primer_theme/conferences/_event.html.haml +10 -10
  27. data/app/views/spina/conferences/primer_theme/conferences/_events.html.haml +14 -13
  28. data/app/views/spina/conferences/primer_theme/conferences/_header.html.haml +46 -0
  29. data/app/views/spina/conferences/primer_theme/conferences/_presentation.html.haml +14 -12
  30. data/app/views/spina/conferences/primer_theme/conferences/_presentations.html.haml +13 -13
  31. data/app/views/spina/conferences/primer_theme/conferences/_submission_flash.html.haml +10 -0
  32. data/app/views/spina/conferences/primer_theme/conferences/index.html.haml +13 -12
  33. data/app/views/spina/conferences/primer_theme/conferences/show.html.haml +34 -65
  34. data/app/views/spina/conferences/primer_theme/kaminari/_gap.html.haml +2 -0
  35. data/app/views/spina/conferences/primer_theme/kaminari/_next_page.html.haml +9 -0
  36. data/app/views/spina/conferences/primer_theme/kaminari/_page.html.haml +10 -0
  37. data/app/views/spina/conferences/primer_theme/kaminari/_paginator.html.haml +17 -0
  38. data/app/views/spina/conferences/primer_theme/kaminari/_prev_page.html.haml +9 -0
  39. data/app/views/spina/conferences/primer_theme/presentations/_abstract.html.haml +1 -1
  40. data/app/views/spina/conferences/primer_theme/presentations/_attachment.html.haml +2 -3
  41. data/app/views/spina/conferences/primer_theme/presentations/_attachments.html.haml +3 -2
  42. data/app/views/spina/conferences/primer_theme/presentations/show.html.haml +9 -7
  43. data/config/initializers/primer.rb +3 -0
  44. data/config/initializers/themes/conferences_primer_theme.rb +95 -178
  45. data/config/locales/en.yml +61 -63
  46. data/db/migrate/20210206170704_change_current_conference_alert_to_text.rb +17 -0
  47. data/lib/spina/conferences/primer_theme.rb +2 -1
  48. data/lib/spina/conferences/primer_theme/breadcrumbs/builder.rb +2 -2
  49. data/lib/spina/conferences/primer_theme/version.rb +1 -1
  50. metadata +18 -31
  51. data/app/assets/stylesheets/spina/conferences/primer_theme/_admin.sass +0 -4
  52. data/app/assets/stylesheets/spina/conferences/primer_theme/_github.sass +0 -2
  53. data/app/assets/stylesheets/spina/conferences/primer_theme/_primer.sass +0 -4
  54. data/app/assets/stylesheets/spina/conferences/primer_theme/_turbolinks.sass +0 -3
  55. data/app/views/spina/application/_image_collection.html.haml +0 -19
  56. data/app/views/spina/conferences/primer_theme/conferences/_information.html.haml +0 -4
  57. data/app/views/spina/conferences/primer_theme/conferences/_sponsor.html.haml +0 -8
  58. data/app/views/spina/conferences/primer_theme/conferences/_sponsors.html.haml +0 -6
  59. data/app/views/spina/conferences/primer_theme/conferences/_tab.html.haml +0 -1
  60. data/app/views/spina/pages/_committee_bio.html.haml +0 -34
  61. data/app/views/spina/pages/_committee_bios.html.haml +0 -7
  62. data/app/views/spina/pages/_constitution.html.haml +0 -11
  63. data/app/views/spina/pages/_contact.html.haml +0 -4
  64. data/app/views/spina/pages/_document.html.haml +0 -15
  65. data/app/views/spina/pages/_documents.html.haml +0 -7
  66. data/app/views/spina/pages/_event.html.haml +0 -17
  67. data/app/views/spina/pages/_events_list.html.haml +0 -19
  68. data/app/views/spina/pages/_homepage_content.html.haml +0 -15
  69. data/app/views/spina/pages/_jumbotron.html.haml +0 -2
  70. data/app/views/spina/pages/_minutes.html.haml +0 -9
  71. data/app/views/spina/pages/_minutes_entry.html.haml +0 -12
  72. data/app/views/spina/pages/_partner_societies.html.haml +0 -10
  73. data/app/views/spina/pages/_partner_society.html.haml +0 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 747d8e4bd24f28e085f7f25e067975bded223945166f790a946344366c698604
4
- data.tar.gz: d048d050d8b62c38bc33b831d4fbf6f3426b50b32123bc1d9ec423abdbb26eea
3
+ metadata.gz: 156c5b1b40b3e0303fd92de0e04a6a62fb146698d85ddd59ed801ab2c78eab4f
4
+ data.tar.gz: 55f7bd8092847e2f43a4859355c2eb0c24511a4f524bb202adc9276a32bbe5f3
5
5
  SHA512:
6
- metadata.gz: a095e0ddfb8342743f321c5e1b3b79c342e4c6a106a91957d0a94559e13d0e4d1fb587d1c36f6080b012027f194d59ba2e8f9cd19ff739b87cf74dd310f636ad
7
- data.tar.gz: d6f67677691a3183b7b870031552fc7c0c4a9c98a7be245f9997d8f58d7168dfaa41275cf4766d63b8a4de0147c7019bca03310a9928d0c331a80cca2f2701ce
6
+ metadata.gz: c32c1e6944e047252b8b87a56a6fab462d66959d9e6b76ff64b6bafbe59ef9b679823a8ad7cf1389316ee3869a4c08641af42d173025a8d5b89d0ddd5a2d8e62
7
+ data.tar.gz: 46d2fe6eb4b871aed7b220851bc0c70b327db56721ef72b86578fa35383152e85e7bb3738aeea05ed07ddcaf59d8dd2333d2b24182d4c311a1e18785eaa022f0
@@ -4,6 +4,5 @@
4
4
 
5
5
  //= link @github/details-dialog-element/dist/index.js
6
6
  //= link @github/include-fragment-element/dist/index.js
7
- //= link @github/tab-container-element/dist/index.js
8
7
  //= link @github/filter-input-element/dist/index.js
9
8
  //= link @github/details-menu-element/dist/index.js
@@ -1,6 +1,5 @@
1
1
  //= require stimulus
2
2
  //= require_directory ./controllers
3
- //= require turbolinks
4
3
 
5
4
  // eslint-disable-next-line no-undef
6
5
  const application = Stimulus.Application.start()
@@ -1,13 +1,16 @@
1
+ @import "@github/details-dialog-element/dist"
2
+
1
3
  @import spina/conferences/primer_theme/custom
4
+ @import "@primer/css"
5
+ @import "@primer/octicons"
6
+
7
+ .admin
8
+ @import "spina/admin_editing"
9
+ #admin_bar
10
+ font-family: 'Metropolis', sans-serif
2
11
 
3
- @import primer
4
- @import github
5
- @import turbolinks
6
- @import admin
12
+ .turbo-progress-bar
13
+ background-color: white
7
14
 
8
- img
9
- max-width: 100%
10
- object-fit: cover
11
- object-position: top left
12
15
  address
13
16
  font-style: normal
@@ -5,7 +5,7 @@ module Spina
5
5
  module PrimerTheme
6
6
  # User-facing controller for conferences, serving both html and ics
7
7
  class ConferencesController < ApplicationController
8
- before_action :set_conference, :set_tab, :set_presentation_type, :set_breadcrumb, only: :show
8
+ before_action :set_conference, :set_tab, :set_presentation_type, :set_presentations, :set_breadcrumb, only: :show
9
9
  before_action :set_metadata
10
10
 
11
11
  def index
@@ -25,6 +25,7 @@ module Spina
25
25
  presentation_types: [:translations],
26
26
  presentations: [session: [:room], presenters: [:institution]])
27
27
  .find(params[:id])
28
+ @conference.view_context = view_context
28
29
  rescue ActiveRecord::RecordNotFound
29
30
  send_file Rails.root.join('public/404.html'), type: 'text/html; charset=utf-8', status: 404
30
31
  end
@@ -34,13 +35,19 @@ module Spina
34
35
  end
35
36
 
36
37
  def set_presentation_type
37
- @presentation_type = if params[:presentation_type].present?
38
- @conference.presentation_types
38
+ if params[:presentation_type].present?
39
+ @presentation_type = @conference.presentation_types
39
40
  .includes(presentations: [session: [:room], presenters: [:institution]])
40
41
  .find(params[:presentation_type])
41
- else
42
- @conference
43
- end
42
+ end
43
+ end
44
+
45
+ def set_presentations
46
+ @presentations = if @presentation_type.present?
47
+ @presentation_type.presentations.page(params[:page])
48
+ else
49
+ @conference.presentations.page(params[:page])
50
+ end
44
51
  end
45
52
 
46
53
  def set_breadcrumb
@@ -7,8 +7,9 @@ module Spina
7
7
  module ApplicationHelper
8
8
  include Spina::PagesHelper
9
9
 
10
- def latest_conference
11
- Spina::Admin::Conferences::Conference.sorted.first
10
+ # Because the upper bound is exclusive a conference is current the day after it ends
11
+ def current_conference
12
+ Spina::Admin::Conferences::Conference.order(dates: :asc).find_by('upper(dates) >= ?', Date.today)
12
13
  end
13
14
 
14
15
  def ancestors
@@ -16,24 +17,12 @@ module Spina
16
17
 
17
18
  render Primer::BreadcrumbComponent.new(mb: 4) do |component|
18
19
  current_page.ancestors.each do |ancestor|
19
- component.slot(:item, href: ancestor.materialized_path) { ancestor.menu_title }
20
+ component.item(href: ancestor.materialized_path) { ancestor.menu_title }
20
21
  end
21
- component.slot(:item, selected: true) { current_page.menu_title }
22
+ component.item(selected: true) { current_page.menu_title }
22
23
  end
23
24
  end
24
25
 
25
- def partable_for(*part_names, parent: current_page)
26
- association = case parent
27
- when Spina::Page then :page_partable
28
- when Spina::StructureItem then :structure_partable
29
- when Spina::Account then :layout_partable
30
- else :partable
31
- end
32
- parts = parent.parts.where(name: part_names)
33
- partables = parts.collect { |part| part.try(association) }
34
- [*parts, *partables]
35
- end
36
-
37
26
  def calendar(name:, &block)
38
27
  # noinspection SpellCheckingInspection
39
28
  block ||= proc { '' }
@@ -1,22 +1,92 @@
1
1
  - cache current_page do
2
- %h1= current_page.title
2
+ = render(Primer::HeadingComponent.new) { current_page.title }
3
+
4
+ - if content(:text).present?
5
+ = render(Primer::MarkdownComponent.new(mt: 4)) { content.html(:text) }
6
+ - if content(:contact).present?
7
+ = render Primer::SubheadComponent.new(mt: 4) do |component|
8
+ = component.heading { t :'.contact.title' }
9
+ = render(Primer::MarkdownComponent.new) { content.html(:contact) }
3
10
 
4
- - cache partable_for(:text) do
5
- - if has_content? :text
6
- .mt-4= render partial: 'text', object: content(:text)
7
- - cache partable_for(:contact) do
8
- - if has_content? :contact
9
- .mt-4= render partial: 'contact', object: content(:contact)
10
11
  .clearfix.gutter
11
- - cache partable_for(:constitution) do
12
- .mt-4.col-12.col-md-6.float-md-left= render partial: 'constitution', object: content(:constitution)
13
- - cache [partable_for(:minutes), content(:minutes)&.structure_items,
14
- content(:minutes)&.structure_items&.collect_concat(&:structure_parts)&.collect(&:structure_partable)] do
15
- .mt-4.col-12.col-md-6.float-md-left= render partial: 'minutes', object: content(:minutes)
16
- - cache [partable_for(:documents), content(:documents)&.structure_items,
17
- content(:documents)&.structure_items&.collect_concat(&:structure_parts)&.collect(&:structure_partable)] do
18
- .mt-4.col-12.col-md-12.float-md-left= render partial: 'documents', object: content(:documents)
19
- - cache [partable_for(:partner_societies), content(:partner_societies)&.structure_items,
20
- content(:partner_societies)&.structure_items&.collect_concat(&:structure_parts)&.collect(&:structure_partable)] do
21
- - if has_content?(:partner_societies) && content(:partner_societies).structure_items.any?
22
- .mt-4= render partial: 'partner_societies', object: content(:partner_societies)
12
+ = render Primer::BoxComponent.new(mt: 4, col: [12, nil, 6, nil], float: [nil, nil, :left, nil]) do
13
+ = render Primer::SubheadComponent.new do |component|
14
+ = component.heading { t :'.constitution.title' }
15
+ - if content(:constitution).present?
16
+ = render Primer::FlexComponent.new(align_items: :center, py: 1) do
17
+ = render Primer::FlexItemComponent.new(flex_auto: true, pr: 1) do
18
+ = t :'.constitution.uploaded',
19
+ date: l(Spina::Attachment.find(content(:constitution).attachment_id).created_at.to_date, format: :long)
20
+ = render Primer::ButtonComponent.new(tag: :a, href: content.attachment_url(:constitution), ml: 2, download: '') do
21
+ = render Primer::OcticonComponent.new('desktop-download')
22
+ = t :'.constitution.download'
23
+ - else
24
+ = render Primer::BlankslateComponent.new(title: t(:'.constitution.no_constitution'), icon: 'law')
25
+
26
+ = render Primer::BoxComponent.new(mt: 4, col: [12, nil, 6, nil], float: [nil, nil, :left, nil]) do
27
+ = render Primer::SubheadComponent.new do |component|
28
+ = component.heading { t :'.minutes.title' }
29
+ - if content(:minutes).present?
30
+ %ul
31
+ - repeater :minutes do |minutes_entry|
32
+ %li.list-style-none.py-1.d-flex.flex-items-center
33
+ = render Primer::FlexItemComponent.new(flex_auto: true) do
34
+ - if minutes_entry.content(:date).present?
35
+ = t(:'.minutes.minutes_for_html', date: time_tag(minutes_entry.content(:date)))
36
+ - else
37
+ = t(:'.minutes.no_date')
38
+ - if minutes_entry.content(:attachment).present?
39
+ = render Primer::ButtonComponent.new(tag: :a, ml: 2, href: minutes_entry.content.attachment_url(:attachment),
40
+ download: '') do
41
+ = render Primer::OcticonComponent.new('desktop-download')
42
+ = t(:'.minutes.download')
43
+ - else
44
+ = render(Primer::TextComponent.new(color: :text_secondary, font_size: 6)) { t :'.minutes.no_file' }
45
+ - else
46
+ = render Primer::BlankslateComponent.new(title: t(:'.minutes.no_minutes'), icon: 'file')
47
+
48
+ = render Primer::BoxComponent.new(mt: 4, col: [12, nil, 6, nil], float: [nil, nil, :left, nil]) do
49
+ - if content(:documents).present?
50
+ = render Primer::SubheadComponent.new do |component|
51
+ = component.heading { t :'.documents.title' }
52
+ %ul
53
+ - repeater :documents do |document|
54
+ %li.list-style-none.py-1.d-flex.flex-items-center
55
+ = render(Primer::TextComponent.new(tag: :div, flex: :auto)) { document.content(:name).presence || t(:'.documents.no_name') }
56
+ - if document.content(:attachment).present?
57
+ = render Primer::ButtonComponent.new(tag: :a, ml: 2, href: document.content.attachment_url(:attachment), download: '') do
58
+ = render Primer::OcticonComponent.new('desktop-download')
59
+ = t :'.documents.download'
60
+ - else
61
+ = render(Primer::TextComponent.new(tag: :div, font_size: 6, color: :text_secondary)) { t :'.documents.no_file' }
62
+
63
+ = render Primer::SubheadComponent.new do |component|
64
+ = component.heading { t :'.partner_societies.title' }
65
+ - if content(:partner_societies).present?
66
+ %ul
67
+ - repeater :partner_societies do |partner_society|
68
+ %li.list-style-none.py-4.border-bottom
69
+ = render Primer::FlexComponent.new(direction: [:column, nil, :row_reverse, nil], align_items: :start) do
70
+ = render Primer::BaseComponent.new(tag: :div, flex: :auto) do
71
+ = render Primer::HeadingComponent.new(tag: :h3, mb: 1) do
72
+ = render Primer::FlexComponent.new(flex_wrap: true, justify_content: :space_between) do
73
+ - if partner_society.content(:name).present?
74
+ = render(Primer::TextComponent.new(tag: :div)) { partner_society.content(:name) }
75
+ = render Primer::ButtonGroupComponent.new(aria: { label: t(:'.partner_societies.contact_buttons') }) do |component|
76
+ - if partner_society.content(:website).present?
77
+ = component.button(tag: :a, href: partner_society.content(:website)) do
78
+ = render Primer::OcticonComponent.new('browser')
79
+ = t(:'.partner_societies.website')
80
+ - if partner_society.content(:email_address).present?
81
+ = component.button(tag: :a, href: "mailto:#{partner_society.content(:email_address)}") do
82
+ = render Primer::OcticonComponent.new('mail')
83
+ = t(:'.partner_societies.email')
84
+ - if partner_society.content(:description).present?
85
+ = render Primer::MarkdownComponent.new(color: :text_secondary) do
86
+ = partner_society.content(:description).try(:html_safe)
87
+ - if partner_society.content(:logo).present?
88
+ = partner_society.content.image_tag(:logo, { resize_to_limit: [200, 150] }, size: nil, draggable: false,
89
+ srcset: srcset(partner_society.content(:logo), variant: { resize_to_limit: [200, 150] }),
90
+ class: %w[mt-4 mt-md-0 mr-md-4])
91
+ - else
92
+ = render Primer::BlankslateComponent.new(title: t(:'.partner_societies.no_societies'), icon: 'organization')
@@ -1,10 +1,42 @@
1
1
  - cache current_page do
2
- %h1= current_page.title
3
-
4
- - cache partable_for(:text) do
5
- - if has_content? :text
6
- .mt-4= render partial: 'text', object: content(:text)
7
- - cache [partable_for(:committee_bios), content(:committee_bios)&.structure_items,
8
- content(:committee_bios)&.structure_items&.collect_concat(&:structure_parts)&.collect(&:structure_partable)] do
9
- - if has_content?(:committee_bios) && content(:committee_bios).structure_items.any?
10
- .mt-4= render partial: 'committee_bios', object: content(:committee_bios)
2
+ = render(Primer::HeadingComponent.new) { current_page.title }
3
+
4
+ - if content(:text).present?
5
+ = render(Primer::MarkdownComponent.new(mt: 4)) { content.html(:text) }
6
+
7
+ - if content(:committee_bios).present?
8
+ %ul.mt-4
9
+ - repeater(:committee_bios) do |committee_bio|
10
+ %li.list-style-none.py-4.border-bottom
11
+ = render Primer::FlexComponent.new(direction: [:column, nil, :row, nil], align_items: :start) do
12
+ - if committee_bio.content(:profile_picture).present?
13
+ = render Primer::AvatarComponent.new(src: committee_bio.content.image_url(:profile_picture, resize_to_fill: [150, 150]),
14
+ srcset: srcset_string(committee_bio.content(:profile_picture),
15
+ variant: { resize_to_fill: [150, 150] }),
16
+ draggable: false, alt: committee_bio.content(:profile_picture).alt, size: 150,
17
+ mr: [nil, nil, 3, nil], mb: [3, nil, 0, nil], flex_shrink: 0)
18
+ = render Primer::FlexItemComponent.new(flex_auto: true) do
19
+ = render Primer::FlexComponent.new(direction: [:column, nil, :row, nil], mb: 1) do
20
+ = render Primer::BoxComponent.new do
21
+ - if committee_bio.content(:name).present?
22
+ = render(Primer::HeadingComponent.new(tag: :h3)) do
23
+ - if committee_bio.content(:role).present?
24
+ = t :'.name_and_role', name: committee_bio.content(:name), role: committee_bio.content(:role)
25
+ - else
26
+ = committee_bio.content(:name)
27
+ - if committee_bio.content(:institution).present?
28
+ = render(Primer::HeadingComponent.new(tag: :h4)) { committee_bio.content(:institution) }
29
+ = render Primer::ButtonGroupComponent.new(mt: [1, nil, 0, nil], ml: [nil, nil, 1, nil],
30
+ aria: { label: t(:'.contact_buttons') }) do |component|
31
+ - if committee_bio.content(:twitter_profile).present?
32
+ = component.button(tag: :a, href: committee_bio.content(:twitter_profile)) do
33
+ = render Primer::OcticonComponent.new('link-external')
34
+ = t(:'.twitter')
35
+ - if committee_bio.content(:facebook_profile).present?
36
+ = component.button(tag: :a, href: committee_bio.content(:facebook_profile)) do
37
+ = render Primer::OcticonComponent.new('link-external')
38
+ = t(:'.facebook')
39
+ - if committee_bio.content(:bio).present?
40
+ = render(Primer::TextComponent.new(tag: :div, color: :text_secondary)) { committee_bio.content.html(:bio) }
41
+ - else
42
+ = render Primer::BlankslateComponent.new(title: t(:'.no_bios'), icon: 'file')
@@ -1,12 +1,59 @@
1
1
  - cache current_page do
2
- %h1= current_page.title
2
+ = render(Primer::HeadingComponent.new) { current_page.title }
3
3
 
4
- - cache partable_for(:text) do
5
- - if has_content? :text
6
- .mt-4= render partial: 'text', object: content(:text)
7
- - cache [partable_for(:events_list), content(:events_list)&.structure_items,
8
- content(:events_list)&.structure_items&.collect_concat(&:structure_parts)&.collect(&:structure_partable)] do
9
- - if has_content?(:events_list) && content(:events_list).structure_items.any?
10
- .mt-2= render partial: 'events_list', object: content(:events_list)
11
- - else
12
- = render Primer::BlankslateComponent.new(title: t(:'.no_events'), icon: 'calendar')
4
+ - if content(:text).present?
5
+ = render(Primer::MarkdownComponent.new(mt: 4)) { content.html(:text) }
6
+
7
+ - if content(:events_list).present?
8
+ = render Primer::SubheadComponent.new(mt: 4) do |component|
9
+ = component.heading { t :'.upcoming' }
10
+ - content(:events_list).filter { |event| event.content(:start_time).blank? || event.content(:start_time) >= Time.now }.then do |events|
11
+ - if events.any?
12
+ %ul
13
+ - repeater(events) do |event|
14
+ %li.list-style-none.py-4.border-bottom
15
+ = render Primer::FlexComponent.new(direction: :column, align_items: :start) do
16
+ - if event.content(:name).present?
17
+ = render(Primer::HeadingComponent.new(tag: :h3, flex: :auto)) { event.content(:name) }
18
+ = render Primer::HeadingComponent.new(tag: :h4, flex: :auto) do
19
+ - if event.content(:start_time).present?
20
+ = t(:'.time_and_place_html',
21
+ time: time_tag(event.content(:start_time), format: :ordinal_datetime_with_year),
22
+ place: event.content(:location).presence || t('.location_tbc'))
23
+ - else
24
+ = t(:'.time_and_place_html', time: t('.time_tbc'), place: event.content(:location).presence || t('.location_tbc'))
25
+ - if event.content(:description).present?
26
+ = render(Primer::TextComponent.new(mt: 1, color: :text_secondary)) { event.content.html(:description) }
27
+ - if event.content(:url).present?
28
+ = render Primer::ButtonComponent.new(tag: :a, href: event.content(:url), mt: 2) do
29
+ = render Primer::OcticonComponent.new('link-external')
30
+ = t :'.more_info'
31
+ - else
32
+ = render Primer::BlankslateComponent.new(title: t(:'.no_events'), icon: 'calendar')
33
+ = render Primer::SubheadComponent.new(mt: 4) do |component|
34
+ = component.heading { t :'.past' }
35
+ - content(:events_list).filter { |event| event.content(:start_time).present? && event.content(:start_time) < Time.now }.then do |events|
36
+ - if events.any?
37
+ %ul
38
+ - repeater(events) do |event|
39
+ %li.list-style-none.py-4.border-bottom
40
+ = render Primer::FlexComponent.new(direction: :column, align_items: :start) do
41
+ - if event.content(:name).present?
42
+ = render(Primer::HeadingComponent.new(tag: :h3, flex: :auto)) { event.content(:name) }
43
+ = render Primer::HeadingComponent.new(tag: :h4, flex: :auto) do
44
+ - if event.content(:start_time).present?
45
+ = t(:'.time_and_place_html',
46
+ time: time_tag(event.content(:start_time), format: :ordinal_datetime_with_year),
47
+ place: event.content(:location).presence || t('.location_tbc'))
48
+ - else
49
+ = t(:'.time_and_place_html', time: t('.time_tbc'), place: event.content(:location).presence || t('.location_tbc'))
50
+ - if event.content(:description).present?
51
+ = render(Primer::TextComponent.new(mt: 1, color: :text_secondary)) { event.content.html(:description) }
52
+ - if event.content(:url).present?
53
+ = render Primer::ButtonComponent.new(tag: :a, href: event.content(:url), mt: 2) do
54
+ = render Primer::OcticonComponent.new('link-external')
55
+ = t :'.more_info'
56
+ - else
57
+ = render Primer::BlankslateComponent.new(title: t(:'.no_events'), icon: 'calendar')
58
+ - else
59
+ = render Primer::BlankslateComponent.new(title: t(:'.no_events'), icon: 'calendar')
@@ -1,5 +1,30 @@
1
1
  - content_for :hero do
2
- - cache [current_page, partable_for(:gallery), latest_conference] do
3
- = render partial: 'homepage_content',
4
- layout: has_content?(:gallery) && content(:gallery).images.any? ? 'image_collection' : 'jumbotron',
5
- locals: { conference: latest_conference, advance: true, image_collection: content(:gallery) }
2
+ - cache [current_page, current_conference] do
3
+ = render Primer::BoxComponent.new(position: :relative, style: 'height: 639px') do
4
+ = render Primer::BoxComponent.new(position: :absolute, top: false, left: false, right: false, bottom: false,
5
+ style: 'background-color: var(--color-bg-backdrop)')
6
+ - if content(:gallery).present?
7
+ = render Primer::FlexComponent.new(position: :absolute, top: false, left: false, right: false, bottom: false, style: 'z-index: 1',
8
+ flex_direction: :column, justify_content: :center, align_items: :center,
9
+ data: { controller: :slideshow, slideshow_incrementer: 0, slideshow_advance: true }) do
10
+ - content(:gallery).each_with_index do |image, index|
11
+ = content.image_tag(image, { resize_to_limit: [1680, 1680] }, draggable: false, hidden: index != 0,
12
+ srcset: srcset(image, variant: { resize_to_limit: [1680, 1680] }),
13
+ style: 'object-fit: cover; max-width: max-content; max-height: max-content',
14
+ data: { slideshow_target: 'slide' }, class: %w[width-full height-full])
15
+ .container-lg.p-responsive.position-relative.text-white.height-full{ style: 'z-index: 2' }
16
+ = render Primer::BoxComponent.new(py: [3, nil, nil, 6]) do
17
+ .text-shadow-dark
18
+ - if current_conference.present?
19
+ = render(Primer::HeadingComponent.new(tag: :h1, classes: 'h000-mktg lh-condensed-ultra')) { current_conference.name }
20
+ = render Primer::TextComponent.new(tag: :address, classes: 'f2-light') do
21
+ = current_conference.institutions.collect(&:name).to_sentence
22
+ = render(Primer::TextComponent.new(tag: :time, classes: 'f2-light')) do
23
+ = t :'.dates_html', start_date: time_tag(current_conference.start_date, format: :day_and_month),
24
+ finish_date: time_tag(current_conference.finish_date, format: :day_and_month)
25
+ - else
26
+ = render(Primer::HeadingComponent.new(tag: :h1, classes: 'h000-mktg lh-condensed-ultra')) { Spina::Account.first.name }
27
+ - if current_conference.present? && current_conference.finish_date >= Date.today
28
+ = link_to t('.more_info'), frontend_conference_path(current_conference),
29
+ class: %w[btn-mktg btn-large-mktg btn-primary-mktg f3 mt-4]
30
+ .text-shadow-dark= render(Primer::MarkdownComponent.new(my: 4)) { content(:text).try(:html_safe) }
@@ -1,6 +1,5 @@
1
1
  - cache current_page do
2
- %h1= current_page.title
3
-
4
- - cache partable_for(:text) do
5
- - if has_content? :text
6
- .mt-4= render partial: 'text', object: content(:text)
2
+ = render(Primer::HeadingComponent.new) { current_page.title }
3
+
4
+ - if content(:text).present?
5
+ = render(Primer::MarkdownComponent.new(mt: 4)) { content.html(:text) }
@@ -1,2 +1,2 @@
1
1
  - cache current_page do
2
- %h1= current_page.title
2
+ = render(Primer::HeadingComponent.new) { current_page.title }
@@ -1,5 +1,5 @@
1
1
  !!!
2
- %html.height-full{ lang: I18n.locale }
2
+ %html{ lang: I18n.locale, data: { color_mode: 'auto', light_theme: 'light', dark_theme: 'dark' } }
3
3
  %head
4
4
  %meta{ charset: 'utf-8' }
5
5
  %meta{ name: 'author', content: author }
@@ -15,23 +15,25 @@
15
15
  = render 'spina/shared/analytics'
16
16
  = stylesheet_link_tag 'spina/conferences/primer_theme/application', media: 'all', data: { turbolinks_track: true }
17
17
  = javascript_include_tag 'spina/conferences/primer_theme/application', data: { turbolinks_track: true }
18
+ = javascript_include_tag 'turbo', type: 'module'
18
19
  %script{ type: 'module', src: asset_path('@github/details-dialog-element/dist/index.js') }
19
20
  %script{ type: 'module', src: asset_path('@github/include-fragment-element/dist/index.js') }
20
- %script{ type: 'module', src: asset_path('@github/tab-container-element/dist/index.js') }
21
21
  %script{ type: 'module', src: asset_path('@github/filter-input-element/dist/index.js') }
22
22
  %script{ type: 'module', src: asset_path('@github/details-menu-element/dist/index.js') }
23
23
  = yield :head
24
24
  %body
25
- .admin= render 'spina/shared/admin_bar'
25
+ - if current_spina_user.present?
26
+ .admin= render 'spina/shared/admin_bar'
26
27
  %header= render 'navigation'
27
28
  = render 'current_conference_alert'
29
+ - if content_for? :flash
30
+ .flash-messages= yield :flash
28
31
  %main
29
- - if content_for? :flash
30
- .flash-messages= yield :flash
31
32
  = yield :hero
32
33
  - if content_for? :breadcrumbs
33
34
  .container-lg.p-responsive.mt-4= yield :breadcrumbs
34
35
  = yield :header
35
36
  .container-lg.p-responsive.mt-4= yield
36
- %footer.container-lg.p-responsive.py-4= render 'footer'
37
+ %footer
38
+ .container-lg.p-responsive.py-4= render 'footer'
37
39
  = render 'spina/shared/social'