spina-conferences-primer_theme 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0f415891da36813f4af78fc54b98daf3e34d1b22853995c7887944757055c05
4
- data.tar.gz: 6f8414d707ea3695ef12e342bb514f04fa667a5fa6f427a3679e9c465992527d
3
+ metadata.gz: a8a85cdf19e437cc1bcfbbac3a0410c9936c7937e0fad5cfd43b69d50e220142
4
+ data.tar.gz: e61eb65c953c3c0f960594b433bbc053a0d6e3c4f78968bd61cfb60f01e11d14
5
5
  SHA512:
6
- metadata.gz: 62789ffa15b959d63a2a6d7cef661fcc3870d3437ca4e23de0dc55496a597a054bdab0de720ba067b59eeb7685108079717b6c7c335139298f3ddf784b03ddf2
7
- data.tar.gz: bcbb08ea4e23752dc6bb8c7d90111701cd0c65ddd1139c549c42fae19b33b75c2391086578a9db9352fa536a4829ac3ddbf675d8b047907251dd3b5e8ee6323e
6
+ metadata.gz: e79f15190f9f206e35e50d073d88e1db00ee4b7b7fe68b890df6f0912e439a449a2ab74d14b1847b9d16348e4704778102b9391aa143d67366310ca7bae0598e
7
+ data.tar.gz: b7d8086273db0c61bf6734c3ef2bb299b46539f634e2b1dafcf2dd730c7e343baee10b1199bb3c7efdc766ef268b3451465b5c1b1c72c9aeb27259fcb0f75b4a
@@ -13,6 +13,7 @@ module Spina
13
13
  def index
14
14
  # having multiple journals is not currently allowed anyway
15
15
  @issues = Admin::Journal::Issue.sorted_desc
16
+ @latest_issue = @issues.find_by 'date <= ?', Time.zone.today
16
17
  end
17
18
 
18
19
  def show
@@ -1,13 +1,12 @@
1
- - cache navigation_item do
2
- .Header-item.mr-0.border-top.border-white-fade-15.flex-column.flex-items-stretch
3
- - if navigation_item.has_children?
4
- %details.details-reset
5
- %summary.Header-link.py-2
6
- = navigation_item.menu_title
7
- = render Primer::OcticonComponent.new('chevron-down')
8
- %ul.list-style-none
9
- - navigation_item.children.each do |child|
10
- %li= link_to child.menu_title, child.materialized_path, class: %w[d-block py-2 pl-3 border-top border-white-fade color-text-white]
11
- - elsif navigation_item.is_root?
12
- = link_to navigation_item.menu_title, navigation_item.materialized_path,
13
- class: %w[Header-link py-2]
1
+ .Header-item.mr-0.border-top.border-white-fade-15.flex-column.flex-items-stretch
2
+ - if navigation_item.has_children?
3
+ %details.details-reset
4
+ %summary.Header-link.py-2
5
+ = navigation_item.menu_title
6
+ = render Primer::OcticonComponent.new('chevron-down')
7
+ %ul.list-style-none
8
+ - navigation_item.children.each do |child|
9
+ %li= link_to child.menu_title, child.materialized_path, class: %w[d-block py-2 pl-3 border-top border-white-fade color-text-white]
10
+ - elsif navigation_item.is_root?
11
+ = link_to navigation_item.menu_title, navigation_item.materialized_path,
12
+ class: %w[Header-link py-2]
@@ -1,3 +1,3 @@
1
1
  %nav.d-flex.flex-column.flex-self-stretch
2
- = render partial: 'mobile_navigation_item', collection: main_navigation_items, cached: true, as: :navigation_item
2
+ = render partial: 'mobile_navigation_item', collection: main_navigation_items, as: :navigation_item, cache: -> navigation_item { [navigation_item, navigation_item.children] }
3
3
  .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]
