spina-conferences-primer_theme 0.1.10 → 0.1.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spina/conferences/primer_theme/application.js +0 -1
  3. data/app/assets/stylesheets/spina/conferences/primer_theme/_turbolinks.sass +1 -1
  4. data/app/assets/stylesheets/spina/conferences/primer_theme/application.sass +1 -1
  5. data/app/controllers/spina/conferences/primer_theme/conferences_controller.rb +8 -6
  6. data/app/controllers/spina/conferences/primer_theme/presentations_controller.rb +1 -6
  7. data/app/helpers/spina/conferences/primer_theme/application_helper.rb +7 -26
  8. data/app/helpers/spina/conferences/primer_theme/asset_helper.rb +9 -11
  9. data/app/views/conferences_primer_theme/pages/homepage.html.haml +4 -5
  10. data/app/views/layouts/conferences_primer_theme/application.html.haml +3 -1
  11. data/app/views/layouts/spina/conferences/primer_theme/application.html.haml +3 -2
  12. data/app/views/layouts/spina/conferences/primer_theme/conferences.html.haml +3 -2
  13. data/app/views/layouts/spina/conferences/primer_theme/presentations.html.haml +4 -2
  14. data/app/views/spina/admin/layout_partables/texts/_form.html.haml +4 -0
  15. data/app/views/spina/application/_cookies.html.haml +2 -9
  16. data/app/views/spina/application/_current_conference_alert.html.haml +1 -1
  17. data/app/views/spina/application/_footer.html.haml +5 -14
  18. data/app/views/spina/application/_footer_content.html.haml +13 -0
  19. data/app/views/spina/application/_image_collection.html.haml +2 -2
  20. data/app/views/spina/application/_list_item.html.haml +1 -1
  21. data/app/views/spina/application/_navigation_item.html.haml +2 -2
  22. data/app/views/spina/application/_text.html.haml +1 -1
  23. data/app/views/spina/conferences/primer_theme/conferences/_conference.html.haml +8 -8
  24. data/app/views/spina/conferences/primer_theme/conferences/_event.html.haml +10 -10
  25. data/app/views/spina/conferences/primer_theme/conferences/_events.html.haml +14 -13
  26. data/app/views/spina/conferences/primer_theme/conferences/_header.html.haml +27 -0
  27. data/app/views/spina/conferences/primer_theme/conferences/_information.html.haml +2 -2
  28. data/app/views/spina/conferences/primer_theme/conferences/_presentation.html.haml +14 -12
  29. data/app/views/spina/conferences/primer_theme/conferences/_presentations.html.haml +12 -13
  30. data/app/views/spina/conferences/primer_theme/conferences/_sponsor.html.haml +2 -2
  31. data/app/views/spina/conferences/primer_theme/conferences/_sponsors.html.haml +3 -3
  32. data/app/views/spina/conferences/primer_theme/conferences/_submission_flash.html.haml +14 -0
  33. data/app/views/spina/conferences/primer_theme/conferences/index.html.haml +12 -9
  34. data/app/views/spina/conferences/primer_theme/conferences/show.html.haml +33 -63
  35. data/app/views/spina/conferences/primer_theme/presentations/_abstract.html.haml +1 -1
  36. data/app/views/spina/conferences/primer_theme/presentations/_attachment.html.haml +1 -2
  37. data/app/views/spina/conferences/primer_theme/presentations/_attachments.html.haml +3 -2
  38. data/app/views/spina/conferences/primer_theme/presentations/show.html.haml +8 -6
  39. data/app/views/spina/pages/_committee_bio.html.haml +22 -20
  40. data/app/views/spina/pages/_committee_bios.html.haml +1 -0
  41. data/app/views/spina/pages/_constitution.html.haml +5 -4
  42. data/app/views/spina/pages/_contact.html.haml +1 -1
  43. data/app/views/spina/pages/_document.html.haml +3 -5
  44. data/app/views/spina/pages/_documents.html.haml +1 -1
  45. data/app/views/spina/pages/_event.html.haml +10 -10
  46. data/app/views/spina/pages/_events_list.html.haml +2 -2
  47. data/app/views/spina/pages/_homepage_content.html.haml +13 -14
  48. data/app/views/spina/pages/_jumbotron.html.haml +1 -1
  49. data/app/views/spina/pages/_minutes.html.haml +1 -1
  50. data/app/views/spina/pages/_minutes_entry.html.haml +6 -4
  51. data/app/views/spina/pages/_partner_societies.html.haml +2 -2
  52. data/app/views/spina/pages/_partner_society.html.haml +21 -19
  53. data/config/initializers/primer.rb +3 -0
  54. data/config/initializers/themes/conferences_primer_theme.rb +1 -1
  55. data/config/locales/en.rb +5 -0
  56. data/config/locales/en.yml +12 -10
  57. data/db/migrate/20210206170704_change_current_conference_alert_to_text.rb +29 -0
  58. data/lib/spina/conferences/primer_theme.rb +2 -1
  59. data/lib/spina/conferences/primer_theme/breadcrumbs/builder.rb +2 -2
  60. data/lib/spina/conferences/primer_theme/version.rb +1 -1
  61. metadata +27 -22
  62. data/app/views/spina/conferences/primer_theme/conferences/_tab.html.haml +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9944a8a75899d111879d10a63f4bfb35980d75169f3ebb41b410eec6eae3a2b9
