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