spina-conferences-primer_theme 0.1.3 → 0.1.4

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: 0f5a1fe323da1becb53d382218a6582f7c6fadc48ced5b3f2972db2c560010c0
4
+ data.tar.gz: 49010b4348e16a95963fe877ef3249987f8d95348ceedca6523825b564d2223d
5
5
  SHA512:
6
- metadata.gz: a5168f067591a29e00d30f9719472ff1e8079959b8dfa0eebef81efda1e76270a5ccc12957dec74f73e3fe6afefcd0cf879084104a36d37776e63a95e6f56212
7
- data.tar.gz: 76412806df69e7c1d27baee9a400dd65b200d86f602ad30181891eb41a89dea9b16b9b2ee859aca45adfe515f5b0da4903246886c1666a75c9a3aa91fe9e0075
6
+ metadata.gz: 514c1696a79af56a0fbc9978b1a98cb504bd5ddbfe7e90a4fab6c565306a6c4faa19cc55ece07b920c3f4d45f752cd9637dff531545239e10a80bc6ff165e945
7
+ data.tar.gz: 24c7b33473536d8e397e61a3eeea5e7077c3b22d0041b788f5f91627040f1b1e348cd1202aa4022d3ffc8203e4614aa78ce0702373471dbb2ed2b3fbeff26e70
@@ -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)
@@ -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,30 @@
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
+ = 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])
10
+ .flex-auto
11
+ .d-flex.flex-column.flex-md-row.mb-1
12
+ - cache partable_for(:name, :role, parent: committee_bio) do
13
+ - if committee_bio.has_content?(:name) && committee_bio.has_content?(:role)
14
+ %h3.flex-auto= t :'.name_and_role', name: committee_bio.content(:name), role: committee_bio.content(:role)
15
+ - elsif committee_bio.has_content?(:name)
16
+ %h3.flex-auto= committee_bio.content(:name)
17
+ .BtnGroup.mt-1.mt-md-0.ml-md-1{ aria: { label: t(:'.contact_buttons') } }
18
+ - cache partable_for(:twitter_profile, parent: committee_bio) do
19
+ - if committee_bio.has_content?(:twitter_profile)
20
+ = render Primer::ButtonComponent.new(tag: :a, href: committee_bio.content(:twitter_profile), group_item: true) do
21
+ = render Primer::OcticonComponent.new(icon: 'link-external')
22
+ = t(:'.twitter')
23
+ - cache partable_for(:facebook_profile, parent: committee_bio) do
24
+ - if committee_bio.has_content?(:facebook_profile)
25
+ = render Primer::ButtonComponent.new(tag: :a, href: committee_bio.content(:facebook_profile), group_item: true) do
26
+ = render Primer::OcticonComponent.new(icon: 'link-external')
27
+ = t(:'.facebook')
28
+ - cache partable_for(:bio, parent: committee_bio) do
29
+ - if committee_bio.has_content?(:bio)
30
+ .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.4'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
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.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Malčić