spina-conferences-primer_theme-fork 0.7.1 → 0.8.0

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: 1561b312a905740c2df8e80cfd2fb875333f588cab5ba2a67feafefeeccc2bf6
4
- data.tar.gz: 0c4fbd31dd842563409598d4486414ef0f5328214c3d7b03c1f3086a3cd77709
3
+ metadata.gz: 49f472da2c641da3e9b2447dcf6d4cc9d10f15a374024eead49056e0ea430a5b
4
+ data.tar.gz: 5e6d9caf62a78d896a05d61199ddbf4ab39e8c1f71788880a0fdc646d9fc2a3c
5
5
  SHA512:
6
- metadata.gz: 854bef4e11f026ceb8eb5db856a46e63416788e4401dc2b0d7d0d284f32c6d5095f4e9a412d7b66636c80b8e31efb4a68dda10acc1a2b6abd0b9b5cfad78d1d3
7
- data.tar.gz: d84b45390c680a89cde4dc89fe6c14e869a11accf522e6a4229424dd177d52ec1472ede1748901873701faca6cb12b6878c756b3bcdd166d35e79fccbf67953c
6
+ metadata.gz: e053a5dc58adeb0a695d424441a46593c8a0eff9c387a0da1a3485616ac275cde4741ffaaa252d62a0f0d20218bbcac487a46c96fc71093df54a2bae37d9c84e
7
+ data.tar.gz: 28f300ad55d0f0aa33294dcf3f7d6671e9f0536da82ec42f522439a2745ca947dccc6992164993bded4a5a56e68ac3e5535a4ba31b84e91c8c3679a6bcd3d4f9
@@ -29,6 +29,26 @@ class SlideshowController extends Stimulus.Controller {
29
29
  this.showSlide()
30
30
  }
31
31
 
