diff options
author | PortableProgrammer <[email protected]> | 2024-12-30 21:17:57 +0000 |
---|---|---|
committer | PortableProgrammer <[email protected]> | 2024-12-30 21:17:57 +0000 |
commit | eae5094ea241cc69b38cce328b73e858e6ff63de (patch) | |
tree | 61c05c3ada6c7b18438405f9ad7fae3afc611499 /src/views/index.pug | |
parent | 6ada78b8b19e7618275c2f9491acc1b5e89cd59a (diff) |
Feat: Card View
Initial Commit
Diffstat (limited to 'src/views/index.pug')
-rw-r--r-- | src/views/index.pug | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/src/views/index.pug b/src/views/index.pug index 0f00efe..5c7d550 100644 --- a/src/views/index.pug +++ b/src/views/index.pug | |||
@@ -2,6 +2,8 @@ include ../mixins/post | |||
2 | include ../mixins/header | 2 | include ../mixins/header |
3 | include ../mixins/head | 3 | include ../mixins/head |
4 | include ../utils | 4 | include ../utils |
5 | - var viewQuery = query && query.view ? query.view : 'compact' | ||
6 | - var sortQuery = query && query.sort ? query.sort + (query.t ? '&t=' + query.t : '') : 'hot' | ||
5 | doctype html | 7 | doctype html |
6 | html | 8 | html |
7 | +head("home") | 9 | +head("home") |
@@ -14,9 +16,9 @@ html | |||
14 | div.sub-title | 16 | div.sub-title |
15 | h1 | 17 | h1 |
16 | if isMulti | 18 | if isMulti |
17 | a(href=`/`) lurker | 19 | a(href=`/?${sortQuery}&${viewQuery}`) lurker |
18 | else | 20 | else |
19 | a(href=`/r/${subreddit}`) | 21 | a(href=`/r/${subreddit}?${sortQuery}&${viewQuery}`) |
20 | | r/#{subreddit} | 22 | | r/#{subreddit} |
21 | if !isMulti | 23 | if !isMulti |
22 | div#button-container | 24 | div#button-container |
@@ -32,27 +34,32 @@ html | |||
32 | a(href="https://donate.stripe.com/dR62bTaZH1295Da4gg") oppiliappan | 34 | a(href="https://donate.stripe.com/dR62bTaZH1295Da4gg") oppiliappan |
33 | |, author of lurker | 35 | |, author of lurker |
34 | hr | 36 | hr |
35 | details | 37 | details.sort-details |
36 | summary.sorting sorting by #{query.sort + (query.t?' '+query.t:'')} | 38 | summary.sorting sorting by #{query.sort + (query.t?' '+query.t:'')}, #{viewQuery} view |
37 | div.sort-opts | 39 | div.sort-opts |
38 | div | 40 | div |
39 | a(href=`/r/${subreddit}?sort=hot`) hot | 41 | a(href=`/r/${subreddit}?sort=hot&view=${viewQuery}`) hot |
40 | div | 42 | div |
41 | a(href=`/r/${subreddit}?sort=new`) new | 43 | a(href=`/r/${subreddit}?sort=new&view=${viewQuery}`) new |
42 | div | 44 | div |
43 | a(href=`/r/${subreddit}?sort=rising`) rising | 45 | a(href=`/r/${subreddit}?sort=rising&view=${viewQuery}`) rising |
44 | div | 46 | div |
45 | a(href=`/r/${subreddit}?sort=top`) top | 47 | a(href=`/r/${subreddit}?sort=top&view=${viewQuery}`) top |
46 | div | 48 | div |
47 | a(href=`/r/${subreddit}?sort=top&t=day`) top day | 49 | a(href=`/r/${subreddit}?sort=top&t=day&view=${viewQuery}`) top day |
48 | div | 50 | div |
49 | a(href=`/r/${subreddit}?sort=top&t=week`) top week | 51 | a(href=`/r/${subreddit}?sort=top&t=week&view=${viewQuery}`) top week |
50 | div | 52 | div |
51 | a(href=`/r/${subreddit}?sort=top&t=month`) top month | 53 | a(href=`/r/${subreddit}?sort=top&t=month&view=${viewQuery}`) top month |
52 | div | 54 | div |
53 | a(href=`/r/${subreddit}?sort=top&t=year`) top year | 55 | a(href=`/r/${subreddit}?sort=top&t=year&view=${viewQuery}`) top year |
54 | div | 56 | div |
55 | a(href=`/r/${subreddit}?sort=top&t=all`) top all | 57 | a(href=`/r/${subreddit}?sort=top&t=all&view=${viewQuery}`) top all |
58 | div.sort-opts | ||
59 | div | ||
60 | a(href=`/r/${subreddit}?sort=${sortQuery}&view=compact`) compact | ||
61 | div | ||
62 | a(href=`/r/${subreddit}?sort=${sortQuery}&view=card`) card | ||
56 | 63 | ||
57 | if posts | 64 | if posts |
58 | each child in posts.posts | 65 | each child in posts.posts |