spina-conferences-primer_theme-fork 0.9.0 → 1.0.0.rc1

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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -4
  3. data/Rakefile +6 -0
  4. data/app/assets/builds/spina/conferences/primer_theme/application.css +25964 -0
  5. data/app/assets/config/spina_conferences_primer_theme_manifest.js +7 -4
  6. data/app/assets/javascripts/spina/conferences/primer_theme/application.js +6 -7
  7. data/app/assets/javascripts/spina/conferences/primer_theme/controllers/application.js +10 -0
  8. data/app/assets/javascripts/spina/conferences/primer_theme/controllers/index.js +5 -0
  9. data/app/assets/javascripts/spina/conferences/primer_theme/controllers/{slideshow_controller.es6 → slideshow_controller.js} +4 -3
  10. data/app/assets/stylesheets/spina/conferences/primer_theme/application.sass +1 -1
  11. data/app/controllers/spina/conferences/primer_theme/blog/application_controller.rb +2 -0
  12. data/app/controllers/spina/conferences/primer_theme/blog/categories_controller.rb +5 -2
  13. data/app/controllers/spina/conferences/primer_theme/blog/posts_controller.rb +7 -7
  14. data/app/controllers/spina/conferences/primer_theme/conferences/conferences_controller.rb +14 -13
  15. data/app/controllers/spina/conferences/primer_theme/conferences/presentations_controller.rb +2 -1
  16. data/app/controllers/spina/conferences/primer_theme/journal/articles_controller.rb +5 -3
  17. data/app/controllers/spina/conferences/primer_theme/journal/issues_controller.rb +2 -1
  18. data/app/helpers/spina/conferences/primer_theme/application_helper.rb +23 -13
  19. data/app/helpers/spina/conferences/primer_theme/asset_helper.rb +10 -2
  20. data/app/helpers/spina/conferences/primer_theme/navigations_helper.rb +3 -1
  21. data/app/models/spina/parts/conferences/primer_theme/checkbox.rb +6 -2
  22. data/app/models/spina/parts/conferences/primer_theme.rb +9 -3
  23. data/app/views/conferences_primer_theme/pages/about.html.haml +9 -9
  24. data/app/views/conferences_primer_theme/pages/committee.html.haml +10 -9
  25. data/app/views/conferences_primer_theme/pages/embedded_form.html.haml +2 -2
  26. data/app/views/conferences_primer_theme/pages/events.html.haml +3 -3
  27. data/app/views/conferences_primer_theme/pages/homepage.html.haml +2 -2
  28. data/app/views/conferences_primer_theme/pages/information.html.haml +2 -2
  29. data/app/views/conferences_primer_theme/pages/periodical.html.haml +5 -5
  30. data/app/views/conferences_primer_theme/pages/show.html.haml +1 -1
  31. data/app/views/conferences_primer_theme/partials/_event.html.haml +1 -1
  32. data/app/views/conferences_primer_theme/partials/_homepage_item.html.haml +2 -2
  33. data/app/views/layouts/spina/conferences/primer_theme/application.html.haml +7 -14
  34. data/app/views/spina/application/_admin_bar.html.haml +7 -0
  35. data/app/views/spina/application/_alert.html.haml +4 -0
  36. data/app/views/spina/application/_analytics.html.erb +10 -0
  37. data/app/views/spina/application/{_footer_content.html.haml → _cookies_footer.html.haml} +1 -1
  38. data/app/views/spina/application/_footer.html.haml +20 -12
  39. data/app/views/spina/application/_google_site_verification.html.haml +1 -0
  40. data/app/views/spina/application/_text.html.haml +1 -1
  41. data/app/views/spina/conferences/primer_theme/blog/categories/show.html.haml +1 -1
  42. data/app/views/spina/conferences/primer_theme/blog/posts/_post.html.haml +4 -3
  43. data/app/views/spina/conferences/primer_theme/blog/posts/index.html.haml +1 -1
  44. data/app/views/spina/conferences/primer_theme/blog/posts/show.html.haml +3 -3
  45. data/app/views/spina/conferences/primer_theme/blog/shared/_sidebar.html.haml +1 -1
  46. data/app/views/spina/conferences/primer_theme/conferences/conferences/_event.html.haml +3 -3
  47. data/app/views/spina/conferences/primer_theme/conferences/conferences/_events.html.haml +1 -1
  48. data/app/views/spina/conferences/primer_theme/conferences/conferences/_header.html.haml +1 -1
  49. data/app/views/spina/conferences/primer_theme/conferences/conferences/_presentation.html.haml +3 -3
  50. data/app/views/spina/conferences/primer_theme/conferences/conferences/_presentations.html.haml +1 -1
  51. data/app/views/spina/conferences/primer_theme/conferences/conferences/_submission_flash.html.haml +3 -3
  52. data/app/views/spina/conferences/primer_theme/conferences/conferences/show.html.haml +5 -5
  53. data/app/views/spina/conferences/primer_theme/conferences/presentations/_abstract.html.haml +1 -1
  54. data/app/views/spina/conferences/primer_theme/conferences/presentations/_attachments.html.haml +1 -1
  55. data/app/views/spina/conferences/primer_theme/conferences/presentations/show.html.haml +3 -3
  56. data/app/views/spina/conferences/primer_theme/journal/articles/_authorship.html.haml +2 -2
  57. data/app/views/spina/conferences/primer_theme/journal/articles/_metadata.html.haml +4 -4
  58. data/app/views/spina/conferences/primer_theme/journal/articles/show.html.haml +15 -15
  59. data/app/views/spina/conferences/primer_theme/journal/issues/_article.html.haml +2 -2
  60. data/app/views/spina/conferences/primer_theme/journal/issues/_issue.html.haml +3 -3
  61. data/app/views/spina/conferences/primer_theme/journal/issues/index.html.haml +2 -2
  62. data/app/views/spina/conferences/primer_theme/journal/issues/show.html.haml +3 -3
  63. data/config/initializers/importmap.rb +21 -0
  64. data/config/initializers/mime_types.rb +3 -1
  65. data/config/initializers/themes/conferences_primer_theme.rb +4 -2
  66. data/config/locales/en.yml +5 -2
  67. data/config/routes.rb +1 -1
  68. data/db/migrate/20210206170704_change_current_conference_alert_to_text.rb +1 -1
  69. data/lib/spina/conferences/primer_theme/breadcrumbs/builder.rb +4 -17
  70. data/lib/spina/conferences/primer_theme/engine.rb +4 -0
  71. data/lib/spina/conferences/primer_theme/version.rb +1 -1
  72. data/lib/spina/conferences/primer_theme.rb +10 -3
  73. metadata +55 -33
  74. data/app/views/spina/application/_current_conference_alert.html.haml +0 -4
