Carte utilisateur 'Dernière vue'

This theme component will allow you to include the “last seen” user statistic in user profile cards.

Repo: GitHub - tshenry/discourse-last-seen-user-card-theme-component

Before

After

About

In addition to my own interest in having this stat added to user cards, there’s been some discussion on here that inspired this theme component’s creation:

Installation

Follow this guide here:

Please feel free to post if there are any questions, problems, or suggestions!

45 « J'aime »

This is fantastic. I will use this function a lot as I assess new members’ engagement and chase particular people down who I work with closely.

2 « J'aime »

This has had a minor update:

  • Reduced the amount of code by switching from a full template override to using the existing plugin outlet to achieve the same positioning.

For anyone that uses this or is interested in using it, there are four metadata positions on the user card. Currently, starting from the left it goes last post, date joined, last seen, and time read. Which position would you prefer the "last seen" metadata to be displayed?
  • First
  • Second
  • Third (where it is currently)
  • Fourth

0 voters

I imagine it’s not extremely important to most, but I’m curious if there is a preference that I can consider for a future update.

4 « J'aime »

I don’t mind where it is so long as it is there.

1 « J'aime »

I’ve update this to position “Last Seen” first in the list. Thanks to all that voiced their opinion :grin:

8 « J'aime »

@tshenry Is it compatible with latest Discourse? It’s not working although installed.

I just checked and it’s working on the latest tests-passed. Did you make sure to refresh the page after adding the component to your main theme?

3 « J'aime »

Did you check on mobile view as well?

1 « J'aime »

Ah, good point! Fun fact - this component was created before mobile user cards existed! Because of that, it was only set up to work on desktop.

I’ve just pushed an update that should support both environments:

https://github.com/tshenry/discourse-last-seen-user-card-theme-component/commit/fdbdb65320d18ac3b466fb3c81e902add7499e0b

8 « J'aime »

I’ve got the update, thanks.

2 « J'aime »

Reviving this one: Just to confirm that it still works like a charm and is super useful!

This makes it super quick easy to check if the user is in fact still an active member. Before I always had to open full profile to decide if it’s worth the time so send a private message to the user.

Would love to see that in core!

4 « J'aime »

Oui !! Devrait absolument être dans le cœur, à mon avis. En attendant, merci beaucoup à @tshenry !

3 « J'aime »

J’ai remarqué depuis ma dernière mise à jour de Discourse que le texte « Vu pour la dernière fois » dans la carte utilisateur est beaucoup plus grand que le reste et également en gras. J’ai vérifié et il est encapsulé dans <h3> donc je l’ai annulé en plaçant

#user-card .last-seen-metadata h3 {
    font-size: unset;
    font-weight: unset;
}

dans le CSS du thème.

Je ne sais pas si c’est un effet intentionnel, j’ai donc voulu partager mon expérience.

2 « J'aime »

Probablement pas.

4 « J'aime »

J’ai ajouté une pull request pour le composant ici afin de supprimer la balise d’en-tête pour correspondre au changement de Discourse :

8 « J'aime »

Merci beaucoup pour l’explication et aussi pour la PR ! :slight_smile:

2 « J'aime »

Merci beaucoup pour cette correction ! Sera-t-elle intégrée dans la branche stable 3.3.x ?

Les mises à jour des composants de thème sont complètement séparées des mises à jour du noyau, vous pouvez les mettre à jour à tout moment depuis l’interface d’administration, indépendamment des mises à jour du noyau.

2 « J'aime »

Oups, désolé, j’avais oublié qu’il s’agissait d’un composant de thème et non du cœur de l’application.

2 « J'aime »

Fonctionne très bien, mais pour une raison quelconque, il s’affiche en dernier dans la liste (après cheers) pour moi.

1 « J'aime »