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