backend: include links to tags in media#show

This commit is contained in:
Lucas 2023-03-19 21:59:41 +00:00
parent ac9054f918
commit 0a20d7e9f7
1 changed files with 7 additions and 3 deletions

View File

@ -14,7 +14,11 @@
<dt>Content-Type</dt>
<dd><%= $media->{content_type} %></dd>
<dt>Tags</dt>
<% for my $tag ($media->{tags}->@*) { %>
<dd><%= link_to $tag => url_for("tag_show", tag_id_or_name => $tag) %></dd>
<% } %>
% if ($media->{tags}->@* == 0) {
<dd>None yet.</dd>
% } else {
<dd><%= c($media->{tags}->@*)
->map(sub { link_to $_ => url_for("tag_show", tag_id_or_name => $_) })
->join(", ") %>.</dd>
% }
</dl>