spina-conferences-primer_theme-fork 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +33 -0
  4. data/Rakefile +36 -0
  5. data/app/assets/config/spina_conferences_primer_theme_manifest.js +9 -0
  6. data/app/assets/javascripts/spina/conferences/primer_theme/application.js +7 -0
  7. data/app/assets/javascripts/spina/conferences/primer_theme/controllers/slideshow_controller.es6 +68 -0
  8. data/app/assets/stylesheets/spina/conferences/primer_theme/_custom.sass +0 -0
  9. data/app/assets/stylesheets/spina/conferences/primer_theme/_custom_variables.sass +0 -0
  10. data/app/assets/stylesheets/spina/conferences/primer_theme/application.sass +44 -0
  11. data/app/controllers/spina/conferences/primer_theme/conferences/application_controller.rb +16 -0
  12. data/app/controllers/spina/conferences/primer_theme/conferences/conferences_controller.rb +72 -0
  13. data/app/controllers/spina/conferences/primer_theme/conferences/presentations_controller.rb +42 -0
  14. data/app/controllers/spina/conferences/primer_theme/journal/application_controller.rb +13 -0
  15. data/app/controllers/spina/conferences/primer_theme/journal/articles_controller.rb +69 -0
  16. data/app/controllers/spina/conferences/primer_theme/journal/issues_controller.rb +53 -0
  17. data/app/helpers/spina/conferences/primer_theme/application_helper.rb +36 -0
  18. data/app/helpers/spina/conferences/primer_theme/asset_helper.rb +51 -0
  19. data/app/helpers/spina/conferences/primer_theme/navigations_helper.rb +24 -0
  20. data/app/views/conferences_primer_theme/pages/about.html.haml +92 -0
  21. data/app/views/conferences_primer_theme/pages/committee.html.haml +42 -0
  22. data/app/views/conferences_primer_theme/pages/embedded_form.html.haml +9 -0
  23. data/app/views/conferences_primer_theme/pages/events.html.haml +59 -0
  24. data/app/views/conferences_primer_theme/pages/homepage.html.haml +34 -0
  25. data/app/views/conferences_primer_theme/pages/information.html.haml +5 -0
  26. data/app/views/conferences_primer_theme/pages/show.html.haml +2 -0
  27. data/app/views/layouts/conferences_primer_theme/application.html.haml +7 -0
  28. data/app/views/layouts/spina/conferences/primer_theme/application.html.haml +40 -0
  29. data/app/views/layouts/spina/conferences/primer_theme/conferences/conferences.html.haml +5 -0
  30. data/app/views/layouts/spina/conferences/primer_theme/conferences/presentations.html.haml +6 -0
  31. data/app/views/layouts/spina/conferences/primer_theme/journal/articles.html.haml +2 -0
  32. data/app/views/layouts/spina/conferences/primer_theme/journal/issues.html.haml +2 -0
  33. data/app/views/spina/admin/layout_partables/texts/_form.html.haml +4 -0
  34. data/app/views/spina/application/_cookies.html.haml +7 -0
  35. data/app/views/spina/application/_current_conference_alert.html.haml +4 -0
  36. data/app/views/spina/application/_footer.html.haml +17 -0
  37. data/app/views/spina/application/_footer_content.html.haml +13 -0
  38. data/app/views/spina/application/_list_item.html.haml +1 -0
  39. data/app/views/spina/application/_logo.html.haml +1 -0
  40. data/app/views/spina/application/_mobile_navigation_item.html.haml +12 -0
  41. data/app/views/spina/application/_mobile_navigation_items.html.haml +4 -0
  42. data/app/views/spina/application/_navigation.html.haml +11 -0
  43. data/app/views/spina/application/_navigation_item.html.haml +11 -0
  44. data/app/views/spina/application/_text.html.haml +1 -0
  45. data/app/views/spina/conferences/primer_theme/conferences/conferences/_conference.html.haml +15 -0
  46. data/app/views/spina/conferences/primer_theme/conferences/conferences/_event.html.haml +12 -0
  47. data/app/views/spina/conferences/primer_theme/conferences/conferences/_events.html.haml +16 -0
  48. data/app/views/spina/conferences/primer_theme/conferences/conferences/_header.html.haml +47 -0
  49. data/app/views/spina/conferences/primer_theme/conferences/conferences/_institution.html.haml +5 -0
  50. data/app/views/spina/conferences/primer_theme/conferences/conferences/_institution_logo.html.haml +4 -0
  51. data/app/views/spina/conferences/primer_theme/conferences/conferences/_presentation.html.haml +15 -0
  52. data/app/views/spina/conferences/primer_theme/conferences/conferences/_presentation_type.html.haml +5 -0
  53. data/app/views/spina/conferences/primer_theme/conferences/conferences/_presentations.html.haml +29 -0
  54. data/app/views/spina/conferences/primer_theme/conferences/conferences/_submission_flash.html.haml +10 -0
  55. data/app/views/spina/conferences/primer_theme/conferences/conferences/index.html.haml +23 -0
  56. data/app/views/spina/conferences/primer_theme/conferences/conferences/show.html.haml +37 -0
  57. data/app/views/spina/conferences/primer_theme/conferences/kaminari/_gap.html.haml +2 -0
  58. data/app/views/spina/conferences/primer_theme/conferences/kaminari/_next_page.html.haml +9 -0
  59. data/app/views/spina/conferences/primer_theme/conferences/kaminari/_page.html.haml +10 -0
  60. data/app/views/spina/conferences/primer_theme/conferences/kaminari/_paginator.html.haml +17 -0
  61. data/app/views/spina/conferences/primer_theme/conferences/kaminari/_prev_page.html.haml +9 -0
  62. data/app/views/spina/conferences/primer_theme/conferences/presentations/_abstract.html.haml +2 -0
  63. data/app/views/spina/conferences/primer_theme/conferences/presentations/_attachment.html.haml +5 -0
  64. data/app/views/spina/conferences/primer_theme/conferences/presentations/_attachments.html.haml +5 -0
  65. data/app/views/spina/conferences/primer_theme/conferences/presentations/show.html.haml +18 -0
  66. data/app/views/spina/conferences/primer_theme/journal/articles/_authorship.html.haml +6 -0
  67. data/app/views/spina/conferences/primer_theme/journal/articles/_metadata.html.haml +36 -0
  68. data/app/views/spina/conferences/primer_theme/journal/articles/show.html.haml +70 -0
  69. data/app/views/spina/conferences/primer_theme/journal/issues/_article.html.haml +15 -0
  70. data/app/views/spina/conferences/primer_theme/journal/issues/_issue.html.haml +17 -0
  71. data/app/views/spina/conferences/primer_theme/journal/issues/_issue_cover.html.haml +6 -0
  72. data/app/views/spina/conferences/primer_theme/journal/issues/index.html.haml +30 -0
  73. data/app/views/spina/conferences/primer_theme/journal/issues/show.html.haml +27 -0
  74. data/config/initializers/assets.rb +13 -0
  75. data/config/initializers/mime_types.rb +1 -0
  76. data/config/initializers/primer.rb +3 -0
  77. data/config/initializers/themes/conferences_primer_theme.rb +237 -0
  78. data/config/locales/en.rb +16 -0
  79. data/config/locales/en.yml +198 -0
  80. data/config/routes.rb +17 -0
  81. data/db/migrate/20210206170704_change_current_conference_alert_to_text.rb +46 -0
  82. data/lib/spina/conferences/primer_theme.rb +17 -0
  83. data/lib/spina/conferences/primer_theme/breadcrumbs/builder.rb +34 -0
  84. data/lib/spina/conferences/primer_theme/engine.rb +13 -0
  85. data/lib/spina/conferences/primer_theme/version.rb +9 -0
  86. data/lib/tasks/spina/conferences/primer_theme_tasks.rake +6 -0
  87. metadata +396 -0
