From 526a7998bba19b2c88caf5faf5477b55ec3f7ff1 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Wed, 25 Apr 2018 22:15:42 +0200 Subject: [PATCH] Remove toString calls (upgrade to latest pixy version) --- mixins/AnimeList.pixy | 2 +- mixins/Postable.pixy | 2 +- pages/anime/anime.pixy | 2 +- pages/anime/episodes.pixy | 2 +- pages/company/company.pixy | 2 +- pages/genre/genre.pixy | 2 +- pages/listimport/listimportanilist/anilist.pixy | 2 +- pages/listimport/listimportkitsu/kitsu.pixy | 2 +- pages/listimport/listimportmyanimelist/myanimelist.pixy | 2 +- pages/profile/profile.pixy | 8 ++++---- pages/shop/shop.pixy | 2 +- pages/users/editors.pixy | 2 +- pages/users/osu.pixy | 4 ++-- pages/users/overwatch.pixy | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/mixins/AnimeList.pixy b/mixins/AnimeList.pixy index e0e4bceb..3a46a9bd 100644 --- a/mixins/AnimeList.pixy +++ b/mixins/AnimeList.pixy @@ -24,7 +24,7 @@ component AnimeListScrollable(animeListItems []*arn.AnimeListItem, viewUser *arn //- else if item.Anime().EpisodeByNumber(item.Episodes + 1) != nil for _, link := range item.Anime().EpisodeByNumber(item.Episodes + 1).Links - a.tip(href=link, aria-label="Watch episode " + toString(item.Episodes + 1), target="_blank", rel="noopener") + a.tip(href=link, aria-label="Watch episode " + fmt.Sprint(item.Episodes + 1), target="_blank", rel="noopener") RawIcon("eye") .anime-list-item-airing-date diff --git a/mixins/Postable.pixy b/mixins/Postable.pixy index 2349c1db..d1b81247 100644 --- a/mixins/Postable.pixy +++ b/mixins/Postable.pixy @@ -1,5 +1,5 @@ component Postable(post arn.Postable, user *arn.User, highlightAuthorID string) - .post.mountable(id=strings.ToLower(post.Type()) + "-" + toString(post.ID()), data-highlight=post.Creator().ID == highlightAuthorID, data-pro=post.Creator().IsPro(), data-api="/api/" + strings.ToLower(post.Type()) + "/" + post.ID()) + .post.mountable(id=strings.ToLower(post.Type()) + "-" + fmt.Sprint(post.ID()), data-highlight=post.Creator().ID == highlightAuthorID, data-pro=post.Creator().IsPro(), data-api="/api/" + strings.ToLower(post.Type()) + "/" + post.ID()) .post-author Avatar(post.Creator()) diff --git a/pages/anime/anime.pixy b/pages/anime/anime.pixy index 674b67c4..76daad43 100644 --- a/pages/anime/anime.pixy +++ b/pages/anime/anime.pixy @@ -248,4 +248,4 @@ component AnimeInformation(anime *arn.Anime) //- a(href=company.Link())= company.Name.English component FriendEntry(friend *arn.User, listItems map[*arn.User]*arn.AnimeListItem) - CustomAvatar(friend, friend.Link(), friend.Nick + " => " + listItems[friend].Status + " | " + toString(listItems[friend].Episodes) + " eps | " + fmt.Sprintf("%.1f", listItems[friend].Rating.Overall) + " rating") + CustomAvatar(friend, friend.Link(), friend.Nick + " => " + listItems[friend].Status + " | " + fmt.Sprint(listItems[friend].Episodes) + " eps | " + fmt.Sprintf("%.1f", listItems[friend].Rating.Overall) + " rating") diff --git a/pages/anime/episodes.pixy b/pages/anime/episodes.pixy index 72dcc508..bd40e278 100644 --- a/pages/anime/episodes.pixy +++ b/pages/anime/episodes.pixy @@ -39,7 +39,7 @@ component AnimeEpisodes(anime *arn.Anime, episodes []*arn.AnimeEpisode, user *ar //- if user != nil && user.Location.CountryName != "Japan" //- td.episode-actions //- for name, link := range episode.Links - //- a(href=link, target="_blank", rel="noopener", title="Watch episode " + toString(episode.Number) + " on " + name) + //- a(href=link, target="_blank", rel="noopener", title="Watch episode " + fmt.Sprint(episode.Number) + " on " + name) //- RawIcon("eye") //- //- a(href="https://translate.google.com/#ja/en/" + episode.Title.Japanese, target="_blank", rel="noopener") //- //- RawIcon("google") diff --git a/pages/company/company.pixy b/pages/company/company.pixy index 715badb8..a8174869 100644 --- a/pages/company/company.pixy +++ b/pages/company/company.pixy @@ -15,7 +15,7 @@ component CompanyPage(company *arn.Company, studioAnime, producedAnime, licensed .company-sidebar if company.Location.Latitude != 0 && company.Location.Longitude != 0 h3.mountable Location - iframe.company-location.mountable(src="https://www.google.com/maps/embed/v1/place?q=" + toString(company.Location.Latitude) + "," + toString(company.Location.Longitude) + "&key=AIzaSyAsx6fhqRGaMLTixIJMIZBU4Mg6HJmvQf0") + iframe.company-location.mountable(src="https://www.google.com/maps/embed/v1/place?q=" + fmt.Sprint(company.Location.Latitude) + "," + fmt.Sprint(company.Location.Longitude) + "&key=AIzaSyAsx6fhqRGaMLTixIJMIZBU4Mg6HJmvQf0") if len(closeCompanies) > 0 h3.mountable Within 1 km radius diff --git a/pages/genre/genre.pixy b/pages/genre/genre.pixy index ec869c94..2174cda4 100644 --- a/pages/genre/genre.pixy +++ b/pages/genre/genre.pixy @@ -1,5 +1,5 @@ component Genre(genre string, animes []*arn.Anime, user *arn.User) - h1(title=toString(len(animes)) + " anime")= strings.Title(genre) + h1(title=fmt.Sprint(len(animes)) + " anime")= strings.Title(genre) .corner-buttons-hide-on-mobile if user != nil diff --git a/pages/listimport/listimportanilist/anilist.pixy b/pages/listimport/listimportanilist/anilist.pixy index bd77f898..03c2eb4c 100644 --- a/pages/listimport/listimportanilist/anilist.pixy +++ b/pages/listimport/listimportanilist/anilist.pixy @@ -1,5 +1,5 @@ component ImportAnilist(user *arn.User, matches []*arn.AniListMatch) - h1= "Preview: anilist.co (" + user.Accounts.AniList.Nick + ", " + toString(len(matches)) + " anime)" + h1= "Preview: anilist.co (" + user.Accounts.AniList.Nick + ", " + fmt.Sprint(len(matches)) + " anime)" ImportButton("/import/anilist/animelist/finish") diff --git a/pages/listimport/listimportkitsu/kitsu.pixy b/pages/listimport/listimportkitsu/kitsu.pixy index f36ba9ff..f755fcd5 100644 --- a/pages/listimport/listimportkitsu/kitsu.pixy +++ b/pages/listimport/listimportkitsu/kitsu.pixy @@ -1,5 +1,5 @@ component ImportKitsu(user *arn.User, matches []*arn.KitsuMatch) - h1= "Preview: kitsu.io (" + user.Accounts.Kitsu.Nick + ", " + toString(len(matches)) + " anime)" + h1= "Preview: kitsu.io (" + user.Accounts.Kitsu.Nick + ", " + fmt.Sprint(len(matches)) + " anime)" ImportButton("/import/kitsu/animelist/finish") diff --git a/pages/listimport/listimportmyanimelist/myanimelist.pixy b/pages/listimport/listimportmyanimelist/myanimelist.pixy index f55d336f..b12fea53 100644 --- a/pages/listimport/listimportmyanimelist/myanimelist.pixy +++ b/pages/listimport/listimportmyanimelist/myanimelist.pixy @@ -1,5 +1,5 @@ component ImportMyAnimeList(user *arn.User, matches []*arn.MyAnimeListMatch) - h1= "Preview: myanimelist.net (" + user.Accounts.MyAnimeList.Nick + ", " + toString(len(matches)) + " anime)" + h1= "Preview: myanimelist.net (" + user.Accounts.MyAnimeList.Nick + ", " + fmt.Sprint(len(matches)) + " anime)" ImportButton("/import/myanimelist/animelist/finish") diff --git a/pages/profile/profile.pixy b/pages/profile/profile.pixy index 020471aa..1777eede 100644 --- a/pages/profile/profile.pixy +++ b/pages/profile/profile.pixy @@ -7,7 +7,7 @@ component Profile(viewUser *arn.User, user *arn.User, animeList *arn.AnimeList, .profile-watching-list.mountable each item in animeList.Items if item.Status == arn.AnimeListStatusWatching || item.Status == arn.AnimeListStatusCompleted - a.profile-watching-list-item.tip(href=item.Anime().Link(), aria-label=item.Anime().Title.ByUser(user) + " (" + toString(item.Episodes) + " / " + arn.EpisodesToString(item.Anime().EpisodeCount) + ")") + a.profile-watching-list-item.tip(href=item.Anime().Link(), aria-label=item.Anime().Title.ByUser(user) + " (" + fmt.Sprint(item.Episodes) + " / " + arn.EpisodesToString(item.Anime().EpisodeCount) + ")") img.profile-watching-list-item-image.lazy(data-src=item.Anime().ImageLink("small"), data-webp="true", data-color=item.Anime().AverageColor(), alt=item.Anime().Title.ByUser(user)) .footer @@ -66,14 +66,14 @@ component ProfileHead(viewUser *arn.User, user *arn.User, uri string) a(href=viewUser.WebsiteURL(), target="_blank", rel="nofollow")= viewUser.WebsiteShortURL() if viewUser.Accounts.Osu.Nick != "" && viewUser.Accounts.Osu.PP >= 100 - p.profile-field.osu(title="osu! Level " + toString(int(viewUser.Accounts.Osu.Level)) + " | Accuracy: " + fmt.Sprintf("%.1f", viewUser.Accounts.Osu.Accuracy) + "%") + p.profile-field.osu(title="osu! Level " + fmt.Sprint(int(viewUser.Accounts.Osu.Level)) + " | Accuracy: " + fmt.Sprintf("%.1f", viewUser.Accounts.Osu.Accuracy) + "%") Icon("trophy") - a(href="https://osu.ppy.sh/u/" + viewUser.Accounts.Osu.Nick, target="_blank", rel="noopener")= toString(int(viewUser.Accounts.Osu.PP)) + " pp" + a(href="https://osu.ppy.sh/u/" + viewUser.Accounts.Osu.Nick, target="_blank", rel="noopener")= fmt.Sprint(int(viewUser.Accounts.Osu.PP)) + " pp" if viewUser.Accounts.Overwatch.BattleTag != "" && viewUser.Accounts.Overwatch.SkillRating >= 1000 p.profile-field.overwatch(title=stringutils.Capitalize(viewUser.Accounts.Overwatch.Tier) + " (Overwatch)") Icon("overwatch") - a(href="https://playoverwatch.com/en-us/career/pc/" + strings.Replace(viewUser.Accounts.Overwatch.BattleTag, "#", "-", 1), target="_blank", rel="noopener")= toString(viewUser.Accounts.Overwatch.SkillRating) + " SR" + a(href="https://playoverwatch.com/en-us/career/pc/" + strings.Replace(viewUser.Accounts.Overwatch.BattleTag, "#", "-", 1), target="_blank", rel="noopener")= fmt.Sprint(viewUser.Accounts.Overwatch.SkillRating) + " SR" //- if viewUser.dataEditCount //- p.profile-field.editor-contribution(title="Anime data modifications") diff --git a/pages/shop/shop.pixy b/pages/shop/shop.pixy index cdcc0548..61a1e080 100644 --- a/pages/shop/shop.pixy +++ b/pages/shop/shop.pixy @@ -31,5 +31,5 @@ component ShopItem(item *arn.ShopItem, popularity int) .buttons.shop-buttons button.shop-button-buy.action(data-item-id=item.ID, data-item-name=item.Name, data-price=item.Price, data-trigger="click", data-action="buyItem") - span.shop-item-price= "Buy for " + toString(item.Price) + span.shop-item-price= "Buy for " + fmt.Sprint(item.Price) Icon("diamond") \ No newline at end of file diff --git a/pages/users/editors.pixy b/pages/users/editors.pixy index 5020000f..70a99611 100644 --- a/pages/users/editors.pixy +++ b/pages/users/editors.pixy @@ -11,7 +11,7 @@ component EditorRankingList(users []*arn.User, idToScore map[string]int, url str tbody for index, user := range users tr.ranking.mountable - td= toString(index + 1) + "." + td= fmt.Sprint(index + 1) + "." td.ranking-user Avatar(user) a.ranking-user-nick(href=user.Link())= user.Nick diff --git a/pages/users/osu.pixy b/pages/users/osu.pixy index 9075d67a..059ff254 100644 --- a/pages/users/osu.pixy +++ b/pages/users/osu.pixy @@ -12,10 +12,10 @@ component OsuRankingList(users []*arn.User, url string) tbody for index, user := range users tr.ranking.mountable - td= toString(index + 1) + "." + td= fmt.Sprint(index + 1) + "." td.ranking-user Avatar(user) a.ranking-user-nick(href=user.Link())= user.Nick - td.ranking-score= toString(int(user.Accounts.Osu.PP + 0.5)) + " pp" + td.ranking-score= fmt.Sprint(int(user.Accounts.Osu.PP + 0.5)) + " pp" td.ranking-accuracy= fmt.Sprintf("%.1f", user.Accounts.Osu.Accuracy) + "%" \ No newline at end of file diff --git a/pages/users/overwatch.pixy b/pages/users/overwatch.pixy index 175273b9..40b668c9 100644 --- a/pages/users/overwatch.pixy +++ b/pages/users/overwatch.pixy @@ -12,7 +12,7 @@ component OverwatchRankingList(users []*arn.User, url string) tbody for index, user := range users tr.ranking.mountable - td= toString(index + 1) + "." + td= fmt.Sprint(index + 1) + "." td.ranking-user Avatar(user) a.ranking-user-nick(href=user.Link())= user.Nick