diff options
| author | Ken D'Ambrosio <ken@jots.org> | 2026-05-14 22:59:59 +0000 |
|---|---|---|
| committer | Ken D'Ambrosio <ken@jots.org> | 2026-05-14 22:59:59 +0000 |
| commit | c76ea393777897e0c367e186d1a3b243193d8377 (patch) | |
| tree | b922795d65bcbea171ef6c2ddf6b3c80881123d2 /views | |
| parent | 6acd47c1ca27d705afe88b292a55a5170c038d2e (diff) | |
Hide transcoded originals from non-admins; mark them visually for admins
update.rb records transcoded_to in album.json (even on re-runs where
the MP4 already exists) so the marker survives across scans.
app.rb filters files with transcoded_to from non-admin views.
album.erb renders them greyed-out with an amber "⚠ original" badge in
admin mode. admin/album.erb marks the edit-table row and shows the
target filename under the original.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'views')
| -rw-r--r-- | views/admin/album.erb | 7 | ||||
| -rw-r--r-- | views/album.erb | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/views/admin/album.erb b/views/admin/album.erb index f28d515..15a043f 100644 --- a/views/admin/album.erb +++ b/views/admin/album.erb @@ -70,9 +70,12 @@ <% @files.each do |name| %> <% meta = (@data['files'] || {})[name] || {} %> <% file_rel = @rel.empty? ? name : "#{@rel}/#{name}" %> - <tr> + <tr<%= ' class="original-file"' if meta['transcoded_to'] %>> <td><img src="/thumb/<%= file_rel %>" width="60" height="60" loading="lazy" style="object-fit:cover"></td> - <td class="filename"><code><%= name %></code></td> + <td class="filename"> + <code><%= name %></code> + <% if meta['transcoded_to'] %><span class="transcoded-label">→ <%= meta['transcoded_to'] %></span><% end %> + </td> <td><input type="text" name="file_caption[<%= name %>]" value="<%= ERB::Util.html_escape(meta['caption'].to_s) %>" placeholder="caption…"></td> <td class="visible-cell"> <input type="hidden" name="file_visible[<%= name %>]" value="0"> diff --git a/views/album.erb b/views/album.erb index 8577bdb..64bf763 100644 --- a/views/album.erb +++ b/views/album.erb @@ -54,7 +54,7 @@ <div class="grid" id="photo-grid"> <% @entries.each_with_index do |e, i| %> <% file_rel = @rel.empty? ? e[:name] : "#{@rel}/#{e[:name]}" %> - <div class="card media-card<%= ' hidden-item' unless e[:visible] %>" + <div class="card media-card<%= ' hidden-item' unless e[:visible] %><%= ' unplayable-original' if e[:transcoded_to] %>" data-index="<%= i %>" data-type="<%= e[:type] %>" data-src="/media/<%= file_rel %>" @@ -66,6 +66,7 @@ <% if e[:type] == :video %><span class="type-badge video-badge">▶</span><% end %> <% if e[:type] == :video && e[:duration] %><span class="duration-badge"><%= format_duration(e[:duration]) %></span><% end %> <% if e[:type] == :audio %><span class="type-badge audio-badge">♪</span><% end %> + <% if e[:transcoded_to] %><span class="unplayable-badge">⚠ original</span><% end %> </div> <% if e[:caption] %> <div class="card-meta"><p class="card-caption"><%= e[:caption] %></p></div> |
