spina-conferences-primer_theme-fork 0.8.1 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -4
  3. data/Rakefile +6 -0
  4. data/app/controllers/spina/conferences/primer_theme/blog/application_controller.rb +23 -0
  5. data/app/controllers/spina/conferences/primer_theme/blog/categories_controller.rb +51 -0
  6. data/app/controllers/spina/conferences/primer_theme/blog/posts_controller.rb +90 -0
  7. data/app/controllers/spina/conferences/primer_theme/conferences/conferences_controller.rb +13 -12
  8. data/app/controllers/spina/conferences/primer_theme/conferences/presentations_controller.rb +2 -1
  9. data/app/controllers/spina/conferences/primer_theme/journal/articles_controller.rb +5 -3
  10. data/app/controllers/spina/conferences/primer_theme/journal/issues_controller.rb +2 -1
  11. data/app/helpers/spina/conferences/primer_theme/application_helper.rb +13 -13
  12. data/app/helpers/spina/conferences/primer_theme/asset_helper.rb +10 -2
  13. data/app/helpers/spina/conferences/primer_theme/navigations_helper.rb +3 -1
  14. data/app/models/spina/parts/conferences/primer_theme/checkbox.rb +6 -2
  15. data/app/models/spina/parts/conferences/primer_theme.rb +9 -3
  16. data/app/views/conferences_primer_theme/pages/about.html.haml +9 -9
  17. data/app/views/conferences_primer_theme/pages/committee.html.haml +10 -9
  18. data/app/views/conferences_primer_theme/pages/embedded_form.html.haml +2 -2
  19. data/app/views/conferences_primer_theme/pages/events.html.haml +2 -2
  20. data/app/views/conferences_primer_theme/pages/homepage.html.haml +2 -2
  21. data/app/views/conferences_primer_theme/pages/information.html.haml +2 -2
  22. data/app/views/conferences_primer_theme/pages/periodical.html.haml +3 -3
  23. data/app/views/conferences_primer_theme/pages/show.html.haml +1 -1
  24. data/app/views/conferences_primer_theme/partials/_event.html.haml +1 -1
  25. data/app/views/conferences_primer_theme/partials/_homepage_item.html.haml +1 -1
  26. data/app/views/layouts/spina/conferences/primer_theme/blog/blog.html.haml +5 -0
  27. data/app/views/spina/application/_footer.html.haml +1 -1
  28. data/app/views/spina/application/_mobile_navigation_items.html.haml +1 -0
  29. data/app/views/spina/application/_navigation.html.haml +1 -0
  30. data/app/views/spina/application/_text.html.haml +1 -1
  31. data/app/views/spina/conferences/primer_theme/blog/categories/show.html.haml +12 -0
  32. data/app/views/spina/conferences/primer_theme/blog/posts/_post.html.haml +10 -0
  33. data/app/views/spina/conferences/primer_theme/blog/posts/archive.html.haml +5 -0
  34. data/app/views/spina/conferences/primer_theme/blog/posts/index.atom.builder +19 -0
  35. data/app/views/spina/conferences/primer_theme/blog/posts/index.html.haml +11 -0
  36. data/app/views/spina/conferences/primer_theme/blog/posts/show.html.haml +17 -0
  37. data/app/views/spina/conferences/primer_theme/blog/shared/_sidebar.html.haml +10 -0
  38. data/app/views/spina/conferences/primer_theme/conferences/conferences/_event.html.haml +3 -3
  39. data/app/views/spina/conferences/primer_theme/conferences/conferences/_events.html.haml +1 -1
  40. data/app/views/spina/conferences/primer_theme/conferences/conferences/_header.html.haml +1 -1
  41. data/app/views/spina/conferences/primer_theme/conferences/conferences/_presentation.html.haml +3 -3
  42. data/app/views/spina/conferences/primer_theme/conferences/conferences/_presentations.html.haml +1 -1
  43. data/app/views/spina/conferences/primer_theme/conferences/conferences/_submission_flash.html.haml +2 -2
  44. data/app/views/spina/conferences/primer_theme/conferences/conferences/show.html.haml +5 -5
  45. data/app/views/spina/conferences/primer_theme/conferences/presentations/_abstract.html.haml +1 -1
  46. data/app/views/spina/conferences/primer_theme/conferences/presentations/_attachments.html.haml +1 -1
  47. data/app/views/spina/conferences/primer_theme/conferences/presentations/show.html.haml +3 -3
  48. data/app/views/spina/conferences/primer_theme/journal/articles/_authorship.html.haml +2 -2
  49. data/app/views/spina/conferences/primer_theme/journal/articles/show.html.haml +15 -15
  50. data/app/views/spina/conferences/primer_theme/journal/issues/_article.html.haml +2 -2
  51. data/app/views/spina/conferences/primer_theme/journal/issues/_issue.html.haml +3 -3
  52. data/app/views/spina/conferences/primer_theme/journal/issues/index.html.haml +2 -2
  53. data/app/views/spina/conferences/primer_theme/journal/issues/show.html.haml +3 -3
  54. data/config/initializers/mime_types.rb +3 -1
  55. data/config/initializers/themes/conferences_primer_theme.rb +1 -1
  56. data/config/locales/en.yml +15 -0
  57. data/config/routes.rb +14 -0
  58. data/db/migrate/20210206170704_change_current_conference_alert_to_text.rb +1 -1
  59. data/lib/spina/conferences/primer_theme/breadcrumbs/builder.rb +4 -17
  60. data/lib/spina/conferences/primer_theme/engine.rb +1 -1
  61. data/lib/spina/conferences/primer_theme/version.rb +1 -1
  62. data/lib/spina/conferences/primer_theme.rb +2 -2
  63. metadata +36 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5eeeecc259280f962b1f0e54454b87884adbbcf02d7bccd976096489e48b7d6a
