"最后登录" 用户卡

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 个赞

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 个赞

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 个赞

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

1 个赞

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

8 个赞

@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 个赞

Did you check on mobile view as well?

1 个赞

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 个赞

I’ve got the update, thanks.

2 个赞

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 个赞

是的!!依我看,这绝对应该包含在核心中。在此之前,非常感谢 @tshenry

3 个赞

我注意到自从上次 Discourse 更新以来,用户卡片中的“最后 seen”文本比其他文本大得多,而且是粗体。我检查了一下,发现它被包裹在 <h3> 中,所以我通过在主题 CSS 中添加以下内容来撤销了这一点:

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

我不知道这是预期的效果,所以我想分享一下我的经历。

2 个赞

可能不会。

4 个赞

我已在此处为组件添加了一个拉取请求,以删除标题标签以匹配 Discourse 的更改:

8 个赞

非常感谢您的解释以及拉取请求!:slight_smile:

2 个赞

非常感谢您的修复!它会进入 3.3.x stable 分支吗?

主题组件更新与核心更新完全分开,您可以随时从管理员界面更新它们,而无需考虑核心更新。

2 个赞

哎呀,抱歉,我忘了这是一个主题组件,而不是核心部分。

2 个赞

运行效果很好,但不知何故,它在我这里显示为列表中的最后一个(在“cheers”之后)。

1 个赞