From 025e90439da7774b5d92610d0f2288179669a17a Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Tue, 6 Nov 2018 19:25:56 +0900 Subject: [PATCH] Added more tags to user profiles --- pages/profile/profile.pixy | 40 +++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/pages/profile/profile.pixy b/pages/profile/profile.pixy index ca6f0c21..40cec3c5 100644 --- a/pages/profile/profile.pixy +++ b/pages/profile/profile.pixy @@ -58,10 +58,21 @@ component ProfileHead(viewUser *arn.User, user *arn.User, uri string) Icon("list") span= fmt.Sprintf("%d anime", len(viewUser.AnimeList().Items)) - if viewUser.Website != "" - a.profile-tag.mountable.never-unmount(href=viewUser.WebsiteURL(), target="_blank", rel="nofollow", aria-label="Website", data-mountable-type="header") - Icon("home") - span= viewUser.WebsiteShortURL() + if user != nil && viewUser.Settings().Privacy.ShowAge && viewUser.Settings().Privacy.ShowGender && viewUser.AgeInYears() != 0 + .profile-tag.mountable.never-unmount(data-mountable-type="header") + if viewUser.Gender == "male" + Icon("mars") + else if viewUser.Gender == "female" + Icon("venus") + else + Icon("venus-mars") + + span= viewUser.AgeInYears() + + if user != nil && viewUser.Settings().Privacy.ShowLocation && viewUser.Location.CountryName != "" + .profile-tag.mountable.never-unmount(data-mountable-type="header") + Icon("map-marker") + span= viewUser.Location.CountryName //- if viewUser.Accounts.Osu.Nick != "" && viewUser.Accounts.Osu.PP >= 100 //- a.profile-tag.tip.mountable.never-unmount(href="https://osu.ppy.sh/u/" + viewUser.Accounts.Osu.Nick, aria-label="osu! | Level " + fmt.Sprint(int(viewUser.Accounts.Osu.Level)) + " | Accuracy: " + fmt.Sprintf("%.1f", viewUser.Accounts.Osu.Accuracy) + "%", target="_blank", rel="noopener", data-mountable-type="header") @@ -92,25 +103,26 @@ component ProfileHead(viewUser *arn.User, user *arn.User, uri string) a.profile-tag.mountable.never-unmount(href="/users/staff", aria-label="Staff member", data-mountable-type="header") Icon("rocket") span= stringutils.Capitalize(viewUser.Role) - + if !viewUser.IsActive() .profile-tag.mountable.never-unmount(title="Hasn't been online for the past 2 weeks", data-mountable-type="header") Icon("bed") span Inactive //- if user != nil && user.ID != viewUser.ID - //- a.button.profile-action(href="/compare/animelist/" + user.Nick + "/" + viewUser.Nick) - //- Icon("exchange") - //- span Compare + //- a.profile-tag.tip.mountable.never-unmount(href="/compare/animelist/" + user.Nick + "/" + viewUser.Nick, aria-label="Compare", data-mountable-type="header") + //- RawIcon("exchange") - //- a.button.profile-action(href="/+" + viewUser.Nick + "/recommended/anime") - //- Icon("archive") - //- span Recomms + //- a.profile-tag.tip.mountable.never-unmount(href="/+" + viewUser.Nick + "/recommended/anime", aria-label="Recommendations", data-mountable-type="header") + //- RawIcon("archive") //- if user != nil && (user.Role == "editor" || user.Role == "admin") - //- a.button.profile-action(href="/+" + viewUser.Nick + "/log") - //- Icon("edit") - //- span Log + //- a.profile-tag.tip.mountable.never-unmoun(href="/+" + viewUser.Nick + "/log", aria-label="Log", data-mountable-type="header") + //- RawIcon("edit") + + //- if viewUser.Website != "" + //- a.profile-tag.tip.mountable.never-unmount(href=viewUser.WebsiteURL(), target="_blank", rel="nofollow", aria-label=viewUser.WebsiteShortURL(), data-mountable-type="header") + //- RawIcon("globe") .profile-actions if user != nil && user.ID != viewUser.ID