Only show embed link on error pages if v
query param is present
All checks were successful
Invidious CI / build (push) Successful in 5m14s
All checks were successful
Invidious CI / build (push) Successful in 5m14s
This commit is contained in:
parent
fde3edb2c1
commit
10b4bfa315
1 changed files with 3 additions and 1 deletions
|
@ -183,6 +183,8 @@ def error_redirect_helper(env : HTTP::Server::Context)
|
||||||
go_to_youtube_embed = translate(locale, "videoinfo_youTube_embed_link")
|
go_to_youtube_embed = translate(locale, "videoinfo_youTube_embed_link")
|
||||||
switch_instance = translate(locale, "Switch Invidious Instance")
|
switch_instance = translate(locale, "Switch Invidious Instance")
|
||||||
|
|
||||||
|
show_embed_link = "(<a rel=\"noreferrer noopener\" href=\"https://youtube.com/embed/#{env.params.query["v"]}\">#{go_to_youtube_embed}</a>)" if env.params.query["v"]?
|
||||||
|
|
||||||
return <<-END_HTML
|
return <<-END_HTML
|
||||||
<p style="margin-bottom: 4px;">#{next_steps_text}</p>
|
<p style="margin-bottom: 4px;">#{next_steps_text}</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -194,7 +196,7 @@ def error_redirect_helper(env : HTTP::Server::Context)
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a rel="noreferrer noopener" href="https://youtube.com#{env.request.resource}">#{go_to_youtube}</a>
|
<a rel="noreferrer noopener" href="https://youtube.com#{env.request.resource}">#{go_to_youtube}</a>
|
||||||
(<a rel="noreferrer noopener" href="https://youtube.com/embed/#{env.params.query["v"]}">#{go_to_youtube_embed}</a>)
|
#{show_embed_link}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
END_HTML
|
END_HTML
|
||||||
|
|
Loading…
Add table
Reference in a new issue