31 lines
1009 B
Plaintext
Raw Normal View History

2018-04-13 10:20:13 +00:00
component SoundTrackLyricsPage(track *arn.SoundTrack, user *arn.User)
SoundTrackTabs(track, user)
2018-04-13 11:39:03 +00:00
if track.Title.ByUser(user) == ""
h1.mountable untitled
else
h1.mountable= track.Title.ByUser(user)
.soundtrack-lyrics
2018-04-13 10:20:13 +00:00
if !track.HasLyrics()
p.no-data.mountable No lyrics available for this track.
else
if track.Lyrics.Native != ""
2018-04-13 11:39:03 +00:00
.lyrics-column
h3.widget-title.mountable(data-mountable-type="native") Native
RenderLyrics(track.Lyrics.Native, "native")
if track.Lyrics.Romaji != ""
.lyrics-column
h3.widget-title.mountable(data-mountable-type="romaji") Romaji
RenderLyrics(track.Lyrics.Romaji, "romaji")
2018-04-13 10:20:13 +00:00
2018-04-13 11:39:03 +00:00
component RenderLyrics(text string, mountType string)
2018-04-13 10:20:13 +00:00
each paragraph in strings.Split(text, "\n\n")
2018-04-13 11:39:03 +00:00
p.lyrics-paragraph
2018-04-13 10:20:13 +00:00
each line in strings.Split(paragraph, "\n")
2018-04-13 11:39:03 +00:00
if mountType == "native"
.lyrics-line.mountable(data-mountable-type=mountType)
Japanese(line)
else
.lyrics-line.mountable(data-mountable-type=mountType)= line