MarseyWorld/files/templates/home.html

139 lines
7.3 KiB
HTML

{% extends "default.html" %}
{% block title %}
{% if hole %}
<title>/h/{{hole.name}}</title>
{% elif request.path == '/' %}
{% if IS_DKD() %}
<title>Kongrama</title>
{% elif SITE_NAME == 'rDrama' %}
{% if IS_HOMOWEEN() %}
<title>Boo! 👻</title>
{% else %}
<title>{{TAGLINES|random}}</title>
{% endif %}
{% else %}
<title>{{SITE_NAME}}{% if TAGLINES %}: {{TAGLINES|random}}{% endif %}</title>
{% endif %}
{% else %}
{{super()}}
{% endif %}
{% endblock %}
{% block pagetitle %}
{% if hole %}
{{'/h/' ~ hole.name}}
{% else %}
{{SITE_NAME}}
{% endif %}
{% endblock %}
{% block desktopBanner %}
{%- if hole -%}
{%- set search_placeholder = "Search (try 'hole:" ~ hole.name ~ "')" -%}
{%- else -%}
{%- set search_placeholder = "Search" -%}
{%- endif -%}
<div class="row" style="overflow:visible; padding-top:5px">
<div class="col">
<form id="searchform" class="form-inline d-md-none search flex-nowrap mt-2" action="/search/posts" method="get">
<input autocomplete="off" class="form-control form-control-sm w-100" type="search" placeholder="{{search_placeholder}}" name="q">
<span class="input-group-append">
<span class="input-group-text border-0 bg-transparent" style="margin-left: -2.5rem">
<button type="submit" class="fas fa-search text-muted"></button>
</span>
</span>
</form>
<a class="btn btn-primary btn-block mt-3 {% if hole and hole.dead_utc %}disabled{% endif %}" href="{% if hole %}/h/{{hole}}{% endif %}/submit"><i class="fas fa-feather-alt mr-2"></i>Create Post {% if hole %}in /h/{{hole}}{% endif %}</a>
{% if hole and hole.dead_utc %}
<button type="button" class="btn btn-success btn-block mt-3" data-areyousure="postToastSwitch(this,'/h/{{hole}}/resurrect')" data-nonce="{{g.nonce}}" data-onclick="areyousure(this)"><img class="mr-2" height=40 loading="lazy" src="https://i.rdrama.net/e/marseynecromancer.webp" alt="marseynecromancer"> Resurrect /h/{{hole}} ({{HOLE_COST | commas}} coins or marseybux)</button>
{% endif %}
{% if hole %}
{% if v %}
{% if hole.stealth %}
<button type="button" id="unsubscribe-sub" class="btn btn-primary btn-block {% if not v.subscribes(hole.name) %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/h/{{hole.name}}/unsubscribe','subscribe-sub','unsubscribe-sub','d-none')"><i class="fas fa-eye-slash mr-2"></i>Block /h/{{hole.name}}</button>
<button type="button" id="subscribe-sub" class="btn btn-primary btn-block {% if v.subscribes(hole.name) %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/h/{{hole.name}}/subscribe','subscribe-sub','unsubscribe-sub','d-none')"><i class="fas fa-eye mr-2"></i>Unblock /h/{{hole.name}}</button>
{% else %}
<button type="button" id="block-hole" class="btn btn-primary btn-block mt-3 {% if v.blocks(hole.name) %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/h/{{hole.name}}/block','block-hole','unblock-hole','d-none')"><i class="fas fa-eye-slash mr-2"></i>Block /h/{{hole.name}}</button>
<button type="button" id="unblock-hole" class="btn btn-primary btn-block mt-3 {% if not v.blocks(hole.name) %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/h/{{hole.name}}/unblock','block-hole','unblock-hole','d-none')"><i class="fas fa-eye mr-2"></i>Unblock /h/{{hole.name}}</button>
{% endif %}
<button type="button" id="follow-hole" class="btn btn-primary btn-follow {% if v.follows(hole.name) %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/h/{{hole.name}}/follow','follow-hole','unfollow-hole','d-none')"><i class="fas fa-bell mr-2"></i>Follow /h/{{hole.name}}</button>
<button type="button" id="unfollow-hole" class="btn btn-primary btn-follow {% if not v.follows(hole.name) %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/h/{{hole.name}}/unfollow','follow-hole','unfollow-hole','d-none')"><i class="fas fa-bell-slash mr-2"></i>Unfollow /h/{{hole.name}}</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 /h/{{hole.name}}</a>
<a class="btn btn-primary btn-block" href="/login?redirect={{request.full_path | urlencode}}"><i class="fas fa-bell mr-2"></i>Follow /h/{{hole.name}}</a>
{% endif %}
{% endif %}
<div class="d-flex justify-content-between align-items-center pt-3 pb-2 sorting fl-r">
{% block navbar %}
<div class="d-flex align-items-center">
{% if CATEGORIES_ICONS %}
<div class="dropdown dropdown-actions mr-2">
<button type="button" class="btn btn-secondary dropdown-toggle" id="dropdownMenuButton2" data-bs-toggle="dropdown">
<i class="fas fa-filter mr-1"></i>
Category Filter
</button>
<div id="category-filter" class="dropdown-menu" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px">
{% for category, icon in CATEGORIES_ICONS.items() %}
<div class="custom-control custom-checkbox pl-45 dropdown-item">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="category-{{category}}" data-nonce="{{g.nonce}}" data-onchange="postToastReload(this, '/toggle_category/{{category}}')" {% if session.get(category, True) %}checked{% endif %}>
<label class="custom-control-label d-flex" for="category-{{category}}">{{category}}</label>
</div>
{% endfor %}
</div>
</div>
{% else %}
{% set color = "primary" if pins else "secondary" %}
<form action="/toggle_pins/{{hole}}/{{sort}}" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHRReload(this)">
<button type="submit" class="btn btn-{{color}} text-{{color}} mx-2"><i type="submit" class="fas fas fa-thumbtack fa-rotate--45 mr-2"></i>Pins</button>
</form>
{% endif %}
{{- macros.time_filter_buttons() -}}
{{- macros.sorting_buttons(POST_SORTS, True, True) -}}
</div>
{% endblock %}
</div>
{% if SITE_NAME == 'WPD' and listing %}
<div class="d-inline-block">
{{macros.pagination("pagination-smaller pl-1 pt-3 pb-3")}}
</div>
{% endif %}
</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">
{% include "post_listing.html" %}
</div>
</div>
</div>
{% endblock %}
{% block pagenav %}
{% if listing %}
{{macros.pagination()}}
{% endif %}
{% if request.path == '/' and v %}
<script defer src="{{'js/register_service_worker.js' | asset}}"></script>
{% endif %}
{% if v and request.path == '/' and g.browser != 'webview' and time.time() > session.get('tooltip_dismissed',0)+86400*30 %}
<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{% if g.browser == 'iphone' %} and be able to enable push notifications{% endif %}"></div>
</div>
<script defer src="{{'js/mobile_prompt.js' | asset}}"></script>
{% endif %}
{% endblock %}