diff --git a/public/css/site.css b/public/css/site.css index 2427198..949f15f 100644 --- a/public/css/site.css +++ b/public/css/site.css @@ -23,3 +23,27 @@ color: #003e80; padding: 3px 8px; } +.log .actions{ + display:none; +} +.log div.col-2 p { + margin: 2px 0px 6px; + text-overflow: ellipsis; + overflow: hidden; +} +.log p.author { + font-size: .875rem; +} +.log p.server { + font-weight: bold; +} +.log a.actions-toggle.btn-link.btn-sm { + margin: 0; + padding: 0; + color: #007bff; + cursor: pointer; +} +.log pre { + font-size: 1.0rem; + color: #333; +} diff --git a/public/js/app.js b/public/js/app.js index f1d8d0a..d06163e 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -31,6 +31,10 @@ var cmdRegex = /```([^`]*?)```/g cmd = function(string) { return ''+string.replace(cmdRegex, '$1'); } +date = function(date){ + var D = new Date(date); + return D.toLocaleDateString()+" "+D.toLocaleTimeString(); +} function updatePage(data){ var content = ""; @@ -46,11 +50,24 @@ function updatePage(data){ id = v._id; content += ` -
-
-

${escape(item.created_at)} -- ${escape(item.author)} -- ${escape(item.server)}

+
+
+ + ${date(escape(item.created_at))}
+
+
+

${escape(item.server)}

+

${escape(item.author)}

+ Actions +
+
+ Remove + Edit +
+
+
 ${cmd(title(url(escape(item.content))))}
- +
`; }); @@ -79,3 +96,6 @@ $("input").on("keyup",function(e){ }); updatePage( initData ); + +$(".actions-toggle").on("click",(e) => { var el=e.target; $(el).next().show(); $(el).hide(); } ) + diff --git a/views/index.pug b/views/index.pug index c89d69d..148b76d 100644 --- a/views/index.pug +++ b/views/index.pug @@ -17,13 +17,12 @@ html(lang="en") - #content.container-fluid + #content.container-sm hr