backend: link to /media/:media_id instead of raw image
This commit is contained in:
parent
84cbc5dd30
commit
171c6ee8cd
@ -23,7 +23,8 @@ sub list ($self)
|
||||
|
||||
$self->title("Pooru~");
|
||||
my @media = map +{
|
||||
media_src => $self->seaweed->url_for(
|
||||
media_link => $self->url_for("media_show", media_id => $_->{media_id}),
|
||||
media_src => $self->seaweed->url_for(
|
||||
SeaweedFS::FID->from_string($_->{seaweedfs_fid})
|
||||
),
|
||||
}, @{$res->json->{media}};
|
||||
|
@ -50,7 +50,8 @@ sub show ($self)
|
||||
|
||||
$self->title($res->json->{name});
|
||||
my @media = map +{
|
||||
media_src => $self->seaweed->url_for(
|
||||
media_link => $self->url_for("media_show", media_id => $_->{media_id}),
|
||||
media_src => $self->seaweed->url_for(
|
||||
SeaweedFS::FID->from_string($_->{seaweedfs_fid})
|
||||
),
|
||||
}, @{$res->json->{media}};
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<div class="flex-c-horizontal flex-c-wrap gallery">
|
||||
% for my $m (@$media) {
|
||||
<%= link_to $m->{media_src} => begin %>
|
||||
<%= link_to $m->{media_link} => begin %>
|
||||
<%= image $m->{media_src} %>
|
||||
<% end %>
|
||||
% }
|
||||
|
Loading…
Reference in New Issue
Block a user