@@ -6,6 +6,6 @@
6
6
  = render Primer::OcticonComponent.new('three-bars', height: 24)
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
- = render partial: 'navigation_item', collection: main_navigation_items, cached: true
9
+ = render partial: 'navigation_item', collection: main_navigation_items, cache: -> navigation_item { [navigation_item, navigation_item.children] }
10
10
  .Header-item.d-none.d-lg-flex= link_to 'Journal', frontend_issues_path, class: %w[Header-link]
11
11
  .Header-item.d-none.d-lg-flex= link_to 'Conferences', frontend_conferences_path, class: %w[Header-link]
@@ -1,12 +1,11 @@
1
- - cache navigation_item do
2
- .Header-item.position-relative.d-none.d-lg-flex
3
- - if navigation_item.has_children? && navigation_item.children.regular_pages.in_menu.live.sorted.any?
4
- %details.details-reset.details-overlay
5
- %summary.Header-link{ role: 'button', aria: { haspopup: 'menu' } }
6
- = navigation_item.menu_title
7
- = render Primer::OcticonComponent.new('chevron-down')
8
- %ul.dropdown-menu.dropdown-menu-sw
9
- - navigation_item.children.regular_pages.in_menu.live.sorted.each do |child|
10
- %li= link_to child.menu_title, child.materialized_path, class: 'dropdown-item'
11
- - elsif navigation_item.is_root?
12
- = link_to navigation_item.menu_title, navigation_item.materialized_path, class: %w[Header-link]
1
+ .Header-item.position-relative.d-none.d-lg-flex
2
+ - if navigation_item.has_children? && navigation_item.children.regular_pages.in_menu.live.sorted.any?
3
+ %details.details-reset.details-overlay
4
+ %summary.Header-link{ role: 'button', aria: { haspopup: 'menu' } }
5
+ = navigation_item.menu_title
6
+ = render Primer::OcticonComponent.new('chevron-down')
7
+ %ul.dropdown-menu.dropdown-menu-sw
8
+ - navigation_item.children.regular_pages.in_menu.live.sorted.each do |child|
9
+ %li= link_to child.menu_title, child.materialized_path, class: 'dropdown-item'
10
+ - elsif navigation_item.is_root?
11
+ = link_to navigation_item.menu_title, navigation_item.materialized_path, class: %w[Header-link]
@@ -1,50 +1,60 @@
1
- = render(Primer::HeadingComponent.new) { @article.title }
1
+ - cache [@article, @article.authorships, @article.affiliations, @article.content(:abstract), @article.issue, @article.issue.volume, @article.issue.content(:cover_img)] do
2
+ = render(Primer::HeadingComponent.new) { @article.title }
2
3
 
3
- = render(Primer::FlexComponent.new(direction: [:column, nil, :row, nil])) do
4
- = render(Primer::FlexItemComponent.new(flex_auto: true, mr: [nil, nil, 4, nil])) do
5
- %ul.list-style-none.d-flex.flex-column.flex-sm-row.my-2
6
- - @article.affiliations.each do |affiliation|
7
- = render(Primer::FlexComponent.new(tag: :li, mr: 4, align_items: :center)) do
8
- = render(Primer::FlexItemComponent.new(mr: 2)) do
9
- = render(Primer::OcticonComponent.new('person'))
10
- = render(Primer::FlexComponent.new(tag: :address, direction: :column)) do
11
- = render(Primer::TextComponent.new(tag: :div, font_weight: :bold)) { affiliation.name }
12
- = render(Primer::TextComponent.new(tag: :div, color: :text_secondary)) { affiliation.institution.name }
4
+ = render(Primer::FlexComponent.new(direction: [:column, nil, :row, nil])) do
5
+ = render(Primer::FlexItemComponent.new(flex_auto: true, mr: [nil, nil, 4, nil])) do
6
+ %ul.list-style-none.d-flex.flex-column.flex-sm-row.my-2
7
+ - @article.affiliations.each do |affiliation|
8
+ = render(Primer::FlexComponent.new(tag: :li, mr: 4, align_items: :center)) do
9
+ = render(Primer::FlexItemComponent.new(mr: 2)) do
10
+ = render(Primer::OcticonComponent.new('person'))
11
+ = render(Primer::FlexComponent.new(tag: :address, direction: :column)) do
12
+ = render(Primer::TextComponent.new(tag: :div, font_weight: :bold)) { affiliation.name }
13
+ = render(Primer::TextComponent.new(tag: :div, color: :text_secondary)) { affiliation.institution.name }
13
14
 
