Added Japanese text for quotes

This commit is contained in:
Eduard Urbach 2018-02-25 19:22:59 +01:00
parent 47503cc74f
commit 20ec5e77f5
6 changed files with 13 additions and 12 deletions

View File

@ -7,8 +7,7 @@ component QuoteContent(quote *arn.Quote)
.quote-content .quote-content
a.quotation.ajax(href=quote.Link()) a.quotation.ajax(href=quote.Link())
blockquote blockquote
p p= quote.Text.English
q= quote.Description
if quote.CharacterID != "" && quote.Character() != nil if quote.CharacterID != "" && quote.Character() != nil
footer.quote-character footer.quote-character

View File

@ -22,7 +22,7 @@ func Edit(ctx *aero.Context) string {
ctx.Data = &arn.OpenGraph{ ctx.Data = &arn.OpenGraph{
Tags: map[string]string{ Tags: map[string]string{
"og:title": quote.Description, "og:title": quote.Text.English,
"og:url": "https://" + ctx.App.Config.Domain + quote.Link(), "og:url": "https://" + ctx.App.Config.Domain + quote.Link(),
"og:site_name": "notify.moe", "og:site_name": "notify.moe",
}, },

View File

@ -22,7 +22,7 @@ func Get(ctx *aero.Context) string {
openGraph := &arn.OpenGraph{ openGraph := &arn.OpenGraph{
Tags: map[string]string{ Tags: map[string]string{
"og:title": "Quote", "og:title": "Quote",
"og:description": quote.Description, "og:description": quote.Text.English,
"og:url": "https://" + ctx.App.Config.Domain + quote.Link(), "og:url": "https://" + ctx.App.Config.Domain + quote.Link(),
"og:site_name": "notify.moe", "og:site_name": "notify.moe",
"og:type": "article", "og:type": "article",

View File

@ -15,16 +15,20 @@ func Best(ctx *aero.Context) string {
user := utils.GetUser(ctx) user := utils.GetUser(ctx)
quotes := arn.FilterQuotes(func(track *arn.Quote) bool { quotes := arn.FilterQuotes(func(track *arn.Quote) bool {
return !track.IsDraft && len(track.Description) > 0 return !track.IsDraft && len(track.Text.English) > 0
}) })
arn.SortQuotesPopularFirst(quotes) arn.SortQuotesPopularFirst(quotes)
// Limit the number of displayed quotes
loadMoreIndex := 0
if len(quotes) > maxQuotes { if len(quotes) > maxQuotes {
quotes = quotes[:maxQuotes] quotes = quotes[:maxQuotes]
loadMoreIndex = maxQuotes
} }
return ctx.HTML(components.Quotes(quotes, maxQuotes, user)) return ctx.HTML(components.Quotes(quotes, loadMoreIndex, user))
} }
// BestFrom renders the quotes from the given index. // BestFrom renders the quotes from the given index.
@ -37,7 +41,7 @@ func BestFrom(ctx *aero.Context) string {
} }
allQuotes := arn.FilterQuotes(func(track *arn.Quote) bool { allQuotes := arn.FilterQuotes(func(track *arn.Quote) bool {
return !track.IsDraft && len(track.Description) > 0 return !track.IsDraft && len(track.Text.English) > 0
}) })
if index < 0 || index >= len(allQuotes) { if index < 0 || index >= len(allQuotes) {

View File

@ -17,12 +17,12 @@ func Latest(ctx *aero.Context) string {
user := utils.GetUser(ctx) user := utils.GetUser(ctx)
quotes := arn.FilterQuotes(func(track *arn.Quote) bool { quotes := arn.FilterQuotes(func(track *arn.Quote) bool {
return !track.IsDraft && len(track.Description) > 0 return !track.IsDraft && len(track.Text.English) > 0
}) })
arn.SortQuotesLatestFirst(quotes) arn.SortQuotesLatestFirst(quotes)
// Reduce the number of displayed quotes // Limit the number of displayed quotes
loadMoreIndex := 0 loadMoreIndex := 0
if len(quotes) > maxQuotes { if len(quotes) > maxQuotes {
@ -43,7 +43,7 @@ func LatestFrom(ctx *aero.Context) string {
} }
allQuotes := arn.FilterQuotes(func(track *arn.Quote) bool { allQuotes := arn.FilterQuotes(func(track *arn.Quote) bool {
return !track.IsDraft && len(track.Description) > 0 return !track.IsDraft && len(track.Text.English) > 0
}) })
if index < 0 || index >= len(allQuotes) { if index < 0 || index >= len(allQuotes) {

View File

@ -41,8 +41,6 @@ blockquote
p p
line-height 2em line-height 2em
q
quotes "\201C""\201D" quotes "\201C""\201D"
color text-color color text-color
text-shadow none text-shadow none