Added comments to AMVs

This commit is contained in:
Eduard Urbach 2018-10-29 12:35:38 +09:00
parent 8191ebaa70
commit c090b6970c
4 changed files with 22 additions and 47 deletions

View File

@ -1,6 +1,9 @@
component Comments(parent arn.PostParent, user *arn.User) component Comments(parent arn.PostParent, user *arn.User)
.thread .thread
.posts .posts
if user == nil && parent.CountPosts() == 0
p.no-data.mountable No comments have been written yet.
else
each post in parent.Posts() each post in parent.Posts()
Postable(post.ToPostable(), user, "") Postable(post.ToPostable(), user, "")

View File

@ -52,6 +52,10 @@ component AMVPage(amv *arn.AMV, user *arn.User)
each tag in amv.Tags each tag in amv.Tags
.tag.mountable= tag .tag.mountable= tag
.widget
h3.widget-title.mountable Comments
Comments(amv, user)
if amv.File != "" && amv.Info.Video.Width > 0 if amv.File != "" && amv.Info.Video.Width > 0
.footer.amv-details.mountable .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("Video: %dx%d | %.0f FPS | %s", amv.Info.Video.Width, amv.Info.Video.Height, amv.Info.Video.FPS, amv.Info.Video.Codec)

View File

@ -4,13 +4,19 @@ component QuotePage(quote *arn.Quote, character *arn.Character, user *arn.User)
.quote-full-page .quote-full-page
.quote-main-column .quote-main-column
QuoteMainColumn(quote, user) QuoteMainColumn(quote, user)
.quote-side-column
QuoteSideColumn(quote, user)
component QuoteMainColumn(quote *arn.Quote, user *arn.User) component QuoteMainColumn(quote *arn.Quote, user *arn.User)
.widget-form.mountable .widget-form.mountable
QuoteContent(quote, user) QuoteContent(quote, user)
if quote.Anime() != nil
p.quote-anime
a(href=quote.Anime().Link())= quote.Anime().Title.ByUser(user)
.widget.mountable
h3.widget-title Comments
Comments(quote, user)
.footer.mountable .footer.mountable
if quote.EditedBy != "" if quote.EditedBy != ""
span Edited span Edited
@ -24,30 +30,6 @@ component QuoteMainColumn(quote *arn.Quote, user *arn.User)
a(href=quote.Creator().Link())= quote.Creator().Nick a(href=quote.Creator().Link())= quote.Creator().Nick
span . span .
component QuoteSideColumn(quote *arn.Quote, user *arn.User)
QuoteInformation(quote, user)
component QuoteInformation(quote *arn.Quote, user *arn.User)
section.quote-section.mountable
h3.quote-section-name Information
table.quote-info-table
if quote.AnimeID != "" && quote.Anime() != nil
tr.mountable(data-mountable-type="info")
td.quote-info-key Anime:
td.quote-info-value
QuoteAnime(quote.Anime(), user)
if quote.EpisodeNumber != -1
tr.mountable(data-mountable-type="info")
td.quote-info-key Episode:
td.quote-info-value= quote.EpisodeNumber
if quote.Time != -1
tr.mountable(data-mountable-type="info")
td.anime-info-key Time:
td.anime-info-value= strconv.Itoa(quote.Time) + " min"
component QuoteTabs(quote *arn.Quote, user *arn.User) component QuoteTabs(quote *arn.Quote, user *arn.User)
.tabs .tabs
LikeTab(strconv.Itoa(len(quote.Likes)), "heart", "quote", quote, user) LikeTab(strconv.Itoa(len(quote.Likes)), "heart", "quote", quote, user)

View File

@ -5,25 +5,11 @@
vertical vertical
flex 1 flex 1
.quote-side-column .quote-anime
sidebar
> 1250px
.quote-full-page
horizontal horizontal
justify-content center
.quote-side-column margin-bottom 1rem
sidebar-medium font-size 0.9rem
> 1400px
.quote-side-column
sidebar-big
.quote-info-table
margin 0
.quote-info-value
text-align right
.quote-section .quote-section
margin-top 1rem margin-top 1rem