Refactor search and stringutils into separate modules
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
component Japanese(text string)
|
||||
if arn.ContainsUnicodeLetters(text)
|
||||
if stringutils.ContainsUnicodeLetters(text)
|
||||
for _, token := range arn.JapaneseTokenizer.Tokenize(text)
|
||||
if token.Furigana
|
||||
a.japanese(href="http://jisho.org/search/" + token.Original, target="_blank", rel="noopener")
|
||||
|
@ -27,7 +27,7 @@ component Postable(post arn.Postable, user *arn.User, highlightAuthorID string)
|
||||
|
||||
.post-toolbar(id="toolbar-" + post.ID())
|
||||
.spacer
|
||||
.post-likes.tip(id="likes-" + post.ID(), aria-label=arn.Plural(len(post.Likes()), "like"))= "+" + strconv.Itoa(len(post.Likes()))
|
||||
.post-likes.tip(id="likes-" + post.ID(), aria-label=stringutils.Plural(len(post.Likes()), "like"))= "+" + strconv.Itoa(len(post.Likes()))
|
||||
|
||||
if user != nil
|
||||
if user.ID != post.Creator().ID
|
||||
|
@ -1,5 +1,5 @@
|
||||
component Rating(value float64, userCount int, user *arn.User)
|
||||
if user == nil
|
||||
.anime-rating.tip(aria-label="Rated by " + arn.Plural(userCount, "user"))= fmt.Sprintf("%.1f", value)
|
||||
.anime-rating.tip(aria-label="Rated by " + stringutils.Plural(userCount, "user"))= fmt.Sprintf("%.1f", value)
|
||||
else
|
||||
.anime-rating.tip(aria-label="Rated by " + arn.Plural(userCount, "user"))= fmt.Sprintf("%." + strconv.Itoa(user.Settings().Format.RatingsPrecision) + "f", value)
|
||||
.anime-rating.tip(aria-label="Rated by " + stringutils.Plural(userCount, "user"))= fmt.Sprintf("%." + strconv.Itoa(user.Settings().Format.RatingsPrecision) + "f", value)
|
Reference in New Issue
Block a user