rDrama/files/templates/home.html

284 lines
13 KiB
HTML
Raw Normal View History

2022-05-04 23:09:46 +00:00
{% extends "default.html" %}
2022-08-05 22:56:21 +00:00
{% if '/h/' in request.path and sub %}
2022-08-05 22:28:22 +00:00
{% block title %}
{% if sub.bannerurl %}
{% set preview = sub.bannerurl %}
{% elif sub.sidebarurl %}
{% set preview = sub.sidebarurl %}
{% else %}
{% set preview = sub.banner_url %}
{% endif %}
2022-08-05 22:28:22 +00:00
<title>{{SITE_NAME}}</title>
<meta property="og:type" content="article">
<meta property="og:title" content="/h/{{sub.name}}">
<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}}">
2022-08-05 22:28:22 +00:00
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="{{SITE_FULL}}">
<meta name="twitter:title" content="/h/{{sub.name}}">
<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 %}
2022-08-05 22:28:22 +00:00
{% endblock %}
{% endif %}
2022-05-04 23:09:46 +00:00
{% block desktopBanner %}
{% if v and v.id == AEVANN_ID %}
<style>
2022-07-04 05:42:46 +00:00
#frontpage .post-title a:not(.visited):not(.sub):visited {
2022-05-04 23:09:46 +00:00
color: var(--black) !important;
}
</style>
{% endif %}
<div class="row" style="overflow: visible;padding-top:5px;">
<div class="col">
{% if sub %}
<div class="mt-3">
{% if v %}
2022-06-23 09:40:01 +00:00
{%- set hole_prefix = '/h/' if not HOLE_STYLE_FLAIR else '' -%}
<a class="btn btn-primary btn-follow {% if v.follows(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/follow','follow-sub','unfollow-sub');this.classList.toggle('d-none');nextElementSibling.classList.toggle('d-none')"><i class="fas fa-bell mr-1"></i> Follow {{hole_prefix}}{{sub.name}}</a>
<a class="btn btn-primary btn-follow {% if not v.follows(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/unfollow','follow-sub','unfollow-sub');this.classList.toggle('d-none');previousElementSibling.classList.toggle('d-none')"><i class="fas fa-bell-slash mr-1"></i> Unfollow {{hole_prefix}}{{sub.name}}</a>
2022-06-09 20:24:24 +00:00
2022-06-23 09:40:01 +00:00
<a class="btn btn-primary btn-block mt-3 {% if v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/block','block-sub','unblock-sub');this.classList.toggle('d-none');nextElementSibling.classList.toggle('d-none')"><i class="fas fa-eye-slash mr-2"></i>Block {{hole_prefix}}{{sub.name}}</a>
<a class="btn btn-primary btn-block mt-3 {% if not v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/unblock','block-sub','unblock-sub');this.classList.toggle('d-none');previousElementSibling.classList.toggle('d-none')"><i class="fas fa-eye mr-2"></i>Unblock {{hole_prefix}}{{sub.name}}</a>
2022-05-04 23:09:46 +00:00
{% else %}
2022-06-23 09:40:01 +00:00
<a class="btn btn-primary btn-block" href="/login"><i class="fas fa-bell mr-1"></i>Follow {{hole_prefix}}{{sub.name}}</a>
<a class="btn btn-primary btn-block mt-3" href="/login"><i class="fas fa-eye-slash mr-2"></i>Block {{hole_prefix}}{{sub.name}}</a>
2022-05-04 23:09:46 +00:00
{% endif %}
</div>
{% 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">
2022-05-07 08:51:07 +00:00
{% if request.path=='/catalog' %}
2022-05-07 09:05:33 +00:00
<a data-bs-toggle="tooltip" data-bs-placement="bottom" title="Catalog View" class="btn btn-primary text-primary mx-2 d-none d-md-block" href="/?sort={{sort}}&t={{t}}&ccmode=false"><i class="fas fa-columns-3 mr-2 "></i>Catalog</a>
2022-05-07 08:51:07 +00:00
{% else %}
2022-05-07 09:05:33 +00:00
<a data-bs-toggle="tooltip" data-bs-placement="bottom" title="Catalog View" class="btn btn-secondary mx-2 d-none d-md-block" href="/catalog?sort={{sort}}&t={{t}}&ccmode=false"><i class="fas fa-columns-3 mr-2 "></i>Catalog</a>
2022-05-07 08:51:07 +00:00
{% endif %}
2022-07-13 17:31:35 +00:00
{% if pins %}
2022-07-13 19:32:28 +00:00
<a class="btn btn-primary text-primary mx-2 smol-fp" href="/toggle_pins/{{sort}}"><i class="fas fas fa-thumbtack fa-rotate--45 mr-2 "></i>Pins</a>
2022-07-13 17:31:35 +00:00
{% else %}
2022-07-13 19:32:28 +00:00
<a class="btn btn-secondary mx-2 smol-fp" href="/toggle_pins/{{sort}}"><i class="fas fas fa-thumbtack fa-rotate--45 mr-2 "></i>Pins</a>
2022-07-13 17:31:35 +00:00
{% endif %}
2022-07-20 01:50:08 +00:00
{% if v and SITE_NAME == 'rDrama' and FEATURES['COUNTRY_CLUB'] %}
2022-05-04 23:09:46 +00:00
{% if v.paid_dues %}
2022-07-13 17:31:35 +00:00
{% if ccmode=="true" %}
<a data-bs-toggle="tooltip" data-bs-placement="bottom" title="Only show country club posts" class="btn btn-primary text-primary mx-2 smol-fp" href="?sort={{sort}}&t={{t}}&ccmode=false"><i class="fas fa-golf-club mr-2 "></i>CC</a>
2022-05-04 23:09:46 +00:00
{% else %}
2022-07-13 17:31:35 +00:00
<a data-bs-toggle="tooltip" data-bs-placement="bottom" title="Only show country club posts" class="btn btn-secondary mx-2 smol-fp" href="?sort={{sort}}&t={{t}}&ccmode=true"><i class="fas fa-golf-club mr-2 "></i>CC</a>
2022-05-04 23:09:46 +00:00
{% endif %}
{% endif %}
{% endif %}
<div class="dropdown dropdown-actions mx-2">
2022-07-13 17:31:35 +00:00
<button class="btn btn-secondary dropdown-toggle smol-fp" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
2022-05-04 23:09:46 +00:00
{% 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>
2022-07-13 17:31:35 +00:00
<div class="dropdown-menu smol-fp" aria-labelledby="dropdownMenuButton" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px;">
2022-05-04 23:09:46 +00:00
{% if t != "hour" %}<a class="dropdown-item" href="?sort={{sort}}&t=hour&ccmode={{ccmode}}"><i class="fas fa-clock mr-2 "></i>Hour</a>{% endif %}
{% if t != "day" %}<a class="dropdown-item" href="?sort={{sort}}&t=day&ccmode={{ccmode}}"><i class="fas fa-calendar-day mr-2 "></i>Day</a>{% endif %}
{% if t != "week" %}<a class="dropdown-item" href="?sort={{sort}}&t=week&ccmode={{ccmode}}"><i class="fas fa-calendar-week mr-2 "></i>Week</a>{% endif %}
{% if t != "month" %}<a class="dropdown-item" href="?sort={{sort}}&t=month&ccmode={{ccmode}}"><i class="fas fa-calendar-alt mr-2 "></i>Month</a>{% endif %}
{% if t != "year" %}<a class="dropdown-item" href="?sort={{sort}}&t=year&ccmode={{ccmode}}"><i class="fas fa-calendar mr-2 "></i>Year</a>{% endif %}
{% if t != "all" %}<a class="dropdown-item" href="?sort={{sort}}&t=all&ccmode={{ccmode}}"><i class="fas fa-infinity mr-2 "></i>All</a>{% endif %}
</div>
</div>
<div class="dropdown dropdown-actions ml-2">
2022-07-13 17:31:35 +00:00
<button class="btn btn-secondary dropdown-toggle smol-fp" type="button" id="dropdownMenuButton2" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
2022-05-04 23:09:46 +00:00
{% 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>
2022-07-13 17:31:35 +00:00
<div class="dropdown-menu smol-fp" aria-labelledby="dropdownMenuButton2" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px;">
2022-05-04 23:09:46 +00:00
{% if sort != "hot" %}<a class="dropdown-item" href="?sort=hot&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-fire mr-2 "></i>Hot</a>{% endif %}
{% if sort != "bump" %}<a class="dropdown-item" href="?sort=bump&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-arrow-up mr-2 "></i>Bump</a>{% endif %}
{% if sort != "top" %}<a class="dropdown-item" href="?sort=top&t={{t}}&ccmode={{ccmode}}"><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}}&ccmode={{ccmode}}"><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}}&ccmode={{ccmode}}"><i class="fas fa-sparkles mr-2 "></i>New</a>{% endif %}
{% if sort != "old" %}<a class="dropdown-item" href="?sort=old&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-book mr-2 "></i>Old</a>{% endif %}
{% if sort != "controversial" %}<a class="dropdown-item" href="?sort=controversial&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-bullhorn mr-2 "></i>Controversial</a>{% endif %}
{% if sort != "comments" %}<a class="dropdown-item" href="?sort=comments&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-comments mr-2 "></i>Comments</a>{% endif %}
</div>
</div>
</div>
{% endblock %}
</div>
</div>
</div>
{% endblock %}
{% block PseudoSubmitForm %}
<div class="row no-gutters d-none d-lg-flex mt-3 {% if not v %}mb-3{% endif %}">
<div class="col">
<div class="card pseudo-submit-form border">
<div class="card-header bg-gray-100">
<div class="mb-0">CREATE A POST</div>
<ul class="list-inline no-bullets mb-0 d-none">
<li class="list-inline-item active mr-4"><i class="fas fa-align-left text-gray-400"></i></li>
<li class="list-inline-item"><i class="fas fa-link text-gray-400"></i></li>
</ul>
</div>
<div class="card-body">
{% if v %}
<a href="{% if sub %}/h/{{sub.name}}{% endif %}/submit">
<input autocomplete="off" type="text" class="form-control"
aria-label="Username"
aria-describedby="basic-addon1">
</a>
{% else %}
<a href="/signup">
<input autocomplete="off" type="text" class="form-control"
aria-label="Username"
aria-describedby="basic-addon1">
</a>
{% endif %}
</div>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<div class="row no-gutters {% if listing %}mt-md-3{% elif not listing %}my-md-3{% endif %}">
<div class="col-12 {% if request.path=='/catalog' %}catalog{% endif %}">
2022-05-04 23:09:46 +00:00
<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}}&ccmode={{ccmode}}" 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}}&ccmode={{ccmode}}">Next</a></small>
</li>
{% else %}
<li class="page-item disabled"><span class="page-link">Next</span></li>
{% endif %}
</ul>
</nav>
{% endif %}
2022-06-27 18:42:41 +00:00
{% if PUSHER_ID != 'blahblahblah' and v %}
2022-07-13 18:14:37 +00:00
<div class="d-none" id="strid">{{SITE}}{{v.id}}</div>
2022-06-27 18:42:41 +00:00
<div class="d-none" id="pusherid">{{PUSHER_ID}}</div>
2022-07-03 10:10:04 +00:00
<script src="/assets/js/pusher.js?v=244"></script>
2022-06-27 18:42:41 +00:00
<script>
if (typeof Android != 'undefined') {
2022-07-13 18:14:37 +00:00
Android.Subscribe('{{SITE}}{{v.id}}');
2022-06-27 18:42:41 +00:00
}
</script>
2022-05-04 23:09:46 +00:00
{% endif %}
2022-05-27 20:31:46 +00:00
{% if request.path in ('/','/logged_out','/logged_out/') and time.time() > session.get('tooltip_last_dismissed',0)+60*60*24*30 and not g.webview %}
2022-05-04 23:09:46 +00:00
<div id="mobile-prompt-container" class="fixed-top">
<div id="mobile-prompt" href="javascript:void(0)" data-bs-toggle="tooltip" data-bs-container="#mobile-prompt-container" data-bs-placement="top" data-bs-trigger="click" data-bs-original-title="Install the {{SITE_NAME}} webapp by saving this page to your home screen!"></div>
</div>
<script>
if (!("standalone" in window.navigator) && !(window.navigator.standalone)) {
if (window.innerWidth <= 737) {
const tt = bootstrap.Tooltip.getOrCreateInstance(document.getElementById('mobile-prompt'))
tt.show()
document.getElementsByClassName('tooltip')[0].onclick = function(event){
tt.hide()
var xhr = new XMLHttpRequest();
xhr.withCredentials=true;
xhr.open("POST", '/dismiss_mobile_tip', true);
xhr.send();
}
}
}
</script>
<style>
#mobile-prompt + .bs-tooltip-bottom {
transform: None !important;
inset: 0px 0px auto auto !important;
}
</style>
{% endif %}
{% if v and FP %}
{% if not v.fp %}
<script>
function fp(fp) {
const xhr = new XMLHttpRequest();
xhr.open("POST", '/fp/'+fp);
xhr.setRequestHeader('xhr', 'xhr');
2022-07-23 08:57:53 +00:00
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 = "/assets/js/fp.js?v=240";
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 %}
2022-05-29 02:11:04 +00:00
{% endblock %}