@@ -0,0 +1,5 @@
1
+ - cache [attachments, attachments.collect(&:attachment)] do
2
+ - if attachments.any?
3
+ = render Primer::ButtonGroupComponent.new(mt: 1) do |component|
4
+ = render partial: 'attachment', collection: attachments, cached: -> attachment { [attachment, attachment.attachment] },
5
+ locals: { component: component }
@@ -0,0 +1,18 @@
1
+ - cache [@presentation, @presentation.presenters, @presentation.attachments.collect(&:attachment)] do
2
+ - cache [@presentation, @presentation.presenters] do
3
+ = render(Primer::HeadingComponent.new(mb: [1, nil, 2, nil])) { @presentation.title }
4
+ %ul.text-secondary-dark.list-style-none.d-flex.flex-column.flex-sm-row.flex-wrap
5
+ %li.mr-sm-3.mb-1
6
+ = render Primer::OcticonComponent.new(@presentation.presenters.many? ? 'people' : 'person')
7
+ = render Primer::TextComponent.new(tag: :address, display: :inline) do
8
+ = @presentation.presenters.collect(&:full_name_and_institution).to_sentence
9
+ %li.mr-sm-3.mb-1
10
+ = render Primer::OcticonComponent.new('clock')
11
+ = time_tag @presentation.start_datetime, format: :short
12
+ %li.mb-1
13
+ = render Primer::OcticonComponent.new('location')
14
+ = render Primer::TextComponent.new(tag: :address, display: :inline) do
15
+ = t :'.room_and_institution', room: @presentation.session.room_name, institution: @presentation.room.institution.name
16
+
17
+ = render partial: 'attachments', object: @presentation.attachments
18
+ = render partial: 'abstract', object: @presentation.abstract
@@ -0,0 +1,6 @@
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::TextComponent.new(tag: :div, font_weight: :bold)) { authorship.affiliation.name }
6
+ = render(Primer::TextComponent.new(tag: :div, color: :text_secondary)) { authorship.affiliation.institution.name }
@@ -0,0 +1,36 @@
1
+ - content_for :head do
2
+ %link{ rel: 'schema.DC', href: 'http://purl.org/dc/elements/1.1/' }
3
+ - @article.authorships.sorted_within_article.each do |authorship|
4
+ %meta{ name: 'DC.Creator.PersonalName', content: authorship.affiliation.name }
5
+ %meta{ name: 'DC.Date.created', scheme: 'ISO8601', content: @issue.date.to_s(:iso8601) }
6
+ %meta{ name: 'DC.Date.issued', scheme: 'ISO8601', content: @issue.date.to_s(:iso8601) }
7
+ %meta{ name: 'DC.Date.modified', scheme: 'ISO8601', content: @issue.date.to_s(:iso8601) }
8
+ - if @article.has_content? :attachment
9
+ %meta{ name: 'DC.Format', scheme: 'IMT', content: 'application/pdf' }
10
+ %meta{ name: 'DC.Identifier', content: @article.id }
11
+ %meta{ name: 'DC.Identifier.URI', content: frontend_issue_article_url(@issue.id, @article.id) }
12
+ %meta{ name: 'DC.Language', scheme: 'ISO639-1', content: 'en' }
13
+ %meta{ name: 'DC.Rights', content: "Copyright #{@article.issue.date.year} #{@article.affiliations.collect(&:name).to_sentence}" }
14
+ - if @licence && @licence.has_content?(:url) && !@licence.content(:url).blank?
15
+ %meta{ name: 'DC.Rights', content: @licence.content(:url) }
16
+ %meta{ name: 'DC.Source', content: @journal.name }
17
+ %meta{ name: 'DC.Title', content: @article.title }
18
+ %meta{ name: 'DC.Type', content: 'Text.Serial.Journal' }
19
+ %meta{ name: 'DC.Type', 'xml:lang': 'en', content: 'text' }
20
+
21
+ %meta{ name: 'gs_meta_revision', content: '1.1' }
22
+
23
+ %meta{ name: 'citation_journal_title', content: @journal.name }
24
+ - if @journal.has_content?(:journal_abbreviation)
25
+ %meta{ name: 'citation_journal_abbrev', content: @journal.content(:journal_abbreviation) }
26
+ - if @journal.has_content?(:issn)
27
+ %meta{ name: 'citation_issn', content: @journal.content(:issn) }
28
+ - @article.authorships.sorted_within_article.each do |authorship|
29
+ %meta{ name: 'citation_author', content: authorship.affiliation.name }
30
+ %meta{ name: 'citation_author_institution', content: authorship.affiliation.institution.name }
31
+ %meta{ name: 'citation_language', content: 'en' }
32
+ %meta{ name: 'citation_date', content: @issue.date.to_s(:iso8601).gsub('-', '/') }
33
+ %meta{ name: 'citation_volume', content: @issue.volume.number }
34
+ %meta{ name: 'citation_issue', content: @issue.number }
35
+ %meta{ name: 'citation_abstract_html_url', content: frontend_issue_article_url(@issue.id, @article.id) }
36
+ %meta{ name: 'citation_pdf_url', content: frontend_issue_article_url(@issue.id, @article.id) + '.pdf' }
@@ -0,0 +1,70 @@
1
+ - cache [@article, @article.authorships, @article.affiliations, @article.content(:abstract), @article.issue, @article.issue.volume, @article.issue.content(:cover_img)] do
2
+ = render partial: 'metadata'
3
+
4
+ = render(Primer::HeadingComponent.new) { @article.title }
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
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::TextComponent.new(tag: :div, font_weight: :bold)) { affiliation.name }
15
+ = render(Primer::TextComponent.new(tag: :div, color: :text_secondary)) { affiliation.institution.name }
16
+
17
+ - if @article.has_content?(:abstract)
18
+ = render(Primer::HeadingComponent.new(tag: :h2, mt: 4, font_size: 3)) { t '.abstract' }
19
+ = render(Primer::MarkdownComponent.new) { @article.content.html(:abstract) }
20
+
21
+ = render(Primer::BorderBoxComponent.new(ml: [nil, nil, 4, nil], style: 'min-width: 20vw')) do |sidebar|
22
+ - sidebar.body do
23
+ - if @article.issue.has_content?(:cover_img)
24
+ = 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
+ = render(Primer::BorderBoxComponent.new) do |component|
26
+ - if @article.has_content?(:attachment)
27
+ - component.row do
28
+ = render(Primer::ButtonComponent.new(tag: :a, href: frontend_issue_article_path(@issue, @article, format: :pdf), download: '', scheme: :primary)) do
29
+ = render Primer::OcticonComponent.new('download')
30
+ = t '.download'
31
+ - component.row do
32
+ = render(Primer::HeadingComponent.new(tag: :h2, font_size: 4, color: :text_secondary)) { t '.published' }
33
+ = render(Primer::TextComponent.new) do
34
+ = time_tag @article.issue.date, format: :long
35
+ - component.row do
36
+ = render(Primer::HeadingComponent.new(tag: :h2, font_size: 4, color: :text_secondary)) { t '.issue' }
37
+ = render(Primer::TextComponent.new) do
38
+ = link_to t('spina.conferences.primer_theme.journal.volume_issue',
39
+ volume_number: @article.issue.volume.number,
40
+ issue_number: @article.issue.number), frontend_issue_path(@article.issue)
41
+ - unless @article.doi.blank?
42
+ - component.row do
43
+ = render(Primer::HeadingComponent.new(tag: :h2, font_size: 4, color: :text_secondary)) { t '.doi' }
44
+ = render(Primer::TextComponent.new(tag: :div, color: :text_secondary, mt: 1)) do
45
+ = link_to nil, @article.doi
46
+ - unless @article.url.blank?
47
+ - component.row do
48
+ = render(Primer::HeadingComponent.new(tag: :h2, font_size: 4, color: :text_secondary)) { t '.url' }
49
+ = render(Primer::TextComponent.new(tag: :div, color: :text_secondary, mt: 1)) do
50
+ = link_to nil, @article.url
51
+ - component.row do
52
+ = render(Primer::FlexComponent.new(direction: :column)) do
53
+ = render(Primer::TextComponent.new(mb: 2)) do
54
+ Copyright #{@article.issue.date.year} #{@article.affiliations.collect(&:name).to_sentence}
55
+ - unless @licence.nil?
56
+ - cache [@licence, @licence.content(:logo), @licence.content(:url)] do
57
+ %a{ rel: 'licence', href: @licence.content(:url) }
58
+ - if @licence.has_content?(:logo)
59
+ = image_tag main_app.url_for(@licence.content(:logo).variant(resize_to_limit: [200, 200])),
60
+ srcset: srcset(@licence.content(:logo), variant: { resize_to_limit: [200, 200] }),
61
+ alt_description: t('.licence_logo'),
62
+ draggable: false,
63
+ class: 'py-1'
64
+ - unless @licence.nil?
65
+ - cache [@licence, @licence.content(:text)] do
66
+ = @licence.has_content?(:text) && render(Primer::TextComponent.new(mt: 1)) { @licence.content(:text) }
67
+
68
+ - if @article.draft?
69
+ - component.row do
70
+ = render(Primer::TextComponent.new(tag: :div, color: :text_danger, font_weight: :bold)) { t '.draft' }
@@ -0,0 +1,15 @@
1
+ = render(Primer::FlexComponent.new(direction: [:column, nil, :row, nil])) do
2
+ = render(Primer::FlexItemComponent.new(flex_auto: true)) do
3
+ = render(Primer::HeadingComponent.new(tag: :h3, mb: 1)) do
4
+ = link_to article.title, frontend_issue_article_path(article.issue, article)
5
+ = render(Primer::TextComponent.new(tag: :div, color: :text_secondary)) do
6
+ = render(Primer::OcticonComponent.new(article.affiliations.many? ? 'people' : 'person'))
7
+ = render(Primer::BaseComponent.new(tag: :address, display: :inline)) do
8
+ = article.authorships.sorted_within_article.collect { |authorship| authorship.affiliation.name }.to_sentence
9
+ - unless article.doi.blank?
10
+ = render(Primer::TextComponent.new(tag: :div, color: :text_secondary)) do
11
+ = link_to nil, article.doi
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
14
+ = render Primer::OcticonComponent.new('download')
15
+ = t '.download'
@@ -0,0 +1,17 @@
1
+ = render(Primer::FlexComponent.new(direction: [:column, nil, :row, nil])) do
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
6
+ = render(Primer::HeadingComponent.new(tag: :h3, mb: 1)) do
7
+ = link_to t('spina.conferences.primer_theme.journal.volume_issue',
8
+ volume_number: issue.volume.number,
9
+ issue_number: issue.number), frontend_issue_path(issue)
10
+ - unless issue.title.blank?
11
+ = render(Primer::HeadingComponent.new(tag: :h4, color: :text_secondary, mb: 1)) do
12
+ = issue.title
13
+ = render(Primer::TextComponent.new(tag: :div, color: :text_secondary, font_weight: :bold)) do
14
+ = time_tag issue.date, format: :long
15
+ - if issue.has_content?(:description)
16
+ = render(Primer::TextComponent.new(tag: :div, color: :text_secondary, mt: 2)) do
17
+ = issue.content.html(:description)
@@ -0,0 +1,6 @@
1
+ - cache cover_img do
2
+ = image_tag main_app.url_for(cover_img.variant(resize_to_limit: size)),
3
+ srcset: srcset(cover_img, variant: { resize_to_limit: size }),
4
+ alt_description: t('spina.conferences.primer_theme.journal.volume_issue', volume_number: issue.volume.number, issue_number: issue.number),
5
+ draggable: false,
6
+ class: 'p-1'
@@ -0,0 +1,30 @@
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] }
24
+
25
+ #journal-issues-list
26
+ = render(Primer::HeadingComponent.new(tag: :h2, mt: 3)) { t '.all_issues' }
27
+ - if @issues.any?
28
+ %ul= render partial: 'issue', collection: @issues, layout: 'list_item', cached: true
29
+ - else
30
+ = render Primer::BlankslateComponent.new(title: t(:'.no_issues'), icon: 'mortar-board')
@@ -0,0 +1,27 @@
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)
7
+
8
+ - unless @issue.title.blank?
9
+ = render(Primer::HeadingComponent.new(tag: :h2, color: :text_secondary, mb: 2)) { @issue.title }
10
+
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
+
14
+ - if @issue.has_content?(:description)
15
+ = render(Primer::MarkdownComponent.new(my: 4)) do
16
+ = @issue.content.html(:description)
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'
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')
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Add additional assets to the asset load path.
6
+ # Rails.application.config.assets.paths << Emoji.images_path
7
+ # Add Yarn node_modules folder to the asset load path.
8
+ Rails.application.config.assets.paths << Spina::Conferences::PrimerTheme::Engine.root.join('node_modules')
9
+
10
+ # Precompile additional assets.
11
+ # application.js, application.css, and all non-JS/CSS in the app/assets
12
+ # folder are already added.
13
+ # Rails.application.config.assets.precompile += %w( admin.js admin.css )
@@ -0,0 +1 @@
1
+ Mime::Type.register "application/pdf", :pdf
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ Rails.application.config.primer_view_components.silence_deprecations = true
@@ -0,0 +1,237 @@
1
+ # frozen_string_literal: true
2
+
3
+ ::Spina::Theme.register do |theme| # rubocop:disable Metrics/BlockLength
4
+ theme.name = 'conferences_primer_theme'
5
+ theme.title = 'Conferences Primer theme'
6
+
7
+ theme.layout_parts = %w[current_conference_alert]
8
+
9
+ theme.parts = [{
10
+ name: 'text',
11
+ title: 'Text',
12
+ part_type: 'Spina::Parts::Text'
13
+ }, {
14
+ name: 'gallery',
15
+ title: 'Gallery',
16
+ part_type: 'Spina::Parts::ImageCollection'
17
+ }, {
18
+ name: 'constitution',
19
+ title: 'Constitution',
20
+ part_type: 'Spina::Parts::Attachment'
21
+ }, {
22
+ name: 'slides',
23
+ title: 'Slides',
24
+ part_type: 'Spina::Parts::Attachment'
25
+ }, {
26
+ name: 'handout',
27
+ title: 'Handout',
28
+ part_type: 'Spina::Parts::Attachment'
29
+ }, {
30
+ name: 'poster',
31
+ title: 'Poster',
32
+ part_type: 'Spina::Parts::Attachment'
33
+ }, {
34
+ name: 'partner_societies',
35
+ title: 'Partner societies',
36
+ part_type: 'Spina::Parts::Repeater',
37
+ parts: %w[name logo email_address website description]
38
+ }, {
39
+ name: 'minutes',
40
+ title: 'Minutes',
41
+ part_type: 'Spina::Parts::Repeater',
42
+ parts: %w[date attachment]
43
+ }, {
44
+ name: 'documents',
45
+ title: 'Documents',
46
+ part_type: 'Spina::Parts::Repeater',
47
+ parts: %w[name attachment]
48
+ }, {
49
+ name: 'contact',
50
+ title: 'Contact',
51
+ part_type: 'Spina::Parts::Text'
52
+ }, {
53
+ name: 'socials',
54
+ title: 'Socials',
55
+ part_type: 'Spina::Parts::Repeater',
56
+ parts: %w[name location description]
57
+ }, {
58
+ name: 'meetings',
59
+ title: 'Meetings',
60
+ part_type: 'Spina::Parts::Repeater',
61
+ parts: %w[name location description]
62
+ }, {
63
+ name: 'submission_url',
64
+ title: 'Submission URL',
65
+ part_type: 'Spina::Parts::Admin::Conferences::Url'
66
+ }, {
67
+ name: 'submission_date',
68
+ title: 'Submission date',
69
+ part_type: 'Spina::Parts::Admin::Conferences::Date'
70
+ }, {
71
+ name: 'submission_text',
72
+ title: 'Submission text',
73
+ part_type: 'Spina::Parts::Line'
74
+ }, {
75
+ name: 'committee_bios',
76
+ title: 'Committee bios',
77
+ part_type: 'Spina::Parts::Repeater',
78
+ parts: %w[name institution role bio profile_picture]
79
+ }, {
80
+ name: 'sponsors',
81
+ title: 'Sponsors',
82
+ part_type: 'Spina::Parts::Repeater',
83
+ parts: %w[name website logo]
84
+ }, {
85
+ name: 'events_list',
86
+ title: 'Events',
87
+ part_type: 'Spina::Parts::Repeater',
88
+ parts: %w[name start_time location description url]
89
+ }, {
90
+ name: 'current_conference_alert',
91
+ title: 'Alert',
92
+ part_type: 'Spina::Parts::Text'
93
+ }, {
94
+ name: 'github_url',
95
+ title: 'GitHub URL',
96
+ part_type: 'Spina::Parts::Line'
97
+ }, {
98
+ name: 'name',
99
+ title: 'Name',
100
+ part_type: 'Spina::Parts::Line'
101
+ }, {
102
+ name: 'logo',
103
+ title: 'Logo',
104
+ part_type: 'Spina::Parts::Image'
105
+ }, {
106
+ name: 'description',
107
+ title: 'Description',
108
+ part_type: 'Spina::Parts::Text'
109
+ }, {
110
+ name: 'website',
111
+ title: 'Website',
112
+ part_type: 'Spina::Parts::Admin::Conferences::Url'
113
+ }, {
114
+ name: 'email_address',
115
+ title: 'Email address',
116
+ part_type: 'Spina::Parts::Admin::Conferences::EmailAddress'
117
+ }, {
118
+ name: 'date',
119
+ title: 'Date',
120
+ part_type: 'Spina::Parts::Admin::Conferences::Date'
121
+ }, {
122
+ name: 'attachment',
123
+ title: 'Attachment',
124
+ part_type: 'Spina::Parts::Attachment'
125
+ }, {
126
+ name: 'start_time',
127
+ title: 'Time',
128
+ part_type: 'Spina::Parts::Admin::Conferences::Time'
129
+ }, {
130
+ name: 'location',
131
+ title: 'Location',
132
+ part_type: 'Spina::Parts::Line'
133
+ }, {
134
+ name: 'institution',
135
+ title: 'Institution',
136
+ part_type: 'Spina::Parts::Line'
137
+ }, {
138
+ name: 'role',
139
+ title: 'Role',
140
+ part_type: 'Spina::Parts::Line'
141
+ }, {
142
+ name: 'bio',
143
+ title: 'Bio',
144
+ part_type: 'Spina::Parts::Text'
145
+ }, {
146
+ name: 'profile_picture',
147
+ title: 'Profile picture',
148
+ part_type: 'Spina::Parts::Image'
149
+ }, {
150
+ name: 'facebook_profile',
151
+ title: 'Facebook profile',
152
+ part_type: 'Spina::Parts::Admin::Conferences::Url'
153
+ }, {
154
+ name: 'twitter_profile',
155
+ title: 'Twitter profile',
156
+ part_type: 'Spina::Parts::Admin::Conferences::Url'
157
+ }, {
158
+ name: 'url',
159
+ title: 'Link',
160
+ part_type: 'Spina::Parts::Admin::Conferences::Url'
161
+ }, {
162
+ name: 'embed_url',
163
+ title: 'Form embed URL',
164
+ part_type: 'Spina::Parts::Admin::Conferences::Url'
165
+ }, {
166
+ name: 'abstract',
167
+ title: 'Abstract',
168
+ part_type: 'Spina::Parts::Text'
169
+ }, {
170
+ name: 'cover_img',
171
+ title: 'Cover image',
172
+ part_type: 'Spina::Parts::Image'
173
+ }, {
174
+ name: 'journal_abbreviation',
175
+ title: 'Journal Abbreviation',
176
+ part_type: 'Spina::Parts::Line'
177
+ }]
178
+
179
+ theme.view_templates = [{
180
+ name: 'homepage',
181
+ title: 'Homepage',
182
+ parts: %w[gallery text]
183
+ }, {
184
+ name: 'information',
185
+ title: 'Information',
186
+ description: 'Contains general information',
187
+ parts: %w[text]
188
+ }, {
189
+ name: 'committee',
190
+ title: 'Committee',
191
+ description: 'Contains committee bios',
192
+ parts: %w[text committee_bios]
193
+ }, {
194
+ name: 'about',
195
+ title: 'About',
196
+ description: 'Contains information about the society',
197
+ parts: %w[text constitution minutes documents partner_societies contact]
198
+ }, {
199
+ name: 'events',
200
+ title: 'Events',
201
+ description: 'Contains details of past and upcoming events',
202
+ parts: %w[text events_list]
203
+ }, {
204
+ name: 'embedded_form',
205
+ title: 'Embedded form',
206
+ description: 'Contains an embedded form',
207
+ parts: %w[text embed_url]
208
+ }, {
209
+ name: 'show',
210
+ title: 'Blank',
211
+ description: 'Blank template',
212
+ parts: []
213
+ }]
214
+
215
+ theme.custom_pages = [{
216
+ name: 'homepage',
217
+ title: 'Homepage',
218
+ deletable: false,
219
+ view_template: 'homepage'
220
+ }, {
221
+ name: 'about',
222
+ title: 'About',
223
+ deletable: false,
224
+ view_template: 'about'
225
+ }]
226
+
227
+ theme.navigations = [{
228
+ name: 'main',
229
+ label: 'Main navigation',
230
+ auto_add_pages: true
231
+ }, {
232
+ name: 'footer',
233
+ label: 'Footer'
234
+ }]
235
+
236
+ theme.plugins = %w[conferences journal]
237
+ end