-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #628 from PRX/feat/606-episode-drafts-sweep
Podcast Planner verbiage and layout
- Loading branch information
Showing
11 changed files
with
108 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
export default class extends Controller { | ||
static targets = ["counter", "display"] | ||
|
||
recount() { | ||
this.displayTarget.innerHTML = this.countSelectedTargets() | ||
} | ||
|
||
countSelectedTargets() { | ||
const selectedTargets = this.counterTargets.filter((el) => { | ||
return !el.disabled | ||
}) | ||
return selectedTargets.length | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<div class="col <%= "d-none" if index >= range %>" data-pager-target="page"> | ||
<div class="col col-xl-4 <%= "d-none" if index >= range %>" data-pager-target="page"> | ||
<%= month_calendar(start_date: start_date) do |date| %> | ||
<% if date_is_in_month?(date, start_date.month) %> | ||
<%= date.day %> | ||
<%= form.hidden_field :selected_dates, multiple: true, data: {date_target: "preselected"}, value: date.to_datetime, disabled: !date_is_in_dates?(date, @planner.dates), draft: date_is_in_dates?(date, @draft_dates) %> | ||
<%= form.hidden_field :selected_dates, multiple: true, data: {date_target: "preselected", count_target: "counter"}, value: date.to_datetime, disabled: !date_is_in_dates?(date, @planner.dates), draft: date_is_in_dates?(date, @draft_dates) %> | ||
<% end %> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,55 @@ | ||
<div class="card"> | ||
<div class="card-header-primary"> | ||
<h5 class="card-title"><%= t(".header.preview") %></h5> | ||
<%= form_with( | ||
url: podcast_planner_path(@podcast), | ||
method: :post | ||
) do |form| %> | ||
<div class="mb-4"> | ||
<h3 class="mb-3"><%= t(".header.publish_time") %></h3> | ||
<div class="col-lg-12"> | ||
<div class="form-floating"> | ||
<%= form.select :publish_time, time_options %> | ||
<%= form.label :publish_time %> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<%= form_with( | ||
url: podcast_planner_path(@podcast), | ||
method: :post | ||
) do |form| %> | ||
<div class="card-body"> | ||
<div class="row mb-4"> | ||
<div class="col-lg-6"> | ||
<h3 class="fw-bold"><%= t(".header.publish_time") %></h3> | ||
<div class="form-floating"> | ||
<%= form.select :publish_time, time_options %> | ||
<%= form.label :publish_time %> | ||
</div> | ||
</div> | ||
<div class="mb-4"> | ||
<h3 class="mb-3"><%= t(".header.audio_segments") %></h3> | ||
<div class="col-lg-12"> | ||
<div class="form-floating"> | ||
<%= form.number_field :segment_count, {min: 1, max: 10, step: 1, value: 2} %> | ||
<%= form.label :segment_count %> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="col-lg-6"> | ||
<h3 class="fw-bold"><%= t(".header.audio_segments") %></h3> | ||
<div class="form-floating"> | ||
<%= form.number_field :segment_count, {min: 1, max: 10, step: 1, value: 2} %> | ||
<%= form.label :segment_count %> | ||
</div> | ||
<div class="card p-4 mt-4mb-4"> | ||
<%= turbo_frame_tag "preview", target: "_top" do %> | ||
<div data-controller="pager count" data-pager-range-value="6"> | ||
<div class="d-flex justify-content-between"> | ||
<h3 class="mb-3"><%= t(".header.number_of_drafts") %> | ||
<span data-count-target="display"><%= @planner.dates.present? ? @planner.dates.count : "0" %></span> | ||
</h3> | ||
<div class="mb-2"> | ||
<%= button_tag type: "button", class: "btn btn-primary btn-sm", data: {action: "click->pager#pageBackward", pager_target: "prev"}, disabled: true do %> | ||
<span class="material-icons">arrow_left</span> | ||
Month | ||
<% end %> | ||
<%= button_tag type: "button", class: "btn btn-primary btn-sm", data: {action: "click->pager#pageForward", pager_target: "next"} do %> | ||
Month | ||
<span class="material-icons">arrow_right</span> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
||
<div class="col-lg"> | ||
<div data-controller="pager" data-pager-range-value="6"> | ||
<div class="mb-2"> | ||
<%= button_tag type: "button", class: "btn btn-primary btn-sm", data: {action: "click->pager#pageBackward", pager_target: "prev"}, disabled: true do %> | ||
<span class="material-icons">arrow_left</span> | ||
Month | ||
<% end %> | ||
<%= button_tag type: "button", class: "btn btn-primary btn-sm", data: {action: "click->pager#pageForward", pager_target: "next"} do %> | ||
Month | ||
<span class="material-icons">arrow_right</span> | ||
<% end %> | ||
</div> | ||
|
||
<%= turbo_frame_tag "preview", target: "_top" do %> | ||
<div class="row"> | ||
<% 24.times do |i| %> | ||
<%= render "calendar", form: form, start_date: Date.today.beginning_of_month + i.months, planner: @planner, index: i, range: 6 %> | ||
<% end %> | ||
</div> | ||
<div class="row d-flex flex-wrap gx-4"> | ||
<% 24.times do |i| %> | ||
<%= render "calendar", form: form, start_date: Date.today.beginning_of_month + i.months, planner: @planner, index: i, range: 6 %> | ||
<% end %> | ||
</div> | ||
</div> | ||
<p class="mb-0 fs-6">Key: <span class="badge bg-warning text-dark">Existing Episode Draft</span> <span class="badge bg-primary">New Episode Draft</span></p> | ||
</div> | ||
<div class="card-footer"> | ||
<%= form.submit t(".label.submit"), class: "btn btn-primary" %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
|
||
</div> | ||
<%= form.submit t(".label.submit"), class: "btn btn-primary mb-4" %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
<%= render "podcasts/tabs" %> | ||
|
||
<div class="row my-4 px-2"> | ||
<div class="col-lg-4"> | ||
<%= render "form_main" %> | ||
</div> | ||
<div class="col-lg-8"> | ||
<%= render "form_side" %> | ||
</div> | ||
<div class="my-4 px-2"> | ||
<%= render "form_main" %> | ||
<%= render "form_side" %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters