spina-conferences-primer_theme 0.1.3 → 0.1.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 222df5505f94f9e9d3034b9b64061c1a30f66199e8185b6ff4af603baf76a8a6
4
- data.tar.gz: 11fe7aacfb24fd9f212acc745ebbe0d9a307a2a58cc360544dcfb837966117a5
3
+ metadata.gz: 647773b8710b54bb05cfd3b9b59d329ff0006a3283d2612694dd2a389c9dc6b9
4
+ data.tar.gz: 60cdaba4af25262ad324f15dc4d3b60bacbdd317ed4894c975d65ad3fb17d9c1
5
5
  SHA512:
6
- metadata.gz: a5168f067591a29e00d30f9719472ff1e8079959b8dfa0eebef81efda1e76270a5ccc12957dec74f73e3fe6afefcd0cf879084104a36d37776e63a95e6f56212
7
- data.tar.gz: 76412806df69e7c1d27baee9a400dd65b200d86f602ad30181891eb41a89dea9b16b9b2ee859aca45adfe515f5b0da4903246886c1666a75c9a3aa91fe9e0075
6
+ metadata.gz: 26453a2c8013741ca8fed90e7bbbb7c87591b8e2d5540b57983613260ee9d044c7c01e01e57033eff9c32a1c36c022d49df0edd3fae5b459dbb48af2c533f84a
7
+ data.tar.gz: 871d716b6640411450356a993570c7a95a7f1a675eca2f1f8b23a82fd81ec1668a0126e2a26fa274010499f09fac12566fd4750388b136beb00eea055454f950
@@ -25,6 +25,8 @@ module Spina
25
25
  presentation_types: [:translations],
26
26
  presentations: [session: [:room], presenters: [:institution]])
27
27
  .find(params[:id])
28
+ rescue ActiveRecord::RecordNotFound
29
+ send_file Rails.root.join('public/404.html'), type: 'text/html; charset=utf-8', status: 404
28
30
  end
29
31
 
30
32
  def set_tab
@@ -9,6 +9,10 @@ module Spina
9
9
 
10
10
  def show
11
11
  add_breadcrumb @presentation.name
12
+ respond_to do |format|
13
+ format.html
14
+ format.ics { head :not_found }
15
+ end
12
16
  end
13
17
 
14
18
  private
@@ -16,6 +20,8 @@ module Spina
16
20
  def set_presentation
17
21
  @presentation = Admin::Conferences::Presentation.includes(:presenters, attachments: [attachment_type: [:translations]])
18
22
  .find(params[:id])
23
+ rescue ActiveRecord::RecordNotFound
24
+ send_file Rails.root.join('public/404.html'), type: 'text/html; charset=utf-8', status: 404
19
25
  end
20
26
 
21
27
  def set_conference
@@ -16,11 +16,11 @@ module Spina
16
16
  def ancestors
17
17
  return [] if current_page.blank?
18
18
 
19
- render Primer::BreadcrumbComponent.new(mb: 4) do
19
+ render Primer::BreadcrumbComponent.new(mb: 4) do |component|
20
20
  current_page.ancestors.each do |ancestor|
21
21
  component.slot(:item, href: 'ancestor.materialized_path') { ancestor.menu_title }
22
22
  end
23
- component.slot(:item, selected: true) { menu_title }
23
+ component.slot(:item, selected: true) { current_page.menu_title }
24
24
  end
25
25
  end
26
26
 
@@ -8,6 +8,11 @@ module Spina
8
8
  METHODS_TO_RESIZE = %i[resize_to_limit resize_to_fit resize_to_fill resize_and_pad].freeze
9
9
  DEFAULT_FACTORS = [1, 2, 3, 4].freeze
10
10
 
11
+ def concat_srcset(image, **options)
12
+ srcset(image, **options).collect { |src_path, size| "#{src_path} #{size}" }
13
+ .join ', '
14
+ end
15
+
11
16
  def srcset(image, **options)
12
17
  return if image.blank?
13
18
 
@@ -10,8 +10,10 @@
10
10
  .clearfix.gutter
11
11
  - cache partable_for(:constitution) do
12
12
  .mt-4.col-12.col-md-6.float-md-left= render partial: 'constitution', object: content(:constitution)
13
- - cache partable_for(:minutes) do
13
+ - cache [partable_for(:minutes), content(:minutes)&.structure_items,
14
+ content(:minutes)&.structure_items&.collect_concat(&:structure_parts)&.collect(&:structure_partable)] do
14
15
  .mt-4.col-12.col-md-6.float-md-left= render partial: 'minutes', object: content(:minutes)
