2018-10-28 12:57:59 +09:00

73 lines
2.2 KiB
Plaintext

component AMVPage(amv *arn.AMV, user *arn.User)
AMVTabs(amv, user)
.widget-form.amv-page
if amv.Title.String() == ""
h1.amv-page-title.mountable untitled
else
h1.amv-page-title.mountable= amv.Title.ByUser(user)
if amv.File != ""
AMV(amv, user)
if amv.MainAnimeID != "" || len(amv.ExtraAnimeIDs) > 0
.widget
h3.widget-title.mountable Anime
if amv.MainAnimeID != "" && amv.MainAnime() != nil
.amv-main-anime.mountable
AnimeGrid([]*arn.Anime{amv.MainAnime()}, user)
if len(amv.ExtraAnimeIDs) > 0
.amv-extra-anime.mountable
AnimeGridSmall(amv.ExtraAnime(), user)
if len(amv.VideoEditorIDs) > 0
.widget
if len(amv.VideoEditorIDs) == 1
h3.widget-title.mountable Editor
else
h3.widget-title.mountable Editors
.user-avatars.amv-editors
each editor in amv.VideoEditors()
.mountable
Avatar(editor)
if len(amv.Links) > 0
.widget
h3.widget-title.mountable Links
.light-button-group.amv-links
each link in amv.Links
a.light-button.amv-link.mountable(href=link.URL)
Icon("external-link")
span= link.Title
if len(amv.Tags) > 0
.widget
h3.widget-title.mountable Tags
.tags.mountable
each tag in amv.Tags
.tag.mountable= tag
if amv.File != "" && amv.Info.Video.Width > 0
.footer.amv-details.mountable
p= fmt.Sprintf("Video: %dx%d | %.0f FPS | %s", amv.Info.Video.Width, amv.Info.Video.Height, amv.Info.Video.FPS, amv.Info.Video.Codec)
p= fmt.Sprintf("Audio: %.0f Hz | %d bit | %s", amv.Info.Audio.SamplingFrequency, amv.Info.Audio.BitDepth, amv.Info.Audio.Codec)
component AnimeGridSmall(animes []*arn.Anime, user *arn.User)
each anime in animes
a.tip.mountable(href=anime.Link(), aria-label=anime.Title.ByUser(user))
img.lazy(data-src=anime.ImageLink("small"), data-webp="true", data-color=anime.AverageColor(), alt=anime.Title.ByUser(user))
component AMVTabs(amv *arn.AMV, user *arn.User)
.tabs
LikeTab(strconv.Itoa(len(amv.Likes)), "heart", "amv", amv, user)
Tab("AMV", "video-camera", amv.Link())
if user != nil
Tab("Edit", "pencil", amv.Link() + "/edit")
Tab("History", "history", amv.Link() + "/history")