made date pretty for dash index listing, quick style fix to compensate for long titles

This commit is contained in:
Ro 2020-06-04 19:50:08 -07:00
parent bd15252475
commit a3a274ea61
4 changed files with 8 additions and 5 deletions

View file

@ -1,8 +1,10 @@
import Book from '../../data/Book';
const express = require('express');
const moment = require('moment');
const router = express.Router();
const config = require('../../../site/settings.json');
const book = new Book();
const indexLimit = 5;
//--------------------------
@ -16,7 +18,7 @@ router.get('/', function (req, res) {
result.forEach(page => {
if (typeof page.metadata.deleted === 'undefined' || page.metadata.deleted === false) {
if (indexCount === indexLimit) return;
indexPages.push(page);
indexPages.push({ page: page, date: moment(page.metadata.created).fromNow() });
++indexCount;
}
});

View file

@ -126,7 +126,7 @@ router.get('/edit/:id', function (req, res) {
title: 'Edit Page',
welcome: 'Edit Page',
page: page.metadata,
date: moment(page.metadata.created).format('YYYY MMM DD'),
date: moment(page.metadata.created).format('YYYY MMM DD HH:mm'),
layout: page.metadata.layout,
rawDate: page.metadata.created,
content: page.content,

View file

@ -13,8 +13,8 @@
label this is empty
else
- for ( index; index < pages.length; index++)
a.post-link(href="/@/dashboard/page/edit/"+pages[index].metadata.uuid id=pages[index].metadata.uuid style="background:url("+pages[index].metadata.feature+") no-repeat center center / cover")
a.post-link(href="/@/dashboard/page/edit/"+pages[index].page.metadata.uuid id=pages[index].page.metadata.uuid style="background:url("+pages[index].page.metadata.feature+") no-repeat center center / cover")
div
label= pages[index].metadata.title
span= pages[index].metadata.created
label= pages[index].page.metadata.title
span= pages[index].date

View file

@ -111,6 +111,7 @@
padding 5px
vertical-align top
display inline-block
word-wrap break-word
width 60%
span