14
- - if @article.has_content?(:abstract)
15
- = render(Primer::HeadingComponent.new(tag: :h2, mt: 4, font_size: 3)) { t '.abstract' }
16
- = render(Primer::MarkdownComponent.new) { @article.content.html(:abstract) }
15
+ - if @article.has_content?(:abstract)
16
+ = render(Primer::HeadingComponent.new(tag: :h2, mt: 4, font_size: 3)) { t '.abstract' }
17
+ = render(Primer::MarkdownComponent.new) { @article.content.html(:abstract) }
17
18
 
18
- = render(Primer::BorderBoxComponent.new(ml: [nil, nil, 4, nil])) do |sidebar|
19
- - sidebar.body do
20
- - if @article.issue.has_content?(:cover_img)
21
- = render partial: 'spina/journal/primer_theme/issues/issue_cover', locals: { issue: @article.issue, cover_img: @article.issue.content(:cover_img), size: [200, 400] }
22
- = render(Primer::BorderBoxComponent.new) do |component|
23
- - if @article.has_content?(:attachment)
19
+ = render(Primer::BorderBoxComponent.new(ml: [nil, nil, 4, nil], style: 'min-width: 20vw')) do |sidebar|
20
+ - sidebar.body do
21
+ - if @article.issue.has_content?(:cover_img)
22
+ = render partial: 'spina/conferences/primer_theme/journal/issues/issue_cover', locals: { issue: @article.issue, cover_img: @article.issue.content(:cover_img), size: [200, 400] }
23
+ = render(Primer::BorderBoxComponent.new) do |component|
24
+ - if @article.has_content?(:attachment)
25
+ - component.row do
26
+ = render(Primer::ButtonComponent.new(tag: :a, href: main_app.url_for(@article.content(:attachment)), download: '', scheme: :primary)) do
27
+ = render Primer::OcticonComponent.new('download')
28
+ = t '.download'
24
29
  - component.row do
