Skip to content

Commit 2f4dfa8

Browse files
committed
Start on settings
1 parent 618dae7 commit 2f4dfa8

File tree

4 files changed

+52
-3
lines changed

4 files changed

+52
-3
lines changed

app/controllers/podcast_stream_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ def stream_params
3838
:status,
3939
:start_date,
4040
:end_date,
41-
:record_days,
42-
:record_hours,
4341
:create_as,
44-
:expiration
42+
:expiration,
43+
record_days: [],
44+
record_hours: []
4545
)
4646
end
4747
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module StreamRecordingsHelper
2+
def stream_record_days_options
3+
StreamRecording::ALL_DAYS.map do |day|
4+
[I18n.t("date.day_names")[day % 7], day]
5+
end
6+
end
7+
8+
def stream_record_hours_options
9+
StreamRecording::ALL_HOURS.map do |hour|
10+
[Time.new(2000, 1, 1, hour, 0, 0).strftime("%l %p").strip, hour]
11+
end
12+
end
13+
end
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<div class="col-12 mb-4">
2+
<div class="card shadow border-0">
3+
<div class="card-header card-header-light d-flex justify-content-between">
4+
<h5 class="card-title flex-grow-1"><%= t(".title") %></h5>
5+
</div>
6+
7+
<div class="card-body pb-0">
8+
<p class=""><%= t(".hint") %></p>
9+
10+
<div class="row">
11+
<div class="col-6 mb-4">
12+
<div class="form-floating input-group">
13+
<%= form.select :record_days, stream_record_days_options, {include_blank: true}, multiple: true %>
14+
<%= form.label :record_days %>
15+
<%= field_help_text t(".help.record_days") %>
16+
</div>
17+
</div>
18+
19+
<div class="col-6 mb-4">
20+
<div class="form-floating input-group">
21+
<%= form.select :record_hours, stream_record_hours_options, {include_blank: true}, multiple: true %>
22+
<%= form.label :record_hours %>
23+
<%= field_help_text t(".help.record_hours") %>
24+
</div>
25+
</div>
26+
</div>
27+
</div>
28+
</div>
29+
</div>

config/locales/en.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,8 @@ en:
613613
embed_player_url: Embeddable Player URL
614614
embed_player_iframe: Embeddable Player IFrame
615615
stream_recording:
616+
record_hours: Hours of the Day
617+
record_days: Days of the Week
616618
url: Stream URL
617619
transcript:
618620
formats:
@@ -1432,6 +1434,11 @@ en:
14321434
form_main:
14331435
help:
14341436
url: Something something what is this
1437+
form_settings:
1438+
help:
1439+
record_days: todo
1440+
hint: Define which days and hours of the stream you want to create clips or episodes from.
1441+
title: Recording Settings
14351442
form_status:
14361443
<<: *form_status
14371444
title: Stream Recording Status

0 commit comments

Comments
 (0)