selfhostable, read-only reddit client

add `edited` indicator to comments

+16 -5
+1 -1
flake.nix
··· 41 cp -R ./node_modules/* $out/node_modules 42 ls -la $out/node_modules 43 ''; 44 - outputHash = "sha256-+4jTWcQFKd5ZxoViWabHgANIV/fi6oevqK9MiyWeF5c="; 45 outputHashAlgo = "sha256"; 46 outputHashMode = "recursive"; 47 };
··· 41 cp -R ./node_modules/* $out/node_modules 42 ls -la $out/node_modules 43 ''; 44 + outputHash = "sha256-iv1DddCTB1yyu21Ev/c4xtLHSvDas9jQAO2Ob9Iah2Q="; 45 outputHashAlgo = "sha256"; 46 outputHashMode = "recursive"; 47 };
+3
src/mixins/comment.pug
··· 19 |  ·  20 | #{timeDifference(Date.now(), data.created * 1000)} 21 |  ·  22 a(href=`https://reddit.com${data.permalink}` title="view on reddit").nav-link open ↗ 23 24 -
··· 19 |  ·  20 | #{timeDifference(Date.now(), data.created * 1000)} 21 |  ·  22 + if data.edited !== false 23 + | edited #{timeDifference(Date.now(), data.edited * 1000)} ago 24 + |  ·  25 a(href=`https://reddit.com${data.permalink}` title="view on reddit").nav-link open ↗ 26 27 -
+1 -1
src/mixins/post.pug
··· 3 mixin post(p, currentUrl) 4 - var from = encodeURIComponent(currentUrl) 5 article.post 6 - div(id=`${p.id}`).post-container 7 div.post-text 8 div.title-container 9 a(href=`/comments/${p.id}?from=${from}`)
··· 3 mixin post(p, currentUrl) 4 - var from = encodeURIComponent(currentUrl) 5 article.post 6 + div.post-container 7 div.post-text 8 div.title-container 9 a(href=`/comments/${p.id}?from=${from}`)
+9 -2
src/public/styles.css
··· 25 --link-color: #79ffe1; 26 --link-visited-color: #999; 27 --accent: var(--link-color); 28 - --error-text-color: lightcoral; 29 } 30 } 31 ··· 307 align-items: center; 308 } 309 310 .post-text { 311 display: flex; 312 flex-direction: column; ··· 464 465 button { 466 border: 0px solid; 467 - border-radius: 4px; 468 background-color: var(--bg-color-muted); 469 color: var(--text-color); 470 padding: 5px;
··· 25 --link-color: #79ffe1; 26 --link-visited-color: #999; 27 --accent: var(--link-color); 28 + --error-text-color: lightcoral; 29 } 30 } 31 ··· 307 align-items: center; 308 } 309 310 + .post-container:target { 311 + outline: 4px solid var(--bg-color-muted); 312 + background: var(--bg-color-muted); 313 + border-radius: 2px; 314 + padding: 5px; 315 + } 316 + 317 .post-text { 318 display: flex; 319 flex-direction: column; ··· 471 472 button { 473 border: 0px solid; 474 + border-radius: 2px; 475 background-color: var(--bg-color-muted); 476 color: var(--text-color); 477 padding: 5px;
+1
src/routes/index.js
··· 159 message, 160 user: req.user, 161 original_query: req.query.q, 162 }); 163 } 164 });
··· 159 message, 160 user: req.user, 161 original_query: req.query.q, 162 + currentUrl: req.url, 163 }); 164 } 165 });
+1 -1
src/views/post-search.pug
··· 20 i #{message} 21 if items 22 each item in items 23 - +post(item.data)
··· 20 i #{message} 21 if items 22 each item in items 23 + +post(item.data, currentUrl)