25
- = render(Primer::ButtonComponent.new(tag: :a, href: main_app.url_for(@article.content(:attachment)), download: '', scheme: :primary)) do
26
- = render Primer::OcticonComponent.new('download')
27
- = t '.download'
28
- - component.row do
29
- = render(Primer::HeadingComponent.new(tag: :h2, font_size: 4, color: :text_secondary)) { t '.published' }
30
- = render(Primer::TextComponent.new) do
31
- = time_tag @article.issue.date, format: :long
32
- - component.row do
33
- = render(Primer::HeadingComponent.new(tag: :h2, font_size: 4, color: :text_secondary)) { t '.issue' }
34
- = render(Primer::TextComponent.new) do
35
- = link_to t('spina.journal.primer_theme.volume_issue',
36
- volume_number: @article.issue.volume.number,
37
- issue_number: @article.issue.number), frontend_issue_path(@article.issue)
38
- - unless @article.doi.blank?
39
- = component.row do
40
- = render(Primer::HeadingComponent.new(tag: :h2, font_size: 4, color: :text_secondary)) { t '.doi' }
41
- = render(Primer::TextComponent.new(tag: :div, color: :text_secondary, mt: 1)) do
42
- = link_to nil, @article.doi
43
- - unless @article.url.blank?
44
- = component.row do
45
- = render(Primer::HeadingComponent.new(tag: :h2, font_size: 4, color: :text_secondary)) { t '.url' }
46
- = render(Primer::TextComponent.new(tag: :div, color: :text_secondary, mt: 1)) do
47
- = link_to nil, @article.url
48
- - if @article.draft?
49
- = component.row do
50
- = render(Primer::TextComponent.new(tag: :div, color: :text_danger, font_weight: :bold)) { t '.draft' }
30
+ = render(Primer::HeadingComponent.new(tag: :h2, font_size: 4, color: :text_secondary)) { t '.published' }
31
+ = render(Primer::TextComponent.new) do
32
+ = time_tag @article.issue.date, format: :long
33
+ - component.row do
34
+ = render(Primer::HeadingComponent.new(tag: :h2, font_size: 4, color: :text_secondary)) { t '.issue' }
35
+ = render(Primer::TextComponent.new) do
36
+ = link_to t('spina.conferences.primer_theme.journal.volume_issue',
37
+ volume_number: @article.issue.volume.number,
38
+ issue_number: @article.issue.number), frontend_issue_path(@article.issue)
39
+ - unless @article.doi.blank?
40
+ - component.row do
41
+ = render(Primer::HeadingComponent.new(tag: :h2, font_size: 4, color: :text_secondary)) { t '.doi' }
42
+ = render(Primer::TextComponent.new(tag: :div, color: :text_secondary, mt: 1)) do
43
+ = link_to nil, @article.doi
44
+ - unless @article.url.blank?
45
+ - component.row do
46
+ = render(Primer::HeadingComponent.new(tag: :h2, font_size: 4, color: :text_secondary)) { t '.url' }
47
+ = render(Primer::TextComponent.new(tag: :div, color: :text_secondary, mt: 1)) do
48
+ = link_to nil, @article.url
49
+ - component.row do
50
+ -# TODO: allow user to select licence
51
+ = render(Primer::FlexComponent.new(direction: :column)) do
52
+ = render(Primer::TextComponent.new(mb: 2)) do
53
+ Copyright #{@article.issue.date.year} #{@article.affiliations.collect(&:name).to_sentence}
54
+ %a{ rel: 'licence', href: 'https://creativecommons.org/licenses/by/4.0/' }
55
+ %img{ alt: 'Creative Commons Attribution 4.0 International Licence', src: '//i.creativecommons.org/l/by/4.0/88x31.png' }
56
+ = render(Primer::TextComponent.new(mt: 1)) { t '.cc_by_licence_html' }
57
+
58
+ - if @article.draft?
59
+ - component.row do
60
+ = render(Primer::TextComponent.new(tag: :div, color: :text_danger, font_weight: :bold)) { t '.draft' }
@@ -3,12 +3,12 @@
3
3
  = render(Primer::FlexItemComponent.new(mr: 4)) do
4
4
  = render partial: 'issue_cover', locals: { issue: issue, cover_img: issue.content(:cover_img), size: [150, 300] }
5
5
  = render(Primer::FlexItemComponent.new(flex_auto: true)) do
6
- = render(Primer::HeadingComponent.new(tag: :h2, mb: 1)) do
6
+ = render(Primer::HeadingComponent.new(tag: :h3, mb: 1)) do
7
7
  = link_to t('spina.conferences.primer_theme.journal.volume_issue',
8
8
  volume_number: issue.volume.number,
9
9
  issue_number: issue.number), frontend_issue_path(issue)
10
10
  - unless issue.title.blank?
11
- = render(Primer::HeadingComponent.new(tag: :h3, color: :text_secondary, mb: 1)) do
11
+ = render(Primer::HeadingComponent.new(tag: :h4, color: :text_secondary, mb: 1)) do
12
12
  = issue.title
13
13
  = render(Primer::TextComponent.new(tag: :div, color: :text_secondary, font_weight: :bold)) do
14
14
  = time_tag issue.date, format: :long
@@ -1,10 +1,30 @@
1
- = render(Primer::HeadingComponent.new) { @journal.name }
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) { @journal.name }
4
+ - if @journal.has_content? :description
5
+ = render(Primer::MarkdownComponent.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] }
2
24
 
