# 在话题卡片中添加浏览量和回复数图标，以及最后活动日期

**URL:** https://meta.discourse.org/t/add-icons-for-views-and-replies-and-last-activity-date-in-topic-cards/312505
**Category:** Feature
**Tags:** completed, topic-cards
**Created:** [2024 年6 月 18 日 06:57 UTC](https://meta.discourse.org/t/add-icons-for-views-and-replies-and-last-activity-date-in-topic-cards/312505 "2024-06-18T06:57:14Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [2024 年6 月 18 日 06:57 UTC](https://meta.discourse.org/t/add-icons-for-views-and-replies-and-last-activity-date-in-topic-cards/312505/1 "2024-06-18T06:57:15Z")

</div>

[Topic Cards](https://meta.discourse.org/t/topic-cards/296048) 提供了一种简单、美观且可用的方式来在主页面上渲染主题。但是，它所呈现的元数据还有改进的空间。

- 它只显示“点赞数”。与此同时，同样是官方的 [Topic List Thumbnails](https://meta.discourse.org/t/topic-list-thumbnails/150602) 则优雅地显示了“浏览量”、“点赞数”、“回复数”的图标，并且“最后活动时间”也与这些图标整齐地一起呈现。
- 它显示的是发布日期而不是最后活动日期，这与 Discourse 的默认行为不一致，可能会让用户感到困惑（“为什么这个主题会排在前面，如果它已经这么旧了？”）。

![image](https://global.discourse-cdn.com/meta/original/4X/0/7/e/07e974a9976d8fc3b79caf852e34119bfac24ae1.png)

从用户体验的角度来看，解决方案可能很简单：像在“主题列表缩略图”中那样渲染“主题卡片”中的元数据。如果可能的话，使用相同的代码。这样可以提高一致性，理论上也可以减少维护工作。

请比较：

**主题卡片**

左侧显示发布日期，右侧显示 ❤。

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/3/b/a3b3948c667f9b0e02d3611bf2cf1eef061348fb.jpeg)

**主题列表缩略图**

同一个主题。显示的数据量加倍，但并未显得杂乱，并且日期对应的是最后活动时间，而不是发布日期，这与 Discourse 的默认行为一致。

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/1/f/a1f6834a354b3a377e3ef2f9d155af3679a616ce.jpeg)

---

<div class="post-metadata">

### Author: ![hoangphuctran93](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hoangphuctran93/32/290976_2.png) [@hoangphuctran93](https://meta.discourse.org/u/hoangphuctran93)
#### Post date: [2024 年6 月 18 日 13:47 UTC](https://meta.discourse.org/t/add-icons-for-views-and-replies-and-last-activity-date-in-topic-cards/312505/2 "2024-06-18T13:47:51Z")

</div>

![The image shows a mobile phone screen displaying a website called "Business Lab" with information about deals and offers related to software products such as MindMaid and guidance on SQL query optimization. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/b/a/d/badf7a5a4c1fc22f5fad5eec06f899e6bf3de837.jpeg)

您可以参考fkb主题，我已进行额外定制并创建了一个私有主题模板，网址为 [https://businesslab.vn](https://businesslab.vn)

---

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [2024 年6 月 19 日 08:56 UTC](https://meta.discourse.org/t/add-icons-for-views-and-replies-and-last-activity-date-in-topic-cards/312505/3 "2024-06-19T08:56:01Z")

</div>

为了简化这个建议，我提议参考一个官方组件（Topic List Thumbnails）来改进另一个官方组件（Topic Cards）。将第三方主题或组件混入其中会使事情复杂化，无论这些外部组件有多好。 🙂

我个人倾向于坚持使用默认主题并在此基础上进行构建。我们可能之所以选择Graceful主题，仅仅是因为它在背景/浮动区域方面提供了更多的设计灵活性。Topic Cards很好地补充了Graceful主题的原则，并且不会增加（在我们看来）我们不需要的更多功能。

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2024 年6 月 20 日 16:04 UTC](https://meta.discourse.org/t/add-icons-for-views-and-replies-and-last-activity-date-in-topic-cards/312505/9 "2024-06-20T16:04:16Z")

</div>

对我来说，这听起来是个不错的改进。我们目前没有精力来采纳这项更改，但我将其标记为 #pr-welcome，这意味着我们很乐意审查社区提出的相关贡献。

感谢 @icaria36 的建议。

---

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [2024 年6 月 20 日 19:40 UTC](https://meta.discourse.org/t/add-icons-for-views-and-replies-and-last-activity-date-in-topic-cards/312505/11 "2024-06-20T19:40:04Z")

</div>

太棒了！@RGJ 和我已经开始讨论 PR 了。

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2024 年6 月 24 日 11:55 UTC](https://meta.discourse.org/t/add-icons-for-views-and-replies-and-last-activity-date-in-topic-cards/312505/12 "2024-06-24T11:55:03Z")

</div>

> [@pmusaraj](#):
>
> 我们乐于审阅社区在此提出的建议性更改的贡献。

👍 PR 在此 [Add icons for Views and Replies, and Last Activity date by communiteq · Pull Request #13 · discourse/discourse-topic-cards · GitHub](https://github.com/discourse/discourse-topic-cards/pull/13)

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/7/1/871c112fbaf8d291d5443a02c6c6d6ecebbde7b5.jpeg)

 ![image](https://global.discourse-cdn.com/meta/original/4X/1/2/5/125ff8aa1dfb00ce04976117b56fb527fd1beb5f.jpeg)

---

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [2024 年6 月 24 日 12:12 UTC](https://meta.discourse.org/t/add-icons-for-views-and-replies-and-last-activity-date-in-topic-cards/312505/13 "2024-06-24T12:12:35Z")

</div>

非常感谢，@RGJ！

我们已在 [https://podkasts.org](https://podkasts.org) 上部署了此版本，并在桌面和移动设备上进行了测试。

我们添加了一些额外的 CSS（本地的，与 @RGJ 的组件版本分开）来：  
a) 移除“Published”（请参阅我上面对此更改的解释）  
b) 使其与 Graceful 主题更好地配合（该主题引入了左边距，限制了移动设备上的空间）。

最终结果正是我们想要的。🎉

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [2024 年7 月 8 日 23:10 UTC](https://meta.discourse.org/t/add-icons-for-views-and-replies-and-last-activity-date-in-topic-cards/312505/14 "2024-07-08T23:10:47Z")

</div>

我认为添加一个启用/禁用额外指标的设置会是个好主意。原始设计旨在通过剥离部分内容来实现更简约的风格，因此我希望能够保持这一意图。

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2024 年7 月 8 日 23:18 UTC](https://meta.discourse.org/t/add-icons-for-views-and-replies-and-last-activity-date-in-topic-cards/312505/15 "2024-07-08T23:18:05Z")

</div>

我将在本周晚些时候添加一个设置，默认不显示视图和回复。

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2024 年7 月 12 日 13:28 UTC](https://meta.discourse.org/t/add-icons-for-views-and-replies-and-last-activity-date-in-topic-cards/312505/16 "2024-07-12T13:28:39Z")

</div>

我已经添加了这些设置，现在可以显示或隐藏每个图标+数字。  
原始行为是默认的。

请参阅 [Add icons for Views and Replies, and Last Activity date by communiteq · Pull Request #13 · discourse/discourse-topic-cards · GitHub](https://github.com/discourse/discourse-topic-cards/pull/13/commits/94b582a789c1f289c02917de8951ff4644a0009d)

---

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [2024 年7 月 16 日 08:29 UTC](https://meta.discourse.org/t/add-icons-for-views-and-replies-and-last-activity-date-in-topic-cards/312505/17 "2024-07-16T08:29:37Z")

</div>

我已经升级了 Discourse，包括 @RGJ 的补丁，而且值得一提的是，我们网站上的一切都按预期运行。 🎉 非常感谢！

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2024 年7 月 17 日 18:51 UTC](https://meta.discourse.org/t/add-icons-for-views-and-replies-and-last-activity-date-in-topic-cards/312505/18 "2024-07-17T18:51:15Z")

</div>

谢谢，此项添加的 PR 现已合并。

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2024 年7 月 20 日 12:00 UTC](https://meta.discourse.org/t/add-icons-for-views-and-replies-and-last-activity-date-in-topic-cards/312505/19 "2024-07-20T12:00:50Z")

</div>

此主题已在 2 天后自动关闭。不再允许回复。