4
- data.tar.gz: 860e7c50cb148b3f51230f32beb0598065c4cc82a3eb8eabb0e329e4fc08ee73
3
+ metadata.gz: 053a0eb11e7ced4282502df407443f30da98f6efd1499a9800aa3aeff8ca6b13
4
+ data.tar.gz: '08d5f2ccb2616cb2d58b153b2bbb00af4e5ee1e7ce45e4c44e04661c72241c8e'
5
5
  SHA512:
6
- metadata.gz: 677fb690c14b5adea6013fc3b7ba650d3143492b562a132cda9dade57ef0383e5feed5fc568924f3f6defb88c6cd71aa378edfc54ca5e63a4d4c6a69c215300f
7
- data.tar.gz: 263a34a87512b24300dab2cfc39459538910fb801709e427a695813626ada9f4e47873e98b1650e739a69dfb70b292037f3cd30d875f4b46c83714533ebb4710
6
+ metadata.gz: 319dac2e50330a0cdfd3faa9f897341f02eee1651825d45a5f917837c7da88d4b0ef223018fe1a23fab54d55fd02d71a7a8f5acf4f4fa0d2b5d0c3bcfe7cd462
7
+ data.tar.gz: 35e652f094562c9032877ce59782870fd5211e62cf4b2655f67eac1a4c47873f23480fef0fda1c202b32d693fe0ceb632544d88a6550d3fc253139a037d49d07
@@ -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,3 +1,3 @@
1
1
  //noinspection CssUnusedSymbol
2
- .turbolinks-progress-bar
2
+ .turbo-progress-bar
3
3
  background-color: white
@@ -8,6 +8,6 @@
8
8
  img
9
9
  max-width: 100%
10
10
  object-fit: cover
11
- object-position: top left
11
+ object-position: center
12
12
  address
13
13
  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
@@ -34,13 +34,15 @@ module Spina
34
34
  end
35
35
 
36
36
  def set_presentation_type
37
- @presentation_type = if params[:presentation_type].present?
38
- @conference.presentation_types
37
+ if params[:presentation_type].present?
38
+ @presentation_type = @conference.presentation_types
39
39
  .includes(presentations: [session: [:room], presenters: [:institution]])
40
40
  .find(params[:presentation_type])
41
- else
42
- @conference
43
- end
41
+ end
42
+ end
43
+
44
+ def set_presentations
45
+ @presentations = @presentation_type.present? ? @presentation_type.presentations : @conference.presentations
44
46
  end
45
47
 
46
48
  def set_breadcrumb
@@ -5,7 +5,7 @@ module Spina
5
5
  module PrimerTheme
6
6
  # User-facing controller for presentations, serving both html and ics
7
7
  class PresentationsController < ApplicationController
8
- before_action :set_presentation, :set_conference, :set_breadcrumb, :set_metadata
8
+ before_action :set_presentation, :set_conference, :set_breadcrumb
9
9
 
10
10
  def show
11
11
  add_breadcrumb @presentation.name
