From 0d4d90ba058ed3b7ee0d4054602096d16151303c Mon Sep 17 00:00:00 2001 From: Akshay Date: Tue, 26 Nov 2024 21:19:41 +0000 Subject: add search page, support spoiler/nsfw imgs --- src/views/comments.pug | 3 ++- src/views/index.pug | 4 ++-- src/views/sub-search.pug | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/views') diff --git a/src/views/comments.pug b/src/views/comments.pug index e9bd332..844dfcc 100644 --- a/src/views/comments.pug +++ b/src/views/comments.pug @@ -43,7 +43,8 @@ html a(href=`/media/${item.url}`) img(src=item.url loading="lazy") else if isPostImage(post) - img(src=post.url).post-media + a(href=`/media/${post.url}`) + img(src=post.url).post-media else if isPostVideo(post) - var url = post.secure_media.reddit_video.dash_url video(controls data-dashjs-player src=`${url}`).post-media diff --git a/src/views/index.pug b/src/views/index.pug index a3bcd84..ea730fb 100644 --- a/src/views/index.pug +++ b/src/views/index.pug @@ -25,9 +25,9 @@ html else button(onclick=`toggleSub('${subreddit}')` id=`thinger_${subreddit}`) subscribe if about && !isMulti - p #{about.public_description} + div.about #{about.public_description} else - p + div.about | consider donating to  a(href="https://donate.stripe.com/dR62bTaZH1295Da4gg") oppiliappan |, author of readit diff --git a/src/views/sub-search.pug b/src/views/sub-search.pug index da33214..bf0d402 100644 --- a/src/views/sub-search.pug +++ b/src/views/sub-search.pug @@ -11,7 +11,8 @@ html div.hero h1 search subreddits form(action="/search" method="get").search-bar - input(type="text" name="q" placeholder="search subreddits (add +nsfw to include over-18 results)" required).search-input + - var prefill = original_query ?? ""; + input(type="text" name="q" placeholder="search subreddits (add +nsfw to include over-18 results)" value=prefill required).search-input button(type="submit").search-button go if message div.search-message -- cgit v1.2.3