-
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 #753 from PRX/feat/podcast-embed-player
Feat/podcast embed player
- Loading branch information
Showing
5 changed files
with
178 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<%= turbo_frame_tag "embed-player", data: {controller: "morphdom"} do %> | ||
<div class="col-12 mb-4"> | ||
<div class="form-floating input-group" data-controller="dynamic-form"> | ||
<%= select_tag :embed_player_type, embed_player_type_options(player_options[:embed_player_type]), class: "form-control", data: {action: "dynamic-form#change"} %> | ||
<%= label_tag :embed_player_type, t("helpers.label.podcast_player.embed_player_type") %> | ||
<a hidden href="<%= request.fullpath %>" data-dynamic-form-target="link"></a> | ||
</div> | ||
|
||
<div class="form-text"> | ||
<%= t(".help.types.#{player_options[:embed_player_type] || "standard"}") %> | ||
</div> | ||
</div> | ||
|
||
<div class="card border-light mb-4"> | ||
<div class="card-header-light"><%= t(".title.playlist") %></div> | ||
|
||
<div class="card-body"> | ||
<div class="form-text mb-4"> | ||
<%= t(".help.playlist") %> | ||
</div> | ||
|
||
<div class="row mb-4" data-controller="toggle-field"> | ||
<div class="col-6"> | ||
<div class="form-floating input-group" data-controller="dynamic-form"> | ||
<%= select_tag :all_episodes, embed_player_all_episodes_options(player_options[:all_episodes]), class: "form-control", data: {action: "dynamic-form#change toggle-field#displayOnlyThisField"}, include_blank: false %> | ||
<%= label_tag t("helpers.label.podcast_player.episode_number") %> | ||
<%= field_help_text t(".help.episode_number") %> | ||
<a hidden href="<%= request.fullpath %>" data-dynamic-form-target="link"></a> | ||
</div> | ||
</div> | ||
|
||
<div class="col-6"> | ||
<div class="<%= "d-none" unless player_options[:all_episodes] == "number" %> form-floating input-group" data-controller="dynamic-form" data-toggle-field-target="field" field="number"> | ||
<%= number_field_tag :episode_number, player_options[:episode_number], class: "form-control", data: {action: "dynamic-form#change"}, min: 1, autocomplete: "off" %> | ||
<%= label_tag t("helpers.label.podcast_player.episode_number") %> | ||
<a hidden href="<%= request.fullpath %>" data-dynamic-form-target="link"></a> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="row mb-4"> | ||
<div class="col-6"> | ||
<div class="form-floating input-group" data-controller="dynamic-form"> | ||
<%= number_field_tag :season, player_options[:season], class: "form-control #{"form-control-blank" unless player_options[:season].present?}", data: {action: "dynamic-form#change"}, min: 0, autocomplete: "off" %> | ||
<%= label_tag :season, t("helpers.label.podcast_player.season") %> | ||
<%= field_help_text t(".help.season") %> | ||
<a hidden href="<%= request.fullpath %>" data-dynamic-form-target="link"></a> | ||
</div> | ||
</div> | ||
|
||
<div class="col-6"> | ||
<div class="form-floating input-group" data-controller="dynamic-form"> | ||
<%= select_tag :category, embed_player_category_options(podcast, player_options[:category]), include_blank: true, class: "form-control #{"form-control-blank" unless player_options[:category].present?}", data: {action: "dynamic-form#change"} %> | ||
<%= label_tag :category, t("helpers.label.podcast_player.category") %> | ||
<%= field_help_text t(".help.episode_category") %> | ||
<a hidden href="<%= request.fullpath %>" data-dynamic-form-target="link"></a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="card-footer"> | ||
<%= link_to t(".clear"), podcast_player_path(podcast), class: "btn btn-primary" %> | ||
</div> | ||
</div> | ||
|
||
<div class="col-12 mb-4"> | ||
<h3 class="fw-bold"><%= t(".title.copy") %></h3> | ||
|
||
<div class="form-text mb-4"> | ||
<%= t(".help.copy") %> | ||
</div> | ||
|
||
<div class="form-floating input-group"> | ||
<%= text_field_tag :embed_player_url, embed_player_podcast_url(podcast, player_options), class: "form-control", disabled: true, autocomplete: "off" %> | ||
<%= label_tag :embed_player_url, t("helpers.label.podcast_player.embed_player_url") %> | ||
<%= field_link embed_player_podcast_url(podcast, player_options) %> | ||
<%= field_copy embed_player_podcast_url(podcast, player_options) %> | ||
</div> | ||
</div> | ||
|
||
<div class="col-12 mb-4"> | ||
<div class="form-floating input-group"> | ||
<%= text_field_tag :embed_player_iframe, embed_player_podcast_iframe(podcast, player_options), class: "form-control", disabled: true, autocomplete: "off" %> | ||
<%= label_tag :embed_player_iframe, t("helpers.label.podcast_player.embed_player_iframe") %> | ||
<%= field_copy embed_player_podcast_iframe(podcast, player_options) %> | ||
</div> | ||
</div> | ||
|
||
<div class="col-12 mb-4"> | ||
<h3 class="fw-bold"><%= t(".title.preview") %></h3> | ||
|
||
<%= embed_player_podcast_iframe(podcast, player_options, true) %> | ||
</div> | ||
<% 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,3 +1,9 @@ | ||
<%= render "podcasts/tabs" %> | ||
|
||
podcast player | ||
<div class="row my-4 mx-2"> | ||
<div class="col-lg-12"> | ||
<div class="row"> | ||
<%= render "form", podcast: @podcast, player_options: @player_options %> | ||
</div> | ||
</div> | ||
</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