@@ -34,11 +34,6 @@ module Spina
34
34
  add_breadcrumb Admin::Conferences::Conference.model_name.human.pluralize, frontend_conferences_path
35
35
  add_breadcrumb @conference.name, frontend_conference_path(@conference)
36
36
  end
37
-
38
- def set_metadata
39
- @title = @presentation.present? ? @presentation.name : Admin::Conferences::Presentation.model_name.human(count: 0)
40
- @description = @presentation.present? ? helpers.strip_tags(@presentation.abstract) : ''
41
- end
42
37
  end
43
38
  end
44
39
  end
@@ -5,43 +5,23 @@ module Spina
5
5
  module PrimerTheme
6
6
  # Base helper
7
7
  module ApplicationHelper
8
+ include Spina::PagesHelper
9
+
8
10
  def latest_conference
9
11
  Spina::Admin::Conferences::Conference.sorted.first
10
12
  end
11
13
 
12
- def breadcrumbs(options = {}, &block)
13
- render_breadcrumbs(builder: Breadcrumbs::Builder, **options, &block)
14
- end
15
-
16
14
  def ancestors
17
15
  return [] if current_page.blank?
18
16
 
19
17
  render Primer::BreadcrumbComponent.new(mb: 4) do |component|
20
18
  current_page.ancestors.each do |ancestor|
21
- component.slot(:item, href: ancestor.materialized_path) { ancestor.menu_title }
19
+ component.item(href: ancestor.materialized_path) { ancestor.menu_title }
22
20
  end
23
- component.slot(:item, selected: true) { current_page.menu_title }
21
+ component.item(selected: true) { current_page.menu_title }
24
22
  end
25
23
  end
26
24
 
27
- def author
28
- current_account.name
29
- end
30
-
31
- def description
32
- current_page.present? ? current_page.description : @description # rubocop:disable Rails/HelperInstanceVariable
33
- end
34
-
35
- def title
36
- # noinspection RailsI18nInspection
37
- t :'.title', title: current_page.present? ? current_page.title : @title, suffix: current_account.name # rubocop:disable Rails/HelperInstanceVariable
38
- end
39
-
40
- def seo_title
41
- # noinspection RailsI18nInspection
42
- t :'.title', title: current_page.present? ? current_page.seo_title : @title, suffix: current_account.name # rubocop:disable Rails/HelperInstanceVariable
43
- end
44
-
45
25
  def partable_for(*part_names, parent: current_page)
46
26
  association = case parent
47
27
  when Spina::Page then :page_partable
@@ -50,12 +30,13 @@ module Spina
50
30
  else :partable
51
31
  end
52
32
  parts = parent.parts.where(name: part_names)
53
- part_parents = parts.collect { |part| part.try(association) }
54
- [*parts, *part_parents]
33
+ partables = parts.collect { |part| part.try(association) }
34
+ [*parts, *partables]
55
35
  end
56
36
 
57
37
  def calendar(name:, &block)
58
38
  # noinspection SpellCheckingInspection
39
+ block ||= proc { '' }
59
40
  Icalendar::Calendar.new.tap { |calendar| calendar.x_wr_calname = name }
60
41
  .then(&:to_ical).then { |calendar| calendar.insert(calendar.index('END:VCALENDAR'), capture(&block)) }
61
42
  end
@@ -5,29 +5,27 @@ module Spina
5
5
  module PrimerTheme
6
6
  # Helper for computing asset sources
7
7
  module AssetHelper
8
- METHODS_TO_RESIZE = %i[resize_to_limit resize_to_fit resize_to_fill resize_and_pad].freeze
9
- DEFAULT_FACTORS = [1, 2, 3, 4].freeze
10
-
11
- def concat_srcset(image, **options)
12
- srcset(image, **options).collect { |src_path, size| "#{src_path} #{size}" }
13
- .join ', '
14
- end
15
-
16
8
  def srcset(image, **options)
17
9
  return if image.blank?
18
10
 
19
11
  options = options.symbolize_keys
20
12
  variant_options = options.delete(:variant)
13
+ return if variant_options.blank?
14
+
21
15
  factors = options.delete(:factors) || DEFAULT_FACTORS
22
16
  variants_for image, variant_options: variant_options, factors: factors
23
17
  end
24
18
 
25
- def src(image, **options)
26
- main_app.url_for(image.variant(**options))
19
+ def srcset_string(image, **options)
20
+ srcset(image, **options).collect { |key, value| "#{key} #{value}" }
21
+ .join(', ')
27
22
  end
28
23
 
29
24
  private
30
25
 
26
+ METHODS_TO_RESIZE = %i[resize_to_limit resize_to_fit resize_to_fill resize_and_pad].freeze
27
+ DEFAULT_FACTORS = [1, 2, 3, 4].freeze
28
+
31
29
  def variants_for(image, variant_options:, factors:)
32
30
  factors.inject({}) { |srcset, factor| srcset.update(variant_url(image, variant_options, factor) => "#{factor}x") }
33
31
  end
@@ -41,7 +39,7 @@ module Spina
41
39
  end
42
40
 
43
41
  def resize_dimensions_for_key(key, factor, dimensions)
44
- dimensions.collect { |dimension| resize_dimension(dimension, factor) } if METHODS_TO_RESIZE.include? key
42
+ METHODS_TO_RESIZE.include?(key) ? dimensions.collect { |dimension| resize_dimension(dimension, factor) } : dimensions
45
43
  end
46
44
 
47
45
  def resize_dimension(dimension = 0, factor = 0)
@@ -1,6 +1,5 @@
1
1
  - content_for :hero do
2
- - cache current_page do
3
- - cache partable_for(:gallery) do
4
- = render partial: 'homepage_content',
5
- layout: has_content?(:gallery) && content(:gallery).images.any? ? 'image_collection' : 'jumbotron',
6
- locals: { conference: latest_conference, advance: true, image_collection: content(:gallery) }
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,4 +2,6 @@
2
2
  - if current_page.ancestors.any?
3
3
  = ancestors
4
4
 
5
- = render template: 'layouts/spina/conferences/primer_theme/application'
5
+ = render template: 'layouts/spina/conferences/primer_theme/application',
6
+ locals: { author: current_account.name, description: current_page.description,
7
+ seo_title: current_page.seo_title, title: current_page.title }
@@ -5,16 +5,17 @@
5
5
  %meta{ name: 'author', content: author }
6
6
  %meta{ name: 'description', content: description }
7
7
  %meta{ name: 'viewport', content: 'initial-scale=1.0' }
8
- %meta{ name: 'og:title', content: title }
8
+ %meta{ name: 'og:title', content: t(:'.title', title: title, suffix: current_account.name) }
9
9
  %meta{ name: 'og:description', content: description }
10
10
  %meta{ name: 'turbolinks-cache-control', content: 'no-preview' }
11
11
  %base{ target: '_blank' }
12
12
  = csrf_meta_tags
13
- %title= seo_title
13
+ %title= t(:'.title', title: seo_title, suffix: current_account.name)
14
14
  = render 'spina/shared/google_site_verification'
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
21
  %script{ type: 'module', src: asset_path('@github/tab-container-element/dist/index.js') }
@@ -1,4 +1,5 @@
1
1
  - content_for :breadcrumbs do
2
- = breadcrumbs
2
+ = render_breadcrumbs(builder: Spina::Conferences::PrimerTheme::Breadcrumbs::Builder)
3
3
 
4
- = render template: 'layouts/spina/conferences/primer_theme/application'
4
+ = render template: 'layouts/spina/conferences/primer_theme/application',
5
+ locals: { author: current_account.name, description: @description, title: @title, seo_title: @title }
@@ -1,4 +1,6 @@
1
1
  - content_for :breadcrumbs do
2
- = breadcrumbs
2
+ = render_breadcrumbs(builder: Spina::Conferences::PrimerTheme::Breadcrumbs::Builder)
3
3
 
