mirror of
https://codeberg.org/tacerus/teddit.git
synced 2024-11-29 19:29:27 +01:00
124 lines
5.0 KiB
Plaintext
124 lines
5.0 KiB
Plaintext
doctype html
|
||
html
|
||
head
|
||
title teddit
|
||
include includes/head.pug
|
||
body(class=""+ user_preferences.theme +"")
|
||
include includes/topbar.pug
|
||
if json === null
|
||
h2 error
|
||
p #{JSON.stringify(http_status_code)}
|
||
p #{JSON.stringify(http_statustext)}
|
||
else
|
||
- var subreddit = ''
|
||
if(user_preferences.subbed_subreddits && Array.isArray(user_preferences.subbed_subreddits))
|
||
- subreddit = '/r/' + user_preferences.subbed_subreddits.join('+')
|
||
header
|
||
a(href="/", class="main")
|
||
h1 teddit
|
||
.bottom
|
||
ul.tabmenu
|
||
li(class=!sortby || sortby == 'hot' ? 'active' : '')
|
||
a(href="" + subreddit + "/") hot
|
||
li(class=sortby === 'new' ? 'active' : '')
|
||
a(href="" + subreddit + "/new") new
|
||
li(class=sortby === 'rising' ? 'active' : '')
|
||
a(href="" + subreddit + "/rising") rising
|
||
li(class=sortby === 'controversial' ? 'active' : '')
|
||
a(href="" + subreddit + "/controversial") controversial
|
||
li(class=sortby === 'top' ? 'active' : '')
|
||
a(href="" + subreddit + "/top") top
|
||
if !before && !after && sortby === 'hot'
|
||
#intro
|
||
h1 Welcome to teddit
|
||
h2 the alternative, privacy respecting, front page of internet.
|
||
#links.sr
|
||
if sortby === 'top' || sortby === 'controversial'
|
||
details
|
||
summary
|
||
if past === 'hour'
|
||
span links from: past hour
|
||
if past === 'day'
|
||
span links from: past 24 hours
|
||
if past === 'week'
|
||
span links from: past week
|
||
if past === 'month'
|
||
span links from: past month
|
||
if past === 'year'
|
||
span links from: past year
|
||
if past === 'all'
|
||
span links from: all time
|
||
ul
|
||
li(class=past === 'hour' ? 'active' : '')
|
||
a(href="?t=hour") past hour
|
||
li(class=past === 'day' ? 'active' : '')
|
||
a(href="?t=day") past 24 hours
|
||
li(class=past === 'week' ? 'active' : '')
|
||
a(href="?t=week") past week
|
||
li(class=past === 'month' ? 'active' : '')
|
||
a(href="?t=month") past month
|
||
li(class=past === 'year' ? 'active' : '')
|
||
a(href="?t=year") past year
|
||
li(class=past === 'all' ? 'active' : '')
|
||
a(href="?t=all") all time
|
||
each link in json.links
|
||
.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 #{cleanTitle(link.title)}
|
||
span (#{link.domain})
|
||
else
|
||
a(href="" + link.url + "", rel="noopener noreferrer")
|
||
h2 #{cleanTitle(link.title)}
|
||
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}
|
||
span(class="to") to
|
||
a(href="/r/" + link.subreddit + "")
|
||
| #{link.subreddit}
|
||
.links
|
||
if link.over_18
|
||
span.tag.nsfw NSFW
|
||
a(href="" + link.permalink + "", class="comments")
|
||
| #{link.num_comments} comments
|
||
#search
|
||
form(action="/r/all/search", method="GET")
|
||
div
|
||
label(for="q") search
|
||
input(type="text", name="q", id="q", placeholder="search")
|
||
div
|
||
label(for="nsfw") include NSFW results
|
||
input(type="checkbox", name="nsfw", id="nsfw", checked="checked")
|
||
input(type="submit", value="search")
|
||
if json.info.before || json.info.after
|
||
.view-more-links
|
||
- var subreddit = 'all'
|
||
if(user_preferences.subbed_subreddits && Array.isArray(user_preferences.subbed_subreddits))
|
||
- subreddit = user_preferences.subbed_subreddits.join('+')
|
||
if json.info.after
|
||
a(href="/r/" + subreddit + "/" + sortby + "?t=" + (past ? past : '') + "&after=" + json.info.after + "") next ›
|
||
include includes/footer.pug
|