spina-conferences-primer_theme-fork 1.0.0.rc2 → 1.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94714b6d36ceca47f2ace1a579c81c5ef9ac11fc59c0a24a608a044d01b16862
4
- data.tar.gz: c70e3ab6596eb92694c22e11c82349b2aa99f5e45ae17173dece175408a2b029
3
+ metadata.gz: 8b41121814204870d40e05f0f24a4903d2a90065a6c4e22f0bb9f35fbfc5cc6d
4
+ data.tar.gz: 407fa16213cc79508555b859dc426de75c632e19d1ddb8ab0f496fafb38132d6
5
5
  SHA512:
6
- metadata.gz: d711b2fddd3733951d33a78867485dbb50ba2410ad8308c08bfecc5d9ddbeeeb8a8cc3ff19c051f73c555e9f85597abe2e71bc23eabace96ef9691dec0dd6e4b
7
- data.tar.gz: a9f6c510143c1db5c547ab992822c1165fa87a158a4a5ea24995947a19f69db10267902edb677b62c4a1213314ba81169f10007b62e02ce430bc3c90d23dedc3
6
+ metadata.gz: b23678f53c4f7b7009dee49c4bf677067ac366498debf71db357c1013f75fc7aec1a1d328568f0c299ef64521545ebb09c3363841956fee86cdc0589efa5f01a
7
+ data.tar.gz: 322fa3813cdd79f002781ce44ee5ae5fbb33e745a3e3f44efbfe679a835318c3643e60a540b8f059a029ca3ca02fbaf4cd24dbb20ef927d5cd5641cd6ea73bc0
@@ -56,8 +56,15 @@ export default class SlideshowController extends Controller {
56
56
  */
57
57
  connect() {
58
58
  this.showSlide()
59
+ this.resetInterval()
60
+ }
61
+
62
+ resetInterval() {
59
63
  if (this.data.has('advance')) {
60
- setInterval(() => this.next(), this.delay)
64
+ if (this.intervalId) {
65
+ clearInterval(this.intervalId)
66
+ }
67
+ this.intervalId = setInterval(() => this.next(), this.delay)
61
68
  }
62
69
  }
63
70
 
@@ -74,6 +81,7 @@ export default class SlideshowController extends Controller {
74
81
  * @private
75
82
  */
76
83
  next() {
84
+ this.resetInterval()
77
85
  const incrementer = this.incrementer
78
86
  this.incrementer = incrementer === this.slideTargets.length - 1 ? 0 : incrementer + 1
79
87
  }
@@ -83,6 +91,7 @@ export default class SlideshowController extends Controller {
83
91
  * @private
84
92
  */
85
93
  previous() {
94
+ this.resetInterval()
86
95
  const incrementer = this.incrementer
87
96
  this.incrementer = incrementer === 0 ? this.slideTargets.length - 1 : incrementer - 1
88
97
  }
@@ -8,6 +8,8 @@ module Spina
8
8
  class ApplicationController < ::Spina::ApplicationController
9
9
  include ::Spina::Frontend
10
10
 
11
+ before_action :page
12
+
11
13
  def cookies_info
12
14
  render partial: 'cookies'
13
15
  end
@@ -17,6 +19,14 @@ module Spina
17
19
  def theme_layout
18
20
  'layouts/spina/conferences/primer_theme/blog/blog'
19
21
  end
22
+
23
+ def page
24
+ @page = Spina::Page.find_or_create_by name: 'blog' do |page|
25
+ page.title = 'Blog'
26
+ page.link_url = '/blog'
27
+ page.deletable = false
28
+ end
29
+ end
20
30
  end
21
31
  end
22
32
  end
@@ -6,7 +6,6 @@ module Spina
6
6
  module Blog
7
7
  # Spina::Blog::CategoriesController
8
8
  class CategoriesController < ApplicationController
9
- before_action :page
10
9
  before_action :category
11
10
  before_action :posts
12
11
  before_action :set_breadcrumb, only: :show
@@ -28,13 +27,6 @@ module Spina
28
27
  .page(params[:page])
29
28
  end
30
29
 
31
- def page
32
- @page = Spina::Page.find_or_create_by name: 'blog' do |page|
33
- page.link_url = '/blog'
34
- page.deletable = false
35
- end
36
- end
37
-
38
30
  def set_breadcrumb
39
31
  add_breadcrumb 'Blog', frontend_blog_root_path
40
32
  end
@@ -7,7 +7,6 @@ module Spina
7
7
  # Spina::Blog::PostsController
8
8
  class PostsController < ApplicationController
9
9
  before_action :find_posts, only: [:index]
10
- before_action :current_spina_user_can_view_page?
11
10
  before_action :set_breadcrumb, only: :show
12
11
 
13
12
  decorates_assigned :posts, :post
@@ -51,14 +50,6 @@ module Spina
51
50
  start_date.end_of_year
52
51
  end
53
52
 
54
- def page
55
- @page ||= Spina::Page.find_or_create_by name: 'blog' do |page|
56
- page.title = 'Blog'
57
- page.link_url = '/blog'
58
- page.deletable = false
59
- end
60
- end
61
-
62
53
  def find_posts
63
54
  @posts = Spina::Admin::Conferences::Blog::Post.available.live.order(published_at: :desc)
64
55
  .page(params[:page])
@@ -69,10 +60,6 @@ module Spina
69
60
  redirect_to rule.new_path, status: :moved_permanently
70
61
  end
71
62
 
72
- def current_spina_user_can_view_page?
73
- raise ActiveRecord::RecordNotFound unless current_spina_user.present? || page.live?
74
- end
75
-
76
63
  def set_breadcrumb
77
64
  add_breadcrumb 'Blog', frontend_blog_root_path
78
65
  end
@@ -6,7 +6,7 @@ module Spina
6
6
  module Conferences
7
7
  # Base class from which controllers inherit
8
8
  class ApplicationController < Spina::ApplicationController
9
- before_action :journal_accessible?
9
+ before_action :page
10
10
 
11
11
  def cookies_info
12
12
  render partial: 'cookies'
@@ -19,13 +19,8 @@ module Spina
19
19
  page.title = 'Conferences'
20
20
  page.link_url = '/conferences/conferences'
21
21
  page.deletable = false
22
- page.view_template = 'blank'
23
22
  end
24
23
  end
25
-
26
- def journal_accessible?
27
- raise ActiveRecord::RecordNotFound unless current_spina_user.present? || page.live?
28
- end
29
24
  end
30
25
  end
31
26
  end
@@ -6,7 +6,7 @@ module Spina
6
6
  module Journal
7
7
  # Base class from which controllers related to the journal plugin inherit
8
8
  class ApplicationController < Spina::ApplicationController
9
- before_action :journal_accessible?
9
+ before_action :page
10
10
 
11
11
  private
12
12
 
@@ -15,13 +15,8 @@ module Spina
15
15
  page.title = 'Journal'
16
16
  page.link_url = '/journal/issues'
17
17
  page.deletable = false
18
- page.view_template = 'blank'
19
18
  end
20
19
  end
21
-
22
- def journal_accessible?
23
- raise ActiveRecord::RecordNotFound unless current_spina_user.present? || page.live?
24
- end
25
20
  end
26
21
  end
27
22
  end
@@ -1,4 +1,4 @@
1
- - cache [current_page, journal_navigation_items] do
1
+ - cache [current_page, controller_name, journal_navigation_items] do
2
2
  = render Primer::MenuComponent.new(ml: [0, nil, nil, 4], mt: [4, 0, nil, nil], col: [nil, nil, nil, 3]) do |component|
3
3
  - component.heading(tag: :h2) do
4
4
  = Spina::Admin::Journal::Journal.instance.name
@@ -3,7 +3,7 @@
3
3
  module Spina
4
4
  module Conferences
5
5
  module PrimerTheme
6
- VERSION = '1.0.0.rc2'
6
+ VERSION = '1.0.0.rc3'
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: 1.0.0.rc2
4
+ version: 1.0.0.rc3
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: 2022-01-31 00:00:00.000000000 Z
12
+ date: 2022-02-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: babel-transpiler