32
+ /**
33
+ * Returns the delay between slide transitions.
34
+ * @private
35
+ * @return {Number} The value for the delay.
36
+ */
37
+ get delay() {
38
+ return this.data.has('delay')
39
+ ? Number.parseInt(this.data.get('delay'))
40
+ : 10000
41
+ }
42
+
43
+ /**
44
+ * Sets the delay between slide transitions.
45
+ * @private
46
+ * @param value {Number} The new value for the delay.
47
+ */
48
+ set delay(value) {
49
+ this.data.set('delay', value.toString())
50
+ }
51
+
32
52
  /**
33
53
  * Hook to start advancing the slides if necessary.
34
54
  * @private
@@ -36,7 +56,7 @@ class SlideshowController extends Stimulus.Controller {
36
56
  connect() {
37
57
  this.showSlide()
38
58
  if (this.data.has('advance')) {
39
- setInterval(() => this.next(), 10000)
59
+ setInterval(() => this.next(), this.delay)
40
60
  }
41
61
  }
42
62
 
@@ -2,33 +2,15 @@
2
2
  - cache [current_page, current_conference] do
3
3
  = render Primer::BoxComponent.new(position: :relative, style: 'height: 639px') do
4
4
  = render Primer::BoxComponent.new(position: :absolute, top: false, left: false, right: false, bottom: false,
5
- style: 'background-color: var(--color-scale-blue-9)')
6
- - if content(:gallery).present?
7
- = render Primer::FlexComponent.new(position: :absolute, top: false, left: false, right: false, bottom: false, style: 'z-index: 1',
8
- flex_direction: :column, justify_content: :center, align_items: :center,
9
- data: { controller: :slideshow, slideshow_incrementer: 0, slideshow_advance: true }) do
10
- - content(:gallery).each_with_index do |image, index|
11
- = content.image_tag(image, { resize_to_limit: [1680, 1680] }, draggable: false, hidden: index != 0,
12
- srcset: srcset(image, variant: { resize_to_limit: [1680, 1680] }),
13
- style: 'object-fit: cover; max-width: max-content; max-height: max-content',
14
- data: { slideshow_target: 'slide' }, class: %w[width-full height-full])
15
- .container-lg.p-responsive.position-relative.color-text-white.height-full{ style: 'z-index: 2' }
16
- = render Primer::BoxComponent.new(py: [3, nil, nil, 6]) do
17
- %div{ style: 'text-shadow: 0 1px 1px #01040940, 0 1px 25px #010409bf;' }
18
- - if current_conference.present?
19
- = render(Primer::HeadingComponent.new(tag: :h1, classes: 'h000-mktg lh-condensed-ultra')) { current_conference.name }
20
- = render Primer::TextComponent.new(tag: :address, classes: 'f2-light') do
21
- = current_conference.institutions.collect(&:name).to_sentence
22
- = render(Primer::TextComponent.new(tag: :time, classes: 'f2-light')) do
23
- = t :'.dates_html', start_date: time_tag(current_conference.start_date, format: :day_and_month),
24
- finish_date: time_tag(current_conference.finish_date, format: :day_and_month)
25
- - else
26
- = render(Primer::HeadingComponent.new(tag: :h1, classes: 'h000-mktg lh-condensed-ultra')) { Spina::Account.first.name }
27
- - if current_conference.present? && current_conference.finish_date >= Date.today
28
- = link_to t('.more_info'), frontend_conference_path(current_conference),
29
- class: %w[btn-mktg btn-large-mktg btn-primary-mktg f3 mt-4]
30
- - else
31
- = link_to t('.more_info'), Spina::Page.find_by(name: 'about').materialized_path,
32
- class: %w[btn-mktg btn-large-mktg btn-primary-mktg f3 mt-4]
33
- %div{ style: 'text-shadow: 0 1px 1px rgba(var(--color-scale-black), 0.25), 0 1px 25px rgba(var(--color-scale-black), 0.75);' }
34
- = render(Primer::MarkdownComponent.new(my: 4)) { content(:text).try(:html_safe) }
5
+ style: 'background-color: #057fab; z-index: 0')
6
+ - if content(:carousel).present?
7
+ %div{data: { controller: :slideshow, slideshow_incrementer: 0, slideshow_advance: true, slideshow_delay: 20000 }}
8
+ - content(:carousel).each_with_index do |carousel_item, index|
9
+ = render partial: 'conferences_primer_theme/partials/homepage_item', locals: { item: carousel_item }
10
+ .position-absolute.top-0.left-0.right-0.bottom-0.container-xl.p-responsive{ style: 'z-index: 2' }
11
+ - if content(:carousel).many?
12
+ .d-flex.flex-justify-between.flex-items-center.height-full
13
+ = render Primer::ButtonComponent.new(data: { action: :'slideshow#previous' }) do
14
+ = render Primer::OcticonComponent.new('arrow-left')
15
+ = render Primer::ButtonComponent.new(data: { action: :'slideshow#next' }) do
16
+ = render Primer::OcticonComponent.new('arrow-right')
@@ -0,0 +1,20 @@
1
+ %div{ data: { slideshow_target: 'slide' } }
2
+ - if item.content(:background_image).present?
3
+ = render Primer::BoxComponent.new(position: :absolute, top: false, left: false, right: false, bottom: false, style: 'z-index: 1') do
4
+ = image_tag(main_app.url_for(item.content(:background_image).variant(resize_to_limit: [1680, 1680])),
5
+ draggable: false,
6
+ srcset: srcset(item.content(:background_image),
7
+ variant: { resize_to_limit: [1680, 1680] }),
8
+ style: 'object-fit: cover;',
9
+ class: %w[width-full height-full])
10
+ .container-lg.p-responsive.position-relative.color-text-white.height-full{ style: 'z-index: 3'}
11
+ = render Primer::BoxComponent.new(py: [3, nil, nil, 6]) do
12
+ %div{ style: 'text-shadow: 0 1px 1px #01040940, 0 1px 25px #010409bf;' }
13
+ = render(Primer::HeadingComponent.new(tag: :h1, classes: 'h000-mktg lh-condensed-ultra')) do
14
+ = item.content(:title)
15
+ %div{ style: 'text-shadow: 0 1px 1px rgba(var(--color-scale-black), 0.25), 0 1px 25px rgba(var(--color-scale-black), 0.75);' }
16
+ = render(Primer::MarkdownComponent.new(my: 4)) do
17
+ = item.content(:description).html_safe
18
+ - if item.content(:url).present?
19
+ = link_to t('.more_info'), item.content(:url),
20
+ class: %w[btn-mktg btn-large-mktg btn-primary-mktg f3 mt-4]
@@ -1,2 +1,2 @@
1
1
  = render template: 'layouts/spina/conferences/primer_theme/application',
2
- locals: { author: current_account.name, description: @description, title: @title, seo_title: @title, hide_alert: true }
2
+ locals: { author: current_account.name, description: @description, title: @title, seo_title: @title, hide_alert: false }
@@ -1,2 +1,2 @@
1
1
  = render template: 'layouts/spina/conferences/primer_theme/application',
2
- locals: { author: current_account.name, description: @description, title: @title, seo_title: @title, hide_alert: true }
2
+ locals: { author: current_account.name, description: @description, title: @title, seo_title: @title, hide_alert: false }
@@ -211,12 +211,25 @@
211
211
  title: 'Periodical Issues',
212
212
  part_type: 'Spina::Parts::Repeater',
213
213
  parts: %w[name date description cover_img attachment url]
214
+ }, {
215
+ name: 'title',
216
+ title: 'Title',
217
+ part_type: 'Spina::Parts::Line'
218
+ }, {
219
+ name: 'background_image',
220
+ title: 'Background Image',
221
+ part_type: 'Spina::Parts::Image'
222
+ }, {
223
+ name: 'carousel',
224
+ title: 'Carousel',
225
+ part_type: 'Spina::Parts::Repeater',
226
+ parts: %w[title description url background_image]
214
227
  }]
215
228
 
216
229
  theme.view_templates = [{
217
230
  name: 'homepage',
218
231
  title: 'Homepage',
219
- parts: %w[gallery text]
232
+ parts: %w[carousel text]
220
233
  }, {
221
234
  name: 'information',
222
235
  title: 'Information',
@@ -85,6 +85,8 @@ en:
85
85
  event:
86
86
  dates_html: "%{start_date} – %{finish_date}"
87
87
  more_info: More information
88
+ homepage_item:
89
+ more_info: Find out more
88
90
 
89
91
 
90
92
  spina:
@@ -3,7 +3,7 @@
3
3
  module Spina
4
4
  module Conferences
5
5
  module PrimerTheme
6
- VERSION = '0.7.1'
6
+ VERSION = '0.8.0'
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-fork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Malčić
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-09-07 00:00:00.000000000 Z
12
+ date: 2021-11-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: babel-transpiler
@@ -314,6 +314,7 @@ files:
314
314
  - app/views/conferences_primer_theme/pages/periodical.html.haml
315
315
  - app/views/conferences_primer_theme/pages/show.html.haml
316
316
  - app/views/conferences_primer_theme/partials/_event.html.haml
317
+ - app/views/conferences_primer_theme/partials/_homepage_item.html.haml
317
318
  - app/views/layouts/conferences_primer_theme/application.html.haml
318
319
  - app/views/layouts/spina/conferences/primer_theme/application.html.haml
319
320
  - app/views/layouts/spina/conferences/primer_theme/conferences/conferences.html.haml