15
- - cache partable_for(:partner_societies) do
16
+ - cache [partable_for(:partner_societies), content(:partner_societies)&.structure_items,
17
+ content(:partner_societies)&.structure_items&.collect_concat(&:structure_parts)&.collect(&:structure_partable)] do
16
18
  - if has_content?(:partner_societies) && content(:partner_societies).structure_items.any?
17
19
  .mt-4= render partial: 'partner_societies', object: content(:partner_societies)
@@ -4,6 +4,7 @@
4
4
  - cache partable_for(:text) do
5
5
  - if has_content? :text
6
6
  .mt-4= render partial: 'text', object: content(:text)
7
- - cache partable_for(:committee_bios) do
7
+ - cache [partable_for(:committee_bios), content(:committee_bios)&.structure_items,
8
+ content(:committee_bios)&.structure_items&.collect_concat(&:structure_parts)&.collect(&:structure_partable)] do
8
9
  - if has_content?(:committee_bios) && content(:committee_bios).structure_items.any?
9
10
  .mt-4= render partial: 'committee_bios', object: content(:committee_bios)
@@ -1,10 +1,9 @@
1
1
  .Header.bg-blue.px-3.px-md-4.px-lg-5
2
- .Header-item.d-none.d-lg-flex.mt-n1.mb-n1= link_to render('logo'), root_path, class: 'Header-link'
2
+ .Header-item.mt-n1.mb-n1= link_to render('logo'), root_path, class: 'Header-link'
3
3
  .Header-item.Header-item--full.d-flex.d-lg-none{ aria: { hidden: true } }
4
- = link_to render('logo'), root_path, class: %w[Header-link float-left]
5
- %details.details-reset.text-right
4
+ %details.details-reset
6
5
  %summary.btn-link.Header-link= octicon 'three-bars', height: 24
7
- .d-flex.flex-column.flex-self-stretch.mt-3.text-left
6
+ .px-3.px-md-4.px-lg-5.bg-blue.Popover.left-0.right-0.mt-3
8
7
  = render partial: 'mobile_navigation_item', collection: main_navigation_items, cached: true
9
8
  = link_to 'Conferences', frontend_conferences_url, class: %w[d-block py-2 border-top border-white-fade text-white]
10
9
  = render partial: 'navigation_item', collection: main_navigation_items, cached: true
@@ -2,5 +2,5 @@
2
2
  %h2.Subhead-heading= t :'.title'
3
3
 
4
4
  %ul.ml-n2.mr-n2.mb-n2.mt-n2{ class: dom_class(sponsors), id: dom_id(sponsors) }
5
- = render partial: 'sponsor', collection: sponsors.structure_items,
5
+ = render partial: 'sponsor', collection: sponsors.structure_items.sorted_by_structure,
6
6
  cached: -> sponsor { [sponsor, sponsor.structure_parts.collect(&:structure_partable)] }
@@ -15,9 +15,9 @@
15
15
  %p= @conference.content(:submission_text).html_safe
16
16
 
17
17
  - content_for :header do
18
- - cache [@conference, @conference.institutions, @conference.content(:gallery)&.images,
19
- @conference.parts.collect(&:partable), @conference.content(:sponsors)&.structure_items,
20
- @conference.content(:sponsors)&.structure_items&.extract_associated(structure_parts: [:structure_partable])] do
18
+ - cache [@conference, @conference.institutions, @conference.parts.collect(&:partable), @conference.content(:gallery)&.images,
19
+ @conference.content(:sponsors)&.structure_items,
20
+ @conference.content(:sponsors)&.structure_items&.collect_concat(&:structure_parts)&.collect(&:structure_partable)] do
21
21
  .container-lg.p-responsive.mb-4{ class: dom_class(@conference), id: dom_id(@conference) }
22
22
  %h1.mb-1.mb-md-2= @conference.name
23
23
  %ul.text-gray-dark.list-style-none.d-flex.flex-column.flex-sm-row.flex-wrap
@@ -34,10 +34,11 @@
34
34
  %ul.list-style-none.d-flex.flex-wrap.mt-4{ class: dom_class(@conference.institutions) }
35
35
  = render partial: 'institution', collection: @conference.institutions,
36
36
  cached: -> institution { [institution, institution.logo] }
37
- - cache partable_for(:sponsors, parent: @conference) do
37
+ - cache [partable_for(:sponsors, parent: @conference), @conference.content(:sponsors)&.structure_items,
38
+ @conference.content(:sponsors)&.structure_items&.collect_concat(&:structure_parts)&.collect(&:structure_partable)] do
38
39
  - if @conference.has_content?(:sponsors) && @conference.content(:sponsors).structure_items.any?