4
- = render template: 'layouts/spina/conferences/primer_theme/application'
4
+ = render template: 'layouts/spina/conferences/primer_theme/application',
5
+ locals: { author: current_account.name, description: strip_tags(@presentation.abstract), title: @presentation.name,
6
+ seo_title: @presentation.name }
@@ -0,0 +1,4 @@
1
+ = f.fields_for :layout_partable, f.object.layout_partable do |ff|
2
+ - object_id = (ff.object.persisted? ? ff.object.object_id : "new_association_#{ff.object.object_id}").to_s + "_content"
3
+ = ff.hidden_field :content, id: "#{object_id}_input", value: ff.object.content(fallback: false, default: nil)
4
+ %trix-editor.text-input.trix-content{ input: "#{object_id}_input" }
@@ -1,14 +1,7 @@
1
1
  = render Primer::BorderBoxComponent.new(classes: 'Box--overlay') do |component|
2
- = component.slot :header do
2
+ - component.header do
3
3
  = button_tag(data: { 'close-dialog': true }, aria: { label: t(:'spina.close') }, type: 'button',
4
4
  class: %w[Box-btn-octicon btn-octicon float-right]) do
5
5
  = render Primer::OcticonComponent.new(icon: 'x')
6
6
  .Box-title= t(:'.title')
7
- = component.slot(:body) { t(:'.purpose') }
8
- = component.slot :row do
9
- = t :'.used.rails_html', cookie: tag.code(Rails.application.config.session_options[:key])
10
- = component.slot :row do
11
- - ga_cookie_names = %w[_ga _gat _gid].collect{ |cookie| tag.code(cookie) }.to_sentence.html_safe
12
- - ga_cookie_info_url = 'https://developers.google.com/analytics/devguides/collection/analyticsjs/cookie-usage'
13
- = t :'.used.google_analytics_html', cookies: link_to(ga_cookie_names, ga_cookie_info_url)
14
- = t :'.no_advertising'
7
+ = component.body { }
@@ -1,4 +1,4 @@
1
1
  - content_for :flash do
2
2
  - cache partable_for(:current_conference_alert, parent: current_account) do
3
3
  - if current_account.has_content? :current_conference_alert
4
- = render(Primer::FlashComponent.new(full: true, variant: :warning)) { current_account.content(:current_conference_alert) }
4
+ = render(Primer::FlashComponent.new(full: true, variant: :warning)) { current_account.content(:current_conference_alert).html_safe }
@@ -1,24 +1,15 @@
1
- .d-flex.flex-column.flex-md-row-reverse.flex-md-items-baseline
2
- .flex-auto.d-flex.flex-column.flex-sm-row.flex-items-baseline.mb-4.mb-md-0
1
+ = render Primer::FlexComponent.new(direction: [:column, nil, :row_reverse, nil], align_items: :center) do
2
+ = render Primer::FlexComponent.new(direction: [:column, :row, nil, nil], mb: [4, nil, 0, nil], flex: :auto) do
3
3
  %ul.list-style-none.flex-auto.mb-2.mb-sm-0.mr-sm-2
4
4
  - footer_navigation_items.each do |item|
5
5
  - cache item do
6
6
  %li
7
7
  = render Primer::ButtonComponent.new(tag: :a, href: item.materialized_path, variant: :small) { item.menu_title }
8
- %details.details-reset.details-overlay.details-overlay-dark.mb-2.mb-sm-0.mr-sm-2
9
- %summary.btn.btn-outline.btn-sm{ aria: { haspopup: 'dialog' } }
10
- = octicon 'info'
11
- = t :'.cookies'
12
- %details-dialog
13
- %include-fragment{ src: frontend_cookies_info_path }
14
- .Box.Box--overlay.d-flex.flex-column
15
- = button_tag(data: { 'close-dialog': true }, aria: { label: t(:'spina.close') }, type: 'button',
16
- class: %w[Box-btn-octicon btn-octicon m-0 position-absolute right-0 top-0]) do
17
- = render Primer::OcticonComponent.new(icon: 'x')
18
- = render(Primer::SpinnerComponent.new(my: 6, mx: :auto))
8
+ = render 'footer_content'
19
9
  - if current_account.has_content? :github_url
20
10
  = render Primer::ButtonComponent.new(tag: :a, href: current_account.content(:github_url), button_type: :outline, variant: :small,
21
11
  display: :inline_block) do
22
12
  = render Primer::OcticonComponent.new(icon: 'mark-github')
23
13
  = t :'.find_on_github'
