Move error message and action links before video title

Error reason, subreason, and 'After which you should try to' links
now appear above the <h1> title, making them the first thing users
see when a video fails to play.
This commit is contained in:
Emilien 2026-06-26 17:51:13 +02:00
parent 9ae7bb4ff6
commit c3f16be5c4
2 changed files with 15 additions and 22 deletions

View File

@ -34,15 +34,11 @@
<% if video.reason.nil? %> <% if video.reason.nil? %>
<%= rendered "components/player" %> <%= rendered "components/player" %>
<% else %> <% else %>
<div id="player-container" class="h-box"> <p>
<div style="display:flex;align-items:center;justify-content:center;background-color:#000;width:100%;aspect-ratio:16/9"> <%= I18n.translate(preferences.locale, "error_from_youtube_unplayable") %>
<p style="color:#fff;font-size:1.2em;text-align:center"> <strong><%= video.reason %></strong>
<%= I18n.translate(preferences.locale, "error_from_youtube_unplayable") %><br/> <% if video.subreason %><br/><%= video.subreason %><% end %>
<strong><%= video.reason %></strong> </p>
<% if video.subreason %><br/><%= video.subreason %><% end %>
</p>
</div>
</div>
<% end %> <% end %>
<script src="/js/embed.js?v=<%= ASSET_COMMIT %>"></script> <script src="/js/embed.js?v=<%= ASSET_COMMIT %>"></script>
</body> </body>

View File

@ -75,19 +75,18 @@ we're going to need to do it here in order to allow for translations.
<div id="player-container" class="h-box"> <div id="player-container" class="h-box">
<%= rendered "components/player" %> <%= rendered "components/player" %>
</div> </div>
<% else %>
<div class="h-box">
<div style="display:flex;align-items:center;justify-content:center;background-color:#000;width:100%;aspect-ratio:16/9">
<p style="color:#fff;font-size:1.2em;text-align:center">
<%= I18n.translate(locale, "error_from_youtube_unplayable") %><br/>
<strong><%= video.reason %></strong>
<% if video.subreason %><br/><%= video.subreason %><% end %>
</p>
</div>
</div>
<% end %> <% end %>
<div class="h-box"> <div class="h-box">
<% if video.reason %>
<h3>
<%= I18n.translate(locale, "error_from_youtube_unplayable") %> <%= video.reason %>
</h3>
<% if video.subreason %>
<p><%= video.subreason %></p>
<% end %>
<%= error_redirect_helper(env) %>
<% end %>
<h1> <h1>
<%= title %> <%= title %>
<% if params.listen %> <% if params.listen %>
@ -107,9 +106,7 @@ we're going to need to do it here in order to allow for translations.
</h3> </h3>
<% end %> <% end %>
<% if video.reason %> <% if video.premiere_timestamp.try &.> Time.utc %>
<%= error_redirect_helper(env) %>
<% elsif video.premiere_timestamp.try &.> Time.utc %>
<h3> <h3>
<%= video.premiere_timestamp.try { |t| I18n.translate(locale, "Premieres in `x`", recode_date((t - Time.utc).ago, locale)) } %> <%= video.premiere_timestamp.try { |t| I18n.translate(locale, "Premieres in `x`", recode_date((t - Time.utc).ago, locale)) } %>
</h3> </h3>