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

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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -0
  3. data/app/controllers/spina/conferences/primer_theme/conferences/application_controller.rb +17 -0
  4. data/app/controllers/spina/conferences/primer_theme/journal/application_controller.rb +16 -0
  5. data/app/controllers/spina/conferences/primer_theme/journal/articles_controller.rb +13 -7
  6. data/app/controllers/spina/conferences/primer_theme/journal/authors_controller.rb +48 -0
  7. data/app/controllers/spina/conferences/primer_theme/journal/issues_controller.rb +10 -4
  8. data/app/helpers/spina/conferences/primer_theme/application_helper.rb +10 -1
  9. data/app/helpers/spina/conferences/primer_theme/navigations_helper.rb +8 -0
  10. data/app/views/conferences_primer_theme/pages/about.html.haml +5 -5
  11. data/app/views/conferences_primer_theme/pages/committee.html.haml +3 -3
  12. data/app/views/conferences_primer_theme/pages/journal_information.html.haml +10 -0
  13. data/app/views/conferences_primer_theme/pages/periodical.html.haml +5 -5
  14. data/app/views/conferences_primer_theme/partials/_event.html.haml +1 -1
  15. data/app/views/layouts/conferences_primer_theme/application.html.haml +1 -1
  16. data/app/views/layouts/spina/conferences/primer_theme/journal/articles.html.haml +3 -0
  17. data/app/views/layouts/spina/conferences/primer_theme/journal/authors.html.haml +5 -0
  18. data/app/views/layouts/spina/conferences/primer_theme/journal/issues.html.haml +3 -0
  19. data/app/views/spina/application/_journal_navigation.html.haml +17 -0
  20. data/app/views/spina/application/_mobile_navigation_items.html.haml +0 -3
  21. data/app/views/spina/application/_navigation.html.haml +0 -3
  22. data/app/views/spina/conferences/primer_theme/blog/categories/show.html.haml +2 -2
  23. data/app/views/spina/conferences/primer_theme/blog/posts/index.html.haml +2 -2
  24. data/app/views/spina/conferences/primer_theme/blog/posts/show.html.haml +5 -5
  25. data/app/views/spina/conferences/primer_theme/conferences/conferences/_conference.html.haml +2 -2
  26. data/app/views/spina/conferences/primer_theme/conferences/conferences/_event.html.haml +3 -3
  27. data/app/views/spina/conferences/primer_theme/conferences/conferences/_header.html.haml +3 -3
  28. data/app/views/spina/conferences/primer_theme/conferences/conferences/_presentation.html.haml +1 -1
  29. data/app/views/spina/conferences/primer_theme/conferences/conferences/_presentations.html.haml +3 -3
  30. data/app/views/spina/conferences/primer_theme/conferences/conferences/index.html.haml +3 -3
  31. data/app/views/spina/conferences/primer_theme/journal/articles/_authorship.html.haml +8 -6
  32. data/app/views/spina/conferences/primer_theme/journal/articles/_metadata.html.haml +3 -3
  33. data/app/views/spina/conferences/primer_theme/journal/articles/show.html.haml +12 -14
  34. data/app/views/spina/conferences/primer_theme/journal/authors/_author.html.haml +9 -0
  35. data/app/views/spina/conferences/primer_theme/journal/authors/index.html.haml +10 -0
  36. data/app/views/spina/conferences/primer_theme/journal/authors/show.html.haml +20 -0
  37. data/app/views/spina/conferences/primer_theme/journal/issues/_article.html.haml +4 -4
  38. data/app/views/spina/conferences/primer_theme/journal/issues/_issue.html.haml +7 -6
  39. data/app/views/spina/conferences/primer_theme/journal/issues/index.html.haml +27 -23
  40. data/app/views/spina/conferences/primer_theme/journal/issues/show.html.haml +31 -21
  41. data/config/initializers/primer.rb +1 -1
  42. data/config/initializers/themes/conferences_primer_theme.rb +12 -2
  43. data/config/locales/en.yml +20 -31
  44. data/config/routes.rb +6 -2
  45. data/lib/spina/conferences/primer_theme/engine.rb +4 -4
  46. data/lib/spina/conferences/primer_theme/version.rb +1 -1
  47. metadata +11 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb05b4e1ad3a267e9271a932686234f556e7268d64b6810f0bc454013c39a6a5
4
- data.tar.gz: 88b725abc9beccc27a5879779be534fa8c3e1aef4443e8f3d33ab01224e03fcb
3
+ metadata.gz: 94714b6d36ceca47f2ace1a579c81c5ef9ac11fc59c0a24a608a044d01b16862
4
+ data.tar.gz: c70e3ab6596eb92694c22e11c82349b2aa99f5e45ae17173dece175408a2b029
5
5
  SHA512:
6
- metadata.gz: 8f6f147dfc7855f2c9e67227455cda78baf867d13806a10178d2e279a1122398736d56ab0b3028f22395bd93ec769c4e9b6003c82dcc89aa1faafb66c4bd0b02
7
- data.tar.gz: eef7ec098e81d0df97978634a9acaf2918f6fa14a3b9d17523a4b50f5c98d56c59575e0f9e03a38c1edaa5c8f5763337b3f39510532c1cb11042065ff39e861b
6
+ metadata.gz: d711b2fddd3733951d33a78867485dbb50ba2410ad8308c08bfecc5d9ddbeeeb8a8cc3ff19c051f73c555e9f85597abe2e71bc23eabace96ef9691dec0dd6e4b
7
+ data.tar.gz: a9f6c510143c1db5c547ab992822c1165fa87a158a4a5ea24995947a19f69db10267902edb677b62c4a1213314ba81169f10007b62e02ce430bc3c90d23dedc3
data/README.md CHANGED
@@ -34,6 +34,12 @@ Or install it yourself as:
34
34
  $ gem install spina-conferences-primer_theme-fork
