Added soundtrack comments
This commit is contained in:
@ -90,9 +90,10 @@ func Forum(ctx *aero.Context) string {
|
||||
func SoundTracks(ctx *aero.Context) string {
|
||||
term := ctx.Get("term")
|
||||
term = strings.TrimPrefix(term, "/")
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
tracks := search.SoundTracks(term, maxSoundTracks)
|
||||
return ctx.HTML(components.SoundTrackSearchResults(tracks))
|
||||
return ctx.HTML(components.SoundTrackSearchResults(tracks, user))
|
||||
}
|
||||
|
||||
// Users search.
|
||||
|
@ -32,7 +32,7 @@ component SearchResults(term string, users []*arn.User, animes []*arn.Anime, pos
|
||||
span Soundtracks
|
||||
|
||||
#soundtrack-search-results
|
||||
SoundTrackSearchResults(tracks)
|
||||
SoundTrackSearchResults(tracks, user)
|
||||
|
||||
//- .widget
|
||||
//- h3.widget-title
|
||||
@ -97,14 +97,14 @@ component ForumSearchResults(posts []*arn.Post, threads []*arn.Thread, user *arn
|
||||
.forum-search-result-author= post.Creator().Nick
|
||||
.forum-search-result-sample= post.Text
|
||||
|
||||
component SoundTrackSearchResults(tracks []*arn.SoundTrack)
|
||||
component SoundTrackSearchResults(tracks []*arn.SoundTrack, user *arn.User)
|
||||
if len(tracks) == 0
|
||||
p.no-search-results.mountable No soundtracks found.
|
||||
else
|
||||
ul.soundtrack-search
|
||||
each track in tracks
|
||||
li.mountable(data-mountable-type="track")
|
||||
a(href=track.Link())= track.Title.ByUser(nil)
|
||||
a(href=track.Link())= track.Title.ByUser(user)
|
||||
span.soundtrack-search-anime= " - " + track.MainAnime().Title.Canonical
|
||||
|
||||
component CompanySearchResults(companies []*arn.Company)
|
||||
|
@ -20,5 +20,10 @@ func Get(ctx *aero.Context) string {
|
||||
}
|
||||
|
||||
ctx.Data = getOpenGraph(ctx, track)
|
||||
return ctx.HTML(components.SoundTrackPage(track, user))
|
||||
|
||||
// Comments
|
||||
posts := track.Posts()
|
||||
arn.SortPostsLatestFirst(posts)
|
||||
|
||||
return ctx.HTML(components.SoundTrackPage(track, posts, user))
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
component SoundTrackPage(track *arn.SoundTrack, user *arn.User)
|
||||
component SoundTrackPage(track *arn.SoundTrack, posts []*arn.Post, user *arn.User)
|
||||
SoundTrackTabs(track, user)
|
||||
|
||||
.soundtrack-full-page
|
||||
@ -55,6 +55,27 @@ component SoundTrackPage(track *arn.SoundTrack, user *arn.User)
|
||||
.tags
|
||||
each tag in track.Tags
|
||||
a.tag(href="/soundtracks/tag/" + tag)= tag
|
||||
|
||||
.widget.mountable
|
||||
h3.widget-title Comments
|
||||
|
||||
.thread
|
||||
.posts
|
||||
each post in posts
|
||||
Postable(post.ToPostable(), user, "")
|
||||
|
||||
if user != nil
|
||||
if track.Locked
|
||||
footer.footer.mountable
|
||||
p.text-center This soundtrack is locked.
|
||||
else
|
||||
NewPostArea(user, "Comment")
|
||||
|
||||
.buttons
|
||||
if !track.Locked
|
||||
button.mountable.action(data-action="createPost", data-trigger="click", data-parent-type="SoundTrack", data-parent-id=track.ID)
|
||||
Icon("mail-reply")
|
||||
span Reply
|
||||
|
||||
.footer.mountable
|
||||
if track.EditedBy != ""
|
||||
|
@ -18,7 +18,7 @@ component Thread(thread *arn.Thread, posts []*arn.Post, user *arn.User)
|
||||
|
||||
.buttons
|
||||
if !thread.Locked
|
||||
button.mountable.action(data-action="forumReply", data-trigger="click")
|
||||
button.mountable.action(data-action="createPost", data-trigger="click", data-parent-type="Thread", data-parent-id=thread.ID)
|
||||
Icon("mail-reply")
|
||||
span Reply
|
||||
|
||||
|
Reference in New Issue
Block a user