39
40
  = render partial: 'sponsors', object: @conference.content(:sponsors)
40
- - cache partable_for(:gallery, parent: @conference) do
41
+ - cache [partable_for(:gallery, parent: @conference), @conference.content(:gallery)&.images] do
41
42
  - if @conference.has_content? :gallery
42
43
  .mb-4= render partial: 'image_collection', object: @conference.content(:gallery), locals: { controls: true }
43
44
 
@@ -1,29 +1,31 @@
1
- .d-flex.flex-column.flex-md-row.flex-items-start
2
- - cache partable_for(:profile_picture, parent: committee_bio) do
3
- - if committee_bio.has_content?(:profile_picture) && committee_bio.content(:profile_picture).persisted?
4
- = render Primer::AvatarComponent.new(src: src(committee_bio.content(:profile_picture).file, resize_to_fill: [150, 150]),
5
- srcset: srcset(committee_bio.content(:profile_picture).file,
6
- variant: { resize_to_limit: [150, 150] }),
7
- draggable: false, alt: committee_bio.content(:name), size: 150, mr: [nil, nil, 3, nil],
8
- mb: [3, nil, 0, nil])
9
- .flex-auto
10
- .d-flex.flex-column.flex-md-row.mb-1
11
- - cache partable_for(:name, :role, parent: committee_bio) do
12
- - if committee_bio.has_content?(:name) && committee_bio.has_content?(:role)
13
- %h3.flex-auto= t :'.name_and_role', name: committee_bio.content(:name), role: committee_bio.content(:role)
14
- - elsif committee_bio.has_content?(:name)
15
- %h3.flex-auto= committee_bio.content(:name)
16
- .BtnGroup.mt-1.mt-md-0.ml-md-1{ aria: { label: t(:'.contact_buttons') } }
17
- - cache partable_for(:twitter_profile, parent: committee_bio) do
18
- - if committee_bio.has_content?(:twitter_profile)
19
- = render Primer::ButtonComponent.new(tag: :a, href: committee_bio.content(:twitter_profile), group_item: true) do
20
- = render Primer::OcticonComponent.new(icon: 'link-external')
21
- = t(:'.twitter')
22
- - cache partable_for(:facebook_profile, parent: committee_bio) do
23
- - if committee_bio.has_content?(:facebook_profile)
24
- = render Primer::ButtonComponent.new(tag: :a, href: committee_bio.content(:facebook_profile), group_item: true) do
25
- = render Primer::OcticonComponent.new(icon: 'link-external')
26
- = t(:'.facebook')
27
- - cache partable_for(:bio, parent: committee_bio) do
28
- - if committee_bio.has_content?(:bio)
29
- .text-gray-light= committee_bio.content(:bio).try(:html_safe)
1
+ - cache [committee_bio, committee_bio.structure_parts.collect(&:structure_partable)] do
2
+ .d-flex.flex-column.flex-md-row.flex-items-start
3
+ - cache partable_for(:profile_picture, parent: committee_bio) do
4
+ - if committee_bio.has_content?(:profile_picture) && committee_bio.content(:profile_picture).persisted?
5
+ .flex-shrink-0
6
+ = render Primer::AvatarComponent.new(src: src(committee_bio.content(:profile_picture).file, resize_to_fill: [150, 150]),
7
+ srcset: concat_srcset(committee_bio.content(:profile_picture).file,
8
+ variant: { resize_to_limit: [150, 150] }),
9
+ draggable: false, alt: committee_bio.content(:name), size: 150, mr: [nil, nil, 3, nil],
10
+ mb: [3, nil, 0, nil])
11
+ .flex-auto
12
+ .d-flex.flex-column.flex-md-row.mb-1
13
+ - cache partable_for(:name, :role, parent: committee_bio) do
14
+ - if committee_bio.has_content?(:name) && committee_bio.has_content?(:role)
15
+ %h3.flex-auto= t :'.name_and_role', name: committee_bio.content(:name), role: committee_bio.content(:role)
16
+ - elsif committee_bio.has_content?(:name)
17
+ %h3.flex-auto= committee_bio.content(:name)
18
+ .BtnGroup.mt-1.mt-md-0.ml-md-1{ aria: { label: t(:'.contact_buttons') } }
19
+ - cache partable_for(:twitter_profile, parent: committee_bio) do
20
+ - if committee_bio.has_content?(:twitter_profile)
21
+ = render Primer::ButtonComponent.new(tag: :a, href: committee_bio.content(:twitter_profile), group_item: true) do
22
+ = render Primer::OcticonComponent.new(icon: 'link-external')
23
+ = t(:'.twitter')
24
+ - cache partable_for(:facebook_profile, parent: committee_bio) do
25
+ - if committee_bio.has_content?(:facebook_profile)
26
+ = render Primer::ButtonComponent.new(tag: :a, href: committee_bio.content(:facebook_profile), group_item: true) do
27
+ = render Primer::OcticonComponent.new(icon: 'link-external')
28
+ = t(:'.facebook')
29
+ - cache partable_for(:bio, parent: committee_bio) do
30
+ - if committee_bio.has_content?(:bio)
31
+ .text-gray-light= committee_bio.content(:bio).try(:html_safe)
@@ -1,5 +1,6 @@
1
1
  - if committee_bios.structure_items.any?
