backend: rename /view -> /media

This commit is contained in:
Lucas 2023-02-19 20:22:29 +00:00
parent b09a5e7fe1
commit c55bdd6ea7
2 changed files with 4 additions and 4 deletions

View File

@ -75,7 +75,7 @@ get "/" => sub {
my @media = map +{
# XXX point to a cache
image_src => "$POORBOORU_API/download/$_",
view_uri => uri_for("/view/$_"),
media_uri => uri_for("/media/$_"),
}, @{$data->{media}};
template "gallery" => {
@ -119,7 +119,7 @@ get "/tag/:tag_id_or_name" => sub {
my @media = map +{
# XXX point to a cache
image_src => "$POORBOORU_API/download/$_",
view_uri => uri_for("/view/$_"),
media_uri => uri_for("/media/$_"),
}, @{$data->{media}};
template "gallery" => {
@ -129,7 +129,7 @@ get "/tag/:tag_id_or_name" => sub {
};
};
get "/view/:media_id" => sub {
get "/media/:media_id" => sub {
my $media_id = route_parameters->get("media_id");
my $res = api_get("/media/$media_id");

View File

@ -1,6 +1,6 @@
<div class="flex-c-horizontal flex-c-wrap gallery">
[% FOREACH entry IN media -%]
<a href="[% entry.view_uri %]">
<a href="[% entry.media_uri %]">
<img class="gallery-image" src="[% entry.image_src %]" />
</a>
[% END -%]