spina-conferences-primer_theme-fork 0.10.0 → 1.0.0.rc4
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.
- checksums.yaml +4 -4
- data/README.md +60 -12
- data/app/assets/builds/spina/conferences/primer_theme/application.css +25964 -0
- data/app/assets/config/spina_conferences_primer_theme_manifest.js +7 -4
- data/app/assets/javascripts/spina/conferences/primer_theme/application.js +6 -7
- data/app/assets/javascripts/spina/conferences/primer_theme/controllers/application.js +10 -0
- data/app/assets/javascripts/spina/conferences/primer_theme/controllers/index.js +5 -0
- data/app/assets/javascripts/spina/conferences/primer_theme/controllers/{slideshow_controller.es6 → slideshow_controller.js} +14 -4
- data/app/assets/stylesheets/spina/conferences/primer_theme/application.sass +1 -1
- data/app/controllers/spina/conferences/primer_theme/blog/application_controller.rb +11 -0
- data/app/controllers/spina/conferences/primer_theme/blog/categories_controller.rb +0 -10
- data/app/controllers/spina/conferences/primer_theme/blog/posts_controller.rb +0 -15
- data/app/controllers/spina/conferences/primer_theme/conferences/application_controller.rb +13 -0
- data/app/controllers/spina/conferences/primer_theme/journal/application_controller.rb +12 -0
- data/app/controllers/spina/conferences/primer_theme/journal/articles_controller.rb +13 -7
- data/app/controllers/spina/conferences/primer_theme/journal/authors_controller.rb +48 -0
- data/app/controllers/spina/conferences/primer_theme/journal/issues_controller.rb +11 -4
- data/app/helpers/spina/conferences/primer_theme/application_helper.rb +20 -1
- data/app/helpers/spina/conferences/primer_theme/navigations_helper.rb +13 -0
- data/app/views/conferences_primer_theme/pages/about.html.haml +16 -10
- data/app/views/conferences_primer_theme/pages/committee.html.haml +8 -6
- data/app/views/conferences_primer_theme/pages/embedded_form.html.haml +1 -1
- data/app/views/conferences_primer_theme/pages/events.html.haml +11 -5
- data/app/views/conferences_primer_theme/pages/information.html.haml +1 -1
- data/app/views/conferences_primer_theme/pages/journal_information.html.haml +10 -0
- data/app/views/conferences_primer_theme/pages/periodical.html.haml +8 -8
- data/app/views/conferences_primer_theme/partials/_event.html.haml +2 -2
- data/app/views/conferences_primer_theme/partials/_homepage_item.html.haml +1 -1
- data/app/views/layouts/conferences_primer_theme/application.html.haml +1 -1
- data/app/views/layouts/spina/conferences/primer_theme/application.html.haml +7 -14
- data/app/views/layouts/spina/conferences/primer_theme/journal/articles.html.haml +3 -0
- data/app/views/layouts/spina/conferences/primer_theme/journal/authors.html.haml +5 -0
- data/app/views/layouts/spina/conferences/primer_theme/journal/issues.html.haml +3 -0
- data/app/views/spina/application/_admin_bar.html.haml +7 -0
- data/app/views/spina/application/_alert.html.haml +4 -0
- data/app/views/spina/application/_analytics.html.erb +10 -0
- data/app/views/spina/application/_cookies.html.haml +8 -7
- data/app/views/spina/application/_cookies_footer.html.haml +15 -0
- data/app/views/spina/application/_footer.html.haml +21 -13
- data/app/views/spina/application/_google_site_verification.html.haml +1 -0
- data/app/views/spina/application/_journal_navigation.html.haml +17 -0
- data/app/views/spina/application/_mobile_navigation_items.html.haml +0 -3
- data/app/views/spina/application/_navigation.html.haml +1 -4
- data/app/views/spina/conferences/primer_theme/blog/categories/show.html.haml +5 -3
- data/app/views/spina/conferences/primer_theme/blog/posts/_post.html.haml +3 -2
- data/app/views/spina/conferences/primer_theme/blog/posts/index.html.haml +5 -3
- data/app/views/spina/conferences/primer_theme/blog/posts/show.html.haml +5 -5
- data/app/views/spina/conferences/primer_theme/conferences/conferences/_conference.html.haml +2 -2
- data/app/views/spina/conferences/primer_theme/conferences/conferences/_event.html.haml +3 -3
- data/app/views/spina/conferences/primer_theme/conferences/conferences/_events.html.haml +6 -3
- data/app/views/spina/conferences/primer_theme/conferences/conferences/_header.html.haml +3 -3
- data/app/views/spina/conferences/primer_theme/conferences/conferences/_presentation.html.haml +1 -1
- data/app/views/spina/conferences/primer_theme/conferences/conferences/_presentations.html.haml +9 -6
- data/app/views/spina/conferences/primer_theme/conferences/conferences/_submission_flash.html.haml +2 -2
- data/app/views/spina/conferences/primer_theme/conferences/conferences/index.html.haml +9 -6
- data/app/views/spina/conferences/primer_theme/conferences/conferences/show.html.haml +8 -4
- data/app/views/spina/conferences/primer_theme/journal/articles/_authorship.html.haml +8 -6
- data/app/views/spina/conferences/primer_theme/journal/articles/_metadata.html.haml +7 -7
- data/app/views/spina/conferences/primer_theme/journal/articles/show.html.haml +12 -14
- data/app/views/spina/conferences/primer_theme/journal/authors/_author.html.haml +9 -0
- data/app/views/spina/conferences/primer_theme/journal/authors/index.html.haml +12 -0
- data/app/views/spina/conferences/primer_theme/journal/authors/show.html.haml +22 -0
- data/app/views/spina/conferences/primer_theme/journal/issues/_article.html.haml +4 -4
- data/app/views/spina/conferences/primer_theme/journal/issues/_issue.html.haml +7 -6
- data/app/views/spina/conferences/primer_theme/journal/issues/index.html.haml +30 -24
- data/app/views/spina/conferences/primer_theme/journal/issues/show.html.haml +33 -21
- data/config/initializers/importmap.rb +21 -0
- data/config/initializers/primer.rb +1 -1
- data/config/initializers/themes/conferences_primer_theme.rb +14 -2
- data/config/locales/en.yml +21 -32
- data/config/routes.rb +6 -2
- data/lib/spina/conferences/primer_theme/engine.rb +6 -2
- data/lib/spina/conferences/primer_theme/version.rb +1 -1
- data/lib/spina/conferences/primer_theme.rb +10 -2
- metadata +53 -25
- data/app/views/spina/application/_current_conference_alert.html.haml +0 -4
- data/app/views/spina/application/_footer_content.html.haml +0 -13
@@ -1,9 +1,12 @@
|
|
1
|
-
//=
|
2
|
-
|
3
|
-
//=
|
4
|
-
//= link
|
1
|
+
//= link spina/conferences/primer_theme/application.css
|
2
|
+
|
3
|
+
//= link_directory ../javascripts/spina/conferences/primer_theme/controllers .js
|
4
|
+
//= link spina/conferences/primer_theme/application.js
|
5
5
|
|
6
6
|
//= link @github/details-dialog-element/dist/index.js
|
7
7
|
//= link @github/include-fragment-element/dist/index.js
|
8
8
|
//= link @github/filter-input-element/dist/index.js
|
9
9
|
//= link @github/details-menu-element/dist/index.js
|
10
|
+
|
11
|
+
//= link spina_admin_conferences_manifest.js
|
12
|
+
//= link spina_admin_journal_manifest.js
|
@@ -1,7 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
application.register('slideshow', SlideshowController)
|
1
|
+
import '@hotwired/turbo-rails'
|
2
|
+
import '@github/details-dialog-element'
|
3
|
+
import '@github/include-fragment-element'
|
4
|
+
import '@github/filter-input-element'
|
5
|
+
import '@github/details-menu-element'
|
6
|
+
import 'controllers'
|
@@ -1,5 +1,6 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import { Controller } from '@hotwired/stimulus'
|
2
|
+
|
3
|
+
export default class SlideshowController extends Controller {
|
3
4
|
static get targets() {
|
4
5
|
return [
|
5
6
|
/**
|
@@ -35,7 +36,7 @@ class SlideshowController extends Stimulus.Controller {
|
|
35
36
|
* @return {Number} The value for the delay.
|
36
37
|
*/
|
37
38
|
get delay() {
|
38
|
-
return this.data.has('delay')
|
39
|
+
return this.data.has('delay')
|
39
40
|
? Number.parseInt(this.data.get('delay'))
|
40
41
|
: 10000
|
41
42
|
}
|
@@ -55,8 +56,15 @@ class SlideshowController extends Stimulus.Controller {
|
|
55
56
|
*/
|
56
57
|
connect() {
|
57
58
|
this.showSlide()
|
59
|
+
this.resetInterval()
|
60
|
+
}
|
61
|
+
|
62
|
+
resetInterval() {
|
58
63
|
if (this.data.has('advance')) {
|
59
|
-
|
64
|
+
if (this.intervalId) {
|
65
|
+
clearInterval(this.intervalId)
|
66
|
+
}
|
67
|
+
this.intervalId = setInterval(() => this.next(), this.delay)
|
60
68
|
}
|
61
69
|
}
|
62
70
|
|
@@ -73,6 +81,7 @@ class SlideshowController extends Stimulus.Controller {
|
|
73
81
|
* @private
|
74
82
|
*/
|
75
83
|
next() {
|
84
|
+
this.resetInterval()
|
76
85
|
const incrementer = this.incrementer
|
77
86
|
this.incrementer = incrementer === this.slideTargets.length - 1 ? 0 : incrementer + 1
|
78
87
|
}
|
@@ -82,6 +91,7 @@ class SlideshowController extends Stimulus.Controller {
|
|
82
91
|
* @private
|
83
92
|
*/
|
84
93
|
previous() {
|
94
|
+
this.resetInterval()
|
85
95
|
const incrementer = this.incrementer
|
86
96
|
this.incrementer = incrementer === 0 ? this.slideTargets.length - 1 : incrementer - 1
|
87
97
|
}
|
@@ -7,6 +7,9 @@ module Spina
|
|
7
7
|
# Base class from which controllers related to the blog plugin inherit
|
8
8
|
class ApplicationController < ::Spina::ApplicationController
|
9
9
|
include ::Spina::Frontend
|
10
|
+
|
11
|
+
before_action :page
|
12
|
+
|
10
13
|
def cookies_info
|
11
14
|
render partial: 'cookies'
|
12
15
|
end
|
@@ -16,6 +19,14 @@ module Spina
|
|
16
19
|
def theme_layout
|
17
20
|
'layouts/spina/conferences/primer_theme/blog/blog'
|
18
21
|
end
|
22
|
+
|
23
|
+
def page
|
24
|
+
@page = Spina::Page.find_or_create_by name: 'blog' do |page|
|
25
|
+
page.title = 'Blog'
|
26
|
+
page.link_url = '/blog'
|
27
|
+
page.deletable = false
|
28
|
+
end
|
29
|
+
end
|
19
30
|
end
|
20
31
|
end
|
21
32
|
end
|
@@ -6,9 +6,6 @@ module Spina
|
|
6
6
|
module Blog
|
7
7
|
# Spina::Blog::CategoriesController
|
8
8
|
class CategoriesController < ApplicationController
|
9
|
-
include ::Spina::Frontend
|
10
|
-
|
11
|
-
before_action :page
|
12
9
|
before_action :category
|
13
10
|
before_action :posts
|
14
11
|
before_action :set_breadcrumb, only: :show
|
@@ -30,13 +27,6 @@ module Spina
|
|
30
27
|
.page(params[:page])
|
31
28
|
end
|
32
29
|
|
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
30
|
def set_breadcrumb
|
41
31
|
add_breadcrumb 'Blog', frontend_blog_root_path
|
42
32
|
end
|
@@ -6,10 +6,7 @@ module Spina
|
|
6
6
|
module Blog
|
7
7
|
# Spina::Blog::PostsController
|
8
8
|
class PostsController < ApplicationController
|
9
|
-
include ::Spina::Frontend
|
10
|
-
|
11
9
|
before_action :find_posts, only: [:index]
|
12
|
-
before_action :current_spina_user_can_view_page?
|
13
10
|
before_action :set_breadcrumb, only: :show
|
14
11
|
|
15
12
|
decorates_assigned :posts, :post
|
@@ -53,14 +50,6 @@ module Spina
|
|
53
50
|
start_date.end_of_year
|
54
51
|
end
|
55
52
|
|
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
53
|
def find_posts
|
65
54
|
@posts = Spina::Admin::Conferences::Blog::Post.available.live.order(published_at: :desc)
|
66
55
|
.page(params[:page])
|
@@ -71,10 +60,6 @@ module Spina
|
|
71
60
|
redirect_to rule.new_path, status: :moved_permanently
|
72
61
|
end
|
73
62
|
|
74
|
-
def current_spina_user_can_view_page?
|
75
|
-
raise ActiveRecord::RecordNotFound unless current_spina_user.present? || page.live?
|
76
|
-
end
|
77
|
-
|
78
63
|
def set_breadcrumb
|
79
64
|
add_breadcrumb 'Blog', frontend_blog_root_path
|
80
65
|
end
|
@@ -6,9 +6,22 @@ module Spina
|
|
6
6
|
module Conferences
|
7
7
|
# Base class from which controllers inherit
|
8
8
|
class ApplicationController < Spina::ApplicationController
|
9
|
+
before_action :page
|
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.active = true
|
23
|
+
end
|
24
|
+
end
|
12
25
|
end
|
13
26
|
end
|
14
27
|
end
|
@@ -6,6 +6,18 @@ 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 :page
|
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.active = true
|
19
|
+
end
|
20
|
+
end
|
9
21
|
end
|
10
22
|
end
|
11
23
|
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 :
|
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 =
|
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 =
|
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
|
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
|
-
|
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 :
|
10
|
+
before_action :set_volume, :set_issue, only: :show
|
11
11
|
before_action :set_metadata
|
12
12
|
|
13
13
|
def index
|
@@ -22,6 +22,7 @@ module Spina
|
|
22
22
|
|
23
23
|
def show
|
24
24
|
@articles = current_spina_user.present? ? @issue.articles : @issue.articles.visible
|
25
|
+
add_breadcrumb helpers.journal_abbreviation_or_name(@journal), frontend_issues_path
|
25
26
|
add_breadcrumb t('spina.conferences.primer_theme.journal.volume_issue',
|
26
27
|
volume_number: @issue.volume.number, issue_number: @issue.number)
|
27
28
|
end
|
@@ -33,14 +34,20 @@ module Spina
|
|
33
34
|
end
|
34
35
|
|
35
36
|
def set_issue
|
36
|
-
@issue =
|
37
|
+
@issue = @volume.issues.includes(:volume, :articles).find_by!(number: params[:number])
|
38
|
+
rescue ActiveRecord::RecordNotFound
|
39
|
+
send_file Rails.root.join('public/404.html'), type: 'text/html; charset=utf-8', status: 404
|
40
|
+
end
|
41
|
+
|
42
|
+
def set_volume
|
43
|
+
@volume = Admin::Journal::Volume.includes(:issues).find_by!(number: params[:volume_number])
|
37
44
|
rescue ActiveRecord::RecordNotFound
|
38
45
|
send_file Rails.root.join('public/404.html'), type: 'text/html; charset=utf-8', status: 404
|
39
46
|
end
|
40
47
|
|
41
48
|
def set_breadcrumb
|
42
|
-
add_breadcrumb @journal
|
43
|
-
add_breadcrumb Admin::Journal::Issue.model_name.human.pluralize, frontend_issues_path
|
49
|
+
add_breadcrumb helpers.journal_abbreviation_or_name(@journal), frontend_issues_path
|
50
|
+
# add_breadcrumb Admin::Journal::Issue.model_name.human.pluralize, frontend_issues_path
|
44
51
|
end
|
45
52
|
|
46
53
|
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
|
15
|
+
def journal_abbreviation_or_name(journal)
|
16
|
+
journal.content(:journal_abbreviation).nil? || journal.content(:journal_abbreviation).blank? ? 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
|
@@ -38,6 +47,16 @@ module Spina
|
|
38
47
|
time.hour,
|
39
48
|
time.min)
|
40
49
|
end
|
50
|
+
|
51
|
+
def primer_theme_importmap_tags(entry_point = 'application', shim: true)
|
52
|
+
safe_join [
|
53
|
+
javascript_inline_importmap_tag(Spina::Conferences::PrimerTheme.config.importmap.to_json(resolver: self)),
|
54
|
+
javascript_importmap_module_preload_tags(Spina::Conferences::PrimerTheme.config.importmap),
|
55
|
+
(javascript_importmap_shim_nonce_configuration_tag if shim),
|
56
|
+
(javascript_importmap_shim_tag if shim),
|
57
|
+
javascript_import_module_tag(entry_point)
|
58
|
+
], "\n"
|
59
|
+
end
|
41
60
|
end
|
42
61
|
end
|
43
62
|
end
|
@@ -13,6 +13,15 @@ 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
|
+
|
20
|
+
# Use this for caching, since pages are not touched when navigation position is updated.
|
21
|
+
def all_navigation_items
|
22
|
+
@all_navigation_items ||= ::Spina::NavigationItem.all
|
23
|
+
end
|
24
|
+
|
16
25
|
private
|
17
26
|
|
18
27
|
def live_navigation_items(name)
|
@@ -20,6 +29,10 @@ module Spina
|
|
20
29
|
.where(spina_navigations: { name: name })
|
21
30
|
.roots.regular_pages.in_menu.live.sorted
|
22
31
|
end
|
32
|
+
|
33
|
+
def live_resource_navigation_items(name)
|
34
|
+
::Spina::Resource.find_by(name: name)&.pages&.roots&.in_menu&.live&.sorted || []
|
35
|
+
end
|
23
36
|
end
|
24
37
|
end
|
25
38
|
end
|
@@ -2,26 +2,28 @@
|
|
2
2
|
= render(Primer::HeadingComponent.new(tag: :h1)) { current_page.title }
|
3
3
|
|
4
4
|
- if content(:text).present?
|
5
|
-
= render(Primer::Markdown.new(mt: 4)) { content.html(:text) }
|
5
|
+
= render(Primer::Markdown.new(mt: 4)) { content.html(:text).to_s }
|
6
6
|
- if content(:contact).present?
|
7
7
|
= render Primer::SubheadComponent.new(mt: 4) do |component|
|
8
8
|
= component.heading { t :'.contact.title' }
|
9
|
-
= render(Primer::Markdown.new) { content.html(:contact) }
|
9
|
+
= render(Primer::Markdown.new) { content.html(:contact).to_s }
|
10
10
|
|
11
11
|
.clearfix.gutter
|
12
12
|
= render Primer::BoxComponent.new(mt: 4, col: [12, nil, 6, nil], float: [nil, nil, :left, nil]) do
|
13
13
|
= render Primer::SubheadComponent.new do |component|
|
14
14
|
= component.heading { t :'.constitution.title' }
|
15
15
|
- if content(:constitution).present?
|
16
|
-
= render Primer::
|
17
|
-
= render Primer::
|
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
|
21
21
|
= render Primer::OcticonComponent.new('desktop-download')
|
22
22
|
= t :'.constitution.download'
|
23
23
|
- else
|
24
|
-
= render Primer::
|
24
|
+
= render Primer::Beta::Blankslate.new do |blankslate|
|
25
|
+
- blankslate.visual_icon(icon: 'law')
|
26
|
+
- blankslate.heading(tag: :h3).with_content(t(:'.constitution.no_constitution'))
|
25
27
|
|
26
28
|
= render Primer::BoxComponent.new(mt: 4, col: [12, nil, 6, nil], float: [nil, nil, :left, nil]) do
|
27
29
|
= render Primer::SubheadComponent.new do |component|
|
@@ -30,7 +32,7 @@
|
|
30
32
|
%ul
|
31
33
|
- repeater :minutes do |minutes_entry|
|
32
34
|
%li.list-style-none.py-1.d-flex.flex-items-center
|
33
|
-
= render Primer::
|
35
|
+
= render Primer::BoxComponent.new(flex: :auto) do
|
34
36
|
- if minutes_entry.content(:date).present?
|
35
37
|
= t(:'.minutes.minutes_for_html', date: time_tag(minutes_entry.content(:date)))
|
36
38
|
- else
|
@@ -43,7 +45,9 @@
|
|
43
45
|
- else
|
44
46
|
= render(Primer::Beta::Text.new(color: :muted, font_size: 6)) { t :'.minutes.no_file' }
|
45
47
|
- else
|
46
|
-
= render Primer::
|
48
|
+
= render Primer::Beta::Blankslate.new do |blankslate|
|
49
|
+
- blankslate.visual_icon(icon: 'file')
|
50
|
+
- blankslate.heading(tag: :h3).with_content(t(:'.minutes.no_minutes'))
|
47
51
|
|
48
52
|
= render Primer::BoxComponent.new(mt: 4, col: [12, nil, 6, nil], float: [nil, nil, :left, nil]) do
|
49
53
|
- if content(:documents).present?
|
@@ -66,10 +70,10 @@
|
|
66
70
|
%ul
|
67
71
|
- repeater :partner_societies do |partner_society|
|
68
72
|
%li.list-style-none.py-4.border-bottom
|
69
|
-
= render Primer::
|
73
|
+
= render Primer::BoxComponent.new(display: :flex, direction: [:column, nil, :row_reverse, nil], align_items: :flex_start) do
|
70
74
|
= render Primer::BaseComponent.new(tag: :div, flex: :auto) do
|
71
75
|
= render Primer::HeadingComponent.new(tag: :h3, mb: 1) do
|
72
|
-
= render Primer::
|
76
|
+
= render Primer::BoxComponent.new(display: :flex, flex_wrap: :wrap, justify_content: :space_between) do
|
73
77
|
- if partner_society.content(:name).present?
|
74
78
|
= render(Primer::Beta::Text.new(tag: :div)) { partner_society.content(:name) }
|
75
79
|
= render Primer::ButtonGroup.new(aria: { label: t(:'.partner_societies.contact_buttons') }) do |component|
|
@@ -89,4 +93,6 @@
|
|
89
93
|
srcset: srcset(partner_society.content(:logo), variant: { resize_to_limit: [200, 150] }),
|
90
94
|
class: %w[mt-4 mt-md-0 mr-md-4])
|
91
95
|
- else
|
92
|
-
= render Primer::
|
96
|
+
= render Primer::Beta::Blankslate.new do |blankslate|
|
97
|
+
- blankslate.visual_icon(icon: 'organization')
|
98
|
+
- blankslate.heading(tag: :h3).with_content(t(:'.partner_societies.no_societies'))
|
@@ -2,13 +2,13 @@
|
|
2
2
|
= render(Primer::HeadingComponent.new(tag: :h1)) { current_page.title }
|
3
3
|
|
4
4
|
- if content(:text).present?
|
5
|
-
= render(Primer::Markdown.new(mt: 4)) { content.html(:text) }
|
5
|
+
= render(Primer::Markdown.new(mt: 4)) { content.html(:text).to_s }
|
6
6
|
|
7
7
|
- if content(:committee_bios).present?
|
8
8
|
%ul.mt-4
|
9
9
|
- repeater(:committee_bios) do |committee_bio|
|
10
10
|
%li.list-style-none.py-4.border-bottom
|
11
|
-
= render Primer::
|
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::
|
20
|
-
= render Primer::
|
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
|
@@ -38,6 +38,8 @@
|
|
38
38
|
= render Primer::OcticonComponent.new('link-external')
|
39
39
|
= t(:'.facebook')
|
40
40
|
- if committee_bio.content(:bio).present?
|
41
|
-
= render(Primer::Beta::Text.new(tag: :div, color: :muted)) { committee_bio.content.html(:bio) }
|
41
|
+
= render(Primer::Beta::Text.new(tag: :div, color: :muted)) { committee_bio.content.html(:bio).to_s }
|
42
42
|
- else
|
43
|
-
= render Primer::
|
43
|
+
= render Primer::Beta::Blankslate.new do |blankslate|
|
44
|
+
- blankslate.visual_icon(icon: 'file')
|
45
|
+
- blankslate.heading(tag: :h3).with_content(t(:'.no_bios'))
|
@@ -2,7 +2,7 @@
|
|
2
2
|
= render(Primer::HeadingComponent.new(tag: :h1)) { current_page.title }
|
3
3
|
|
4
4
|
- if content(:text).present?
|
5
|
-
= render(Primer::Markdown.new(mt: 4)) { content.html(:text) }
|
5
|
+
= render(Primer::Markdown.new(mt: 4)) { content.html(:text).to_s }
|
6
6
|
|
7
7
|
- if content(:embed_url).present?
|
8
8
|
= render Primer::BoxComponent.new(mt: 4, col: 12) do
|
@@ -2,7 +2,7 @@
|
|
2
2
|
= render(Primer::HeadingComponent.new(tag: :h1)) { current_page.title }
|
3
3
|
|
4
4
|
- if content(:text).present?
|
5
|
-
= render(Primer::Markdown.new(mt: 4)) { content.html(:text) }
|
5
|
+
= render(Primer::Markdown.new(mt: 4)) { content.html(:text).to_s }
|
6
6
|
|
7
7
|
- if content(:events_list).present?
|
8
8
|
= render Primer::SubheadComponent.new(mt: 4) do |component|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
- else
|
13
13
|
= t :'.upcoming'
|
14
14
|
|
15
|
-
- content(:events_list).filter do |event|
|
15
|
+
- content(:events_list).filter do |event|
|
16
16
|
- (event.content(:start_date).blank? || event.content(:start_date) >= Date.today) && event.content(:is_archived) != Spina::Parts::Conferences::PrimerTheme::Checkbox::CHECKED_VALUE
|
17
17
|
- end.then do |events|
|
18
18
|
- if events.any?
|
@@ -20,7 +20,9 @@
|
|
20
20
|
- repeater(events) do |event|
|
21
21
|
= render 'conferences_primer_theme/partials/event', event: event
|
22
22
|
- else
|
23
|
-
= render Primer::
|
23
|
+
= render Primer::Beta::Blankslate.new do |blankslate|
|
24
|
+
- blankslate.visual_icon(icon: 'calendar')
|
25
|
+
- blankslate.heading(tag: :h3).with_content(t(:'.no_events'))
|
24
26
|
|
25
27
|
|
26
28
|
= render Primer::SubheadComponent.new(mt: 4) do |component|
|
@@ -38,6 +40,10 @@
|
|
38
40
|
- repeater(events) do |event|
|
39
41
|
= render 'conferences_primer_theme/partials/event', event: event
|
40
42
|
- else
|
41
|
-
= render Primer::
|
43
|
+
= render Primer::Beta::Blankslate.new do |blankslate|
|
44
|
+
- blankslate.visual_icon(icon: 'calendar')
|
45
|
+
- blankslate.heading(tag: :h3).with_content(t(:'.no_events'))
|
42
46
|
- else
|
43
|
-
= render Primer::
|
47
|
+
= render Primer::Beta::Blankslate.new do |blankslate|
|
48
|
+
- blankslate.visual_icon(icon: 'calendar')
|
49
|
+
- blankslate.heading(tag: :h3).with_content(t(:'.no_events'))
|
@@ -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'
|