Is it possible to display only one trust level badge on the user card?


(Tobias Eigen) #1

If a user has TL4 badge, I’d like their user card to not also show the TL3, TL2, TL1 badges.
If a user has TL3 badge, I’d like their user card to not also show the TL2, TL1 badges.
If a user has TL2 badge, I’d like their user card to not also show the TL1 badges.

Is there a way to make this happen?


Why are some people on two trust levels
Help finding some monthly site stats about topics and user trust levels
(Jeff Atwood) #2

Seems like a good idea, cc: @sam


(Tobias Eigen) #3

You know, I think this is pretty important to do - I was just on another forum looking at a user card, and find seeing multiple TL badges is distracting and pushes other badges off the card. So you have to click through to see them. And in this case, it’s just more TL badges!

And while I’m at it - on my forums I have changed the TL names to TL0, TL1, TL2, TL3, TL4 which is how we have begun talking about them, which works better for us methinks than the names Basic, Member, Regular, Leader.


(Jeff Atwood) #4

I definitely support this, it is up to @sam.

Also annoying: getting multiple trust level notifications on a new site, though I suppose this is a lament for the staff and admins only:


(Tobias Eigen) #5

@sam could you implement this soonly?

Here’s how badges appear now on my site which, as you can see, is duplicative and crowds out more interesting info.


(Sam Saffron) #6

Agree that we need special casing here, this is still in my bookmarks list.


(Keith) #7

Just wanted to bump this subject, as it’s still a bit of an ear flick for me - I’d love to see the badge representation on profiles cleaned up a little bit to give them a more meaningful presence.


(Leo McArdle) #8

I’ve implemented this, and submitted a PR.

Before:

After:

The one thing I wasn’t sure about is what to do when users just have trust level badges, currently the following will happen:

I think it would make sense to make use of the space and display the rest of the trust level badges in a situation like this. However, I expect this is an incredibly rare occurrence (only found when a user has been granted trust levels rather then earned them), and I wonder if it’s therefore worth the added code complexity.

Speaking of code complexity, I spent a while staring at my screen trying to work out if I could make the featured_user_badges query more efficient, but didn’t come up with anything. We end up running the same subquery twice (to find the highest trust level badge a user has) and from what I can tell ActiveRecord doesn’t support WITH queries (which, if my understanding is correct, would mean the duplicated subquery is only ran once). I’m not sure how much of a performance impact this is, though. Again - some advice would be very welcome here.


(Tobias Eigen) #9

Shweet. Many thanks! :rocket:

I am loving the improvements to user cards you are doing. Much appreciated.


(Leo McArdle) #10

This was merged a few days ago:

Thanks @Falco!


(Rafael dos Santos Silva) #11