158 lines
6.7 KiB
Plaintext
158 lines
6.7 KiB
Plaintext
doctype html
|
||
html
|
||
head
|
||
if no_query
|
||
title search teddit
|
||
else
|
||
title search results for #{q}
|
||
include includes/head.pug
|
||
body(class=""+ (user_preferences.theme === 'auto' ? 'dark' : user_preferences.theme) + "")
|
||
include includes/topbar.pug
|
||
#search.sr.search-page
|
||
form(action="/r/" + subreddit + "/search", method="GET")
|
||
div
|
||
label(for="q") search
|
||
input(type="text", name="q", id="q", placeholder="search", value=""+ q +"")
|
||
div
|
||
label(for="restrict_sr") limit my search to r/#{subreddit}
|
||
if !restrict_sr || restrict_sr === 'on'
|
||
input(type="checkbox", name="restrict_sr", id="restrict_sr", checked="checked")
|
||
else
|
||
input(type="checkbox", name="restrict_sr", id="restrict_sr")
|
||
div
|
||
label(for="nsfw") include NSFW results
|
||
if !nsfw || nsfw === 'on'
|
||
input(type="checkbox", name="nsfw", id="nsfw", checked="checked")
|
||
else
|
||
input(type="checkbox", name="nsfw", id="nsfw")
|
||
div
|
||
//- Let me know if there's a better way to add selected attribute!
|
||
label(for="sort") sorted by:
|
||
select(name="sort", id="sort")
|
||
if sortby === 'relevance' || !sortby
|
||
option(value="relevance", selected="selected") relevance
|
||
option(value="top") top
|
||
option(value="new") new
|
||
option(value="comments") comments
|
||
if sortby === 'top'
|
||
option(value="relevance") relevance
|
||
option(value="top", selected="selected") top
|
||
option(value="new") new
|
||
option(value="comments") comments
|
||
if sortby === 'new'
|
||
option(value="relevance") relevance
|
||
option(value="top") top
|
||
option(value="new", selected="selected") new
|
||
option(value="comments") comments
|
||
if sortby === 'comments'
|
||
option(value="relevance") relevance
|
||
option(value="top") top
|
||
option(value="new") new
|
||
option(value="comments", selected="selected") comments
|
||
div
|
||
//- Let me know if there's a better way to add selected attribute!
|
||
label(for="t") links from:
|
||
select(name="t", id="t")
|
||
if past === 'hour'
|
||
option(value="hour", selected="selected") hour
|
||
option(value="day") 24 hours
|
||
option(value="week") week
|
||
option(value="month") month
|
||
option(value="year") year
|
||
option(value="all") all time
|
||
if past === 'day'
|
||
option(value="hour") hour
|
||
option(value="day", selected="selected") 24 hours
|
||
option(value="week") week
|
||
option(value="month") month
|
||
option(value="year") year
|
||
option(value="all") all time
|
||
if past === 'week'
|
||
option(value="hour") hour
|
||
option(value="day") 24 hours
|
||
option(value="week", selected="selected") week
|
||
option(value="month") month
|
||
option(value="year") year
|
||
option(value="all") all time
|
||
if past === 'month'
|
||
option(value="hour") hour
|
||
option(value="day") 24 hours
|
||
option(value="week") week
|
||
option(value="month", selected="selected") month
|
||
option(value="year") year
|
||
option(value="all") all time
|
||
if past === 'year'
|
||
option(value="hour") hour
|
||
option(value="day") 24 hours
|
||
option(value="week") week
|
||
option(value="month") month
|
||
option(value="year", selected="selected") year
|
||
option(value="all") all time
|
||
if past === 'all' || !past
|
||
option(value="hour") hour
|
||
option(value="day") 24 hours
|
||
option(value="week") week
|
||
option(value="month") month
|
||
option(value="year") year
|
||
option(value="all", selected="selected") all time
|
||
input(type="submit", value="search")
|
||
#links.search
|
||
if json.posts.length === 0 && !no_query
|
||
p no results
|
||
else
|
||
each link in json.posts
|
||
.link
|
||
.upvotes
|
||
.arrow
|
||
span #{kFormatter(link.ups)}
|
||
.arrow.down
|
||
.image
|
||
if link.images
|
||
if link.is_self_link
|
||
a(href="" + link.permalink + "")
|
||
img(src="" + link.images.thumb + "", alt="")
|
||
else
|
||
a(href=""+ link.url +"", rel="noopener noreferrer")
|
||
img(src="" + link.images.thumb + "", alt="")
|
||
else
|
||
a(href="" + link.permalink + "")
|
||
.no-image no image
|
||
.entry
|
||
.title
|
||
if link.is_self_link
|
||
a(href="" + link.permalink + "")
|
||
h2(class="" + (link.stickied ? 'green' : '') + "") #{cleanTitle(link.title)}
|
||
!= link.link_flair
|
||
span (#{link.domain})
|
||
else
|
||
a(href="" + link.url + "", rel="noopener noreferrer")
|
||
h2(class="" + (link.stickied ? 'green' : '') + "") #{cleanTitle(link.title)}
|
||
!= link.link_flair
|
||
span (#{link.domain})
|
||
.meta
|
||
p.submitted submitted
|
||
span(title="" + toUTCString(link.created) + "") #{timeDifference(link.created)} by
|
||
if link.author === '[deleted]'
|
||
span(class="deleted") [deleted]
|
||
else
|
||
a(href="/u/" + link.author + "")
|
||
| #{link.author}
|
||
!= link.user_flair
|
||
p.to to
|
||
a(href="/r/" + link.subreddit + "")
|
||
| #{link.subreddit}
|
||
if link.stickied
|
||
span(class="green") stickied
|
||
.links
|
||
if link.over_18
|
||
span.tag.nsfw NSFW
|
||
a(href="" + link.permalink + "", class="comments")
|
||
| #{link.num_comments} comments
|
||
if json.before || json.after
|
||
.view-more-links
|
||
if json.before && !subreddit_front
|
||
a(href="?q=" + q + "&restrict_sr=" + restrict_sr + "&nsfw=" + nsfw + "&before=" + json.before + "") ‹ prev
|
||
if json.after
|
||
a(href="?q=" + q + "&restrict_sr=" + restrict_sr + "&nsfw=" + nsfw + "&after=" + json.after + "") next ›
|
||
include includes/footer.pug
|