🎨 仪表盘样式优化

pull/41/head
ruibaby 2018-10-31 10:17:55 +08:00
parent e2c2468be2
commit cd0513cf9a
4 changed files with 18 additions and 3 deletions

View File

@ -238,7 +238,7 @@
<span class="label bg-red"><@spring.message code='common.status.recycle-bin' /></span>
</#if>
</td>
<td>${post.postDate?if_exists?string("yyyy-MM-dd HH:mm")}</td>
<td><@common.timeline datetime="${post.postDate?if_exists}"?datetime /></td>
</tr>
</#list>
<#else>
@ -310,7 +310,7 @@
<#break >
</#switch>
</td>
<td>${comment.commentDate?string("yyyy-MM-dd HH:mm")}</td>
<td><@common.timeline datetime="${comment.commentDate}"?datetime /></td>
</tr>
</#list>
<#else>

View File

@ -35,7 +35,7 @@
</div>
<h4>
${comment.commentAuthor}
<small> ${comment.commentDate?string("yyyy/MM/dd HH:mm")}</small>
<small> <@common.timeline datetime="${comment.commentDate}"?datetime /></small>
</h4>
<object>${comment.commentContent}</object>
</a>

View File

@ -1,4 +1,5 @@
<#macro head>
<#import "/common/macro/common_macro.ftl" as common>
<!DOCTYPE html>
<html>
<head>

View File

@ -31,4 +31,18 @@
<#if options.blog_verification_qihu??>
<meta name="360-site-verification" content="${options.blog_verification_qihu}" />
</#if>
</#macro>
<#-- 时间格式化 几...前 -->
<#macro timeline datetime=.now>
<#assign ct = (.now?long-datetime?long)/1000>
<#if ct gte 31104000>${(ct/31104000)?int}年前
<#t><#elseif ct gte 2592000>${(ct/2592000)?int}个月前
<#t><#elseif ct gte 86400*2>${(ct/86400)?int}天前
<#t><#elseif ct gte 86400>昨天
<#t><#elseif ct gte 3600>${(ct/3600)?int}小时前
<#t><#elseif ct gte 60>${(ct/60)?int}分钟前
<#t><#elseif ct gt 0>${ct?int}秒前
<#t><#else>刚刚
</#if>
</#macro>