spina-conferences-primer_theme 0.1.4 → 0.1.9

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: 0f5a1fe323da1becb53d382218a6582f7c6fadc48ced5b3f2972db2c560010c0
4
- data.tar.gz: 49010b4348e16a95963fe877ef3249987f8d95348ceedca6523825b564d2223d
3
+ metadata.gz: 665965738e060bd5c6c9f90e5452f9cd84f92456a6e04e6de2fe85b594ecc397
4
+ data.tar.gz: b3a31fb3bb0f867801f9f8fff03265ad9d33ec4cc8bb6acfdbe4b72ec8e8ff8f
5
5
  SHA512:
6
- metadata.gz: 514c1696a79af56a0fbc9978b1a98cb504bd5ddbfe7e90a4fab6c565306a6c4faa19cc55ece07b920c3f4d45f752cd9637dff531545239e10a80bc6ff165e945
7
- data.tar.gz: 24c7b33473536d8e397e61a3eeea5e7077c3b22d0041b788f5f91627040f1b1e348cd1202aa4022d3ffc8203e4614aa78ce0702373471dbb2ed2b3fbeff26e70
6
+ metadata.gz: 3e149a65b5ef03f743d3d9249a7cbe6e1b463090d10e1af8f833dbf49cebf416cc97e899d5c1340afc12cc67101a2b202a697d719c4a2ef11c35051d8079d03c
7
+ data.tar.gz: 2fb6e336499d4b36b4cfba6521bd3dace00bc325668a618e97e55e2ac4c79de7f4fac45a3d8baf94ca9291488c5867ff49e2b5e6da77970bde371b1d8e6cd5cc
@@ -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
 
@@ -42,15 +42,16 @@ module Spina
42
42
  t :'.title', title: current_page.present? ? current_page.seo_title : @title, suffix: current_account.name # rubocop:disable Rails/HelperInstanceVariable
43
43
  end
44
44
 
45
- def partable_for(*parts, parent: current_page)
45
+ def partable_for(*part_names, parent: current_page)
46
46
  association = case parent
47
47
  when Spina::Page then :page_partable
48
48
  when Spina::StructureItem then :structure_partable
49
49
  when Spina::Account then :layout_partable
50
50
  else :partable
51
51
  end
52
- part = parent.parts.find_by(name: parts)
53
- [part, part.try(association)]
52
+ parts = parent.parts.where(name: part_names)
53
+ part_parents = parts.collect { |part| part.try(association) }
54
+ [*parts, *part_parents]
54
55
  end
55
56
 
56
57
  def calendar(name:, &block)
@@ -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
@@ -1,16 +1,15 @@
1
- - cache [conference, conference.institutions, conference.institutions.collect(&:logo)] do
2
- .d-flex.flex-column.flex-md-row-reverse.flex-justify-start.flex-md-justify-between
3
- %ul.list-style-none.d-flex.flex-wrap.flex-md-justify-end.pl-md-2.pb-2.pb-md-0{ class: dom_class(conference.institutions) }
4
- = render partial: 'institution', collection: conference.institutions, cached: -> institution { [institution, institution.logo] }
5
- .flex-auto
6
- %h3.mb-1
7
- = link_to conference.name, frontend_conference_path(conference)
8
- %ul.text-gray.list-style-none.d-flex.flex-column.flex-sm-row.flex-wrap
9
- %li.mr-sm-3
10
- = octicon 'calendar'
11
- = t :'.dates_html', start_date: time_tag(conference.start_date, format: :date), finish_date: time_tag(conference.finish_date)
12
- - if conference.institutions.any?
13
- %li
14
- = octicon 'location'
15
- %address.d-inline= t :'.locations', institutions: conference.institutions.pluck(:name).to_sentence,
16
- cities: conference.institutions.pluck(:city).uniq.to_sentence
1
+ .d-flex.flex-column.flex-md-row-reverse.flex-justify-start.flex-md-justify-between
2
+ %ul.list-style-none.d-flex.flex-wrap.flex-md-justify-end.pl-md-2.pb-2.pb-md-0{ class: dom_class(conference.institutions) }
3
+ = render partial: 'institution', collection: conference.institutions, cached: -> institution { [institution, institution.logo] }
4
+ .flex-auto
5
+ %h3.mb-1
6
+ = link_to conference.name, frontend_conference_path(conference)
7
+ %ul.text-gray.list-style-none.d-flex.flex-column.flex-sm-row.flex-wrap
8
+ %li.mr-sm-3
9
+ = octicon 'calendar'
10
+ = t :'.dates_html', start_date: time_tag(conference.start_date, format: :date), finish_date: time_tag(conference.finish_date)
11
+ - if conference.institutions.any?
12
+ %li
13
+ = octicon 'location'
14
+ %address.d-inline= t :'.locations', institutions: conference.institutions.pluck(:name).to_sentence,
15
+ cities: conference.institutions.pluck(:city).uniq.to_sentence
@@ -1,3 +1 @@
1
- <% cache conference do %>
2
1
  <%= conference.to_event.to_ical -%>
