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? %>
<%= rendered "components/player" %>
<% else %>
<div id="player-container" 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(preferences.locale, "error_from_youtube_unplayable") %><br/>
<p>
<%= I18n.translate(preferences.locale, "error_from_youtube_unplayable") %>
<strong><%= video.reason %></strong>
<% if video.subreason %><br/><%= video.subreason %><% end %>
</p>
</div>
</div>
</p>
<% end %>
<script src="/js/embed.js?v=<%= ASSET_COMMIT %>"></script>
</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">
<%= rendered "components/player" %>
</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 %>
<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>
<%= title %>
<% if params.listen %>
@ -107,9 +106,7 @@ we're going to need to do it here in order to allow for translations.
</h3>
<% end %>
<% if video.reason %>
<%= error_redirect_helper(env) %>
<% elsif video.premiere_timestamp.try &.> Time.utc %>
<% if video.premiere_timestamp.try &.> Time.utc %>
<h3>
<%= video.premiere_timestamp.try { |t| I18n.translate(locale, "Premieres in `x`", recode_date((t - Time.utc).ago, locale)) } %>
</h3>