35
35
  ```
36
36
 
37
+ The first thing you will probably want to do is add three pages using the 'blank' template, and add
38
+ forwarding URLs as follows:
39
+ * Conferences to `/conferences/conferences`
40
+ * Journal to `/journal/issues`
41
+ * Blog to `/blog`
42
+
37
43
  ## Contributing
38
44
  Contributions welcome, open an issue first please.
39
45
 
@@ -6,9 +6,26 @@ module Spina
6
6
  module Conferences
7
7
  # Base class from which controllers inherit
8
8
  class ApplicationController < Spina::ApplicationController
9
+ before_action :journal_accessible?
10
+
9
11
  def cookies_info
10
12
  render partial: 'cookies'
11
13
  end
14
+
15
+ private
16
+
17
+ def page
18
+ @page ||= Spina::Page.find_or_create_by name: 'conferences' do |page|
19
+ page.title = 'Conferences'
20
+ page.link_url = '/conferences/conferences'
21
+ page.deletable = false
22
+ page.view_template = 'blank'
23
+ end
24
+ end
25
+
26
+ def journal_accessible?
27
+ raise ActiveRecord::RecordNotFound unless current_spina_user.present? || page.live?
28
+ end
12
29
  end
13
30
  end
14
31
  end
@@ -6,6 +6,22 @@ module Spina
6
6
  module Journal
7
7
  # Base class from which controllers related to the journal plugin inherit
8
8
  class ApplicationController < Spina::ApplicationController
9
+ before_action :journal_accessible?
10
+
11
+ private
12
+
13
+ def page
14
+ @page ||= Spina::Page.find_or_create_by name: 'journal' do |page|
15
+ page.title = 'Journal'
16
+ page.link_url = '/journal/issues'
17
+ page.deletable = false
18
+ page.view_template = 'blank'
19
+ end
20
+ end
21
+
22
+ def journal_accessible?
23
+ raise ActiveRecord::RecordNotFound unless current_spina_user.present? || page.live?
24
+ end
9
25
  end
10
26
  end
11
27
  end
@@ -6,8 +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,
10
- :require_admin_for_invisible_article
9
+ before_action :set_volume, :set_issue, :set_article, :set_journal, :set_licence,
10
+ :set_breadcrumb, :set_metadata, :require_admin_for_invisible_article
11
11
 
12
12
  def show
13
13
  respond_to do |format|
@@ -25,13 +25,19 @@ module Spina
25
25
  private
26
26
 
27
27
  def set_article
28
- @article = Admin::Journal::Article.includes(affiliations: [:institution]).find(params[:id])
28
+ @article = @issue.articles.includes(affiliations: [:institution]).find_by!(number: params[:number])
29
29
  rescue ActiveRecord::RecordNotFound
30
30
  send_file Rails.root.join('public/404.html'), type: 'text/html; charset=utf-8', status: 404
31
31
  end
32
32
 
33
33
  def set_issue
34
- @issue = Admin::Journal::Issue.includes(:volume, :articles).find(params[:issue_id])
34
+ @issue = @volume.issues.includes(:volume, :articles).find_by!(number: params[:issue_number])
35
+ rescue ActiveRecord::RecordNotFound
36
+ send_file Rails.root.join('public/404.html'), type: 'text/html; charset=utf-8', status: 404
37
+ end
38
+
39
+ def set_volume
40
+ @volume = Admin::Journal::Volume.includes(:issues).find_by!(number: params[:volume_number])
35
41
  rescue ActiveRecord::RecordNotFound
36
42
  send_file Rails.root.join('public/404.html'), type: 'text/html; charset=utf-8', status: 404
37
43
  end
@@ -47,11 +53,11 @@ module Spina
47
53
  def set_breadcrumb
48
54
  return if @issue.blank?
49
55
 
50
- add_breadcrumb @journal.name, frontend_issues_path
51
- add_breadcrumb Admin::Journal::Issue.model_name.human.pluralize, frontend_issues_path
56
+ add_breadcrumb helpers.journal_abbreviation_or_name(@journal), frontend_issues_path
57
+ # add_breadcrumb Admin::Journal::Issue.model_name.human.pluralize, frontend_issues_path
52
58
  add_breadcrumb t('spina.conferences.primer_theme.journal.volume_issue', volume_number: @issue.volume.number,
53
59
  issue_number: @issue.number),
54
- frontend_issue_path(@issue.id)
60
+ frontend_volume_issue_path(@issue.volume.number, @issue.number)
55
61
  end
56
62
 
57
63
  def set_metadata
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spina
4
+ module Conferences
5
+ module PrimerTheme
6
+ module Journal
7
+ # User-facing controller for authors
8
+ class AuthorsController < ApplicationController
9
+ before_action :set_journal, :set_breadcrumb
10
+ before_action :set_author, only: :show
11
+ before_action :set_metadata
12
+
13
+ def index
14
+ @authors = Admin::Journal::Author.all.sort do |a, b|
15
+ a.primary_affiliation.name <=> b.primary_affiliation.name
16
+ end
17
+ end
18
+
19
+ def show
20
+ add_breadcrumb @author.primary_affiliation.name
21
+ end
22
+
23
+ private
24
+
25
+ def set_journal
26
+ @journal = Admin::Journal::Journal.instance
27
+ end
28
+
29
+ def set_author
30
+ @author = Admin::Journal::Author.includes(:affiliations, :articles).find(params[:id])
31
+ rescue ActiveRecord::RecordNotFound
32
+ send_file Rails.root.join('public/404.html'), type: 'text/html; charset=utf-8', status: 404
33
+ end
34
+
35
+ def set_metadata
36
+ @title = @journal.name
37
+ @description = ActionView::Base.full_sanitizer.sanitize(@journal.content(:description))
38
+ end
39
+
40
+ def set_breadcrumb
41
+ add_breadcrumb helpers.journal_abbreviation_or_name(@journal), frontend_issues_path
42
+ add_breadcrumb Admin::Journal::Author.model_name.human(count: :many), frontend_authors_path
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -7,7 +7,7 @@ module Spina
7
7
  # User-facing controller for journal issues
8
8
  class IssuesController < ApplicationController
9
9
  before_action :set_journal
10
- before_action :set_issue, :set_breadcrumb, only: :show
10
+ before_action :set_volume, :set_issue, only: :show
11
11
  before_action :set_metadata
12
12
 
13
13
  def index
@@ -33,14 +33,20 @@ module Spina
33
33
  end
34
34
 
35
35
  def set_issue
36
- @issue = Admin::Journal::Issue.includes(:volume, :articles).find(params[:id])
36
+ @issue = @volume.issues.includes(:volume, :articles).find_by!(number: params[:number])
37
+ rescue ActiveRecord::RecordNotFound
38
+ send_file Rails.root.join('public/404.html'), type: 'text/html; charset=utf-8', status: 404
39
+ end
40
+
41
+ def set_volume
42
+ @volume = Admin::Journal::Volume.includes(:issues).find_by!(number: params[:volume_number])
37
43
  rescue ActiveRecord::RecordNotFound
38
44
  send_file Rails.root.join('public/404.html'), type: 'text/html; charset=utf-8', status: 404
39
45
  end
40
46
 
41
47
  def set_breadcrumb
42
- add_breadcrumb @journal.name, frontend_issues_path
43
- add_breadcrumb Admin::Journal::Issue.model_name.human.pluralize, frontend_issues_path
48
+ add_breadcrumb helpers.journal_abbreviation_or_name(@journal), frontend_issues_path
49
+ # add_breadcrumb Admin::Journal::Issue.model_name.human.pluralize, frontend_issues_path
44
50
  end
45
51
 
46
52
  def set_metadata
@@ -12,10 +12,19 @@ module Spina
12
12
  Spina::Admin::Conferences::Conference.order(dates: :asc).find_by('upper(dates) >= ?', Time.zone.today)
13
13
  end
14
14
 
15
- def ancestors
15
+ def journal_abbreviation_or_name(journal)
16
+ journal.content(:journal_abbreviation) && journal.content(:journal_abbreviation).empty? ? journal.name : journal.content(:journal_abbreviation) # rubocop:disable Layout/LineLength
17
+ end
18
+
19
+ def ancestors # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
16
20
  return [] if current_page.blank?
17
21
 
18
22
  render Primer::Beta::Breadcrumbs.new(mb: 4) do |component|
23
+ if current_page.resource&.name = 'journal'
24
+ component.item(href: frontend_issues_path) do
25
+ journal_abbreviation_or_name(Spina::Admin::Journal::Journal.instance)
26
+ end
27
+ end
19
28
  current_page.ancestors.each do |ancestor|
20
29
  component.item(href: ancestor.materialized_path) { ancestor.menu_title }
21
30
  end
@@ -13,6 +13,10 @@ module Spina
13
13
  @footer_navigation_items ||= live_navigation_items('footer')
14
14
  end
15
15
 
16
+ def journal_navigation_items
17
+ @journal_navigation_items ||= live_resource_navigation_items('journal')
18
+ end
19
+
16
20
  private
17
21
 
18
22
  def live_navigation_items(name)
@@ -20,6 +24,10 @@ module Spina
20
24
  .where(spina_navigations: { name: name })
21
25
  .roots.regular_pages.in_menu.live.sorted
22
26
  end
27
+
28
+ def live_resource_navigation_items(name)
29
+ ::Spina::Resource.find_by(name: name)&.pages&.roots&.in_menu&.live&.sorted || []
30
+ end
23
31
  end
24
32
  end
25
33
  end
@@ -13,8 +13,8 @@
13
13
  = render Primer::SubheadComponent.new do |component|
14
14
  = component.heading { t :'.constitution.title' }
15
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
16
+ = render Primer::BoxComponent.new(display: :flex, align_items: :center, py: 1) do
17
+ = render Primer::BoxComponent.new(flex: :auto, pr: 1) do
18
18
  = t :'.constitution.uploaded',
19
19
  date: l(Spina::Attachment.find(content(:constitution).attachment_id).created_at.to_date, format: :long)
20
20
  = render Primer::ButtonComponent.new(tag: :a, href: content.attachment_url(:constitution), ml: 2, download: '') do
@@ -30,7 +30,7 @@
30
30
  %ul
31
31
  - repeater :minutes do |minutes_entry|
32
32
  %li.list-style-none.py-1.d-flex.flex-items-center
33
- = render Primer::FlexItemComponent.new(flex_auto: true) do
33
+ = render Primer::BoxComponent.new(flex: :auto) do
34
34
  - if minutes_entry.content(:date).present?
35
35
  = t(:'.minutes.minutes_for_html', date: time_tag(minutes_entry.content(:date)))
36
36
  - else
@@ -66,10 +66,10 @@
66
66
  %ul
67
67
  - repeater :partner_societies do |partner_society|
68
68
  %li.list-style-none.py-4.border-bottom
69
- = render Primer::FlexComponent.new(direction: [:column, nil, :row_reverse, nil], align_items: :start) do
69
+ = render Primer::BoxComponent.new(display: :flex, direction: [:column, nil, :row_reverse, nil], align_items: :flex_start) do
70
70
  = render Primer::BaseComponent.new(tag: :div, flex: :auto) do
71
71
  = render Primer::HeadingComponent.new(tag: :h3, mb: 1) do
72
- = render Primer::FlexComponent.new(flex_wrap: true, justify_content: :space_between) do
72
+ = render Primer::BoxComponent.new(display: :flex, flex_wrap: :wrap, justify_content: :space_between) do
73
73
  - if partner_society.content(:name).present?
74
74
  = render(Primer::Beta::Text.new(tag: :div)) { partner_society.content(:name) }
75
75
  = render Primer::ButtonGroup.new(aria: { label: t(:'.partner_societies.contact_buttons') }) do |component|
@@ -8,7 +8,7 @@
8
8
  %ul.mt-4
9
9
  - repeater(:committee_bios) do |committee_bio|
10
10
  %li.list-style-none.py-4.border-bottom
11
- = render Primer::FlexComponent.new(direction: [:column, nil, :row, nil], align_items: :start) do
11
+ = render Primer::BoxComponent.new(display: :flex, direction: [:column, nil, :row, nil], align_items: :flex_start) do
12
12
  - if committee_bio.content(:profile_picture).present?
13
13
  -# TODO: create helper to replace this, because Primer::Beta::Avatar limits size to 80 sadly
14
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]),
@@ -16,8 +16,8 @@
16
16
  variant: { resize_to_fill: [150, 150] }),
17
17
  draggable: false,
18
18
  alt: committee_bio.content(:profile_picture).alt}
19
- = render Primer::FlexItemComponent.new(flex_auto: true) do
20
- = render Primer::FlexComponent.new(direction: [:column, nil, :row, nil], mb: 1) do
19
+ = render Primer::BoxComponent.new(flex: :auto) do
20
+ = render Primer::BoxComponent.new(display: :flex, direction: [:column, nil, :row, nil], mb: 1) do
21
21
  = render Primer::BoxComponent.new do
22
22
  - if committee_bio.content(:name).present?
23
23
  = render(Primer::HeadingComponent.new(tag: :h3)) do
@@ -0,0 +1,10 @@
1
+ - cache [current_page, journal_navigation_items] do
2
+ = render Primer::BoxComponent.new(display: :flex, direction: [:column, nil, nil, :row]) do
3
+ - cache current_page do
4
+ = render Primer::BoxComponent.new(col: [nil, nil, nil, 9]) do
5
+ = render(Primer::HeadingComponent.new(tag: :h1)) { current_page.title }
6
+
7
+ - if content(:text).present?
8
+ = render(Primer::Markdown.new(mt: 4)) { content.html(:text).to_s }
9
+
10
+ = render 'journal_navigation'
@@ -8,16 +8,16 @@
8
8
  %ul.mt-4
9
9
  - repeater(:periodical_issues) do |issue|
10
10
  %li.list-style-none.py-4.border-bottom
11
- = render Primer::FlexComponent.new(direction: [:column, nil, :row, nil], align_items: :start) do
11
+ = render Primer::BoxComponent.new(display: :flex, direction: [:column, nil, :row, nil], align_items: :flex_start) do
12
12
  - if issue.content(:cover_img).present?
13
- = render Primer::FlexItemComponent.new(mr: [nil, nil, 3, nil], mb: [3, nil, 0, nil], flex_shrink: 0) do
13
+ = render Primer::BoxComponent.new(mr: [nil, nil, 3, nil], mb: [3, nil, 0, nil], flex_shrink: 0) do
14
14
  = render Primer::LinkComponent.new(href: issue.content(:url)) do
15
15
  = image_tag(issue.content.image_url(:cover_img, resize_to_limit: [300, 300]),
16
16
  srcset: srcset_string(issue.content(:cover_img),
17
17
  variant: { resize_to_limit: [300, 300] }),
18
18
  alt: issue.content(:cover_img).alt)
19
- = render Primer::FlexItemComponent.new(flex_auto: true) do
20
- = render Primer::FlexComponent.new(direction: [:column, nil, :row, nil], mb: 1) do
19
+ = render Primer::BoxComponent.new(flex: :auto) do
20
+ = render Primer::BoxComponent.new(display: :flex, direction: [:column, nil, :row, nil], mb: 1) do
21
21
  = render Primer::BoxComponent.new do
22
22
  - if issue.content(:name).present?
23
23
  = render Primer::HeadingComponent.new(tag: :h2) do
@@ -28,7 +28,7 @@
28
28
  - if issue.content(:description).present?
29
29
  = render Primer::Markdown.new(tag: :div, color: :muted) do
30
30
  = issue.content.html(:description).to_s
31
- = render Primer::FlexComponent.new(direction: [:column, nil, :row, nil], align_items: :start) do
31
+ = render Primer::BoxComponent.new(display: :flex, direction: [:column, nil, :row, nil], align_items: :flex_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
34
34
  = render Primer::OcticonComponent.new('link-external')
@@ -1,5 +1,5 @@
1
1
  %li.list-style-none.py-4.border-bottom
2
- = render Primer::FlexComponent.new(direction: :column, align_items: :start) do
2
+ = render Primer::BoxComponent.new(display: :flex, direction: :column, align_items: :flex_start) do
3
3
  - if event.content(:name).present?
4
4
  = render(Primer::HeadingComponent.new(tag: :h3, flex: :auto)) { event.content(:name) }
5
5
  = render Primer::HeadingComponent.new(tag: :h4, flex: :auto) do
@@ -1,5 +1,5 @@
1
1
  - content_for :breadcrumbs do
2
- - if current_page.ancestors.any?
2
+ - if current_page.ancestors.any? || current_page.resource&.name == 'journal'
3
3
  = ancestors
4
4
 
5
5
  = render template: 'layouts/spina/conferences/primer_theme/application',
@@ -1,2 +1,5 @@
1
+ - content_for :breadcrumbs do
2
+ = render_breadcrumbs(builder: Spina::Conferences::PrimerTheme::Breadcrumbs::Builder)
3
+
1
4
  = render template: 'layouts/spina/conferences/primer_theme/application',
2
5
  locals: { author: current_account.name, description: @description, title: @title, seo_title: @title, hide_alert: false }
@@ -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, hide_alert: false }
@@ -1,2 +1,5 @@
1
+ - content_for :breadcrumbs do
2
+ = render_breadcrumbs(builder: Spina::Conferences::PrimerTheme::Breadcrumbs::Builder)
3
+
1
4
  = render template: 'layouts/spina/conferences/primer_theme/application',
2
5
  locals: { author: current_account.name, description: @description, title: @title, seo_title: @title, hide_alert: false }
@@ -0,0 +1,17 @@
1
+ - cache [current_page, journal_navigation_items] do
2
+ = render Primer::MenuComponent.new(ml: [0, nil, nil, 4], mt: [4, 0, nil, nil], col: [nil, nil, nil, 3]) do |component|
3
+ - component.heading(tag: :h2) do
4
+ = Spina::Admin::Journal::Journal.instance.name
5
+
6
+ - component.item(selected: controller_name == 'issues', href: frontend_issues_path) do
7
+ = t '.issues'
8
+ - component.item(selected: controller_name == 'authors', href: frontend_authors_path) do
9
+ = t '.authors'
10
+
11
+ - journal_navigation_items.each do |page|
12
+ - component.item(selected: page == current_page, href: page.materialized_path) do
13
+ = page.menu_title
14
+ - if page.children&.in_menu.live.any?
15
+ - page.children.in_menu.live.sorted.each do |sub_page|
16
+ - component.item(selected: sub_page == current_page, href: sub_page.materialized_path, pl: 5) do
17
+ = sub_page.menu_title
@@ -1,5 +1,2 @@
1
1
  %nav.d-flex.flex-column.flex-self-stretch
2
2
  = render partial: 'mobile_navigation_item', collection: main_navigation_items, as: :navigation_item, cache: -> navigation_item { [navigation_item, navigation_item.children] }
3
- .Header-item.mr-0.border-top.border-white-fade-15= link_to 'Blog', frontend_blog_root_path, class: %w[Header-link py-2 py-lg-0]
4
- .Header-item.mr-0.border-top.border-white-fade-15= link_to 'Journal', frontend_issues_path, class: %w[Header-link py-2 py-lg-0]
5
- .Header-item.mr-0.border-top.border-white-fade-15= link_to 'Conferences', frontend_conferences_path, class: %w[Header-link py-2 py-lg-0]
@@ -7,6 +7,3 @@
7
7
  .Header-item.Header-item--full.flex-column.width-full.flex-order-1.mr-0.mt-3
8
8
  = render partial: 'mobile_navigation_items'
9
9
  = render partial: 'navigation_item', collection: main_navigation_items, cache: -> navigation_item { [navigation_item, navigation_item.children] }
10
- .Header-item.d-none.d-lg-flex= link_to 'Blog', frontend_blog_root_path, class: %w[Header-link]
11
- .Header-item.d-none.d-lg-flex= link_to 'Journal', frontend_issues_path, class: %w[Header-link]
12
- .Header-item.d-none.d-lg-flex= link_to 'Conferences', frontend_conferences_path, class: %w[Header-link]
@@ -3,8 +3,8 @@
3
3
  = render(Primer::HeadingComponent.new(tag: :h2)) do
4
4
  = t '.category', name: @category.name
5
5
 
6
- = render(Primer::FlexComponent.new(flex: :auto, direction: [:column, nil, :row, nil])) do
7
- = render(Primer::FlexItemComponent.new(flex_auto: true)) do
6
+ = render(Primer::BoxComponent.new(display: :flex, flex: :auto, direction: [:column, nil, :row, nil])) do
7
+ = render(Primer::BoxComponent.new(flex: :auto)) do
8
8
  - if @posts.any?
9
9
  %ul= render collection: @posts, partial: 'spina/conferences/primer_theme/blog/posts/post', layout: 'list_item', cached: true
10
10
  - else
@@ -1,8 +1,8 @@
1
1
  = render(Primer::HeadingComponent.new(tag: :h1)) do
2
2
  Blog
3
3
 
4
- = render(Primer::FlexComponent.new(flex: :auto, direction: [:column, nil, :row, nil])) do
5
- = render(Primer::FlexItemComponent.new(flex_auto: true)) do
4
+ = render(Primer::BoxComponent.new(display: :flex, flex: :auto, direction: [:column, nil, :row, nil])) do
5
+ = render(Primer::BoxComponent.new(flex: :auto)) do
6
6
  - if @posts.any?
7
7
  %ul= render collection: @posts, partial: 'post', layout: 'list_item', cached: true
8
8
  - else
@@ -2,16 +2,16 @@
2
2
  = @post.title
3
3
 
4
4
  %ul.list-style-none.d-flex.flex-column.flex-sm-row.my-2
5
- = render(Primer::FlexComponent.new(tag: :li, mr: 4, align_items: :center)) do
6
- = render(Primer::FlexItemComponent.new(mr: 2)) do
5
+ = render(Primer::BoxComponent.new(display: :flex, tag: :li, mr: 4, align_items: :center)) do
6
+ = render(Primer::BoxComponent.new(mr: 2)) do
7
7
  = render(Primer::OcticonComponent.new('person'))
8
- = render(Primer::FlexComponent.new(tag: :address, direction: :column)) do
8
+ = render(Primer::BoxComponent.new(display: :flex, tag: :address, direction: :column)) do
9
9
  = render(Primer::Beta::Text.new(tag: :div, font_weight: :bold)) { @post.user.name }
10
10
 
11
11
  - if @post.image
12
12
  = image_tag main_app.url_for(@post.image.file)
13
13
 
14
- = render(Primer::FlexComponent.new(flex: :auto, direction: [:column, nil, :row, nil])) do
15
- = render(Primer::FlexItemComponent.new(flex_auto: true)) do
14
+ = render(Primer::BoxComponent.new(display: :flex, flex: :auto, direction: [:column, nil, :row, nil])) do
15
+ = render(Primer::BoxComponent.new(flex: :auto)) do
16
16
  = render(Primer::Markdown.new(tag: :article)) do
17
17
  = @post.content.html_safe
@@ -1,7 +1,7 @@
1
- = render Primer::FlexComponent.new(direction: [:column, nil, :row_reverse, nil]) do
1
+ = render Primer::BoxComponent.new(display: :flex, 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
3
3
  = render partial: 'institution', collection: conference.institutions, cached: -> institution { [institution, institution.logo] }
4
- = render Primer::FlexItemComponent.new(flex_auto: true) do
4
+ = render Primer::BoxComponent.new(flex: :auto) do
5
5
  = render(Primer::HeadingComponent.new(tag: :h3, mb: 1)) { link_to conference.name, frontend_conference_path(conference) }
6
6
  %ul.text-secondary.list-style-none.d-flex.flex-column.flex-sm-row.flex-wrap
7
7
  %li.mr-sm-3
@@ -1,12 +1,12 @@
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
1
+ = render Primer::BoxComponent.new(display: :flex, direction: [:column, nil, :row, nil]) do
2
+ = render Primer::BoxComponent.new(mr: [nil, nil, 3, nil], mb: [3, nil, 0, nil], col: [nil, nil, 4, nil]) do
3
3
  = render Primer::Beta::Text.new(tag: :div, font_size: 3, font_weight: :light, mb: 1) do
4
4
  = render Primer::OcticonComponent.new('clock', vertical_align: :baseline)
5
5
  = t :'.times_html', start_time: time_tag(event.start_time, format: :short), finish_time: time_tag(event.finish_time, format: :time)
6
6
  = render Primer::Beta::Text.new(tag: :div, color: :muted) do
7
7
  = render Primer::OcticonComponent.new('location')
8
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
9
+ = render Primer::BoxComponent.new(flex: :auto, col: [nil, nil, 8, nil]) do
10
10
  = render(Primer::HeadingComponent.new(tag: :h3, mb: 1)) { event.name }
11
11
  = render(Primer::Beta::Text.new(tag: :div, color: :muted)) do
12
12
  = event.description
@@ -19,9 +19,9 @@
19
19
  - if @conference.content(:sponsors).present?
20
20
  = render Primer::SubheadComponent.new(spacious: true) do |component|
21
21
  = component.heading(tag: :h2) { t :'.sponsors.title' }
22
- = render Primer::FlexComponent.new(flex_wrap: true, ml: -2, mr: -2, mt: -2, mb: -2) do
22
+ = render Primer::BoxComponent.new(display: :flex, flex_wrap: :wrap, ml: -2, mr: -2, mt: -2, mb: -2) do
23
23
  - repeater @conference.content(:sponsors) do |sponsor|
24
- = render Primer::FlexItemComponent.new(m: 2, vertical_align: :middle) do
24
+ = render Primer::BoxComponent.new(m: 2, vertical_align: :middle) do
25
25
  - if sponsor.content(:logo).present?
26
26
  = link_to sponsor.content(:website) do
27
27
  = sponsor.content.image_tag(:logo, { resize_to_limit: [200, 60] }, draggable: false,
@@ -30,7 +30,7 @@
30
30
  = render(Primer::LinkComponent.new(href: sponsor.content(:website) || '')) { sponsor.content(:name) }
31
31
 
32
32
  - if @conference.content(:gallery).present?
33
- = render Primer::FlexComponent.new(flex_direction: :column, justify_content: :center, align_items: :center, mb: 4, position: :relative,
33
+ = render Primer::BoxComponent.new(display: :flex, flex_direction: :column, justify_content: :center, align_items: :center, mb: 4, position: :relative,
34
34
  data: { controller: :slideshow, slideshow_incrementer: 0, slideshow_advance: true }) do
35
35
  - @conference.content(:gallery).each_with_index do |image, index|
36
36
  = @conference.content.image_tag(image, { resize_to_fill: [1680, 600] }, draggable: false, data: { 'slideshow-target': 'slide' },
@@ -1,4 +1,4 @@
1
- = render Primer::FlexComponent.new(direction: [:column, nil, :row, nil]) do
1
+ = render Primer::BoxComponent.new(display: :flex, direction: [:column, nil, :row, nil]) do
2
2
  = render Primer::BaseComponent.new(tag: :div, flex_shrink: 0, mr: [nil, nil, 3, nil], mb: [3, nil, 0, nil], col: [nil, nil, 3, nil]) do
3
3
  = render Primer::Beta::Text.new(tag: :div, font_size: 3, font_weight: :light, mb: 1) do
4
4
  = render Primer::OcticonComponent.new('clock', vertical_align: :baseline)
@@ -1,6 +1,6 @@
1
1
  - cache [@conference.presentations, @presentation_type, @presentations, @presentations.collect(&:presenters), @tab] do
2
- = render Primer::FlexComponent.new(direction: [:column, nil, nil, :row], my: 4) do
3
- = render Primer::FlexItemComponent.new(pr: [nil, nil, nil, 4], mb: [4, nil, nil, 0], col: [12, nil, nil, 3]) do
2
+ = render Primer::BoxComponent.new(display: :flex, direction: [:column, nil, nil, :row], my: 4) do
3
+ = render Primer::BoxComponent.new(pr: [nil, nil, nil, 4], mb: [4, nil, nil, 0], col: [12, nil, nil, 3]) do
4
4
  %ul.filter-list
5
5
  - cache [@conference.presentations, @presentation_type] do
6
6
  %li
@@ -10,7 +10,7 @@
10
10
  %span.count{ title: t(:'.results') }= @conference.presentations.count
11
11
  = render partial: 'presentation_type', collection: @conference.presentation_types.sorted,
12
12
  cached: -> presentation_type { [presentation_type, @presentation_type] }
13
- = render Primer::FlexItemComponent.new(col: [12, nil, nil, 9]) do
13
+ = render Primer::BoxComponent.new(col: [12, nil, nil, 9]) do
14
14
  - if @presentations.any?
15
15
  %filter-input{ aria: { owns: 'presentation_list' } }
16
16
  .subnav.subnav-flush
@@ -1,12 +1,12 @@
1
- = render Primer::FlexComponent.new(direction: [:column_reverse, nil, :row, nil]) do
2
- = render Primer::FlexItemComponent.new(flex_auto: true, mb: [4, nil, 0, nil]) do
1
+ = render Primer::BoxComponent.new(display: :flex, direction: [:column_reverse, nil, :row, nil]) do
2
+ = render Primer::BoxComponent.new(flex: :auto, mb: [4, nil, 0, nil]) do
3
3
  %filter-input{ aria: { owns: 'conference_list' } }
4
4
  - if @conferences.any?
5
5
  .subnav.subnav-flush
6
6
  .subnav-search.float-left.ml-0
7
7
  = search_field_tag 'search', nil, class: %w[form-control subnav-search-input], aria: { label: t(:'.search') }
8
8
  = render Primer::OcticonComponent.new('search', classes: 'subnav-search-icon')
9
- = render Primer::FlexItemComponent.new(mb: [4, nil, 0, nil]) do
9
+ = render Primer::BoxComponent.new(mb: [4, nil, 0, nil]) do
10
10
  = render Primer::ButtonComponent.new(tag: :a, href: frontend_conferences_url(protocol: :webcal, format: :ics), button_type: :primary,
11
11
  ml: [0, nil, 6, nil]) do
12
12
  = render Primer::OcticonComponent.new('calendar')
@@ -1,6 +1,8 @@
1
- = render(Primer::FlexComponent.new(tag: :li, mr: 4, align_items: :center)) do
2
- = render(Primer::FlexItemComponent.new(mr: 2)) do
3
- = render(Primer::OcticonComponent.new('person'))
4
- = render(Primer::FlexComponent.new(tag: :address, direction: :column)) do
5
- = render(Primer::Beta::Text.new(tag: :div, font_weight: :bold)) { authorship.affiliation.name }
6
- = render(Primer::Beta::Text.new(tag: :div, color: :muted)) { authorship.affiliation.institution.name }
1
+ %li
2
+ = link_to frontend_author_path(authorship.affiliation.author) do
3
+ = render(Primer::BoxComponent.new(display: :flex, tag: :li, mr: 4, align_items: :center)) do
4
+ = render(Primer::BoxComponent.new(mr: 2)) do
5
+ = render(Primer::OcticonComponent.new('person'))
6
+ = render(Primer::BoxComponent.new(display: :flex, tag: :address, direction: :column)) do
7
+ = render(Primer::Beta::Text.new(tag: :div, font_weight: :bold)) { authorship.affiliation.name }
8
+ = render(Primer::Beta::Text.new(tag: :div, color: :muted)) { authorship.affiliation.institution.name }
@@ -8,7 +8,7 @@
8
8
  - if @article.has_content? :attachment
9
9
  %meta{ name: 'DC.Format', scheme: 'IMT', content: 'application/pdf' }
10
10
  %meta{ name: 'DC.Identifier', content: @article.id }
11
- %meta{ name: 'DC.Identifier.URI', content: frontend_issue_article_url(@issue.id, @article.id) }
11
+ %meta{ name: 'DC.Identifier.URI', content: frontend_volume_issue_article_url(@volume.number, @issue.number, @article.number) }
12
12
  - if @article.has_content? :page_range
13
13
  %meta{ name: 'DC.Identifier.pageNumber', content: "#{@article.content(:page_range).first_page}-#{@article.content(:page_range).last_page}" }
14
14
  %meta{ name: 'DC.Language', scheme: 'ISO639-1', content: 'en' }
@@ -37,5 +37,5 @@
37
37
  - if @article.has_content? :page_range
38
38
  %meta{ name: 'citation_firstpage', content: @article.content(:page_range).first_page }
39
39
  %meta{ name: 'citation_lastpage', content: @article.content(:page_range).last_page }
40
- %meta{ name: 'citation_abstract_html_url', content: frontend_issue_article_url(@issue.id, @article.id) }
41
- %meta{ name: 'citation_pdf_url', content: frontend_issue_article_url(@issue.id, @article.id) + '.pdf' }
40
+ %meta{ name: 'citation_abstract_html_url', content: frontend_volume_issue_article_url(@volume.number, @issue.number, @article.number) }
41
+ %meta{ name: 'citation_pdf_url', content: frontend_volume_issue_article_url(@volume.number, @issue.number, @article.number) + '.pdf' }
@@ -3,29 +3,23 @@
3
3
 
4
4
  = render(Primer::HeadingComponent.new(tag: :h1)) { @article.title }
5
5
 
6
- = render(Primer::FlexComponent.new(direction: [:column, nil, :row, nil])) do
7
- = render(Primer::FlexItemComponent.new(flex_auto: true, mr: [nil, nil, 4, nil])) do
6
+ = render(Primer::BoxComponent.new(display: :flex, direction: [:column, nil, nil, :row])) do
7
+ = render(Primer::BoxComponent.new(flex: :auto, mr: [nil, nil, nil, 4], col: [nil, nil, nil, 8])) do
8
8
  %ul.list-style-none.d-flex.flex-column.flex-sm-row.my-2
9
- - @article.affiliations.each do |affiliation|
10
- = render(Primer::FlexComponent.new(tag: :li, mr: 4, align_items: :center)) do
11
- = render(Primer::FlexItemComponent.new(mr: 2)) do
12
- = render(Primer::OcticonComponent.new('person'))
13
- = render(Primer::FlexComponent.new(tag: :address, direction: :column)) do
14
- = render(Primer::Beta::Text.new(tag: :div, font_weight: :bold)) { affiliation.name }
15
- = render(Primer::Beta::Text.new(tag: :div, color: :muted)) { affiliation.institution.name }
9
+ = render partial: 'authorship', collection: @article.authorships.sorted_within_article
16
10
 
17
11
  - if @article.has_content?(:abstract)
18
12
  = render(Primer::HeadingComponent.new(tag: :h2, mt: 4, font_size: 3)) { t '.abstract' }
19
- = render(Primer::Markdown.new) { @article.content.html(:abstract) }
13
+ = render(Primer::Markdown.new) { @article.content.html(:abstract).to_s }
20
14
 
21
- = render(Primer::BorderBoxComponent.new(ml: [nil, nil, 4, nil], style: 'min-width: 20vw')) do |sidebar|
15
+ = render(Primer::BorderBoxComponent.new(ml: [nil, nil, nil, 4], col: [nil, nil, nil, 4])) do |sidebar|
22
16
  - sidebar.body do
23
17
  - if @article.issue.has_content?(:cover_img)
24
18
  = render partial: 'spina/conferences/primer_theme/journal/issues/issue_cover', locals: { issue: @article.issue, cover_img: @article.issue.content(:cover_img), size: [200, 400] }
25
19
  = render(Primer::BorderBoxComponent.new) do |component|
26
20
  - if @article.has_content?(:attachment)
27
21
  - component.row do
28
- = render(Primer::ButtonComponent.new(tag: :a, href: frontend_issue_article_path(@issue, @article, format: :pdf), download: '', scheme: :primary)) do
22
+ = render(Primer::ButtonComponent.new(tag: :a, href: frontend_volume_issue_article_path(@issue.volume.number, @issue.number, @article.number, format: :pdf), download: '', scheme: :primary)) do
29
23
  = render Primer::OcticonComponent.new('download')
30
24
  = t '.download'
31
25
  - component.row do
@@ -37,7 +31,7 @@
37
31
  = render(Primer::Beta::Text.new) do
38
32
  = link_to t('spina.conferences.primer_theme.journal.volume_issue',
39
33
  volume_number: @article.issue.volume.number,
40
- issue_number: @article.issue.number), frontend_issue_path(@article.issue)
34
+ issue_number: @article.issue.number), frontend_volume_issue_path(@article.issue.volume.number, @article.issue.number)
41
35
  - unless @article.doi.blank?
42
36
  - component.row do
43
37
  = render(Primer::HeadingComponent.new(tag: :h2, font_size: 4, color: :muted)) { t '.doi' }
@@ -49,7 +43,11 @@
49
43
  = render(Primer::Beta::Text.new(tag: :div, color: :muted, mt: 1)) do
50
44
  = link_to nil, @article.url
51
45
  - component.row do
52
- = render(Primer::FlexComponent.new(direction: :column)) do
46
+ = render(Primer::HeadingComponent.new(tag: :h2, font_size: 4, color: :muted)) { t '.permalink' }
47
+ = render(Primer::Beta::Text.new(tag: :div, color: :muted, mt: 1)) do
48
+ = link_to nil, frontend_volume_issue_article_url(@volume.number, @issue.number, @article.number)
49
+ - component.row do
50
+ = render(Primer::BoxComponent.new(display: :flex, direction: :column)) do
53
51
  = render(Primer::Beta::Text.new(mb: 2)) do
54
52
  Copyright © #{@article.issue.date.year} #{@article.affiliations.collect(&:name).to_sentence}
55
53
  - unless @licence.nil?
@@ -0,0 +1,9 @@
1
+ = render(Primer::BoxComponent.new(display: :flex, direction: [:column, nil, :row, nil], align_items: [:flex_start, nil, nil, :center])) do
2
+ = render(Primer::BoxComponent.new(mr: 2)) do
3
+ = render(Primer::OcticonComponent.new('person'))
4
+ = render(Primer::BoxComponent.new(flex: :auto)) do
5
+ = link_to frontend_author_path(author) do
6
+ = render(Primer::HeadingComponent.new(tag: :h3, mb: 1)) do
7
+ = author.primary_affiliation.name
8
+ = render(Primer::HeadingComponent.new(tag: :h4, color: :muted, mb: 1)) do
9
+ = author.primary_affiliation.institution.name
@@ -0,0 +1,10 @@
1
+ = render(Primer::BoxComponent.new(display: :flex, direction: [:column, nil, nil, :row])) do
2
+ = render(Primer::BoxComponent.new(col: [nil, nil, nil, 9])) do
3
+ = render(Primer::HeadingComponent.new(tag: :h1)) do
4
+ = @journal.name
5
+ = render(Primer::HeadingComponent.new(tag: :h2, mt: 3)) { t '.authors' }
6
+ - if @authors.any?
7
+ %ul= render partial: 'author', collection: @authors, layout: 'list_item', cached: true
8
+ - else
9
+ = render Primer::BlankslateComponent.new(title: t(:'.no_authors'), icon: 'mortar-board')
10
+ = render 'journal_navigation'
@@ -0,0 +1,20 @@
1
+ = render(Primer::BoxComponent.new(display: :flex, direction: [:column, nil, nil, :row])) do
2
+ = render(Primer::BoxComponent.new(col: [nil, nil, nil, 9])) do
3
+ = render(Primer::HeadingComponent.new(tag: :h1)) do
4
+ = @journal.name
5
+ = render(Primer::HeadingComponent.new(tag: :h2, mt: 2)) do
6
+ = t '.name_institution', name: @author.primary_affiliation.name, institution: @author.primary_affiliation.institution.name
7
+ - if @author.affiliations.count > 1
8
+ = render(Primer::BoxComponent.new) do
9
+ = render(Primer::Beta::Text.new) do
10
+ = t '.aka'
11
+ = @author.affiliations.not_primary.map { |affiliation| t('.name_institution', name: affiliation.name, institution: affiliation.institution.name) }.join(', ')
12
+
13
+ = render(Primer::HeadingComponent.new(tag: :h3, mt: 3)) { t '.articles' }
14
+
15
+ - if @author.articles.any?
16
+ %ul= render partial: 'spina/conferences/primer_theme/journal/issues/article', collection: @author.articles.sorted_asc, layout: 'list_item', cached: true
17
+ - else
18
+ = render Primer::BlankslateComponent.new(title: t(:'.no_articles'), icon: 'mortar-board')
19
+
20
+ = render 'journal_navigation'
@@ -1,7 +1,7 @@
1
- = render(Primer::FlexComponent.new(direction: [:column, nil, :row, nil])) do
2
- = render(Primer::FlexItemComponent.new(flex_auto: true)) do
1
+ = render(Primer::BoxComponent.new(display: :flex, direction: [:column, nil, :row, nil])) do
2
+ = render(Primer::BoxComponent.new(flex: :auto)) do
3
3
  = render(Primer::HeadingComponent.new(tag: :h3, mb: 1)) do
4
- = link_to article.title, frontend_issue_article_path(article.issue, article)
4
+ = link_to article.title, frontend_volume_issue_article_path(article.issue.volume.number, article.issue.number, article.number)
5
5
  = render(Primer::Beta::Text.new(tag: :div, color: :muted)) do
6
6
  = render(Primer::OcticonComponent.new(article.affiliations.many? ? 'people' : 'person'))
7
7
  = render(Primer::BaseComponent.new(tag: :address, display: :inline)) do
@@ -10,6 +10,6 @@
10
10
  = render(Primer::Beta::Text.new(tag: :div, color: :muted)) do
11
11
  = link_to nil, article.doi
12
12
  - if article.has_content?(:attachment)
13
- = render(Primer::ButtonComponent.new(tag: :a, href: frontend_issue_article_path(article.issue, article, format: :pdf), mt: 2, download: '')) do
13
+ = render(Primer::ButtonComponent.new(tag: :a, href: frontend_volume_issue_article_path(article.issue.volume.number, article.issue.number, article.number, format: :pdf), mt: 2, download: '')) do
14
14
  = render Primer::OcticonComponent.new('download')
15
15
  = t '.download'
@@ -1,12 +1,13 @@
1
- = render(Primer::FlexComponent.new(direction: [:column, nil, :row, nil])) do
1
+ = render(Primer::BoxComponent.new(display: :flex, direction: [:column, nil, :row, nil])) do
2
2
  - if issue.content(:cover_img).present?
3
- = render(Primer::FlexItemComponent.new(mr: 4)) do
4
- = render partial: 'issue_cover', locals: { issue: issue, cover_img: issue.content(:cover_img), size: [150, 300] }
5
- = render(Primer::FlexItemComponent.new(flex_auto: true)) do
3
+ = render(Primer::BoxComponent.new(mr: 4)) do
4
+ = link_to frontend_volume_issue_path(issue.volume.number, issue.number) do
5
+ = render partial: 'issue_cover', locals: { issue: issue, cover_img: issue.content(:cover_img), size: [150, 300] }
6
+ = render(Primer::BoxComponent.new(flex: :auto)) do
6
7
  = render(Primer::HeadingComponent.new(tag: :h3, mb: 1)) do
7
8
  = link_to t('spina.conferences.primer_theme.journal.volume_issue',
8
9
  volume_number: issue.volume.number,
9
- issue_number: issue.number), frontend_issue_path(issue)
10
+ issue_number: issue.number), frontend_volume_issue_path(issue.volume.number, issue.number)
10
11
  - unless issue.title.blank?
11
12
  = render(Primer::HeadingComponent.new(tag: :h4, color: :muted, mb: 1)) do
12
13
  = issue.title
@@ -14,4 +15,4 @@
14
15
  = time_tag issue.date, format: :long
15
16
  - if issue.has_content?(:description)
16
17
  = render(Primer::Beta::Text.new(tag: :div, color: :muted, mt: 2)) do
17
- = issue.content.html(:description)
18
+ = issue.content.html(:description).to_s
@@ -1,26 +1,25 @@
1
- = render(Primer::FlexComponent.new(direction: [:column, nil, :row, nil])) do
2
- = render(Primer::FlexComponent.new(direction: :column, flex: :auto)) do
3
- = render(Primer::HeadingComponent.new(tag: :h1)) { @journal.name }
4
- - if @journal.has_content? :description
5
- = render(Primer::Markdown.new(my: 4)) { @journal.content.html(:description) }
6
- = render(Primer::BorderBoxComponent.new(ml: [nil, nil, 4, nil], style: 'min-width: 15vw;')) do |sidebar|
7
- - if @journal.has_content? :logo
8
- - sidebar.header(bg: :primary) do
9
- = render(Primer::FlexItemComponent.new(mb: 4)) do
10
- - cache @journal.content(:logo) do
11
- = image_tag main_app.url_for(@journal.content(:logo).variant(resize_to_limit: [300, 150])),
12
- srcset: srcset(@journal.content(:logo), variant: { resize_to_limit: [300, 150] }),
13
- alt_description: t('.logo'),
14
- draggable: false,
15
- class: 'p-1'
16
- - unless @latest_issue.nil?
17
- - sidebar.row do
18
- = render(Primer::HeadingComponent.new(tag: :h2, font_size: 3)) do
19
- = link_to t('.latest_issue', volume_number: @latest_issue.volume.number, issue_number: @latest_issue.number), frontend_issue_path(@latest_issue)
20
- - if @latest_issue.has_content?(:cover_img)
21
- - sidebar.row do
22
- = link_to(frontend_issue_path(@latest_issue)) do
23
- = render partial: 'issue_cover', locals: { issue: @latest_issue, cover_img: @latest_issue.content(:cover_img), size: [150, 300] }
1
+ = render(Primer::BoxComponent.new(display: :flex, direction: [:column, nil, nil, :row])) do
2
+ = render(Primer::BoxComponent.new(display: :flex, direction: :column, col: [nil, nil, nil, 9])) do
3
+ = render(Primer::BoxComponent.new) do
4
+ = render(Primer::HeadingComponent.new(tag: :h1)) { @journal.name }
5
+ - if @journal.has_content? :description
6
+ = render(Primer::Markdown.new(my: 4)) { @journal.content.html(:description).to_s }
7
+ = render Primer::BoxComponent.new(my: 4, col: [12, nil, 6, nil], float: [nil, nil, :left, nil]) do
8
+ - if @journal.has_content?(:documents) && @journal.content(:documents)&.any?
9
+ = render Primer::SubheadComponent.new do |component|
10
+ = component.heading { t :'.documents.title' }
11
+ %ul
12
+ - @journal.content(:documents).each do |document|
13
+ %li.list-style-none.py-1.d-flex.flex-items-center
14
+ = render(Primer::Beta::Text.new(tag: :div, flex: :auto)) { document.content(:name).presence || t(:'.documents.no_name') }
15
+ - if document.content(:attachment).present?
16
+ = render Primer::ButtonComponent.new(tag: :a, ml: 2, href: main_app.url_for(document.content(:attachment)), download: '') do
17
+ = render Primer::OcticonComponent.new('desktop-download')
18
+ = t :'.documents.download'
19
+ - else
20
+ = render(Primer::Beta::Text.new(tag: :div, font_size: 6, color: :muted)) { t :'.documents.no_file' }
21
+
22
+ = render 'journal_navigation'
24
23
 
25
24
  #journal-issues-list
26
25
  = render(Primer::HeadingComponent.new(tag: :h2, mt: 3)) { t '.all_issues' }
@@ -28,3 +27,8 @@
28
27
  %ul= render partial: 'issue', collection: @issues, layout: 'list_item', cached: true
29
28
  - else
30
29
  = render Primer::BlankslateComponent.new(title: t(:'.no_issues'), icon: 'mortar-board')
30
+
31
+ - if @journal.has_content?(:issn) && !@journal.content(:issn).empty?
32
+ = render(Primer::BoxComponent.new(mt: 4)) do
33
+ = render(Primer::Beta::Text.new(font_weight: :bold)) do
34
+ = t '.issn', issn: @journal.content(:issn)
@@ -1,27 +1,37 @@
1
1
  - cache [@issue, @issue.volume, @issue.articles, @issue.content(:cover_img), @issue.content(:description)] do
2
- - cache [@issue, @issue.volume] do
3
- = render(Primer::HeadingComponent.new(tag: :h1)) do
4
- = t('spina.conferences.primer_theme.journal.volume_issue',
5
- volume_number: @issue.volume.number,
6
- issue_number: @issue.number)
2
+ = render(Primer::BoxComponent.new(display: :flex, direction: [:column, nil, nil, :row])) do
3
+ = render(Primer::BoxComponent.new(mr: [nil, nil, nil, 4], col: [nil, nil, nil, 8])) do
4
+ - cache [@issue, @issue.volume] do
5
+ = render(Primer::HeadingComponent.new(tag: :h1)) do
6
+ = t('spina.conferences.primer_theme.journal.volume_issue',
7
+ volume_number: @issue.volume.number,
8
+ issue_number: @issue.number)
7
9
 
8
- - unless @issue.title.blank?
9
- = render(Primer::HeadingComponent.new(tag: :h2, color: :muted, mb: 2)) { @issue.title }
10
+ - unless @issue.title.blank?
11
+ = render(Primer::HeadingComponent.new(tag: :h2, color: :muted, mb: 2)) { @issue.title }
10
12
 
11
- - if @issue.has_content?(:cover_img)
12
- = render partial: 'issue_cover', locals: { issue: @issue, cover_img: @issue.content(:cover_img), size: [300, 600] }
13
+ - if @issue.has_content?(:description)
14
+ = render(Primer::Markdown.new(my: 4)) do
15
+ = @issue.content.html(:description).to_s
13
16
 
14
- - if @issue.has_content?(:description)
15
- = render(Primer::Markdown.new(my: 4)) do
16
- = @issue.content.html(:description)
17
17
 
18
- - if @issue.has_content?(:attachment)
19
- = render(Primer::ButtonComponent.new(tag: :a, scheme: :primary, href: main_app.url_for(@issue.content(:attachment)), my: 2, download: '')) do
20
- = render Primer::OcticonComponent.new('download')
21
- = t '.download'
18
+ %div#journal-articles-list.border-top
19
+ - if @articles.any?
20
+ %ul= render partial: 'article', collection: @articles.sorted_asc, layout: 'list_item', cached: true
21
+ - else
22
+ = render Primer::BlankslateComponent.new(title: t(:'.no_articles'), icon: 'mortar-board')
22
23
 
23
- %div#journal-articles-list.border-top
24
- - if @articles.any?
25
- %ul= render partial: 'article', collection: @articles.sorted_asc, layout: 'list_item', cached: true
26
- - else
27
- = render Primer::BlankslateComponent.new(title: t(:'.no_articles'), icon: 'mortar-board')
24
+ = render(Primer::BorderBoxComponent.new(ml: [nil, nil, nil, 4], col: [nil, nil, nil, 4])) do |sidebar|
25
+ - sidebar.body do
26
+ - if @issue.has_content?(:cover_img)
27
+ = render partial: 'spina/conferences/primer_theme/journal/issues/issue_cover', locals: { issue: @issue, cover_img: @issue.content(:cover_img), size: [300, 600] }
28
+ = render(Primer::BorderBoxComponent.new) do |component|
29
+ - component.row do
30
+ = render(Primer::HeadingComponent.new(tag: :h2, font_size: 4, color: :muted)) { t '.published' }
31
+ = render(Primer::Beta::Text.new) do
32
+ = time_tag @issue.date, format: :long
33
+ - if @issue.has_content?(:attachment)
34
+ - component.row do
35
+ = render(Primer::ButtonComponent.new(tag: :a, scheme: :primary, href: main_app.url_for(@issue.content(:attachment)), my: 2, download: '')) do
36
+ = render Primer::OcticonComponent.new('download')
37
+ = t '.download'
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- Rails.application.config.primer_view_components.silence_deprecations = true
3
+ Rails.application.config.primer_view_components.silence_deprecations = false
@@ -235,6 +235,11 @@
235
235
  title: 'Information',
236
236
  description: 'Contains general information',
237
237
  parts: %w[text]
238
+ }, {
239
+ name: 'journal_information',
240
+ title: 'Information (Journal)',
241
+ description: 'An information page specifically for the journal section',
242
+ parts: %w[text]
238
243
  }, {
239
244
  name: 'committee',
240
245
  title: 'Committee',
@@ -286,8 +291,13 @@
286
291
  }, {
287
292
  name: 'footer',
288
293
  label: 'Footer'
289
- }, {
290
- name: 'journal'
294
+ }]
295
+
296
+ theme.resources = [{
297
+ name: 'journal',
298
+ label: 'Journal',
299
+ slug: 'journal',
300
+ view_template: 'journal_information'
291
301
  }]
292
302
 
293
303
  theme.plugins = %w[conferences journal conferences-blog]
@@ -1,34 +1,3 @@
1
- # Files in the config/locales directory are used for internationalization
2
- # and are automatically loaded by Rails. If you want to use locales other
3
- # than English, add the necessary files in this directory.
4
- #
5
- # To use the locales, use `I18n.t`:
6
- #
7
- # I18n.t 'hello'
8
- #
9
- # In views, this is aliased to just `t`:
10
- #
11
- # <%= t(:'hello') %>
12
- #
13
- # To use a different locale, set it with `I18n.locale`:
14
- #
15
- # I18n.locale = :es
16
- #
17
- # This would use the information in config/locales/es.yml.
18
- #
19
- # The following keys must be escaped otherwise they will not be retrieved by
20
- # the default I18n backend:
21
- #
22
- # true, false, on, off, yes, no
23
- #
24
- # Instead, surround them with single quotes.
25
- #
26
- # en:
27
- # 'true': 'foo'
28
- #
29
- # To learn more, please read the Rails Internationalization guide
30
- # available at http://guides.rubyonrails.org/i18n.html.
31
-
32
1
  en:
33
2
  layouts:
34
3
  spina:
@@ -101,6 +70,9 @@ en:
101
70
  cookies_footer:
102
71
  cookies: About cookies
103
72
  loading: Loading…
73
+ journal_navigation:
74
+ issues: View issues
75
+ authors: View authors
104
76
 
105
77
  conferences:
106
78
  primer_theme:
@@ -175,6 +147,12 @@ en:
175
147
  logo: Journal logo
176
148
  all_issues: All Issues
177
149
  latest_issue: "Latest Issue (Vol. %{volume_number} Issue %{issue_number})"
150
+ issn: "ISSN: %{issn}"
151
+ documents:
152
+ title: Useful documents
153
+ download: Download
154
+ no_file: No file uploaded.
155
+ no_name: No name.
178
156
  show:
179
157
  no_articles: This issue has no articles.
180
158
  download: Full Issue PDF
@@ -185,11 +163,22 @@ en:
185
163
  download: PDF
186
164
  doi: DOI
187
165
  url: URL
166
+ permalink: Permalink
188
167
  abstract: Abstract
189
168
  published: Published
190
169
  issue: Issue
191
170
  draft: THIS ARTICLE IS A DRAFT
192
171
  licence_logo: Licence logo
172
+ authors:
173
+ index:
174
+ authors: Authors
175
+ no_authors: This journal has no authors.
176
+ show:
177
+ authors: Authors
178
+ articles: Articles
179
+ aka: "Also known as:"
180
+ name_institution: "%{name} (%{institution})"
181
+
193
182
  blog:
194
183
  posts:
195
184
  index:
data/config/routes.rb CHANGED
@@ -10,9 +10,13 @@ Spina::Engine.routes.draw do
10
10
  end
11
11
 
12
12
  namespace :frontend, path: 'journal', module: 'conferences/primer_theme/journal' do
13
- resources :issues, only: %i[index show] do
14
- resources :articles, only: %i[show]
13
+ resources :issues, only: :index
14
+ resources :volumes, only: [], param: :number do
15
+ resources :issues, only: :show, param: :number do
16
+ resources :articles, only: %i[show], param: :number
17
+ end
15
18
  end
19
+ resources :authors, only: %i[index show]
16
20
  end
17
21
 
18
22
  namespace :frontend, as: 'frontend_blog', path: 'blog', module: 'conferences/primer_theme/blog' do
@@ -9,13 +9,13 @@ module Spina
9
9
  app.config.importmap.cache_sweepers << Engine.root.join('app/assets/javascripts')
10
10
  end
11
11
 
12
- config.after_initialize do
13
- Spina::Part.register(Spina::Parts::Conferences::PrimerTheme::Checkbox)
14
- end
15
-
16
12
  config.to_prepare do
17
13
  ::Spina::PagesController.helper 'spina/conferences/primer_theme/application'
18
14
  end
15
+
16
+ config.after_initialize do
17
+ Spina::Part.register(Spina::Parts::Conferences::PrimerTheme::Checkbox)
18
+ end
19
19
  end
20
20
  end
21
21
  end
@@ -3,7 +3,7 @@
3
3
  module Spina
4
4
  module Conferences
5
5
  module PrimerTheme
6
- VERSION = '1.0.0.rc1'
6
+ VERSION = '1.0.0.rc2'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spina-conferences-primer_theme-fork
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc1
4
+ version: 1.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Malčić
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-01-30 00:00:00.000000000 Z
12
+ date: 2022-01-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: babel-transpiler
@@ -73,14 +73,14 @@ dependencies:
73
73
  requirements:
74
74
  - - '='
75
75
  - !ruby/object:Gem::Version
76
- version: 0.0.66
76
+ version: 0.0.67
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - '='
82
82
  - !ruby/object:Gem::Version
83
- version: 0.0.66
83
+ version: 0.0.67
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: rails
86
86
  requirement: !ruby/object:Gem::Requirement
@@ -333,6 +333,7 @@ files:
333
333
  - app/controllers/spina/conferences/primer_theme/conferences/presentations_controller.rb
334
334
  - app/controllers/spina/conferences/primer_theme/journal/application_controller.rb
335
335
  - app/controllers/spina/conferences/primer_theme/journal/articles_controller.rb
336
+ - app/controllers/spina/conferences/primer_theme/journal/authors_controller.rb
336
337
  - app/controllers/spina/conferences/primer_theme/journal/issues_controller.rb
337
338
  - app/helpers/spina/conferences/primer_theme/application_helper.rb
338
339
  - app/helpers/spina/conferences/primer_theme/asset_helper.rb
@@ -345,6 +346,7 @@ files:
345
346
  - app/views/conferences_primer_theme/pages/events.html.haml
346
347
  - app/views/conferences_primer_theme/pages/homepage.html.haml
347
348
  - app/views/conferences_primer_theme/pages/information.html.haml
349
+ - app/views/conferences_primer_theme/pages/journal_information.html.haml
348
350
  - app/views/conferences_primer_theme/pages/periodical.html.haml
349
351
  - app/views/conferences_primer_theme/pages/show.html.haml
350
352
  - app/views/conferences_primer_theme/partials/_event.html.haml
@@ -355,6 +357,7 @@ files:
355
357
  - app/views/layouts/spina/conferences/primer_theme/conferences/conferences.html.haml
356
358
  - app/views/layouts/spina/conferences/primer_theme/conferences/presentations.html.haml
357
359
  - app/views/layouts/spina/conferences/primer_theme/journal/articles.html.haml
360
+ - app/views/layouts/spina/conferences/primer_theme/journal/authors.html.haml
358
361
  - app/views/layouts/spina/conferences/primer_theme/journal/issues.html.haml
359
362
  - app/views/spina/admin/layout_partables/texts/_form.html.haml
360
363
  - app/views/spina/admin/parts/conferences/primer_theme/checkboxes/_form.html.haml
@@ -365,6 +368,7 @@ files:
365
368
  - app/views/spina/application/_cookies_footer.html.haml
366
369
  - app/views/spina/application/_footer.html.haml
367
370
  - app/views/spina/application/_google_site_verification.html.haml
371
+ - app/views/spina/application/_journal_navigation.html.haml
368
372
  - app/views/spina/application/_list_item.html.haml
369
373
  - app/views/spina/application/_logo.html.haml
370
374
  - app/views/spina/application/_mobile_navigation_item.html.haml
@@ -403,6 +407,9 @@ files:
403
407
  - app/views/spina/conferences/primer_theme/journal/articles/_authorship.html.haml
404
408
  - app/views/spina/conferences/primer_theme/journal/articles/_metadata.html.haml
405
409
  - app/views/spina/conferences/primer_theme/journal/articles/show.html.haml
410
+ - app/views/spina/conferences/primer_theme/journal/authors/_author.html.haml
411
+ - app/views/spina/conferences/primer_theme/journal/authors/index.html.haml
412
+ - app/views/spina/conferences/primer_theme/journal/authors/show.html.haml
406
413
  - app/views/spina/conferences/primer_theme/journal/issues/_article.html.haml
407
414
  - app/views/spina/conferences/primer_theme/journal/issues/_issue.html.haml
408
415
  - app/views/spina/conferences/primer_theme/journal/issues/_issue_cover.html.haml