3
- <% end %>
@@ -1,12 +1,11 @@
1
- - cache event do
2
- .d-flex.flex-column.flex-sm-row
3
- .flex-shrink-0.mr-sm-3.mb-3.mb-sm-0.col-sm-4
4
- %span.f3-light.mb-1
5
- = octicon 'clock', class: 'v-align-baseline'
6
- = t :'.times_html', start_time: time_tag(event.start_time, format: :short), finish_time: time_tag(event.finish_time, format: :time)
7
- .text-gray
8
- = octicon 'location'
9
- %address.d-inline= event.location
10
- .flex-auto
11
- %h3.mb-1= event.name
12
- .text-gray= event.description.try(:html_safe)
1
+ .d-flex.flex-column.flex-sm-row
2
+ .flex-shrink-0.mr-sm-3.mb-3.mb-sm-0.col-sm-4
3
+ %span.f3-light.mb-1
4
+ = octicon 'clock', class: 'v-align-baseline'
5
+ = t :'.times_html', start_time: time_tag(event.start_time, format: :short), finish_time: time_tag(event.finish_time, format: :time)
6
+ .text-gray
7
+ = octicon 'location'
8
+ %address.d-inline= event.location
9
+ .flex-auto
10
+ %h3.mb-1= event.name
11
+ .text-gray= event.description.try(:html_safe)
@@ -1,3 +1 @@
1
- <% cache event do %>
2
1
  <%= event.to_event.to_ical -%>
3
- <% end %>
@@ -1,6 +1,5 @@
1
- - cache [institution, institution.logo] do
2
- %li
3
- - if institution.logo.present?
4
- = render partial: 'institution_logo', object: institution.logo, locals: { institution: institution }
5
- - else
6
- = institution.name
1
+ %li
2
+ - if institution.logo.present?
3
+ = render partial: 'institution_logo', object: institution.logo, locals: { institution: institution }
4
+ - else
5
+ = institution.name
@@ -1,3 +1,4 @@
1
- - if institution_logo.file.present?
2
- = image_tag main_app.url_for(institution_logo.file.variant(resize_to_limit: [300, 60])), srcset: srcset(institution_logo.file,
3
- variant: { resize_to_limit: [300, 60] }), alt_description: institution.name, draggable: false, class: 'p-1'
1
+ - cache institution_logo do
2
+ - if institution_logo.file.present?
3
+ = image_tag main_app.url_for(institution_logo.file.variant(resize_to_limit: [300, 60])), srcset: srcset(institution_logo.file,
4
+ variant: { resize_to_limit: [300, 60] }), alt_description: institution.name, draggable: false, class: 'p-1'
@@ -1,14 +1,13 @@
1
- - cache [presentation, presentation.presenters] do
2
- .d-flex.flex-column.flex-sm-row
3
- .flex-shrink-0.mr-sm-3.mb-3.mb-sm-0.col-sm-3
4
- %span.f3-light.mb-1
5
- = octicon 'clock', class: 'v-align-baseline'
6
- = time_tag presentation.start_datetime, format: :short
7
- .text-gray
8
- = octicon 'location'
9
- %address.d-inline= presentation.session.room_name
10
- .flex-auto
11
- %h3.mb-1= link_to presentation.title, frontend_conference_presentation_path(conference, presentation)
12
- .text-gray
13
- = octicon presentation.presenters.many? ? 'people' : 'person'
14
- %address.d-inline= presentation.presenters.collect(&:full_name_and_institution).to_sentence
1
+ .d-flex.flex-column.flex-sm-row
2
+ .flex-shrink-0.mr-sm-3.mb-3.mb-sm-0.col-sm-3
3
+ %span.f3-light.mb-1
4
+ = octicon 'clock', class: 'v-align-baseline'
5
+ = time_tag presentation.start_datetime, format: :short
6
+ .text-gray
7
+ = octicon 'location'
8
+ %address.d-inline= presentation.session.room_name
9
+ .flex-auto
10
+ %h3.mb-1= link_to presentation.title, frontend_conference_presentation_path(conference, presentation)
11
+ .text-gray
12
+ = octicon presentation.presenters.many? ? 'people' : 'person'
13
+ %address.d-inline= presentation.presenters.collect(&:full_name_and_institution).to_sentence
@@ -1,3 +1 @@
1
- <% cache presentation do %>
2
1
  <%= presentation.to_event.to_ical -%>
