Skip to content

Commit

Permalink
feat: 笔记时间支持显示时分秒;调整了笔记卡片布局
Browse files Browse the repository at this point in the history
  • Loading branch information
Tokinx authored May 29, 2023
1 parent 25388ec commit 70b89e9
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions static/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -846,13 +846,6 @@ const $modules = new function () {
<a :href="note.permalink">{{ note.title }}</a>
</h3>
<div v-else class="flex-center">
<time class="mr-2" :datetime="note.date" itemprop="datePublished" pubdate>{{ noteDate }}</time>
<button class="btn btn-link btn-sm text-gray mr-2" @click="handleComment">
<i class="czs-talk"></i> {{ note.comment_count }}
</button>
<button :class="['btn btn-link btn-sm text-gray mr-2', { 'text-error': praise }]" @click="handleMenuClick({ id: 'praise' })">
<i class="czs-heart"></i> <span :class="'praise-' + note.id">{{ notePraise }}</span>
</button>
<span v-if="note.status === 'private'" class="chip bg-gray text-gray">{{ note.status.toLocaleUpperCase() }}</span>
</div>
</div>
Expand Down Expand Up @@ -894,12 +887,23 @@ const $modules = new function () {
</div>
<attachment-chips v-if="note.attachment" :attachments="note.attachment"></attachment-chips>
</div>
<div v-if="isPost" class="tile-footer text-gray text-tiny flex-center justify-between">
<div class="tile-footer text-gray text-tiny flex-center justify-between">
<div class="flex-center">
<time class="mr-2">{{ noteDate }}</time>
<button class="btn btn-link btn-sm text-gray d-flex align-center" @click="handleComment">
<i class="czs-talk mr-1"></i> {{ note.comment_count }}
</button>
<div v-if="isPost">
<time class="mr-2">{{ noteDate }}</time>
<button class="btn btn-link btn-sm text-gray d-flex align-center" @click="handleComment">
<i class="czs-talk mr-1"></i> {{ note.comment_count }}
</button>
</div>
<div v-else>
<time class="mr-2" :datetime="note.date" itemprop="datePublished" pubdate>{{ noteDate }}</time>
<button class="btn btn-link btn-sm text-gray mr-2" @click="handleComment">
<i class="czs-talk"></i> {{ note.comment_count }}
</button>
<button :class="['btn btn-link btn-sm text-gray mr-2', { 'text-error': praise }]" @click="handleMenuClick({ id: 'praise' })">
<i class="czs-heart"></i> <span :class="'praise-' + note.id">{{ notePraise }}</span>
</button>
</div>
</div>
<a v-if="isPost" class="btn btn-link btn-sm text-gray d-flex align-center" :href="note.permalink">
Expand Down Expand Up @@ -1020,7 +1024,7 @@ const $modules = new function () {
if ( this.lately ) {
return Lately && Lately.format(this.note.date);
}
return dayjs && dayjs(this.note.date).format('YYYY/MM/DD');
return dayjs && dayjs(this.note.date).format('YYYY/MM/DD HH:mm:ss');
},
notePraise() {
return String(this.note.fields && (this.note.fields.praise || 0));
Expand Down

0 comments on commit 70b89e9

Please sign in to comment.