Slightly imroved main quote rendering

This commit is contained in:
Eduard Urbach 2018-04-10 20:56:56 +02:00
parent 9fb455fa53
commit b58e4e8c79
3 changed files with 8 additions and 11 deletions

View File

@ -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

View File

@ -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,6 +32,7 @@ component CharacterDetails(character *arn.Character, characterAnime []*arn.Anime
.character-quotes.mountable .character-quotes.mountable
each quote in quotes each quote in quotes
if mainQuote == nil || quote.ID != mainQuote.ID
.character-quote .character-quote
Quote(quote) Quote(quote)

View File

@ -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
} }