2018-03-13 00:49:54 +00:00
|
|
|
component SoundTrackPage(track *arn.SoundTrack, user *arn.User)
|
2017-11-05 18:54:58 +00:00
|
|
|
SoundTrackTabs(track, user)
|
|
|
|
|
2018-03-11 14:43:17 +00:00
|
|
|
.soundtrack-full-page
|
2018-04-08 20:50:23 +00:00
|
|
|
if track.Title.ByUser(user) == ""
|
2017-10-12 22:44:19 +00:00
|
|
|
h1.mountable untitled
|
|
|
|
else
|
2018-04-08 20:50:23 +00:00
|
|
|
h1.mountable= track.Title.ByUser(user)
|
2017-06-27 22:16:45 +00:00
|
|
|
|
2018-03-11 14:43:17 +00:00
|
|
|
.widget-form.soundtrack-media-list
|
2017-10-12 22:44:19 +00:00
|
|
|
each media in track.Media
|
|
|
|
.widget.mountable
|
|
|
|
h3.widget-title= media.Service
|
2018-03-11 14:43:17 +00:00
|
|
|
.soundtrack-media.video-container
|
2017-11-17 12:08:00 +00:00
|
|
|
iframe.lazy.video(data-src=media.EmbedLink(), allowfullscreen="allowfullscreen")
|
2018-03-11 02:00:06 +00:00
|
|
|
|
2018-03-11 03:51:10 +00:00
|
|
|
if user != nil && media.Service == "Youtube" && track.File != ""
|
2018-03-11 02:00:06 +00:00
|
|
|
.buttons
|
2018-03-11 17:17:35 +00:00
|
|
|
button.action(data-action="playAudio", data-trigger="click", data-audio-src="/audio/" + track.File, data-soundtrack-id=track.ID)
|
2018-03-11 02:00:06 +00:00
|
|
|
Icon("play")
|
|
|
|
span Play in background
|
2017-11-05 18:54:58 +00:00
|
|
|
|
2017-10-15 23:26:41 +00:00
|
|
|
.widget.mountable
|
|
|
|
h3.widget-title Anime
|
|
|
|
|
2018-03-11 14:43:17 +00:00
|
|
|
.soundtrack-anime-list
|
2017-10-15 23:26:41 +00:00
|
|
|
each anime in track.Anime()
|
2018-03-23 20:33:19 +00:00
|
|
|
a.soundtrack-anime-list-item(href=anime.Link(), title=anime.Title.ByUser(user))
|
2018-03-20 21:39:21 +00:00
|
|
|
img.soundtrack-anime-list-item-image.lazy(data-src=anime.ImageLink("small"), data-webp="true", data-color=anime.AverageColor(), alt=anime.Title.ByUser(user))
|
2017-11-05 18:54:58 +00:00
|
|
|
|
2018-03-17 21:31:14 +00:00
|
|
|
if len(track.Links) > 0
|
|
|
|
.widget.mountable
|
|
|
|
h3.widget-title Links
|
|
|
|
ul.soundtrack-links
|
|
|
|
for _, link := range track.Links
|
|
|
|
li
|
|
|
|
a.soundtrack-link(href=link.URL, target="_blank")= link.Title
|
|
|
|
|
2018-03-13 15:45:40 +00:00
|
|
|
//- TODO: This is quite ineffective, performance-wise
|
|
|
|
if len(track.OsuBeatmaps()) > 0 || len(track.EtternaBeatmaps()) > 0
|
2017-10-22 12:36:55 +00:00
|
|
|
.widget.mountable
|
|
|
|
h3.widget-title Beatmaps
|
|
|
|
ul.beatmaps
|
2018-03-13 15:45:40 +00:00
|
|
|
for index, beatmap := range track.OsuBeatmaps()
|
2017-10-22 12:36:55 +00:00
|
|
|
li
|
2018-03-13 15:45:40 +00:00
|
|
|
a.beatmap(href="https://osu.ppy.sh/s/" + beatmap, target="_blank")= "Osu Beatmap #" + strconv.Itoa(index + 1)
|
|
|
|
|
|
|
|
for index, beatmap := range track.EtternaBeatmaps()
|
|
|
|
li
|
2018-04-13 10:20:13 +00:00
|
|
|
a.beatmap(href="https://etternaonline.com/song/view/" + beatmap, target="_blank")= "Etterna Beatmap #" + strconv.Itoa(index + 1)
|
|
|
|
|
2017-10-15 18:19:45 +00:00
|
|
|
.widget.mountable
|
|
|
|
h3.widget-title Tags
|
2018-03-13 00:49:54 +00:00
|
|
|
|
2017-10-15 23:35:28 +00:00
|
|
|
.tags
|
2017-10-15 18:19:45 +00:00
|
|
|
each tag in track.Tags
|
2018-03-23 20:33:19 +00:00
|
|
|
a.tag(href="/soundtracks/tag/" + tag)= tag
|
2018-03-13 00:49:54 +00:00
|
|
|
|
2017-11-13 15:46:33 +00:00
|
|
|
.footer.mountable
|
2017-10-12 22:44:19 +00:00
|
|
|
if track.EditedBy != ""
|
2017-11-13 20:28:03 +00:00
|
|
|
span Edited
|
2017-10-12 22:44:19 +00:00
|
|
|
span.utc-date(data-date=track.Edited)
|
2017-11-13 20:28:03 +00:00
|
|
|
span by
|
2018-04-08 10:01:18 +00:00
|
|
|
span= track.Editor().Nick
|
2017-10-12 22:44:19 +00:00
|
|
|
else
|
2017-11-13 20:28:03 +00:00
|
|
|
span Posted
|
2017-10-12 22:44:19 +00:00
|
|
|
span.utc-date(data-date=track.Created)
|
2017-11-13 20:28:03 +00:00
|
|
|
span by
|
2017-10-18 16:18:15 +00:00
|
|
|
span= track.Creator().Nick
|
2017-11-05 18:54:58 +00:00
|
|
|
|
2017-10-12 22:44:19 +00:00
|
|
|
span .
|
2017-10-12 15:52:46 +00:00
|
|
|
|
2017-11-05 18:54:58 +00:00
|
|
|
component SoundTrackTabs(track *arn.SoundTrack, user *arn.User)
|
2017-10-12 15:52:46 +00:00
|
|
|
.tabs
|
2018-03-01 13:39:43 +00:00
|
|
|
TabLike(strconv.Itoa(len(track.Likes)), "heart", "track", track, user)
|
2017-10-12 15:52:46 +00:00
|
|
|
Tab("Soundtrack", "music", track.Link())
|
2018-04-13 10:20:13 +00:00
|
|
|
|
|
|
|
if track.HasLyrics()
|
|
|
|
Tab("Lyrics", "font", track.Link() + "/lyrics")
|
|
|
|
|
2018-03-15 21:44:09 +00:00
|
|
|
if user != nil
|
|
|
|
Tab("Edit", "pencil", track.Link() + "/edit")
|
2018-04-13 10:20:13 +00:00
|
|
|
|
2018-03-13 16:59:16 +00:00
|
|
|
Tab("History", "history", track.Link() + "/history")
|