wco_models 3.1.0.314 → 3.1.0.316
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 +4 -4
- data/app/assets/javascripts/wco/application_studio.js +8 -0
- data/app/assets/stylesheets/wco/application.scss +0 -3
- data/app/assets/stylesheets/wco/application_studio.scss +0 -0
- data/app/assets/stylesheets/wco/newsvideos.scss +33 -1
- data/app/assets/stylesheets/wco/studio.scss +33 -0
- data/app/controllers/wco/api/newspartials_controller.rb +8 -0
- data/app/controllers/wco/api/newsproducer_controller.rb +17 -8
- data/app/controllers/wco/newsvideo_events_controller.rb +66 -0
- data/app/controllers/wco/newsvideos_controller.rb +3 -0
- data/app/models/wco/newsoverlay.rb +7 -0
- data/app/models/wco/newspartial.rb +10 -4
- data/app/models/wco/newsvideo.rb +6 -3
- data/app/models/wco/newsvideo_event.rb +21 -0
- data/app/models/wco_email/email_action.rb +2 -1
- data/app/models/wco_email/message.rb +2 -4
- data/app/views/wco/api/newsproducer/_studio_blue.js +730 -0
- data/app/views/wco/api/newsproducer/_studio_green.js +326 -0
- data/app/views/wco/api/newsproducer/studio_blue.html.erb +108 -0
- data/app/views/wco/api/newsproducer/studio_green.html.erb +27 -0
- data/app/views/wco/newsoverlays/_form.haml +4 -0
- data/app/views/wco/newsoverlays/_show_in_newsvideo.haml +2 -1
- data/app/views/wco/newspartials/_show_in_newsvideo.haml +6 -1
- data/app/views/wco/newspartials/_timeline.haml +24 -0
- data/app/views/wco/newsvideo_events/_form.haml +27 -0
- data/app/views/wco/newsvideo_events/_show_in_newsvideo.haml +12 -0
- data/app/views/wco/newsvideo_events/edit.haml +4 -0
- data/app/views/wco/newsvideo_events/new.haml +4 -0
- data/app/views/wco/newsvideos/show.haml +12 -2
- data/config/initializers/assets.rb +2 -0
- data/config/routes.rb +4 -0
- data/lib/tasks/office_tasks.rake +10 -3
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ef74c55ae94534c3dafd7ba9354becda76ca6ca4f7e22e588e21302a98013555
|
|
4
|
+
data.tar.gz: 33fd534065e448419f01d686c5abc00dc64fe2977681f87dae1943e46bb1c836
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d3b94363aecd6b681874d855ea62d9d5e9dc171594cb2de015cdeee2d67eca2906bc81e0d4e61a88984d1c40c6279cc96c787bd90b9c4bd7a17d048dfbcc9bc
|
|
7
|
+
data.tar.gz: 3195590a90fc0c6fb0d49449e84c0217a7699423657c2783c525693df08f0907c236de0a3055a0c501f605bb742f23e4d2a5c63fb4c66e89bd95da971d26db05
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//
|
|
2
|
+
//= require ../vendor/jquery-3.3.1.min
|
|
3
|
+
//= require ../vendor/popper-1.14.0.min
|
|
4
|
+
//= require ../vendor/bootstrap-4.6.2.min
|
|
5
|
+
//= require ../vendor/select2-4.0.0
|
|
6
|
+
//= require ../vendor/jquery.dataTables-1.10.16
|
|
7
|
+
//= require ../vendor/jquery-ui@1.13.2.js
|
|
8
|
+
//
|
|
File without changes
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
.newsvideos-show {
|
|
3
|
+
.generated-video {
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
2
9
|
.zero-height {
|
|
3
10
|
position: absolute;
|
|
4
11
|
}
|
|
@@ -26,6 +33,21 @@
|
|
|
26
33
|
|
|
27
34
|
|
|
28
35
|
|
|
36
|
+
.NewsvideoEventTimeline {
|
|
37
|
+
border: 1px solid orange;
|
|
38
|
+
background: white;
|
|
39
|
+
position: absolute;
|
|
40
|
+
left: 230px;
|
|
41
|
+
|
|
42
|
+
&:hover {
|
|
43
|
+
z-index: 5;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.disabled {
|
|
47
|
+
background: gray;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
29
51
|
|
|
30
52
|
|
|
31
53
|
.NewsoverlayTimeline {
|
|
@@ -37,6 +59,10 @@
|
|
|
37
59
|
&:hover {
|
|
38
60
|
z-index: 5;
|
|
39
61
|
}
|
|
62
|
+
|
|
63
|
+
&.disabled {
|
|
64
|
+
background: gray;
|
|
65
|
+
}
|
|
40
66
|
}
|
|
41
67
|
|
|
42
68
|
.NewspartialTimelineW {
|
|
@@ -70,13 +96,19 @@
|
|
|
70
96
|
min-width: 300px;
|
|
71
97
|
}
|
|
72
98
|
|
|
73
|
-
.
|
|
99
|
+
.header.collapse-expand {
|
|
100
|
+
position: relative;
|
|
74
101
|
z-index: 4;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.full-textC {
|
|
75
105
|
position: relative;
|
|
76
106
|
background: white;
|
|
77
107
|
padding: 10px;
|
|
78
108
|
border: 1px solid black;
|
|
79
109
|
border-radius: 10px;
|
|
110
|
+
|
|
111
|
+
z-index: 4;
|
|
80
112
|
}
|
|
81
113
|
|
|
82
114
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
body {
|
|
3
|
+
background: #ccc;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
.ctrl-row {
|
|
8
|
+
label {
|
|
9
|
+
margin-right: 2em;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
.StudioW1 {
|
|
15
|
+
border: 1px solid red;
|
|
16
|
+
|
|
17
|
+
height: 100%;
|
|
18
|
+
|
|
19
|
+
display: flex;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
|
|
22
|
+
.StudioW0 {
|
|
23
|
+
border: 1px solid blue;
|
|
24
|
+
background: #bbb;
|
|
25
|
+
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
|
|
30
|
+
z-index: 5;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
@@ -54,6 +54,14 @@ class Wco::Api::NewspartialsController < Wco::ApiController
|
|
|
54
54
|
def show_config
|
|
55
55
|
@newspartial = Wco::Newspartial.find params[:id]
|
|
56
56
|
config = JSON.parse @newspartial.speech_json
|
|
57
|
+
|
|
58
|
+
# @newsvideo_events = Wco::NewsvideoEvent.where( newsvideo: @newspartial.newsvideo )
|
|
59
|
+
@newsvideo_events = @newspartial.newsvideo_events
|
|
60
|
+
config[:fns] = @newsvideo_events.map { |ev| ev.exec_js }
|
|
61
|
+
config[:ftimes] = @newsvideo_events.map { |ev| ev.start_at_ms }
|
|
62
|
+
config[:fdurations] = @newsvideo_events.map { |ev| ev.duration_ms }
|
|
63
|
+
|
|
64
|
+
|
|
57
65
|
config[:w_px] = @newspartial.newsvideo.w_px
|
|
58
66
|
config[:h_px] = @newspartial.newsvideo.h_px
|
|
59
67
|
config[:slug] = "#{@newspartial.newsvideo.slug}::#{@newspartial.slug}"
|
|
@@ -4,16 +4,16 @@ class Wco::Api::NewsproducerController < Wco::ApiController
|
|
|
4
4
|
before_action :decode_simple_api_key
|
|
5
5
|
|
|
6
6
|
## trash
|
|
7
|
-
def canvas
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
end
|
|
7
|
+
# def canvas
|
|
8
|
+
# authorize! :home, Wco
|
|
9
|
+
# # render 'canvas_minimal'
|
|
10
|
+
# end
|
|
11
11
|
|
|
12
12
|
## trash
|
|
13
|
-
def canvas_minimal
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
end
|
|
13
|
+
# def canvas_minimal
|
|
14
|
+
# authorize! :home, Wco
|
|
15
|
+
# render 'canvas_minimal'
|
|
16
|
+
# end
|
|
17
17
|
|
|
18
18
|
##
|
|
19
19
|
## current
|
|
@@ -22,5 +22,14 @@ class Wco::Api::NewsproducerController < Wco::ApiController
|
|
|
22
22
|
authorize! :home, Wco
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
+
def studio_blue
|
|
26
|
+
authorize! :home, Wco
|
|
27
|
+
@newspartial = Wco::Newspartial.find params[:newspartial_id] rescue nil
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def studio_green
|
|
31
|
+
authorize! :home, Wco
|
|
32
|
+
end
|
|
33
|
+
|
|
25
34
|
end
|
|
26
35
|
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
|
|
2
|
+
class Wco::NewsvideoEventsController < Wco::ApplicationController
|
|
3
|
+
|
|
4
|
+
before_action :set_lists, only: [ :edit, :new ]
|
|
5
|
+
|
|
6
|
+
def create
|
|
7
|
+
@newsvideo_event = Wco::NewsvideoEvent.new params[:newsvideo_event].permit!
|
|
8
|
+
authorize! :create, @newsvideo_event
|
|
9
|
+
if @newsvideo_event.save
|
|
10
|
+
flash_notice 'Success'
|
|
11
|
+
else
|
|
12
|
+
flash_alert "No luck: #{@newsvideo_event.errors.full_messages.join(',')}."
|
|
13
|
+
end
|
|
14
|
+
redirect_to controller: :newsvideos, method: :index
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def destroy
|
|
18
|
+
@newsvideo_event = Wco::NewsvideoEvent.find params[:id]
|
|
19
|
+
authorize! :destroy, @newsvideo_event
|
|
20
|
+
if @newsvideo_event.delete
|
|
21
|
+
flash[:notice] = "deleted newsvideo_event"
|
|
22
|
+
else
|
|
23
|
+
flash[:alert] = "Cannot delete newsvideo_event: #{@newsvideo_event.errors.messages}"
|
|
24
|
+
end
|
|
25
|
+
redirect_to request.referrer
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def edit
|
|
29
|
+
@newsvideo_event = Wco::NewsvideoEvent.find params[:id]
|
|
30
|
+
authorize! :edit, @newsvideo_event
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def new
|
|
34
|
+
authorize! :create, Wco::NewsvideoEvent
|
|
35
|
+
@newsvideo_event = Wco::NewsvideoEvent.new newsvideo_id: params[:newsvideo_id]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def update
|
|
39
|
+
@newsvideo_event = Wco::NewsvideoEvent.find params[:id]
|
|
40
|
+
authorize! :update, @newsvideo_event
|
|
41
|
+
|
|
42
|
+
if @newsvideo_event.update_attributes params[:newsvideo_event].permit!
|
|
43
|
+
flash_notice 'Success'
|
|
44
|
+
else
|
|
45
|
+
flash_alert "No luck: #{@newsvideo_event.errors.full_messages.join(',')}."
|
|
46
|
+
end
|
|
47
|
+
redirect_to controller: 'newsvideos', action: 'show', id: params[:newsvideo_event][:newsvideo_id]
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
##
|
|
51
|
+
## private
|
|
52
|
+
##
|
|
53
|
+
private
|
|
54
|
+
|
|
55
|
+
def set_lists
|
|
56
|
+
if params[:newspartial_id]
|
|
57
|
+
partial = Wco::Newspartial.find params[:newspartial_id]
|
|
58
|
+
@newspartials_list = partial.newsvideo.newspartials.list
|
|
59
|
+
@newsvideos_list = []
|
|
60
|
+
else
|
|
61
|
+
@newspartials_list = []
|
|
62
|
+
@newsvideos_list = Wco::Newsvideo.list
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
end
|
|
@@ -168,7 +168,10 @@ class Wco::NewsvideosController < Wco::ApplicationController
|
|
|
168
168
|
authorize! :show, @newsvideo
|
|
169
169
|
@newspartials = Wco::Newspartial.where( newsvideo_id: @newsvideo.id.to_s).includes(:video)
|
|
170
170
|
@newsoverlays = @newsvideo.newsoverlays
|
|
171
|
+
@newsvideo_events = @newsvideo.newsvideo_events
|
|
171
172
|
@skip_footer = true
|
|
173
|
+
|
|
174
|
+
puts! @newsvideo_events.to_a, 'zz'
|
|
172
175
|
end
|
|
173
176
|
|
|
174
177
|
def split
|
|
@@ -37,6 +37,13 @@ class Wco::Newsoverlay
|
|
|
37
37
|
field :start_at_ms, type: :integer, default: 0
|
|
38
38
|
field :duration_ms, type: :integer, default: 0
|
|
39
39
|
|
|
40
|
+
STATUS_ACTIVE = 'active'
|
|
41
|
+
STATUS_DISABLED = 'disabled'
|
|
42
|
+
field :status, type: :string, default: STATUS_ACTIVE
|
|
43
|
+
def self.active
|
|
44
|
+
where( status: STATUS_ACTIVE)
|
|
45
|
+
end
|
|
46
|
+
|
|
40
47
|
delegate :duration_ms, to: :video
|
|
41
48
|
delegate :name, to: :video
|
|
42
49
|
|
|
@@ -12,17 +12,19 @@ class Wco::Newspartial
|
|
|
12
12
|
|
|
13
13
|
MAX_WORDS = 30
|
|
14
14
|
|
|
15
|
-
field :title
|
|
16
|
-
# validates :title, presence: true, uniqueness: true
|
|
17
|
-
# index({ title: 1 }, { unique: true })
|
|
18
|
-
|
|
19
15
|
field :body
|
|
20
16
|
field :config_json, type: :string, default: '{}'
|
|
21
17
|
field :speech_json, type: :string, default: '{}' # the smaller config, excludes audio wav
|
|
22
18
|
|
|
23
19
|
belongs_to :newsvideo
|
|
20
|
+
|
|
24
21
|
has_one :video
|
|
25
22
|
|
|
23
|
+
has_many :newsvideo_events, class_name: 'Wco::NewsvideoEvent'
|
|
24
|
+
def newsvideo_events
|
|
25
|
+
Wco::NewsvideoEvent.where(newspartial_id: self.id)
|
|
26
|
+
end
|
|
27
|
+
|
|
26
28
|
field :slug, type: :string
|
|
27
29
|
|
|
28
30
|
has_mongoid_attached_file :audio,
|
|
@@ -127,4 +129,8 @@ class Wco::Newspartial
|
|
|
127
129
|
Wco::Video.where( newspartial_id: self[:id] ).first
|
|
128
130
|
end
|
|
129
131
|
|
|
132
|
+
def to_s
|
|
133
|
+
"#{newsvideo.slug}::#{slug}"
|
|
134
|
+
end
|
|
135
|
+
|
|
130
136
|
end
|
data/app/models/wco/newsvideo.rb
CHANGED
|
@@ -47,7 +47,10 @@ class Wco::Newsvideo
|
|
|
47
47
|
has_and_belongs_to_many :tags
|
|
48
48
|
has_many :videos
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
has_many :newsvideo_events
|
|
51
|
+
def newsvideo_events
|
|
52
|
+
Wco::NewsvideoEvent.where( newsvideo_id: self.id )
|
|
53
|
+
end
|
|
51
54
|
|
|
52
55
|
has_many :newsoverlays
|
|
53
56
|
def newsoverlays
|
|
@@ -133,10 +136,10 @@ class Wco::Newsvideo
|
|
|
133
136
|
|
|
134
137
|
|
|
135
138
|
## overlays
|
|
136
|
-
if @newsvideo.newsoverlays.length > 0
|
|
139
|
+
if @newsvideo.newsoverlays.active.length > 0
|
|
137
140
|
## get overlays
|
|
138
141
|
cmd = "cd #{Rails.root.join('tmp', @newsvideo.id)} ; "
|
|
139
|
-
@newsvideo.newsoverlays.each_with_index do |overlay, idx|
|
|
142
|
+
@newsvideo.newsoverlays.active.each_with_index do |overlay, idx|
|
|
140
143
|
cmd = "#{cmd} wget -nc -O overlay_#{idx}.mp4 #{overlay.video.video.url} ; "
|
|
141
144
|
end
|
|
142
145
|
puts "+++ overlays cmd:"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
class Wco::NewsvideoEvent
|
|
3
|
+
include Mongoid::Document
|
|
4
|
+
include Mongoid::Timestamps
|
|
5
|
+
include Wco::Utils
|
|
6
|
+
store_in collection: 'wco_newsvideo_events'
|
|
7
|
+
|
|
8
|
+
PAGE_PARAM_NAME = 'newsvideo_events_page'
|
|
9
|
+
|
|
10
|
+
belongs_to :newsvideo, class_name: 'Wco::Newsvideo', optional: true
|
|
11
|
+
belongs_to :newspartial, class_name: 'Wco::Newspartial', optional: true
|
|
12
|
+
|
|
13
|
+
field :start_at_ms, type: :integer, default: 0
|
|
14
|
+
field :duration_ms, type: :integer, default: 0
|
|
15
|
+
|
|
16
|
+
field :exec_js, type: :string, default: ''
|
|
17
|
+
|
|
18
|
+
field :status, default: 'active'
|
|
19
|
+
field :name, default: '<event>'
|
|
20
|
+
|
|
21
|
+
end
|
|
@@ -56,12 +56,13 @@ class WcoEmail::EmailAction
|
|
|
56
56
|
next_sch.save!
|
|
57
57
|
end
|
|
58
58
|
end
|
|
59
|
-
|
|
59
|
+
def do_run; send_and_roll; end
|
|
60
60
|
|
|
61
61
|
def self.list
|
|
62
62
|
[[nil,nil]] + all.map { |p| [ "#{p.lead&.email} :: #{p.tmpl&.slug}", p.id ] }
|
|
63
63
|
end
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
+
|
|
66
67
|
Sch = WcoEmail::EmailAction
|
|
67
68
|
|
|
@@ -26,9 +26,7 @@ class WcoEmail::Message
|
|
|
26
26
|
field :subject
|
|
27
27
|
|
|
28
28
|
field :part_html
|
|
29
|
-
|
|
30
|
-
part_html_sanitized
|
|
31
|
-
end
|
|
29
|
+
field :part_txt
|
|
32
30
|
|
|
33
31
|
field :read_at, type: DateTime
|
|
34
32
|
index({ read_at: -1 })
|
|
@@ -57,7 +55,7 @@ class WcoEmail::Message
|
|
|
57
55
|
part_html_fully_sanitized[0..200]
|
|
58
56
|
end
|
|
59
57
|
|
|
60
|
-
|
|
58
|
+
|
|
61
59
|
|
|
62
60
|
field :from, type: :string
|
|
63
61
|
field :mail_from, type: :string
|