concerto_emergency 0.7 → 0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/concerto_emergency/engine.rb +7 -4
- data/lib/concerto_emergency/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae5b167fe1838320f01a54deb219434671fd73a5
|
4
|
+
data.tar.gz: 05ca46587948ef1b4d354706a75998d057aada44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e77365dc568c0e369e8e18f9d97f78180bc5a6cdc2f2897b73e1b3b19b9ba372b2442b1e6f5711d1db8b43d2d6e653bc14cce7d9a7c94e6ffacb610fb1a52748
|
7
|
+
data.tar.gz: c72bb0080e297eca9b7e99b41dd58000b3934b9bcb31fb90a6b415180e345effee7cf2585ab7fa61d544357993cfe40d7e95dce0fdbb7004ef287bdd28d35a9c
|
@@ -27,10 +27,10 @@ module ConcertoEmergency
|
|
27
27
|
add_controller_hook "Screen", :frontend_display, :before do
|
28
28
|
|
29
29
|
emergency_feed = Feed.find_by_name(ConcertoConfig[:emergency_feed])
|
30
|
+
emergency_active = emergency_feed.submissions.approved.active.includes(:content).where("kind_id != 4").present?
|
30
31
|
|
31
32
|
# Check for emergency content
|
32
|
-
if not emergency_feed.nil? and
|
33
|
-
|
33
|
+
if not emergency_feed.nil? and emergency_active
|
34
34
|
# swap template to emergency template if emergency content is present
|
35
35
|
emergency_template = Template.find_by_name(ConcertoConfig[:emergency_template])
|
36
36
|
if not emergency_template.nil?
|
@@ -44,13 +44,14 @@ module ConcertoEmergency
|
|
44
44
|
add_controller_hook "Frontend::ContentsController", :index, :after do
|
45
45
|
|
46
46
|
emergency_feed = Feed.find_by_name(ConcertoConfig[:emergency_feed])
|
47
|
+
emergency_active = emergency_feed.submissions.approved.active.includes(:content).where("kind_id != 4").present?
|
47
48
|
|
48
49
|
if not emergency_feed.nil?
|
49
|
-
emergency_submissions = emergency_feed.submissions.approved.active
|
50
|
+
emergency_submissions = emergency_feed.submissions.approved.active.includes(:content).where("kind_id = ?", @field.kind_id)
|
50
51
|
emergency_contents = Array.new()
|
51
52
|
emergency_submissions.each { |submission| emergency_contents << Content.find(submission.content_id) }
|
52
53
|
|
53
|
-
if
|
54
|
+
if emergency_active
|
54
55
|
|
55
56
|
# Change template identifier so the screen knows a template
|
56
57
|
# is used for emergency alerts
|
@@ -62,6 +63,8 @@ module ConcertoEmergency
|
|
62
63
|
# Content supplied to screen is replaced with emergency contents
|
63
64
|
@content = emergency_contents
|
64
65
|
end
|
66
|
+
else
|
67
|
+
Rails.logger.error("could not find emergency feed #{ConcertoConfig[:emergency_feed]}")
|
65
68
|
end
|
66
69
|
end
|
67
70
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: concerto_emergency
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.8'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Concerto Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
version: '0'
|
119
119
|
requirements: []
|
120
120
|
rubyforge_project:
|
121
|
-
rubygems_version: 2.
|
121
|
+
rubygems_version: 2.4.5.1
|
122
122
|
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: Broadcast emergency alerts on Concerto screens.
|