4
- data.tar.gz: 0e9baa272b17486a1888d7103da11c22563c90208b62e625a245d7be90ef94bc
3
+ metadata.gz: ce68bf02784663a0e354ca369154d20f4599eae01c0910be10c57d6d330afba3
4
+ data.tar.gz: fe44d6649b68188d82fdd843b0a55d44b32bde8f89752513a152f61fd074ea2f
5
5
  SHA512:
6
- metadata.gz: 5916e3b6065d2f4c5d4bef963ce35915c6666e99363001de02585536a8b8133860f7899f7bdf9851fa318d7f2aea9597f41e9b072b7cd3ca21c56f1998d38abd
7
- data.tar.gz: 8473988d364a83fdba70e3a10d4c476f12df2fbd0b58c666bee88fec6e4686112f9dd67443102b48b4afc3d483ad1d9b89bce43e8f67e687ad8482b5e62414ce
6
+ metadata.gz: 193634c447d2d784f51be6787991e3754d178bc78998de0a4c0dfd4171eeb5ad669fc1a13e7ac02fd2d288a254611213d6b72949360d547855c63e59707fca93
7
+ data.tar.gz: d337742e09e81dab12073e1a49a844e3d66612769e5bd7d9cb152beccfba1f3f629909bdc39ce8871fadfbd440e044c1ea2a9399e65e31e64b8965af0d15d7df
data/README.md CHANGED
@@ -1,10 +1,16 @@
1
- # PrimerTheme
2
- A plugin for `Spina` that provides a frontend for `Spina::Admin::Conferences` using components from `Primer::ViewComponents`.
1
+ # PrimerTheme: frontend for Spina
3
2
 
