Fix missing transcripts btn when desc is expanded

This commit is contained in:
syeopite 2025-05-10 20:32:16 -07:00
parent 7593717707
commit 6ecae19477
No known key found for this signature in database
GPG Key ID: A73C186DA3955A1A
2 changed files with 17 additions and 14 deletions

View File

@ -0,0 +1,13 @@
<% if captions %>
<div class="description-widget description-show-transcript-widget">
<h4><%=HTML.escape(translate(locale, "video_description_show_transcript_section_label"))%></h4>
<% if transcript %>
<% hide_transcripts_param = env.params.query.dup %>
<% hide_transcripts_param.delete_all("show_transcripts") %>
<a class="pure-button pure-button-secondary" href="/watch?<%= hide_transcripts_param %>"><%=HTML.escape(translate(locale, "video_description_show_transcript_section_button_hide"))%></a>
<% else %>
<a class="pure-button pure-button-secondary" href="/watch?<%= env.params.query %>&show_transcripts=1"><%=HTML.escape(translate(locale, "video_description_show_transcript_section_button"))%></a>
<% end %>
</div>
<% end %>

View File

@ -253,23 +253,13 @@ we're going to need to do it here in order to allow for translations.
<div id="description-box"> <!-- Description --> <div id="description-box"> <!-- Description -->
<% if video.description.size < 200 || params.extend_desc %> <% if video.description.size < 200 || params.extend_desc %>
<div id="descriptionWrapper"><%= video.description_html %></div> <div id="descriptionWrapper"><%= video.description_html %>
<%= rendered "components/description_toggle_transcripts_widget" %>
</div>
<% else %> <% else %>
<input id="descexpansionbutton" type="checkbox"/> <input id="descexpansionbutton" type="checkbox"/>
<div id="descriptionWrapper"><%-= video.description_html %> <div id="descriptionWrapper"><%-= video.description_html %>
<% if captions %> <%= rendered "components/description_toggle_transcripts_widget" %>
<div class="description-widget description-show-transcript-widget">
<h4><%=HTML.escape(translate(locale, "video_description_show_transcript_section_label"))%></h4>
<% if transcript %>
<% hide_transcripts_param = env.params.query.dup %>
<% hide_transcripts_param.delete_all("show_transcripts") %>
<a class="pure-button pure-button-secondary" href="/watch?<%= hide_transcripts_param %>"><%=HTML.escape(translate(locale, "video_description_show_transcript_section_button_hide"))%></a>
<% else %>
<a class="pure-button pure-button-secondary" href="/watch?<%= env.params.query %>&show_transcripts=1"><%=HTML.escape(translate(locale, "video_description_show_transcript_section_button"))%></a>
<% end %>
</div>
<% end %>
</div> </div>
<label for="descexpansionbutton"> <label for="descexpansionbutton">
<a></a> <a></a>