Skip to content

Commit

Permalink
Add link and iframe copy
Browse files Browse the repository at this point in the history
  • Loading branch information
radical-ube committed Aug 7, 2023
1 parent 60b0d36 commit 13c2b4e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/helpers/embed_player_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def embed_player_episode_url(ep, type = nil, preview = false)
embed_params(params)
end

def embed_player_podcast_url(podcast, preview = false, options)
def embed_player_podcast_url(podcast, options, preview = false)
params = {}

params[EMBED_PLAYER_FEED] = podcast.published_url
Expand All @@ -63,8 +63,8 @@ def embed_player_episode_iframe(ep, type = nil, preview = false)
end
end

def embed_player_podcast_iframe(podcast, preview = false, options)
src = embed_player_podcast_url(podcast, preview, options)
def embed_player_podcast_iframe(podcast, options, preview = false)
src = embed_player_podcast_url(podcast, options, preview)
allow = "monetization"

if options[:embed_player_type] == "card"
Expand Down
17 changes: 14 additions & 3 deletions app/views/podcast_player/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,32 @@
</div>

<div class="col-12 mb-4">
<div class="form-floating input-group">
<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.episode.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.episode.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, true, player_options) %>
<%= embed_player_podcast_iframe(podcast, player_options, true) %>
</div>

<% end %>

0 comments on commit 13c2b4e

Please sign in to comment.