2
2
  %ul{ class: dom_class(committee_bios), id: dom_id(committee_bios) }
3
- = render partial: 'committee_bio', collection: committee_bios.structure_items.sorted_by_structure, layout: 'list_item', cached: true
3
+ = render partial: 'committee_bio', collection: committee_bios.structure_items.sorted_by_structure, layout: 'list_item',
4
+ cached: ->(committee_bio) { [committee_bio, committee_bio.structure_parts.collect(&:structure_partable)] }
4
5
  - else
5
6
  = render Primer::BlankslateComponent.new(title: t(:'.no_bios'), icon: 'file')
@@ -2,7 +2,8 @@
2
2
  = component.slot(:heading) { t :'.title' }
3
3
 
4
4
  - if minutes.present? && minutes.structure_items.any?
5
- %ul{ class: dom_class(minutes), id: dom_id(minutes) }= render partial: 'minutes_entry',
6
- collection: minutes.structure_items.sorted_by_structure, cached: true
5
+ %ul{ class: dom_class(minutes), id: dom_id(minutes) }
6
+ = render partial: 'minutes_entry', collection: minutes.structure_items.sorted_by_structure,
7
+ cached: ->(minutes_entry) { [minutes_entry, minutes_entry.structure_parts.collect(&:structure_partable)] }
7
8
  - else
8
9
  = render Primer::BlankslateComponent.new(title: t(:'.no_minutes'), icon: 'file')
@@ -1,11 +1,12 @@
1
- %li.list-style-none.py-1.d-flex.flex-items-center
2
- - cache partable_for(:date, parent: minutes_entry) do
3
- .flex-auto= minutes_entry.has_content?(:date) ? t(:'.minutes_html', date: time_tag(minutes_entry.content(:date))) : t(:'.no_date')
4
- - cache partable_for(:attachment, parent: minutes_entry) do
5
- - if minutes_entry.has_content?(:attachment) && minutes_entry.content(:attachment).persisted?
6
- = render Primer::ButtonComponent.new(tag: :a, ml: 2,
7
- href: main_app.rails_blob_path(minutes_entry.content(:attachment), disposition: :attachment)) do
8
- = render Primer::OcticonComponent.new(icon: 'desktop-download')
9
- = t(:'.download')
10
- - else
11
- .text-small.text-gray= t :'.no_file'
1
+ - cache [minutes_entry, minutes_entry.structure_parts.collect(&:structure_partable)] do
2
+ %li.list-style-none.py-1.d-flex.flex-items-center
3
+ - cache partable_for(:date, parent: minutes_entry) do
4
+ .flex-auto= minutes_entry.has_content?(:date) ? t(:'.minutes_html', date: time_tag(minutes_entry.content(:date))) : t(:'.no_date')
5
+ - cache partable_for(:attachment, parent: minutes_entry) do
6
+ - if minutes_entry.has_content?(:attachment) && minutes_entry.content(:attachment).persisted?
7
+ = render Primer::ButtonComponent.new(tag: :a, ml: 2,
8
+ href: main_app.rails_blob_path(minutes_entry.content(:attachment), disposition: :attachment)) do
9
+ = render Primer::OcticonComponent.new(icon: 'desktop-download')
10
+ = t(:'.download')
11
+ - else
12
+ .text-small.text-gray= t :'.no_file'
@@ -4,6 +4,7 @@
4
4
  - if partner_societies.structure_items.any?
5
5
  %ul{ class: dom_class(partner_societies), id: dom_id(partner_societies) }
6
6
  = render partial: 'partner_society', collection: partner_societies.structure_items.sorted_by_structure,
