forked from rDrama/rDrama
254 lines
12 KiB
HTML
254 lines
12 KiB
HTML
{% extends "default.html" %}
|
|
{% block title %}
|
|
{% if sub %}
|
|
<title>/h/{{sub}}</title>
|
|
{% elif request.path == '/' %}
|
|
<title>{{SITE_NAME}}</title>
|
|
{% else %}
|
|
{{super()}}
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block head_final %}
|
|
{% set preview = sub.siderbarurl if sub and sub.sidebarurl else sub.bannerurl %}
|
|
|
|
<meta property="og:type" content="article">
|
|
<meta property="og:title" content="/h/{{sub}}">
|
|
<meta property="og:site_name" content="{{SITE}}">
|
|
<meta property="og:image" content="{{preview}}">
|
|
<meta property="og:url" content="{{request.full_path}}">
|
|
<meta property="og:author" name="author" content="{{SITE_FULL}}">
|
|
|
|
<meta name="twitter:card" content="summary_large_image">
|
|
<meta name="twitter:site" content="{{SITE_FULL}}">
|
|
<meta name="twitter:title" content="/h/{{sub}}">
|
|
<meta name="twitter:creator" content="{{SITE_FULL}}">
|
|
<meta name="twitter:image" content="{{preview}}">
|
|
<meta name="twitter:url" content="{{request.full_path}}">
|
|
|
|
{% if sub.sidebar %}
|
|
<meta property="og:description" name="description" content="{{sub.sidebar}}">
|
|
<meta name="twitter:description" content="{{sub.sidebar}}">
|
|
{% endif %}
|
|
{% endblock %}
|
|
{% block desktopBanner %}
|
|
<div class="row" style="overflow: visible;padding-top:5px;">
|
|
<div class="col">
|
|
<a class="btn btn-primary btn-block mt-3" href="{% if sub %}/h/{{sub}}{% endif %}/submit"><i class="fas fa-feather-alt mr-2"></i>Create Post</a>
|
|
|
|
{% if sub %}
|
|
{% if v %}
|
|
{%- set hole_prefix = '/h/' if not HOLE_STYLE_FLAIR else '' -%}
|
|
|
|
{% if sub.stealth %}
|
|
<button type="button" id="subscribe-sub" class="btn btn-primary btn-block {% if v.subscribes(sub.name) %}d-none{% endif %}" onclick="postToastSwitch(this,'/h/{{sub}}/subscribe','subscribe-sub','unsubscribe-sub','d-none')"><i class="fas fa-eye mr-2"></i>Unblock {{hole_prefix}}{{sub}}</button>
|
|
<button type="button" id="unsubscribe-sub" class="btn btn-primary btn-block {% if not v.subscribes(sub.name) %}d-none{% endif %}" onclick="postToastSwitch(this,'/h/{{sub}}/unsubscribe','subscribe-sub','unsubscribe-sub','d-none')"><i class="fas fa-eye-slash mr-2"></i>Block {{hole_prefix}}{{sub}}</button>
|
|
{% else %}
|
|
<button type="button" id="block-sub" class="btn btn-primary btn-block mt-3 {% if v.blocks(sub.name) %}d-none{% endif %}" onclick="postToastSwitch(this,'/h/{{sub}}/block','block-sub','unblock-sub','d-none')"><i class="fas fa-eye-slash mr-2"></i>Block {{hole_prefix}}{{sub}}</button>
|
|
<button type="button" id="unblock-sub" class="btn btn-primary btn-block mt-3 {% if not v.blocks(sub.name) %}d-none{% endif %}" onclick="postToastSwitch(this,'/h/{{sub}}/unblock','block-sub','unblock-sub','d-none')"><i class="fas fa-eye mr-2"></i>Unblock {{hole_prefix}}{{sub}}</button>
|
|
{% endif %}
|
|
|
|
<button type="button" id="follow-sub" class="btn btn-primary btn-follow {% if v.follows(sub.name) %}d-none{% endif %}" onclick="postToastSwitch(this,'/h/{{sub}}/follow','follow-sub','unfollow-sub','d-none')"><i class="fas fa-bell mr-2"></i>Follow {{hole_prefix}}{{sub}}</button>
|
|
<button type="button" id="unfollow-sub" class="btn btn-primary btn-follow {% if not v.follows(sub.name) %}d-none{% endif %}" onclick="postToastSwitch(this,'/h/{{sub}}/unfollow','follow-sub','unfollow-sub','d-none')"><i class="fas fa-bell-slash mr-2"></i>Unfollow {{hole_prefix}}{{sub}}</button>
|
|
{% else %}
|
|
<a class="btn btn-primary btn-block" href="/login?redirect={{request.full_path | urlencode}}"><i class="fas fa-eye-slash mr-2"></i>Block {{hole_prefix}}{{sub}}</a>
|
|
<a class="btn btn-primary btn-block" href="/login?redirect={{request.full_path | urlencode}}"><i class="fas fa-bell mr-2"></i>Follow {{hole_prefix}}{{sub}}</a>
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
<div class="d-flex justify-content-between align-items-center pt-3 pb-2 sorting" style="float:right">
|
|
|
|
{% block navbar %}
|
|
<div class="d-flex align-items-center">
|
|
{% if pins %}
|
|
{% set pcolor = "primary" %}
|
|
{% else %}
|
|
{% set pcolor = "secondary" %}
|
|
{% endif %}
|
|
|
|
<a class="btn btn-{{pcolor}} text-{{pcolor}} mx-2 smol-fp" href="/toggle_pins/{{sort}}"><i class="fas fas fa-thumbtack fa-rotate--45 mr-2 "></i>Pins</a>
|
|
|
|
{% if SITE_NAME != 'WPD' and not sub %}
|
|
{% if holes %}
|
|
{% set hcolor = "primary" %}
|
|
{% else %}
|
|
{% set hcolor = "secondary" %}
|
|
{% endif %}
|
|
|
|
<a class="btn btn-{{hcolor}} text-{{hcolor}} mx-2 smol-fp" href="/toggle_holes"><i class="fas fas fa-manhole mr-2 "></i>Holes</a>
|
|
{% endif %}
|
|
|
|
<div class="dropdown dropdown-actions mx-2">
|
|
<button type="button" class="btn btn-secondary dropdown-toggle smol-fp" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
{% if t=="hour" %}<i class="fas fa-clock mr-2 "></i>
|
|
{% elif t=="day" %}<i class="fas fa-calendar-day mr-2 "></i>
|
|
{% elif t=="week" %}<i class="fas fa-calendar-week mr-2 "></i>
|
|
{% elif t=="month" %}<i class="fas fa-calendar-alt mr-2 "></i>
|
|
{% elif t=="year" %}<i class="fas fa-calendar mr-2 "></i>
|
|
{% elif t=="all" %}<i class="fas fa-infinity mr-2 "></i>
|
|
{% endif %}
|
|
{{t | capitalize}}
|
|
</button>
|
|
<div class="dropdown-menu smol-fp" aria-labelledby="dropdownMenuButton" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px;">
|
|
{% if t != "hour" %}<a class="dropdown-item" href="?sort={{sort}}&t=hour"><i class="fas fa-clock mr-2 "></i>Hour</a>{% endif %}
|
|
{% if t != "day" %}<a class="dropdown-item" href="?sort={{sort}}&t=day"><i class="fas fa-calendar-day mr-2 "></i>Day</a>{% endif %}
|
|
{% if t != "week" %}<a class="dropdown-item" href="?sort={{sort}}&t=week"><i class="fas fa-calendar-week mr-2 "></i>Week</a>{% endif %}
|
|
{% if t != "month" %}<a class="dropdown-item" href="?sort={{sort}}&t=month"><i class="fas fa-calendar-alt mr-2 "></i>Month</a>{% endif %}
|
|
{% if t != "year" %}<a class="dropdown-item" href="?sort={{sort}}&t=year"><i class="fas fa-calendar mr-2 "></i>Year</a>{% endif %}
|
|
{% if t != "all" %}<a class="dropdown-item" href="?sort={{sort}}&t=all"><i class="fas fa-infinity mr-2 "></i>All</a>{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="dropdown dropdown-actions ml-2">
|
|
<button type="button" class="btn btn-secondary dropdown-toggle smol-fp" id="dropdownMenuButton2" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
{% if sort=="hot" %}<i class="fas fa-fire mr-2 "></i>{% endif %}
|
|
{% if sort=="bump" %}<i class="fas fa-arrow-up mr-2 "></i>{% endif %}
|
|
{% if sort=="top" %}<i class="fas fa-arrow-alt-circle-up mr-2 "></i>{% endif %}
|
|
{% if sort=="bottom" %}<i class="fas fa-arrow-alt-circle-down mr-2 "></i>{% endif %}
|
|
{% if sort=="new" %}<i class="fas fa-sparkles mr-2 "></i>{% endif %}
|
|
{% if sort=="old" %}<i class="fas fa-book mr-2 "></i>{% endif %}
|
|
{% if sort=="controversial" %}<i class="fas fa-bullhorn mr-2 "></i>{% endif %}
|
|
{% if sort=="comments" %}<i class="fas fa-comments mr-2 "></i>{% endif %}
|
|
{{sort | capitalize}}
|
|
</button>
|
|
<div class="dropdown-menu smol-fp" aria-labelledby="dropdownMenuButton2" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px;">
|
|
{% if sort != "hot" %}<a class="dropdown-item" href="?sort=hot&t={{t}}"><i class="fas fa-fire mr-2 "></i>Hot</a>{% endif %}
|
|
{% if sort != "bump" %}<a class="dropdown-item" href="?sort=bump&t={{t}}"><i class="fas fa-arrow-up mr-2 "></i>Bump</a>{% endif %}
|
|
{% if sort != "top" %}<a class="dropdown-item" href="?sort=top&t={{t}}"><i class="fas fa-arrow-alt-circle-up mr-2 "></i>Top</a>{% endif %}
|
|
{% if sort != "bottom" %}<a class="dropdown-item" href="?sort=bottom&t={{t}}"><i class="fas fa-arrow-alt-circle-down mr-2 "></i>Bottom</a>{% endif %}
|
|
{% if sort != "new" %}<a class="dropdown-item" href="?sort=new&t={{t}}"><i class="fas fa-sparkles mr-2 "></i>New</a>{% endif %}
|
|
{% if sort != "old" %}<a class="dropdown-item" href="?sort=old&t={{t}}"><i class="fas fa-book mr-2 "></i>Old</a>{% endif %}
|
|
{% if sort != "controversial" %}<a class="dropdown-item" href="?sort=controversial&t={{t}}"><i class="fas fa-bullhorn mr-2 "></i>Controversial</a>{% endif %}
|
|
{% if sort != "comments" %}<a class="dropdown-item" href="?sort=comments&t={{t}}"><i class="fas fa-comments mr-2 "></i>Comments</a>{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
{% block PseudoSubmitForm %}{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
<div class="row no-gutters {% if listing %}mt-md-3{% elif not listing %}my-md-3{% endif %}">
|
|
<div class="col-12">
|
|
<div class="posts" id="posts">
|
|
{% include "submission_listing.html" %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
{% block pagenav %}
|
|
{% if listing %}
|
|
<nav aria-label="Page navigation">
|
|
<ul class="pagination pagination-sm mb-0">
|
|
{% if page>1 %}
|
|
<li class="page-item">
|
|
<small><a class="page-link" href="?sort={{sort}}&page={{page-1}}&t={{t}}" tabindex="-1">Prev</a></small>
|
|
</li>
|
|
{% else %}
|
|
<li class="page-item disabled"><span class="page-link">Prev</span></li>
|
|
{% endif %}
|
|
{% if next_exists %}
|
|
<li class="page-item">
|
|
<small><a class="page-link" href="?sort={{sort}}&page={{page+1}}&t={{t}}">Next</a></small>
|
|
</li>
|
|
{% else %}
|
|
<li class="page-item disabled"><span class="page-link">Next</span></li>
|
|
{% endif %}
|
|
</ul>
|
|
</nav>
|
|
{% endif %}
|
|
|
|
{% if request.path == '/' and PUSHER_ID != DEFAULT_CONFIG_VALUE and v %}
|
|
<div class="d-none" id="strid">{{SITE}}{{v.id}}</div>
|
|
<div class="d-none" id="pusherid">{{PUSHER_ID}}</div>
|
|
<script defer src="{{'js/vendor/pusher.js' | asset}}"></script>
|
|
<script>
|
|
if (typeof Android != 'undefined') {
|
|
Android.Subscribe('{{SITE}}{{v.id}}');
|
|
}
|
|
</script>
|
|
{% endif %}
|
|
|
|
{% if request.path == '/' and time.time() > session.get('tooltip_last_dismissed',0)+86400*30 %}
|
|
<style>
|
|
.dismiss-beg {
|
|
color: #919191;
|
|
float: left;
|
|
font-size: 14px;
|
|
padding-top: 0.25rem;
|
|
padding-right: 0.25rem;
|
|
}
|
|
</style>
|
|
|
|
<div id="mobile-prompt-container" class="fixed-top">
|
|
<div id="mobile-prompt" data-bs-toggle="tooltip" data-bs-container="#mobile-prompt-container" data-bs-placement="top" data-bs-trigger="click" data-bs-html="true" title="<i class='dismiss-beg fas fa-x'></i>Click me to install the {{SITE_NAME}} mobile app!"></div>
|
|
</div>
|
|
|
|
<script>
|
|
if (!window.matchMedia('(display-mode: minimal-ui)')['matches']) {
|
|
if (window.innerWidth <= 737) {
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const tt = bootstrap.Tooltip.getOrCreateInstance(document.getElementById('mobile-prompt'))
|
|
tt.show()
|
|
document.getElementsByClassName('tooltip')[0].onclick = function(e) {
|
|
tt.hide()
|
|
var xhr = new XMLHttpRequest();
|
|
xhr.withCredentials=true;
|
|
xhr.open("POST", '/dismiss_mobile_tip', true);
|
|
xhr.setRequestHeader('xhr', 'xhr');
|
|
xhr.send();
|
|
if (!e.target.classList.contains('dismiss-beg'))
|
|
location.href = "/app"
|
|
}
|
|
})
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
#mobile-prompt + .bs-tooltip-bottom {
|
|
transform: None !important;
|
|
inset: 0px 0px auto auto !important;
|
|
}
|
|
</style>
|
|
{% endif %}
|
|
|
|
{% if request.path == '/' and v and FP %}
|
|
{% if not v.fp %}
|
|
<script>
|
|
function fp(fp) {
|
|
const xhr = new XMLHttpRequest();
|
|
xhr.open("POST", '/fp/'+fp);
|
|
xhr.setRequestHeader('xhr', 'xhr');
|
|
const form = new FormData()
|
|
form.append("formkey", formkey());
|
|
xhr.send(form);
|
|
};
|
|
|
|
const fpPromise = new Promise((resolve, reject) => {
|
|
const script = document.createElement('script');
|
|
script.onload = resolve;
|
|
script.onerror = reject;
|
|
script.async = true;
|
|
script.src = "{{'js/vendor/fp.js' | asset}}";
|
|
document.head.appendChild(script);
|
|
})
|
|
.then(() => FingerprintJS.load({token: '{{FP}}'}));
|
|
|
|
fpPromise
|
|
.then(fp => fp.get())
|
|
.then(result => {if (result.visitorId != '{{v.fp}}') fp(result.visitorId);})
|
|
</script>
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% endblock %}
|