Slightly imroved main quote rendering
This commit is contained in:
parent
9fb455fa53
commit
b58e4e8c79
@ -37,14 +37,9 @@ func Get(ctx *aero.Context) string {
|
||||
})
|
||||
|
||||
// Quotes
|
||||
var mainQuote *arn.Quote
|
||||
mainQuote := character.MainQuote()
|
||||
quotes := character.Quotes()
|
||||
for i, quote := range quotes {
|
||||
if quote.IsMainQuote {
|
||||
mainQuote = quote
|
||||
quotes = append(quotes[:i], quotes[i+1:]...)
|
||||
}
|
||||
}
|
||||
|
||||
arn.SortQuotesPopularFirst(quotes)
|
||||
|
||||
// Set OpenGraph attributes
|
||||
|
@ -13,9 +13,11 @@ component CharacterDetails(character *arn.Character, characterAnime []*arn.Anime
|
||||
Japanese(character.Name.Japanese)
|
||||
else
|
||||
Japanese("日本語の名前無し")
|
||||
if mainQuote != nil
|
||||
|
||||
if mainQuote != nil
|
||||
.character-quote
|
||||
Quote(mainQuote)
|
||||
|
||||
.character-description.mountable!= markdown.Render(character.Description)
|
||||
|
||||
h3.mountable Anime
|
||||
@ -30,8 +32,9 @@ component CharacterDetails(character *arn.Character, characterAnime []*arn.Anime
|
||||
|
||||
.character-quotes.mountable
|
||||
each quote in quotes
|
||||
.character-quote
|
||||
Quote(quote)
|
||||
if mainQuote == nil || quote.ID != mainQuote.ID
|
||||
.character-quote
|
||||
Quote(quote)
|
||||
|
||||
.character-sidebar
|
||||
if len(character.Attributes) > 0
|
||||
|
@ -200,7 +200,6 @@ func RenderField(b *bytes.Buffer, v *reflect.Value, field reflect.StructField, i
|
||||
return
|
||||
}
|
||||
|
||||
// TODO: Render bool type
|
||||
b.WriteString(components.InputBool(idPrefix+field.Name, fieldValue.Bool(), field.Name, field.Tag.Get("tooltip")))
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user