From af29e37379f4400d5a07432d47ff79f2220540c3 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Thu, 14 Mar 2019 16:37:02 +0800 Subject: [PATCH 1/2] admin dashboard data --- .../halo/model/dto/post/PostWithTitleDTO.java | 4 +- .../resources/templates/admin/admin_index.ftl | 64 ++++++++----------- 2 files changed, 28 insertions(+), 40 deletions(-) diff --git a/src/main/java/cc/ryanc/halo/model/dto/post/PostWithTitleDTO.java b/src/main/java/cc/ryanc/halo/model/dto/post/PostWithTitleDTO.java index 3842a76de..beb0dea67 100644 --- a/src/main/java/cc/ryanc/halo/model/dto/post/PostWithTitleDTO.java +++ b/src/main/java/cc/ryanc/halo/model/dto/post/PostWithTitleDTO.java @@ -18,9 +18,7 @@ public class PostWithTitleDTO implements OutputConverter private Integer id; - /** - * 文章标题 - */ private String title; + private String type; } diff --git a/src/main/resources/templates/admin/admin_index.ftl b/src/main/resources/templates/admin/admin_index.ftl index fba920444..f799954bc 100755 --- a/src/main/resources/templates/admin/admin_index.ftl +++ b/src/main/resources/templates/admin/admin_index.ftl @@ -156,7 +156,7 @@ <#if (options.widget_postcount!'true')=='true'>
-

<@articleTag method="postsCount">${postsCount!0}

<@spring.message code='admin.index.widgets.posts' />

+

${postsCount!0}

<@spring.message code='admin.index.widgets.posts' />

<@spring.message code='common.btn.view-all' />
@@ -165,7 +165,7 @@ <#if (options.widget_commentcount!'true')=='true'>
-

${commentCount!0}

<@spring.message code='admin.index.widgets.comments' />

+

${commentsCount!0}

<@spring.message code='admin.index.widgets.comments' />

<@spring.message code='common.btn.view-all' />
@@ -174,7 +174,7 @@ <#if (options.widget_attachmentcount!'true')=='true'>
-

${mediaCount!0}

<@spring.message code='admin.index.widgets.attachments' />

+

${attachmentsCount!0}

<@spring.message code='admin.index.widgets.attachments' />

<@spring.message code='common.btn.upload-image' />
@@ -211,13 +211,13 @@ <@spring.message code='common.th.status' /> <@spring.message code='common.th.date' /> - <#if postsLatest??> - <#list postsLatest as post> + <#if latestPosts??> + <#list latestPosts as post> <#if post.postStatus == 0> - ${post.postTitle} + ${post.title} <#else > - ${post.postTitle} + ${post.title} <#if post.postStatus==0> @@ -228,7 +228,7 @@ <@spring.message code='common.status.recycle-bin' /> - <@common.timeline datetime="${post.postDate!}"?datetime /> + <@common.timeline datetime="${post.createTime!}"?datetime /> <#else> @@ -261,29 +261,19 @@ <@spring.message code='common.th.status' /> <@spring.message code='common.th.date' /> - <#if commentsLatest??> - <#list commentsLatest as comment> + <#if latestComments??> + <#list latestComments as comment> - ${comment.commentAuthor} + ${comment.author!} - <#if comment.post.postType=="post"> - ${comment.post.postTitle} + <#if comment.post.type=="post"> + ${comment.post.title!} <#else> - ${comment.post.postTitle} + ${comment.post.title!} - <#switch comment.commentStatus> - <#case 0> - ${comment.commentContent} - <#break> - <#case 1> - ${comment.commentContent} - <#break> - <#case 2> - ${comment.commentContent} - <#break> - + ${comment.content!} <#switch comment.commentStatus> @@ -298,7 +288,7 @@ <#break > - <@common.timeline datetime="${comment.commentDate}"?datetime /> + <@common.timeline datetime="${comment.createTime}"?datetime /> <#else> @@ -338,15 +328,15 @@ IP <@spring.message code='common.th.date' /> - <#if logsLatest??> - <#list logsLatest as log> - - ${log.logTitle} - ${log.logContent} - ${log.logIp} - ${log.logCreated?string("yyyy-MM-dd HH:mm")} - - + <#if latestLogs??> + <#list latestLogs as log> + + ${log.type} + ${log.content} + ${log.ipAddress} + ${log.createTime?string("yyyy-MM-dd HH:mm")} + + <#else> <@spring.message code='common.text.no-data' /> @@ -368,9 +358,9 @@