24
- %small.flex-auto.mr-sm-2.text-small.text-gray= t :'.copyright', name: Spina::Account.first.name, year: Date.today.year
14
+ = render(Primer::TextComponent.new(tag: :small, color: :gray, mr: [nil, 2, nil, nil], font_size: 6, flex_grow: 0)) do
15
+ = t :'.copyright', name: Spina::Account.first.name, year: Date.today.year
@@ -0,0 +1,13 @@
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')
4
+ = t :'.cookies'
5
+ = component.body(tag: :'details-dialog') do
6
+ %include-fragment{ src: frontend_cookies_info_path, loading: :lazy }
7
+ = render Primer::BorderBoxComponent.new(classes: 'Box--overlay') do |box_component|
8
+ = box_component.body do
9
+ = button_tag(data: { 'close-dialog': true }, aria: { label: t(:'spina.close') }, type: 'button',
10
+ class: %w[Box-btn-octicon btn-octicon m-0 position-absolute right-0 top-0]) do
11
+ = render Primer::OcticonComponent.new(icon: 'x')
12
+ = render Primer::BlankslateComponent.new(title: t('.loading')) do |blankslate_component|
13
+ = blankslate_component.spinner(size: :large)
@@ -5,9 +5,9 @@
5
5
  - if image.file.present?
6
6
  = image_tag(main_app.url_for(image.file.variant(resize_to_fill: [1680, 600])), alt_description: image.file.name, draggable: false,
7
7
  srcset: srcset(image.file, variant: { resize_to_fill: [1680, 600] }), hidden: index != 0,
8
- data: { 'slideshow-target': 'slide' })
8
+ data: { 'slideshow-target': 'slide' }, class: %w[d-block mx-auto])
9
9
  .position-absolute.top-0.left-0.right-0.bottom-0.container-lg.p-responsive{ class: ('position-absolute top-0' if local_assigns[:controls]) }
10
- - if local_assigns[:controls]
10
+ - if local_assigns[:controls] && image_collection.images.many?
11
11
  .d-none.d-sm-flex.flex-justify-between.flex-items-center.height-full
12
12
  = render Primer::ButtonComponent.new(data: { action: :'slideshow#previous' }) do
13
13
  = render Primer::OcticonComponent.new(icon: 'arrow-left')
@@ -1 +1 @@
1
- %li.list-style-none.py-4.border-bottom= yield
1
+ %li.list-style-none.py-4.border-bottom{ id: local_assigns[:list_item_id]&.call(local_assigns) }= yield
@@ -5,8 +5,8 @@
5
5
  = navigation_item.menu_title
6
6
  %span.dropdown-caret
7
7
  %details-menu.dropdown-menu.dropdown-menu-se.mt-3{ role: 'menu' }
8
- - navigation_item.children.each do |child|
8
+ - navigation_item.children.in_menu.sorted.each do |child|
9
9
  %li= link_to child.menu_title, child.materialized_path, class: 'dropdown-item'
10
- - elsif navigation_item.has_parent?
10
+ - elsif navigation_item.is_root?
11
11
  .Header-item.d-none.d-lg-flex
12
12
  = link_to navigation_item.menu_title, navigation_item.materialized_path, class: 'Header-link'
@@ -1 +1 @@
1
- .markdown-body= text.html_safe
1
+ = render(Primer::MarkdownComponent.new) { text.html_safe }
@@ -1,15 +1,15 @@
1
- .d-flex.flex-column.flex-md-row-reverse.flex-justify-start.flex-md-justify-between
1
+ = render Primer::FlexComponent.new(direction: [:column, nil, :row_reverse, nil]) do
2
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) }
3
3
  = render partial: 'institution', collection: conference.institutions, cached: -> institution { [institution, institution.logo] }
4
- .flex-auto
5
- %h3.mb-1
6
- = link_to conference.name, frontend_conference_path(conference)
4
+ = render Primer::FlexItemComponent.new(flex_auto: true) do
5
+ = render(Primer::HeadingComponent.new(tag: :h3, mb: 1)) { link_to conference.name, frontend_conference_path(conference) }
7
6
  %ul.text-gray.list-style-none.d-flex.flex-column.flex-sm-row.flex-wrap
8
7
  %li.mr-sm-3