@@ -1,9 +1,12 @@
1
- //= link_directory ../stylesheets/spina/conferences/primer_theme .css
2
- //= link_directory ../javascripts/spina/conferences/primer_theme .js
3
- //= link spina_admin_conferences_manifest.js
4
- //= link spina_admin_journal_manifest.js
1
+ //= link spina/conferences/primer_theme/application.css
2
+
3
+ //= link_directory ../javascripts/spina/conferences/primer_theme/controllers .js
4
+ //= link spina/conferences/primer_theme/application.js
5
5
 
6
6
  //= link @github/details-dialog-element/dist/index.js
7
7
  //= link @github/include-fragment-element/dist/index.js
8
8
  //= link @github/filter-input-element/dist/index.js
9
9
  //= link @github/details-menu-element/dist/index.js
10
+
11
+ //= link spina_admin_conferences_manifest.js
12
+ //= link spina_admin_journal_manifest.js
@@ -1,7 +1,6 @@
1
- //= require stimulus
2
- //= require_directory ./controllers
3
-
4
- // eslint-disable-next-line no-undef
5
- const application = Stimulus.Application.start()
6
- // eslint-disable-next-line no-undef
7
- application.register('slideshow', SlideshowController)
1
+ import '@hotwired/turbo-rails'
2
+ import '@github/details-dialog-element'
3
+ import '@github/include-fragment-element'
4
+ import '@github/filter-input-element'
5
+ import '@github/details-menu-element'
6
+ import 'controllers'
@@ -0,0 +1,10 @@
1
+ import { Application } from '@hotwired/stimulus'
2
+
3
+ const application = Application.start()
4
+
5
+ // Configure Stimulus
6
+ application.warnings = true
7
+ application.debug = false
8
+ window.Stimulus = application
9
+
10
+ export { application }
@@ -0,0 +1,5 @@
1
+ import { application } from 'controllers/application'
2
+
3
+ // Eager load all Stimulus controllers
4
+ import { eagerLoadControllersFrom } from '@hotwired/stimulus-loading'
5
+ eagerLoadControllersFrom('controllers', application)
@@ -1,5 +1,6 @@
1
- // eslint-disable-next-line no-unused-vars,no-undef
2
- class SlideshowController extends Stimulus.Controller {
1
+ import { Controller } from '@hotwired/stimulus'
2
+
3
+ export default class SlideshowController extends Controller {
3
4
  static get targets() {
4
5
  return [
5
6
  /**
@@ -35,7 +36,7 @@ class SlideshowController extends Stimulus.Controller {
35
36
  * @return {Number} The value for the delay.
36
37
  */
37
38
  get delay() {
38
- return this.data.has('delay')
39
+ return this.data.has('delay')
39
40
  ? Number.parseInt(this.data.get('delay'))
40
41
  : 10000
41
42
  }
@@ -28,7 +28,7 @@
28
28
  font-display: swap
29
29
 
30
30
  .admin
31
- @import "spina/admin_editing"
31
+ //@import "spina/admin_editing"
32
32
  #admin_bar
33
33
  font-family: 'Metropolis', sans-serif
34
34
 
@@ -4,8 +4,10 @@ module Spina
4
4
  module Conferences
5
5
  module PrimerTheme
6
6
  module Blog
7
+ # Base class from which controllers related to the blog plugin inherit
7
8
  class ApplicationController < ::Spina::ApplicationController
8
9
  include ::Spina::Frontend
10
+
9
11
  def cookies_info
10
12
  render partial: 'cookies'
11
13
  end
@@ -6,12 +6,11 @@ module Spina
6
6
  module Blog
7
7
  # Spina::Blog::CategoriesController
8
8
  class CategoriesController < ApplicationController
9
- include ::Spina::Frontend
10
-
11
9
  before_action :page
12
10
  before_action :category
13
11
  before_action :posts
14
12
  before_action :set_breadcrumb, only: :show
13
+ before_action :set_metadata
15
14
 
16
15
  def show
17
16
  add_breadcrumb t('.category', name: @category.name)
@@ -39,6 +38,10 @@ module Spina
39
38
  def set_breadcrumb
40
39
  add_breadcrumb 'Blog', frontend_blog_root_path
41
40
  end
41
+
42
+ def set_metadata
43
+ @title = @category.name
44
+ end
42
45
  end
43
46
  end
44
47
  end
@@ -6,8 +6,6 @@ module Spina
6
6
  module Blog
7
7
  # Spina::Blog::PostsController
8
8
  class PostsController < ApplicationController
9
- include ::Spina::Frontend
10
-
11
9
  before_action :find_posts, only: [:index]
12
10
  before_action :current_spina_user_can_view_page?
13
11
  before_action :set_breadcrumb, only: :show
@@ -17,6 +15,8 @@ module Spina
17
15
  def index
18
16
  @posts = @posts.unscope(where: :draft) if current_spina_user&.admin?
19
17
 
18
+ @title = t('.blog')
19
+
20
20
  respond_to do |format|
21
21
  format.atom
22
22
  format.html { render layout: theme_layout }
@@ -34,9 +34,9 @@ module Spina
34
34
 
35
35
  def archive
36
36
  @posts = Spina::Admin::Conferences::Blog::Post.live
37
- .where(published_at: start_date..end_date)
38
- .order(published_at: :desc)
39
- .page(params[:page])
37
+ .where(published_at: start_date..end_date)
38
+ .order(published_at: :desc)
39
+ .page(params[:page])
40
40
 
41
41
  render layout: theme_layout
42
42
  end
@@ -61,7 +61,7 @@ module Spina
61
61
 
62
62
  def find_posts
63
63
  @posts = Spina::Admin::Conferences::Blog::Post.available.live.order(published_at: :desc)
64
- .page(params[:page])
64
+ .page(params[:page])
65
65
  end
66
66
 
67
67
  def try_redirect
@@ -78,7 +78,7 @@ module Spina
78
78
  end
79
79
 
80
80
  def set_metadata
81
- @title = @post.seo_title || @post.title
81
+ @title = @post.seo_title.presence || @post.title
82
82
  @description = @post.description
83
83
  end
84
84
  end
@@ -6,7 +6,8 @@ module Spina
6
6
  module Conferences
7
7
  # User-facing controller for conferences, serving both html and ics
8
8
  class ConferencesController < ApplicationController
9
- before_action :set_conference, :set_tab, :set_presentation_type, :set_presentations, :set_breadcrumb, only: :show
9
+ before_action :set_conference, :set_tab, :set_presentation_type, :set_presentations, :set_breadcrumb,
10
+ only: :show
10
11
  before_action :set_metadata
11
12
 
12
13
  def index
@@ -30,7 +31,7 @@ module Spina
30
31
  def set_conference
31
32
  @conference = Admin::Conferences::Conference.includes(:events, :institutions,
32
33
  presentation_types: [:translations],
33
- presentations: [session: [:room], presenters: [:institution]])
34
+ presentations: [session: [:room], presenters: [:institution]]) # rubocop:disable Layout/LineLength
34
35
  .find(params[:id])
35
36
  @conference.view_context = view_context
36
37
  rescue ActiveRecord::RecordNotFound
@@ -42,28 +43,28 @@ module Spina
42
43
  end
43
44
 
44
45
  def set_presentation_type
45
- if params[:presentation_type].present?
46
- @presentation_type = @conference.presentation_types
47
- .includes(presentations: [session: [:room], presenters: [:institution]])
48
- .find(params[:presentation_type])
49
- end
46
+ return if params[:presentation_type].blank?
47
+
48
+ @presentation_type = @conference.presentation_types
49
+ .includes(presentations: [session: [:room], presenters: [:institution]])
50
+ .find(params[:presentation_type])
50
51
  end
51
52
 
52
53
  def set_presentations
53
54
  @presentations = if @presentation_type.present?
54
- @presentation_type.presentations.page(params[:page]).per(15)
55
- else
56
- @conference.presentations.page(params[:page]).per(15)
57
- end
55
+ @presentation_type.presentations.page(params[:page]).per(15)
56
+ else
57
+ @conference.presentations.page(params[:page]).per(15)
58
+ end
58
59
  end
59
60
 
60
61
  def set_breadcrumb
61
- add_breadcrumb 'Blog', frontend_conferences_path
62
+ add_breadcrumb Admin::Conferences::Conference.model_name.human.pluralize, frontend_conferences_path
62
63
  end
63
64
 
64
65
  def set_metadata
65
66
  @title = @conference.present? ? @conference.name : Admin::Conferences::Conference.model_name.human(count: 0)
66
- @description = @conference.present? && @conference.has_content?(:text) ? helpers.strip_tags(@conference.content(:text)) : ''
67
+ @description = @conference.present? && @conference.has_content?(:text) ? helpers.strip_tags(@conference.content(:text)) : '' # rubocop:disable Layout/LineLength
67
68
  end
68
69
  end
69
70
  end
@@ -19,7 +19,8 @@ module Spina
19
19
  private
20
20
 
21
21
  def set_presentation
22
- @presentation = Admin::Conferences::Presentation.includes(:presenters, attachments: [attachment_type: [:translations]])
22
+ @presentation = Admin::Conferences::Presentation.includes(:presenters,
23
+ attachments: [attachment_type: [:translations]])
23
24
  .find(params[:id])
24
25
  rescue ActiveRecord::RecordNotFound
25
26
  send_file Rails.root.join('public/404.html'), type: 'text/html; charset=utf-8', status: 404
@@ -6,7 +6,8 @@ module Spina
6
6
  module Journal
7
7
  # User-facing controller for journal articles
8
8
  class ArticlesController < ApplicationController
9
- before_action :set_article, :set_issue, :set_journal, :set_licence, :set_breadcrumb, :set_metadata, :require_admin_for_invisible_article
9
+ before_action :set_article, :set_issue, :set_journal, :set_licence, :set_breadcrumb, :set_metadata,
10
+ :require_admin_for_invisible_article
10
11
 
11
12
  def show
12
13
  respond_to do |format|
@@ -48,8 +49,9 @@ module Spina
48
49
 
49
50
  add_breadcrumb @journal.name, frontend_issues_path
50
51
  add_breadcrumb Admin::Journal::Issue.model_name.human.pluralize, frontend_issues_path
51
- add_breadcrumb t('spina.conferences.primer_theme.journal.volume_issue', volume_number: @issue.volume.number, issue_number: @issue.number),
52
- frontend_issue_path(@issue.id)
52
+ add_breadcrumb t('spina.conferences.primer_theme.journal.volume_issue', volume_number: @issue.volume.number,
53
+ issue_number: @issue.number),
54
+ frontend_issue_path(@issue.id)
53
55
  end
54
56
 
55
57
  def set_metadata
@@ -22,7 +22,8 @@ module Spina
22
22
 
23
23
  def show
24
24
  @articles = current_spina_user.present? ? @issue.articles : @issue.articles.visible
25
- add_breadcrumb t('spina.conferences.primer_theme.journal.volume_issue', volume_number: @issue.volume.number, issue_number: @issue.number)
25
+ add_breadcrumb t('spina.conferences.primer_theme.journal.volume_issue',
26
+ volume_number: @issue.volume.number, issue_number: @issue.number)
26
27
  end
27
28
 
28
29
  private
@@ -9,34 +9,44 @@ module Spina
9
9
 
10
10
  # Because the upper bound is exclusive a conference is current the day after it ends
11
11
  def current_conference
12
- Spina::Admin::Conferences::Conference.order(dates: :asc).find_by('upper(dates) >= ?', Date.today)
12
+ Spina::Admin::Conferences::Conference.order(dates: :asc).find_by('upper(dates) >= ?', Time.zone.today)
13
13
  end
14
14
 
15
15
  def ancestors
16
16
  return [] if current_page.blank?
17
17
 
18
- render Primer::BreadcrumbComponent.new(mb: 4) do |component|
18
+ render Primer::Beta::Breadcrumbs.new(mb: 4) do |component|
19
19
  current_page.ancestors.each do |ancestor|
20
20
  component.item(href: ancestor.materialized_path) { ancestor.menu_title }
21
21
  end
22
- component.item(selected: true) { current_page.menu_title }
22
+ component.item(href: current_page.materialized_path) { current_page.menu_title }
23
23
  end
24
24
  end
25
25
 
26
- def calendar(name:)
26
+ def calendar(name:, &block)
27
27
  Icalendar::Calendar.new
28
- .tap { |calendar| calendar.x_wr_calname = name }
29
- .tap { |calendar| yield(calendar) }
30
- .tap(&:publish)
31
- .then(&:to_ical)
28
+ .tap { |calendar| calendar.x_wr_calname = name }
29
+ .tap(&block)
30
+ .tap(&:publish)
31
+ .then(&:to_ical)
32
32
  end
33
33
 
34
34
  def generate_datetime(date, time)
35
- Time.new(date.year,
36
- date.month,
37
- date.day,
38
- time.hour,
39
- time.min)
35
+ Time.zone.local(date.year,
36
+ date.month,
37
+ date.day,
38
+ time.hour,
39
+ time.min)
40
+ end
41
+
42
+ def primer_theme_importmap_tags(entry_point = 'application', shim: true)
43
+ safe_join [
44
+ javascript_inline_importmap_tag(Spina::Conferences::PrimerTheme.config.importmap.to_json(resolver: self)),
45
+ javascript_importmap_module_preload_tags(Spina::Conferences::PrimerTheme.config.importmap),
46
+ (javascript_importmap_shim_nonce_configuration_tag if shim),
47
+ (javascript_importmap_shim_tag if shim),
48
+ javascript_import_module_tag(entry_point)
49
+ ], "\n"
40
50
  end
41
51
  end
42
52
  end
@@ -27,7 +27,9 @@ module Spina
27
27
  DEFAULT_FACTORS = [1, 2, 3, 4].freeze
28
28
 
29
29
  def variants_for(image, variant_options:, factors:)
30
- factors.inject({}) { |srcset, factor| srcset.update(variant_url(image, variant_options, factor) => "#{factor}x") }
30
+ factors.inject({}) do |srcset, factor|
31
+ srcset.update(variant_url(image, variant_options, factor) => "#{factor}x")
32
+ end
31
33
  end
32
34
 
33
35
  def variant_url(image, variant_options, factor)
@@ -39,7 +41,13 @@ module Spina
39
41
  end
40
42
 
41
43
  def resize_dimensions_for_key(key, factor, dimensions)
42
- METHODS_TO_RESIZE.include?(key) ? dimensions.collect { |dimension| resize_dimension(dimension, factor) } : dimensions
44
+ if METHODS_TO_RESIZE.include?(key)
45
+ dimensions.collect do |dimension|
46
+ resize_dimension(dimension, factor)
47
+ end
48
+ else
49
+ dimensions
50
+ end
43
51
  end
44
52
 
45
53
  def resize_dimension(dimension = 0, factor = 0)
@@ -16,7 +16,9 @@ module Spina
16
16
  private
17
17
 
18
18
  def live_navigation_items(name)
19
- ::Spina::NavigationItem.joins(:navigation).where(spina_navigations: { name: name }).roots.regular_pages.in_menu.live.sorted
19
+ ::Spina::NavigationItem.joins(:navigation)
20
+ .where(spina_navigations: { name: name })
21
+ .roots.regular_pages.in_menu.live.sorted
20
22
  end
21
23
  end
22
24
  end
@@ -1,11 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spina
2
4
  module Parts
3
5
  module Conferences
4
6
  module PrimerTheme
7
+ # A simplistic checkbox part, e.g. to indicate whether an item should
8
+ # show or not.
5
9
  class Checkbox < Spina::Parts::Base
6
10
  # Booleans don't work nicely with Spina page parts, so we have this mess
7
- CHECKED_VALUE = "1"
8
- UNCHECKED_VALUE = "0"
11
+ CHECKED_VALUE = '1'
12
+ UNCHECKED_VALUE = '0'
9
13
 
10
14
  attr_json :content, :string, default: UNCHECKED_VALUE
11
15
  end
@@ -1,7 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spina
2
- module Parts::Conferences::PrimerTheme
3
- def self.table_name_prefix
4
- 'spina_parts_conferences_primer_theme_'
4
+ module Parts
5
+ module Conferences
6
+ module PrimerTheme # rubocop:disable Style/Documentation
7
+ def self.table_name_prefix
8
+ 'spina_parts_conferences_primer_theme_'
9
+ end
10
+ end
5
11
  end
6
12
  end
7
13
  end
@@ -1,12 +1,12 @@
1
1
  - cache current_page do
2
- = render(Primer::HeadingComponent.new) { current_page.title }
2
+ = render(Primer::HeadingComponent.new(tag: :h1)) { current_page.title }
3
3
 
4
4
  - if content(:text).present?
5
- = render(Primer::MarkdownComponent.new(mt: 4)) { content.html(:text) }
5
+ = render(Primer::Markdown.new(mt: 4)) { content.html(:text).to_s }
6
6
  - if content(:contact).present?
7
7
  = render Primer::SubheadComponent.new(mt: 4) do |component|
8
8
  = component.heading { t :'.contact.title' }
9
- = render(Primer::MarkdownComponent.new) { content.html(:contact) }
9
+ = render(Primer::Markdown.new) { content.html(:contact).to_s }
10
10
 
11
11
  .clearfix.gutter
12
12
  = render Primer::BoxComponent.new(mt: 4, col: [12, nil, 6, nil], float: [nil, nil, :left, nil]) do
@@ -41,7 +41,7 @@
41
41
  = render Primer::OcticonComponent.new('desktop-download')
42
42
  = t(:'.minutes.download')
43
43
  - else
44
- = render(Primer::TextComponent.new(color: :text_secondary, font_size: 6)) { t :'.minutes.no_file' }
44
+ = render(Primer::Beta::Text.new(color: :muted, font_size: 6)) { t :'.minutes.no_file' }
45
45
  - else
46
46
  = render Primer::BlankslateComponent.new(title: t(:'.minutes.no_minutes'), icon: 'file')
47
47
 
@@ -52,13 +52,13 @@
52
52
  %ul
53
53
  - repeater :documents do |document|
54
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') }
55
+ = render(Primer::Beta::Text.new(tag: :div, flex: :auto)) { document.content(:name).presence || t(:'.documents.no_name') }
56
56
  - if document.content(:attachment).present?
57
57
  = render Primer::ButtonComponent.new(tag: :a, ml: 2, href: document.content.attachment_url(:attachment), download: '') do
58
58
  = render Primer::OcticonComponent.new('desktop-download')
59
59
  = t :'.documents.download'
60
60
  - else
61
- = render(Primer::TextComponent.new(tag: :div, font_size: 6, color: :text_secondary)) { t :'.documents.no_file' }
61
+ = render(Primer::Beta::Text.new(tag: :div, font_size: 6, color: :muted)) { t :'.documents.no_file' }
62
62
 
63
63
  = render Primer::SubheadComponent.new(mt: 4) do |component|
64
64
  = component.heading { t :'.partner_societies.title' }
@@ -71,8 +71,8 @@
71
71
  = render Primer::HeadingComponent.new(tag: :h3, mb: 1) do
72
72
  = render Primer::FlexComponent.new(flex_wrap: true, justify_content: :space_between) do
73
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|
74
+ = render(Primer::Beta::Text.new(tag: :div)) { partner_society.content(:name) }
75
+ = render Primer::ButtonGroup.new(aria: { label: t(:'.partner_societies.contact_buttons') }) do |component|
76
76
  - if partner_society.content(:website).present?
77
77
  = component.button(tag: :a, href: partner_society.content(:website)) do
78
78
  = render Primer::OcticonComponent.new('browser')
@@ -82,7 +82,7 @@
82
82
  = render Primer::OcticonComponent.new('mail')
83
83
  = t(:'.partner_societies.email')
84
84
  - if partner_society.content(:description).present?
85
- = render Primer::MarkdownComponent.new(color: :text_secondary) do
85
+ = render Primer::Markdown.new(color: :muted) do
86
86
  = partner_society.content(:description).try(:html_safe)
87
87
  - if partner_society.content(:logo).present?
88
88
  = partner_society.content.image_tag(:logo, { resize_to_limit: [200, 150] }, size: nil, draggable: false,
@@ -1,8 +1,8 @@
1
1
  - cache current_page do
2
- = render(Primer::HeadingComponent.new) { current_page.title }
2
+ = render(Primer::HeadingComponent.new(tag: :h1)) { current_page.title }
3
3
 
4
4
  - if content(:text).present?
5
- = render(Primer::MarkdownComponent.new(mt: 4)) { content.html(:text) }
5
+ = render(Primer::Markdown.new(mt: 4)) { content.html(:text).to_s }
6
6
 
7
7
  - if content(:committee_bios).present?
8
8
  %ul.mt-4
@@ -10,11 +10,12 @@
10
10
  %li.list-style-none.py-4.border-bottom
11
11
  = render Primer::FlexComponent.new(direction: [:column, nil, :row, nil], align_items: :start) do
12
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)
13
+ -# TODO: create helper to replace this, because Primer::Beta::Avatar limits size to 80 sadly
14
+ %img.avatar.circle.mr-md-3.mb-3.mb-md-0.flex-shrink-0{src: committee_bio.content.image_url(:profile_picture, resize_to_fill: [150, 150]),
15
+ srcset: srcset_string(committee_bio.content(:profile_picture),
16
+ variant: { resize_to_fill: [150, 150] }),
17
+ draggable: false,
18
+ alt: committee_bio.content(:profile_picture).alt}
18
19
  = render Primer::FlexItemComponent.new(flex_auto: true) do
19
20
  = render Primer::FlexComponent.new(direction: [:column, nil, :row, nil], mb: 1) do
20
21
  = render Primer::BoxComponent.new do
@@ -26,7 +27,7 @@
26
27
  = committee_bio.content(:name)
27
28
  - if committee_bio.content(:institution).present?
28
29
  = 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
+ = render Primer::ButtonGroup.new(mt: [1, nil, 0, nil], ml: [nil, nil, 1, nil],
30
31
  aria: { label: t(:'.contact_buttons') }) do |component|
31
32
  - if committee_bio.content(:twitter_profile).present?
32
33
  = component.button(tag: :a, href: committee_bio.content(:twitter_profile)) do
@@ -37,6 +38,6 @@
37
38
  = render Primer::OcticonComponent.new('link-external')
38
39
  = t(:'.facebook')
39
40
  - if committee_bio.content(:bio).present?
40
- = render(Primer::TextComponent.new(tag: :div, color: :text_secondary)) { committee_bio.content.html(:bio) }
41
+ = render(Primer::Beta::Text.new(tag: :div, color: :muted)) { committee_bio.content.html(:bio).to_s }
41
42
  - else
42
43
  = render Primer::BlankslateComponent.new(title: t(:'.no_bios'), icon: 'file')
@@ -1,8 +1,8 @@
1
1
  - cache current_page do
2
- = render(Primer::HeadingComponent.new) { current_page.title }
2
+ = render(Primer::HeadingComponent.new(tag: :h1)) { current_page.title }
3
3
 
4
4
  - if content(:text).present?
5
- = render(Primer::MarkdownComponent.new(mt: 4)) { content.html(:text) }
5
+ = render(Primer::Markdown.new(mt: 4)) { content.html(:text).to_s }
6
6
 
7
7
  - if content(:embed_url).present?
8
8
  = render Primer::BoxComponent.new(mt: 4, col: 12) do
@@ -1,8 +1,8 @@
1
1
  - cache current_page do
2
- = render(Primer::HeadingComponent.new) { current_page.title }
2
+ = render(Primer::HeadingComponent.new(tag: :h1)) { current_page.title }
3
3
 
4
4
  - if content(:text).present?
5
- = render(Primer::MarkdownComponent.new(mt: 4)) { content.html(:text) }
5
+ = render(Primer::Markdown.new(mt: 4)) { content.html(:text).to_s }
6
6
 
7
7
  - if content(:events_list).present?
8
8
  = render Primer::SubheadComponent.new(mt: 4) do |component|
@@ -12,7 +12,7 @@
12
12
  - else
13
13
  = t :'.upcoming'
14
14
 
15
- - content(:events_list).filter do |event|
15
+ - content(:events_list).filter do |event|
16
16
  - (event.content(:start_date).blank? || event.content(:start_date) >= Date.today) && event.content(:is_archived) != Spina::Parts::Conferences::PrimerTheme::Checkbox::CHECKED_VALUE
17
17
  - end.then do |events|
18
18
  - if events.any?
@@ -8,8 +8,8 @@
8
8
  - content(:carousel).each_with_index do |carousel_item, index|
9
9
  = render partial: 'conferences_primer_theme/partials/homepage_item', locals: { item: carousel_item }
10
10
  - if content(:carousel).many?
11
- .container-lg.height-full.d-flex.flex-column-reverse.mb-8
12
- = render(Primer::ButtonGroupComponent.new) do |component|
11
+ .container-lg.height-full.d-flex.flex-column-reverse.mb-8{ style: 'z-index: 5' }
12
+ = render(Primer::ButtonGroup.new) do |component|
13
13
  = component.button(data: { action: :'slideshow#previous' }) do
14
14
  = render Primer::OcticonComponent.new('arrow-left')
15
15
  = component.button(data: { action: :'slideshow#next' }) do
@@ -1,5 +1,5 @@
1
1
  - cache current_page do
2
- = render(Primer::HeadingComponent.new) { current_page.title }
2
+ = render(Primer::HeadingComponent.new(tag: :h1)) { current_page.title }
3
3
 
4
4
  - if content(:text).present?
5
- = render(Primer::MarkdownComponent.new(mt: 4)) { content.html(:text) }
5
+ = render(Primer::Markdown.new(mt: 4)) { content.html(:text).to_s }
@@ -1,9 +1,9 @@
1
1
  - cache current_page do
2
- = render(Primer::HeadingComponent.new) { current_page.title }
2
+ = render(Primer::HeadingComponent.new(tag: :h1)) { current_page.title }
3
3
 
4
4
  - if content(:text).present?
5
- = render(Primer::MarkdownComponent.new(mt: 4)) { content.html(:text) }
6
-
5
+ = render(Primer::Markdown.new(mt: 4)) { content.html(:text).to_s }
6
+
7
7
  - if content(:periodical_issues).present?
8
8
  %ul.mt-4
9
9
  - repeater(:periodical_issues) do |issue|
@@ -26,8 +26,8 @@
26
26
  = render Primer::HeadingComponent.new(tag: :h4) do
27
27
  = time_tag issue.content(:date), format: :long_ordinal
28
28
  - if issue.content(:description).present?
29
- = render Primer::MarkdownComponent.new(tag: :div, color: :text_secondary) do
30
- = issue.content.html(:description)
29
+ = render Primer::Markdown.new(tag: :div, color: :muted) do
30
+ = issue.content.html(:description).to_s
31
31
  = render Primer::FlexComponent.new(direction: [:column, nil, :row, nil], align_items: :start) do
32
32
  - if issue.content(:url).present?
33
33
  = render Primer::ButtonComponent.new(scheme: :primary, tag: :a, href: issue.content(:url), mt: 2, mr: 2) do
@@ -1,2 +1,2 @@
1
1
  - cache current_page do
2
- = render(Primer::HeadingComponent.new) { current_page.title }
2
+ = render(Primer::HeadingComponent.new(tag: :h1)) { current_page.title }
@@ -21,7 +21,7 @@
21
21
  = render Primer::HeadingComponent.new(tag: :h5, flex: :auto) do
22
22
  = event.content(:location).presence
23
23
  - if event.content(:description).present?
24
- = render(Primer::MarkdownComponent.new(mt: 1, color: :text_secondary)) { event.content.html(:description) }
24
+ = render(Primer::Markdown.new(mt: 1, color: :muted)) { event.content.html(:description).to_s }
25
25
  - if event.content(:url).present?
26
26
  = render Primer::ButtonComponent.new(tag: :a, href: event.content(:url), mt: 2) do
27
27
  = render Primer::OcticonComponent.new('link-external')
@@ -13,8 +13,8 @@
13
13
  = render(Primer::HeadingComponent.new(tag: :h1, classes: 'h000-mktg lh-condensed-ultra')) do
14
14
  = item.content(:title)
15
15
  %div{ style: 'text-shadow: 0 1px 1px rgba(var(--color-scale-black), 0.25), 0 1px 25px rgba(var(--color-scale-black), 0.75);' }
16
- = render(Primer::MarkdownComponent.new(my: 4)) do
17
- = item.content(:description).html_safe
16
+ = render(Primer::Markdown.new(my: 4)) do
17
+ = item.content.html(:description).to_s
18
18
  - if item.content(:url).present?
19
19
  = link_to t('.more_info'), item.content(:url),
20
20
  class: %w[btn-mktg btn-large-mktg btn-primary-mktg f3 mt-4]