3
- <% end %>
@@ -1,6 +1,5 @@
1
- - cache [presentation_type, @presentation_type] do
2
- %li
3
- = link_to frontend_conference_url(presentation_type.conference, presentation_type: presentation_type.id, tab: 'presentations'),
4
- class: 'filter-item', aria: { current: @presentation_type == presentation_type ? 'page' : nil } do
5
- = presentation_type.name.pluralize
6
- %span.count{ title: t(:'.results') }= presentation_type.presentations.count
1
+ %li
2
+ = link_to frontend_conference_url(presentation_type.conference, presentation_type: presentation_type.id, tab: 'presentations'),
3
+ class: 'filter-item', aria: { current: @presentation_type == presentation_type ? 'page' : nil } do
4
+ = presentation_type.name.pluralize
5
+ %span.count{ title: t(:'.results') }= presentation_type.presentations.count
@@ -1,9 +1,8 @@
1
- - cache [sponsor, sponsor.structure_parts.collect(&:structure_partable)] do
2
- %li.d-inline-block.m-2.v-align-middle
3
- - if sponsor.has_content?(:logo) && sponsor.content(:logo).file.present?
4
- = link_to sponsor.content(:website) do
5
- = image_tag(main_app.url_for(sponsor.content(:logo).file.variant(resize_to_limit: [200, 60])),
6
- srcset: srcset(sponsor.content(:logo).file, variant: { resize_to_limit: [200, 60] }),
7
- alt_description: sponsor.content(:name), draggable: false)
8
- - else
9
- = link_to sponsor.content(:name), sponsor.content(:website)
1
+ %li.d-inline-block.m-2.v-align-middle
2
+ - if sponsor.has_content?(:logo) && sponsor.content(:logo).file.present?
3
+ = link_to sponsor.content(:website) do
4
+ = image_tag(main_app.url_for(sponsor.content(:logo).file.variant(resize_to_limit: [200, 60])),
5
+ srcset: srcset(sponsor.content(:logo).file, variant: { resize_to_limit: [200, 60] }),
6
+ alt_description: sponsor.content(:name), draggable: false)
7
+ - else
8
+ = link_to sponsor.content(:name), sponsor.content(:website)
@@ -2,11 +2,12 @@
2
2
  .d-flex.flex-column.flex-md-row.flex-items-start
3
3
  - cache partable_for(:profile_picture, parent: committee_bio) do
4
4
  - if committee_bio.has_content?(:profile_picture) && committee_bio.content(:profile_picture).persisted?
5
- = render Primer::AvatarComponent.new(src: src(committee_bio.content(:profile_picture).file, resize_to_fill: [150, 150]),
6
- srcset: concat_srcset(committee_bio.content(:profile_picture).file,
7
- variant: { resize_to_limit: [150, 150] }),
8
- draggable: false, alt: committee_bio.content(:name), size: 150, mr: [nil, nil, 3, nil],
9
- mb: [3, nil, 0, nil])
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])
10
11
  .flex-auto
11
12
  .d-flex.flex-column.flex-md-row.mb-1
12
13
  - cache partable_for(:name, :role, parent: committee_bio) do
@@ -3,7 +3,7 @@
3
3
  module Spina
4
4
  module Conferences
5
5
  module PrimerTheme
6
- VERSION = '0.1.4'
6
+ VERSION = '0.1.9'
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.4
4
+ version: 0.1.9
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