diff --git a/mixins/Rating.pixy b/mixins/Rating.pixy index e2a76cd3..d9479160 100644 --- a/mixins/Rating.pixy +++ b/mixins/Rating.pixy @@ -1,2 +1,2 @@ -component Rating(value float64) - .anime-rating= int(value + 0.5) \ No newline at end of file +component Rating(value float64, user *arn.User) + .anime-rating= fmt.Sprintf("%." + strconv.Itoa(user.Settings().Format.RatingsPrecision) + "f", value) \ No newline at end of file diff --git a/pages/anime/anime.pixy b/pages/anime/anime.pixy index 8a4469e7..4edd4546 100644 --- a/pages/anime/anime.pixy +++ b/pages/anime/anime.pixy @@ -51,16 +51,16 @@ component Anime(anime *arn.Anime, friends []*arn.User, listItems map[*arn.User]* .anime-rating-category-name Hype else .anime-rating-category-name Overall - Rating(anime.Rating.Overall) + Rating(anime.Rating.Overall, user) .anime-rating-category(title=toString(anime.Rating.Story)) .anime-rating-category-name Story - Rating(anime.Rating.Story) + Rating(anime.Rating.Story, user) .anime-rating-category(title=toString(anime.Rating.Visuals)) .anime-rating-category-name Visuals - Rating(anime.Rating.Visuals) + Rating(anime.Rating.Visuals, user) .anime-rating-category(title=toString(anime.Rating.Soundtrack)) .anime-rating-category-name Soundtrack - Rating(anime.Rating.Soundtrack) + Rating(anime.Rating.Soundtrack, user) if len(friends) > 0 h3.anime-section-name Friends diff --git a/pages/settings/settings.pixy b/pages/settings/settings.pixy index 1195d8da..e1d80304 100644 --- a/pages/settings/settings.pixy +++ b/pages/settings/settings.pixy @@ -157,6 +157,14 @@ component Settings(user *arn.User) a.button.ajax(href="/shop") Icon("star") span Go PRO + + .widget.mountable(data-api="/api/settings/" + user.ID) + h3.widget-title + Icon("font") + span Formatting + + .widget-section + InputNumber("Format.RatingsPrecision", float64(user.Settings().Format.RatingsPrecision), "Ratings precision", "How many decimals after the comma would you like to display in ratings?", "0", "2", "1") //- .widget.mountable(data-api="/api/settings/" + user.ID) //- h3.widget-title