4
- This fork provides an updated version of the plugin, as the main repo is currently stale.
3
+ ![Rails tests](https://github.com/louis-vs/spina-conferences-primer_theme-fork/workflows/Verify/badge.svg?branch=master&event=push)
4
+ [![codecov](https://codecov.io/gh/louis-vs/spina-conferences-primer_theme-fork/branch/master/graph/badge.svg?token=9TZ9QGGLAH)](https://codecov.io/gh/louis-vs/spina-conferences-primer_theme-fork)
5
+ [![CodeFactor](https://www.codefactor.io/repository/github/louis-vs/spina-conferences-primer_theme-fork/badge)](https://www.codefactor.io/repository/github/louis-vs/spina-conferences-primer_theme-fork)
6
+ [![Inline docs](http://inch-ci.org/github/louis-vs/spina-conferences-primer_theme-fork.svg?branch=master)](http://inch-ci.org/github/louis-vs/spina-conferences-primer_theme-fork)
7
+
8
+ A plugin for `Spina` that provides a frontend for `Spina::Admin::Conferences`, `Spina::Admin::Journal`, and `Spina::Admin::Conferences::Blog` using components from `Primer::ViewComponents`.
9
+
10
+ This fork provides an updated version of the plugin, as the main repo is currently badly outdated.
5
11
 
6
12
  ## Usage
7
- See the README for `Spina::Admin::Conferences`. Also make sure to ensure compilation of the assets for this gem by adding the following line to your
13
+ See the READMEs for the conference plugin, the journal plugin, and the bog plugin, respectively, for more information on what kind of content this frontend allows you to create and how to do so within the admin interface. Also make sure to ensure compilation of the assets for this gem by adding the following line to your
8
14
  `manifest.js` file.
9
15
 
10
16
  ```js
data/Rakefile CHANGED
@@ -33,4 +33,10 @@ Rake::TestTask.new(:test) do |t|
33
33
  t.ruby_opts = %w[-W:no-deprecated]
34
34
  end
35
35
 
36
+ require 'rubocop/rake_task'
37
+
38
+ RuboCop::RakeTask.new do |t|
39
+ t.options << '--parallel' if ENV['CI']
40
+ end
41
+
36
42
  task default: :test
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spina
4
+ module Conferences
5
+ module PrimerTheme
6
+ module Blog
7
+ # Base class from which controllers related to the blog plugin inherit
8
+ class ApplicationController < ::Spina::ApplicationController
9
+ include ::Spina::Frontend
10
+ def cookies_info
11
+ render partial: 'cookies'
12
+ end
13
+
14
+ protected
15
+
16
+ def theme_layout
17
+ 'layouts/spina/conferences/primer_theme/blog/blog'
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spina
4
+ module Conferences
5
+ module PrimerTheme
6
+ module Blog
7
+ # Spina::Blog::CategoriesController
8
+ class CategoriesController < ApplicationController
9
+ include ::Spina::Frontend
10
+
11
+ before_action :page
12
+ before_action :category
13
+ before_action :posts
14
+ before_action :set_breadcrumb, only: :show
15
+ before_action :set_metadata
16
+
17
+ def show
18
+ add_breadcrumb t('.category', name: @category.name)
19
+ render layout: theme_layout
20
+ end
21
+
22
+ private
23
+
24
+ def category
25
+ @category = Spina::Admin::Conferences::Blog::Category.friendly.find params[:id]
26
+ end
27
+
28
+ def posts
29
+ @posts = @category.posts.available.live.order(published_at: :desc)
30
+ .page(params[:page])
31
+ end
32
+
33
+ def page
34
+ @page = Spina::Page.find_or_create_by name: 'blog' do |page|
35
+ page.link_url = '/blog'
36
+ page.deletable = false
37
+ end
38
+ end
39
+
40
+ def set_breadcrumb
41
+ add_breadcrumb 'Blog', frontend_blog_root_path
42
+ end
43
+
44
+ def set_metadata
45
+ @title = @category.name
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spina
4
+ module Conferences
5
+ module PrimerTheme
6
+ module Blog
7
+ # Spina::Blog::PostsController
8
+ class PostsController < ApplicationController
9
+ include ::Spina::Frontend
10
+
11
+ before_action :find_posts, only: [:index]
12
+ before_action :current_spina_user_can_view_page?
13
+ before_action :set_breadcrumb, only: :show
14
+
15
+ decorates_assigned :posts, :post
16
+
17
+ def index
18
+ @posts = @posts.unscope(where: :draft) if current_spina_user&.admin?
19
+
20
+ @title = t('.blog')
21
+
22
+ respond_to do |format|
23
+ format.atom
24
+ format.html { render layout: theme_layout }
25
+ end
26
+ end
27
+
28
+ def show
29
+ @post = Spina::Admin::Conferences::Blog::Post.friendly.find params[:id]
30
+ set_metadata
31
+ add_breadcrumb @post.title
32
+ render layout: theme_layout
33
+ rescue ActiveRecord::RecordNotFound
34
+ try_redirect
35
+ end
36
+
37
+ def archive
38
+ @posts = Spina::Admin::Conferences::Blog::Post.live
39
+ .where(published_at: start_date..end_date)
40
+ .order(published_at: :desc)
41
+ .page(params[:page])
42
+
43
+ render layout: theme_layout
44
+ end
45
+
46
+ private
47
+
48
+ def start_date
49
+ Time.zone.local(params[:year].to_i, (params[:month] || 1).to_i)
50
+ end
51
+
52
+ def end_date
53
+ start_date.end_of_year
54
+ end
55
+
56
+ def page
57
+ @page ||= Spina::Page.find_or_create_by name: 'blog' do |page|
58
+ page.title = 'Blog'
59
+ page.link_url = '/blog'
60
+ page.deletable = false
61
+ end
62
+ end
63
+
64
+ def find_posts
65
+ @posts = Spina::Admin::Conferences::Blog::Post.available.live.order(published_at: :desc)
66
+ .page(params[:page])
67
+ end
68
+
69
+ def try_redirect
70
+ rule = RewriteRule.find_by!(old_path: "/blog/posts/#{params[:id]}")
71
+ redirect_to rule.new_path, status: :moved_permanently
72
+ end
73
+
74
+ def current_spina_user_can_view_page?
75
+ raise ActiveRecord::RecordNotFound unless current_spina_user.present? || page.live?
76
+ end
77
+
78
+ def set_breadcrumb
79
+ add_breadcrumb 'Blog', frontend_blog_root_path
80
+ end
81
+
82
+ def set_metadata
83
+ @title = @post.seo_title.presence || @post.title
84
+ @description = @post.description
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
90
+ 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,19 +43,19 @@ 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
@@ -63,7 +64,7 @@ module Spina
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,34 @@ 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
40
  end
41
41
  end
42
42
  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) }
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) }
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) }
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) }
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) }
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) }
6
6
 
7
7
  - if content(:events_list).present?
8
8
  = render Primer::SubheadComponent.new(mt: 4) do |component|
@@ -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) }
@@ -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) }
6
6
 
7
7
  - if content(:periodical_issues).present?
8
8
  %ul.mt-4
@@ -26,7 +26,7 @@
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
29
+ = render Primer::Markdown.new(tag: :div, color: :muted) do
30
30
  = issue.content.html(:description)
31
31
  = render Primer::FlexComponent.new(direction: [:column, nil, :row, nil], align_items: :start) do
32
32
  - if issue.content(:url).present?
@@ -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) }
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,7 +13,7 @@
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
16
+ = render(Primer::Markdown.new(my: 4)) do
17
17
  = item.content(:description).html_safe
18
18
  - if item.content(:url).present?
19
19
  = link_to t('.more_info'), item.content(:url),
@@ -0,0 +1,5 @@
1
+ - content_for :breadcrumbs do
2
+ = render_breadcrumbs(builder: Spina::Conferences::PrimerTheme::Breadcrumbs::Builder)
3
+
4
+ = render template: 'layouts/spina/conferences/primer_theme/application',
5
+ locals: { author: current_account.name, description: @description, title: @title, seo_title: @title }