9
- = octicon 'calendar'
8
+ = render Primer::OcticonComponent.new(icon: 'calendar')
10
9
  = t :'.dates_html', start_date: time_tag(conference.start_date, format: :date), finish_date: time_tag(conference.finish_date)
11
10
  - if conference.institutions.any?
12
11
  %li
13
- = octicon 'location'
14
- %address.d-inline= t :'.locations', institutions: conference.institutions.pluck(:name).to_sentence,
15
- cities: conference.institutions.pluck(:city).uniq.to_sentence
12
+ = render Primer::OcticonComponent.new(icon: 'location')
13
+ = render Primer::BaseComponent.new(tag: :address, display: :inline) do
14
+ = t :'.locations', institutions: conference.institutions.pluck(:name).to_sentence,
15
+ cities: conference.institutions.pluck(:city).uniq.to_sentence
@@ -1,11 +1,11 @@
1
- .d-flex.flex-column.flex-sm-row
2
- .flex-shrink-0.mr-sm-3.mb-3.mb-sm-0.col-sm-4
3
- %span.f3-light.mb-1
4
- = octicon 'clock', class: 'v-align-baseline'
1
+ = render Primer::FlexComponent.new(direction: [:column, nil, :row, nil]) do
2
+ = render Primer::FlexItemComponent.new(mr: [nil, nil, 3, nil], mb: [3, nil, 0, nil], col: [nil, nil, 4, nil]) do
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)
5
5
  = t :'.times_html', start_time: time_tag(event.start_time, format: :short), finish_time: time_tag(event.finish_time, format: :time)
6
- .text-gray
7
- = octicon 'location'
8
- %address.d-inline= event.location
9
- .flex-auto
10
- %h3.mb-1= event.name
11
- .text-gray= event.description.try(:html_safe)
6
+ = render Primer::TextComponent.new(tag: :div, color: :gray) do
7
+ = render Primer::OcticonComponent.new(icon: 'location')
8
+ = render(Primer::BaseComponent.new(tag: :address, display: :inline)) { event.location }
9
+ = render Primer::FlexItemComponent.new(flex_auto: true, col: [nil, nil, 8, nil]) do
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) }
@@ -1,15 +1,16 @@
1
1
  - cache [events, @tab] do
2
- - if events.any?
3
- %filter-input.d-flex.flex-sm-justify-start{ aria: { owns: 'event_list' } }
4
- .subnav.subnav-flush
5
- .subnav-search.m-0.width-full
6
- = search_field_tag 'search', nil, class: %w[form-control subnav-search-input width-full], aria: { label: t(:'.search') }
7
- = octicon 'search', class: 'subnav-search-icon'
8
- %div{ id: 'event_list' }
2
+ = render Primer::BaseComponent.new(tag: :div, my: 4) do
9
3
  - if events.any?
10
- %ul{ class: dom_class(events), data: { filter: { list: true } } }
11
- = render partial: 'event', collection: events.sorted, layout: 'list_item', cached: true
12
- - else
13
- = render Primer::BlankslateComponent.new(title: t(:'.no_events'), icon: 'calendar')
14
- = render Primer::BlankslateComponent.new(title: t(:'.no_matching_events'), icon: 'calendar', hidden: true,
15
- data: { 'filter-empty-state': true })
4
+ %filter-input{ aria: { owns: 'event_list' } }
5
+ .subnav.subnav-flush
6
+ .subnav-search.float-left.ml-0
7
+ = search_field_tag 'search', nil, class: %w[form-control subnav-search-input], aria: { label: t(:'.search') }
8
+ = octicon 'search', class: 'subnav-search-icon'
9
+ %div{ id: 'event_list' }
10
+ - if events.any?
11
+ %ul{ class: dom_class(events), data: { filter: { list: true } } }
12
+ = render partial: 'event', collection: events.sorted, layout: 'list_item', cached: true
13
+ - else
14
+ = render Primer::BlankslateComponent.new(title: t(:'.no_events'), icon: 'calendar')
15
+ = render Primer::BlankslateComponent.new(title: t(:'.no_matching_events'), icon: 'calendar', hidden: true,
16
+ data: { 'filter-empty-state': true })