This repository has been archived by the owner on May 21, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f8f19c
commit 5460c49
Showing
4 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package anime | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/animenotifier/notify.moe/utils" | ||
|
||
"github.com/animenotifier/notify.moe/components" | ||
|
||
"github.com/aerogo/aero" | ||
"github.com/animenotifier/arn" | ||
) | ||
|
||
// Trailers Display the trailers of an anime. | ||
func Trailers(ctx *aero.Context) string { | ||
id := ctx.Get("id") | ||
user := utils.GetUser(ctx) | ||
anime, err := arn.GetAnime(id) | ||
|
||
if err != nil { | ||
return ctx.Error(http.StatusNotFound, "Anime not found", err) | ||
} | ||
|
||
return ctx.HTML(components.AnimeTrailers(anime, user)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
component AnimeTrailers(anime *arn.Anime, user *arn.User) | ||
if anime.Trailers != nil && len(anime.Trailers) > 0 | ||
.anime-section.mountable | ||
h3.anime-section-name | ||
a(href=anime.TrailersLink()) Trailers | ||
|
||
.trailers.anime-trailers | ||
each trailer in anime.Trailers | ||
if trailer.ServiceID != "" | ||
.trailer.mountable(data-mountable-type="trailer") | ||
.anime-trailer.video-container | ||
//iframe.video(src="https://www.youtube.com/embed/" + trailer.ServiceID + "?showinfo=0", allowfullscreen) | ||
ExternalMedia(trailer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.anime-trailers | ||
vertical | ||
.trailer | ||
margin 1rem 0 | ||
border-bottom-left-radius ui-element-border-radius !important | ||
border-top-left-radius ui-element-border-radius !important | ||
box-shadow shadow-light | ||
min-height 200px | ||
border-radius ui-element-border-radius | ||
overflow hidden | ||
|
||
iframe | ||
width 100% | ||
|
||
> | ||
500px | ||
.anime-trailers | ||
horizontal-wrap | ||
justify-content flex-start | ||
|
||
.trailer | ||
max-width 200px | ||
margin calc(content-padding / 2) | ||
min-height 112px | ||
height 112px | ||
margin soundtrack-margin | ||
margin-bottom media-bottom-margin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters