From 81cafb14bb5ced3598b5be842f86b53192a4e1e1 Mon Sep 17 00:00:00 2001 From: Hilary Liu <2788370451@qq.com> Date: Fri, 25 Aug 2023 22:36:12 +0800 Subject: [PATCH] fix: style issue of post widget when post title is too long (#4416) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind bug /area console #### What this PR does / why we need it: 文章标题过长时,面板“最近文章”会存在日期显示不完整 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/4304 #### Special notes for your reviewer: 目前我的解决方案是将Entity加上一个flex-wrap,这样可以保证日期显示完整,但是这可能导致上下文章的布局结构不统一。不知是否可以采纳。 ![image](https://github.com/halo-dev/halo/assets/110895612/45218eaf-7d7c-46ba-80ad-2d646e5b16dd) #### Does this PR introduce a user-facing change? ```release-note 用户在仪表板页面为`最近文章`设置的宽度不够时,可以显示创建日期 ``` --- console/src/locales/en.yaml | 1 + console/src/locales/zh-CN.yaml | 1 + console/src/locales/zh-TW.yaml | 1 + .../posts/widgets/RecentPublishedWidget.vue | 21 +++++++++++-------- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/console/src/locales/en.yaml b/console/src/locales/en.yaml index bd7fa9bc4..604a72c96 100644 --- a/console/src/locales/en.yaml +++ b/console/src/locales/en.yaml @@ -102,6 +102,7 @@ core: title: Recent Posts visits: "{visits} Visits" comments: "{comments} Comments" + publishTime: "Publish Time {publishTime}" quicklink: title: Quick Link actions: diff --git a/console/src/locales/zh-CN.yaml b/console/src/locales/zh-CN.yaml index 21abecdad..eaf09547b 100644 --- a/console/src/locales/zh-CN.yaml +++ b/console/src/locales/zh-CN.yaml @@ -102,6 +102,7 @@ core: title: 最近文章 visits: "访问量 {visits}" comments: "评论 {comments}" + publishTime: "发布日期 {publishTime}" quicklink: title: 快捷访问 actions: diff --git a/console/src/locales/zh-TW.yaml b/console/src/locales/zh-TW.yaml index 6b7477519..0562b4fbf 100644 --- a/console/src/locales/zh-TW.yaml +++ b/console/src/locales/zh-TW.yaml @@ -102,6 +102,7 @@ core: title: 最近文章 visits: "訪問量 {visits}" comments: "留言 {comments}" + publishTime: "發佈日期 {publishTime}" quicklink: title: 快捷訪問 actions: diff --git a/console/src/modules/contents/posts/widgets/RecentPublishedWidget.vue b/console/src/modules/contents/posts/widgets/RecentPublishedWidget.vue index 9aa7932a9..5b0eefd17 100644 --- a/console/src/modules/contents/posts/widgets/RecentPublishedWidget.vue +++ b/console/src/modules/contents/posts/widgets/RecentPublishedWidget.vue @@ -70,6 +70,18 @@ const { data } = useQuery({ ) }} + + {{ + $t( + "core.dashboard.widgets.presets.recent_published.publishTime", + { + publishTime: formatDatetime( + post.post.spec.publishTime + ), + } + ) + }} + -