3
- - if @journal.content(:description).present?
4
- = render(Primer::MarkdownComponent.new(mt: 4)) { @journal.content.html(:description) }
5
-
6
- %div#journal-issues-list.border-top
25
+ #journal-issues-list
26
+ = render(Primer::HeadingComponent.new(tag: :h2, mt: 3)) { t '.all_issues' }
7
27
  - if @issues.any?
8
- %ul= render partial: 'issue', collection: @issues, layout: 'list_item'
28
+ %ul= render partial: 'issue', collection: @issues, layout: 'list_item', cached: true
9
29
  - else
10
30
  = render Primer::BlankslateComponent.new(title: t(:'.no_issues'), icon: 'mortar-board')
@@ -1,18 +1,27 @@
1
- = render(Primer::HeadingComponent.new) do
2
- = t('spina.conferences.primer_theme.journal.volume_issue', volume_number: @issue.volume.number, issue_number: @issue.number)
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) do
4
+ = t('spina.conferences.primer_theme.journal.volume_issue',
5
+ volume_number: @issue.volume.number,
6
+ issue_number: @issue.number)
3
7
 
4
- - unless @issue.title.blank?
5
- = render(Primer::HeadingComponent.new(tag: :h2, color: :text_secondary, mb: 2)) { @issue.title }
8
+ - unless @issue.title.blank?
9
+ = render(Primer::HeadingComponent.new(tag: :h2, color: :text_secondary, mb: 2)) { @issue.title }
6
10
 
7
- - if @issue.has_content?(:cover_img)
8
- = render partial: 'issue_cover', locals: { issue: @issue, cover_img: @issue.content(:cover_img), size: [300, 600] }
11
+ - if @issue.has_content?(:cover_img)
12
+ = render partial: 'issue_cover', locals: { issue: @issue, cover_img: @issue.content(:cover_img), size: [300, 600] }
9
13
 
10
- - if @issue.has_content?(:description)
11
- = render(Primer::MarkdownComponent.new(my: 4)) do
12
- = @issue.content.html(:description)
14
+ - if @issue.has_content?(:description)
15
+ = render(Primer::MarkdownComponent.new(my: 4)) do
16
+ = @issue.content.html(:description)
13
17
 
14
- %div#journal-articles-list.border-top
15
- - if @articles.any?
16
- %ul= render partial: 'article', collection: @articles.sorted_asc, layout: 'list_item'
17
- - else
18
- = render Primer::BlankslateComponent.new(title: t(:'.no_articles'), icon: 'mortar-board')
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'
22
+
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')
@@ -167,8 +167,11 @@ en:
167
167
  index:
168
168
  no_issues: This journal has no issues.
169
169
  logo: Journal logo
170
+ all_issues: All Issues
171
+ latest_issue: "Latest Issue (Vol. %{volume_number} Issue %{issue_number})"
170
172
  show:
171
173
  no_articles: This issue has no articles.
174
+ download: Full Issue PDF
172
175
  article:
173
176
  download: PDF
174
177
  articles:
@@ -180,6 +183,7 @@ en:
180
183
  published: Published
181
184
  issue: Issue
182
185
  draft: THIS ARTICLE IS A DRAFT
186
+ cc_by_licence_html: This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
183
187
 
184
188
  languages:
185
189
  en-GB: British English
@@ -3,7 +3,7 @@
3
3
  module Spina
4
4
  module Conferences
5
5
  module PrimerTheme
6
- VERSION = '0.5.0'
6
+ VERSION = '0.5.1'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spina-conferences-primer_theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Malčić
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-24 00:00:00.000000000 Z
11
+ date: 2021-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: babel-transpiler
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 0.4.0
117
+ version: 0.4.2
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 0.4.0
124
+ version: 0.4.2
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: capybara
127
127
  requirement: !ruby/object:Gem::Requirement