Skip to content

Commit

Permalink
Add en.yml translations and clear button
Browse files Browse the repository at this point in the history
  • Loading branch information
radical-ube committed Aug 9, 2023
1 parent ed69b7c commit ee398d1
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 27 deletions.
53 changes: 29 additions & 24 deletions app/views/podcast_player/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
<%= 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.episode.embed_player_type") %>
<%= 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] || "card"}") %>
<%= t(".help.types.#{player_options[:embed_player_type] || "standard"}") %>
</div>
</div>

<div class="col-12 mb-4">
<div>
<div class="form-floating input-group mb-2" data-controller="dynamic-form">
<%= number_field_tag :episode_number, player_options[:episode_number], class: "form-control", data: {action: "dynamic-form#change"}, min: 1, autocomplete: "off" %>
<%= label_tag "Number of Episodes" %>
<%= field_help_text t(".help.episode_number") %>
<a hidden href="<%= request.fullpath %>" data-dynamic-form-target="link"></a>
</div>
<h3 class="fw-bold"><%= t(".title.playlist") %></h3>

<div class="form-floating input-group mb-2" data-controller="dynamic-form">
<%= number_field_tag :season, player_options[:season], class: "form-control", data: {action: "dynamic-form#change"}, min: 0, autocomplete: "off" %>
<%= label_tag :season, t("helpers.label.episode.season") %>
<%= field_help_text t(".help.season") %>
<a hidden href="<%= request.fullpath %>" data-dynamic-form-target="link"></a>
</div>
<div class="form-text mb-4">
<%= t(".help.playlist") %>
</div>

<div class="form-floating input-group mb-2" data-controller="dynamic-form">
<%= select_tag :category, embed_player_category_options(podcast, player_options[:category]), include_blank: true, class: "form-control", data: {action: "dynamic-form#change"} %>
<%= label_tag :category, t("helpers.label.episode.category") %>
<%= field_help_text t(".help.episode_category") %>
<a hidden href="<%= request.fullpath %>" data-dynamic-form-target="link"></a>
</div>
<div class="form-floating input-group mb-2" data-controller="dynamic-form">
<%= 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") %>
<%= field_help_text t(".help.episode_number") %>
<a hidden href="<%= request.fullpath %>" data-dynamic-form-target="link"></a>
</div>

<div class="form-floating input-group mb-2" data-controller="dynamic-form">
<%= number_field_tag :season, player_options[:season], class: "form-control", 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 class="form-floating input-group mb-2" data-controller="dynamic-form">
<%= select_tag :category, embed_player_category_options(podcast, player_options[:category]), include_blank: true, class: "form-control", 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>

<%= link_to t(".clear"), podcast_player_path(podcast), class: "btn btn-primary" %>
</div>

<div class="col-12 mb-4">
Expand All @@ -46,7 +51,7 @@

<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.episode.embed_player_url") %>
<%= 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>
Expand All @@ -55,7 +60,7 @@
<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.episode.embed_player_iframe") %>
<%= label_tag :embed_player_iframe, t("helpers.label.podcast_player.embed_player_iframe") %>
<%= field_copy embed_player_podcast_iframe(podcast, player_options) %>
</div>
</div>
Expand Down
25 changes: 22 additions & 3 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ en:
true: Serial
subtitle: Teaser
title: Title
podcast_player:
embed_player_type: Player Style
episode_number: Number of Episodes
season: Season Number
category: Category
embed_player_url: Embeddable Player Link
embed_player_iframe: Embeddable Player IFrame
# specific pages/views
episodes:
confirm_destroy:
Expand Down Expand Up @@ -265,14 +272,14 @@ en:
episode_player:
form:
enclosure_not_ready: No Media Files Uploaded
help:
help: &player_help
copy: Copy the code for one of the following players, and place it on your webpage.
types:
card: Something about a responsive card
card_fixed: Fixed width card something blah
fixed_card: Fixed width card something blah
standard: The standard player is responsive, meaning it automatically adjusts to the content column it is embedded in. Resize this panel to see how the player adjusts and looks at different widths.
warning: It looks like your episode is not yet published, or very recently published. The player below is only a preview of how it will appear after your feed is updated with the new episode. Your copyable iframe/links will begin to function as expected within a few minutes of publishing.
title:
title: &player_title
copy: Copy and Use your Embed Code
preview: Player
warning: Warning
Expand Down Expand Up @@ -583,6 +590,18 @@ en:
end_date: End date
month: Weeks of the Month
period: Weekly interval
podcast_player:
form:
help:
<<: *player_help
episode_number: Choose the number of episodes for this playlist. Leaving this blank will play only the most recent episode.
season: (Optional) Choose a single season for this playlist. Leaving this blank or 0 will not add a season filter.
episode_category: (Optional) Choose a single category for this playlist. Leaving this blank will not add a category filter.
playlist: Add any options below to better specify the playlist you want to create.
title:
<<: *player_title
playlist: Make it a playlist
clear: Clear options
podcast_switcher:
dropdown:
all: View all my Podcasts
Expand Down

0 comments on commit ee398d1

Please sign in to comment.