7
- layout: 'list_item', cached: true
7
+ layout: 'list_item',
8
+ cached: ->(partner_society) { [partner_society, partner_society.structure_parts.collect(&:structure_partable)] }
8
9
  - else
9
10
  = render Primer::BlankslateComponent.new(title: t(:'.no_societies'), icon: 'organization')
@@ -1,25 +1,26 @@
1
- .d-flex.flex-column.flex-md-row-reverse.flex-items-start
2
- .flex-auto
3
- %h3.d-flex.flex-wrap.mb-1
4
- - cache partable_for(:name, parent: partner_society) do
5
- - if partner_society.has_content? :name
6
- .flex-auto= partner_society.content(:name)
7
- .BtnGroup.mt-1.mt-sm-0{ aria: { label: t(:'.contact_buttons') } }
8
- - cache partable_for(:website, parent: partner_society) do
9
- - if partner_society.has_content? :website
10
- = render Primer::ButtonComponent.new(tag: :a, href: partner_society.content(:website), group_item: true) do
11
- = render Primer::OcticonComponent.new(icon: 'browser')
12
- = t(:'.website')
13
- - cache partable_for(:email_address, parent: partner_society) do
14
- - if partner_society.has_content? :email_address
15
- = render Primer::ButtonComponent.new(tag: :a, href: "mailto:#{partner_society.content(:email_address)}", group_item: true) do
16
- = render Primer::OcticonComponent.new(icon: 'mail')
17
- = t(:'.email')
18
- - cache partable_for(:description, parent: partner_society) do
19
- - if partner_society.has_content? :description
20
- .text-gray= render partial: 'text', object: partner_society.content(:description)
21
- - cache partable_for(:logo, parent: partner_society) do
22
- - if partner_society.has_content?(:logo) && partner_society.content(:logo).persisted?
23
- = image_tag(main_app.url_for(partner_society.content(:logo).file.variant(resize_to_limit: [200, 150])),
24
- srcset: srcset(partner_society.content(:logo).file, variant: { resize_to_limit: [200, 150] }), size: nil,
25
- alt_description: partner_society.content(:name), draggable: false, class: %w[mt-4 mt-md-0 mr-md-4])
1
+ - cache [partner_society, partner_society.structure_parts.collect(&:structure_partable)] do
2
+ .d-flex.flex-column.flex-md-row-reverse.flex-items-start
3
+ .flex-auto
4
+ %h3.d-flex.flex-wrap.mb-1
5
+ - cache partable_for(:name, parent: partner_society) do
6
+ - if partner_society.has_content? :name
7
+ .flex-auto= partner_society.content(:name)
8
+ .BtnGroup.mt-1.mt-sm-0{ aria: { label: t(:'.contact_buttons') } }
9
+ - cache partable_for(:website, parent: partner_society) do
10
+ - if partner_society.has_content? :website
11
+ = render Primer::ButtonComponent.new(tag: :a, href: partner_society.content(:website), group_item: true) do
12
+ = render Primer::OcticonComponent.new(icon: 'browser')
13
+ = t(:'.website')
14
+ - cache partable_for(:email_address, parent: partner_society) do
15
+ - if partner_society.has_content? :email_address
16
+ = render Primer::ButtonComponent.new(tag: :a, href: "mailto:#{partner_society.content(:email_address)}", group_item: true) do
17
+ = render Primer::OcticonComponent.new(icon: 'mail')
18
+ = t(:'.email')
19
+ - cache partable_for(:description, parent: partner_society) do
20
+ - if partner_society.has_content? :description
21
+ .text-gray= render partial: 'text', object: partner_society.content(:description)
22
+ - cache partable_for(:logo, parent: partner_society) do
23
+ - if partner_society.has_content?(:logo) && partner_society.content(:logo).persisted?
24
+ = image_tag(main_app.url_for(partner_society.content(:logo).file.variant(resize_to_limit: [200, 150])),
25
+ srcset: srcset(partner_society.content(:logo).file, variant: { resize_to_limit: [200, 150] }), size: nil,
26
+ alt_description: partner_society.content(:name), draggable: false, class: %w[mt-4 mt-md-0 mr-md-4])
@@ -3,7 +3,7 @@
3
3
  module Spina
4
4
  module Conferences
5
5
  module PrimerTheme
6
- VERSION = '0.1.3'
6
+ VERSION = '0.1.8'
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.1.3
4
+ version: 0.1.8
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: 2020-11-07 00:00:00.000000000 Z
11
+ date: 2020-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: babel-transpiler