rDrama/files/templates/default.html
Ben Rog-Wilhelm 310c6c4424
Rig up chat to be suitable for a Doge election. (Hopefully.) (#692)
* Integrate chat from upstream

Substantially borrowed from upstream ref: 13a208ee88e55 (before they
started editing generated artefacts instead of source).

Integrated, including:
  - Remove previously removed features: emoji, hats, and name colors
  - Compensate for lack of unified root template
  - Add React build process to Dockerfile and `bootstrap/init.sh`
  - Preliminary integration of chat websocket workers

For testing, modify `supervisord.conf.dev` to put chat on port 80 and
the site service on some other port. Then visit: http://localhost/chat

Still to do:
  - Access control for specific small-groups (and admins probably):
    Set the values somewhere (site_settings.json? Redis?) and use for
    authorization in `chat_is_allowed`.
  - Proxying only /chat to the websocket workers
  - Chat persistance across restarts: either Redis devops or to DB

* Add nginx server to do appropriate redirection.

* Add necessary columns to User.

* Wire up chat permissions.

* Reload chat on source change.

* Add a better structure for slash commands and add/remove functionality.

* Stop putting up previews of slash commands.

* We require more whitespace.

* Strip DMs out entirely, I currently do not want to deal with them.

* Change "Users Online" to just "Users".

* Clean up a little more DM detritus.

* Save chat history in database.

* Remove unnecessary hefty query to the DB.

* Clean up optimistic messages.

* Initial implementation of notification icon.

* Update readme a little bit.

* Fix notification highlight (mostly).

* Remove chat version number that will never be updated.

* Fix: Errors on logged-out users.

* Add function to nuke the chat state.

* Update DB.

* Add a dedicated deployable docker image.

* Fix: init_build.sh execute bit not set.

* Whoops, screwed up the abort() call.

* Relax chat rate limiter.

* Remove a somewhat silly comment.

* Remove an unnecessary g.db.add().

---------

Co-authored-by: TLSM <duolsm@outlook.com>
2023-09-04 12:42:20 -05:00

307 lines
9.1 KiB
HTML

{%- import "util/forms.html" as forms -%}
<!DOCTYPE html>
<html lang="en">
<head>
{% include "analytics.html" %}
<link rel="alternate" type="application/rss+xml" title="The Motte RSS" href="/rss">
<meta name="description" content="{{config('DESCRIPTION')}}">
<script src="{{ 'js/bootstrap.js' | asset }}"></script>
<script src="{{ 'js/micromodal.js' | asset }}"></script>
{% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="{{ 'css/main.css' | asset }}">
<link rel="stylesheet" href="{{ ('css/'~v.theme~'.css') | asset }}">
{% if v.css %}
<style>{{v.css | safe}}</style>
{% endif %}
{% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="{{ 'css/main.css' | asset }}">
<link rel="stylesheet" href="{{ ('css/'~config('DEFAULT_THEME')~'.css') | asset }}">
{% endif %}
{% if request.path == '/catalog' %}
<link rel="stylesheet" href="{{ 'css/catalog.css' | asset }}">
{% endif %}
{% if v and v.themecolor == '30409f' %}
<style>
p a {
color: #2a96f3;
}
</style>
{% endif %}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="thumbnail" content="{{ ('images/'~SITE_ID~'/site_preview.webp') | asset }}">
<link rel="icon" type="image/png" href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}">
{% block title %}
<title>{{SITE_TITLE}}</title>
<meta property="og:type" content="article">
<meta property="og:title" content="{{SITE_TITLE}}">
<meta property="og:site_name" content="{{request.host}}">
<meta property="og:image" content="{{ ('images/'~SITE_ID~'/site_preview.webp') | asset }}">
<meta property="og:url" content="{{SITE_FULL}}{{request.full_path}}">
<meta property="og:description" name="description" content="{{config('DESCRIPTION')}}">
<meta property="og:author" name="author" content="{{SITE_FULL}}">
<meta property="og:site_name" content="{{request.host}}">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="{{SITE_FULL}}">
<meta name="twitter:title" content="{{SITE_TITLE}}">
<meta name="twitter:creator" content="{{SITE_FULL}}">
<meta name="twitter:description" content="{{config('DESCRIPTION')}}">
<meta name="twitter:image" content="{{ ('images/'~SITE_ID~'/site_preview.webp') | asset }}">
<meta name="twitter:url" content="{{SITE_FULL}}{{request.full_path}}">
{% endblock %}
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" sizes="180x180" href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}">
<link rel="manifest" href="{{ ('manifest_'~SITE_ID~'.json') | asset }}">
<link rel="mask-icon" href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}">
<link rel="shortcut icon" href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}">
<meta name="apple-mobile-web-app-title" content="{{SITE_TITLE}}">
<meta name="application-name" content="{{SITE_TITLE}}">
<meta name="msapplication-TileColor" content="#{{config('DEFAULT_COLOR')}}">
<meta name="msapplication-config" content="{{ 'browserconfig.xml' | asset }}">
<meta name="theme-color" content="#{{config('DEFAULT_COLOR')}}">
<link
rel="apple-touch-startup-image"
sizes="320x480"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="640x960"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-icon"
sizes="640x1136"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-icon"
sizes="750x1334"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="768x1004"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="768x1024"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="828x1792"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="1024x748"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="1024x768"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="1125x2436"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="1242x2208"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="1242x2688"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="1334x750"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="1536x2008"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="1536x2048"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="1668x2224"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="1792x828"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="2048x1496"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="2048x1536"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="2048x2732"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="2208x1242"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="2224x1668"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="2436x1125"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="2668x1242"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
<link
rel="apple-touch-startup-image"
sizes="2737x2048"
href="{{ ('images/'~SITE_ID~'/icon.webp') | asset }}"
>
{% block fixedMobileBarJS %}
{% endblock %}
</head>
<body id="{% if request.path != '/comments' %}{% block pagetype %}frontpage{% endblock %}{% endif %}">
{% include "header.html" %}
{% block Banner %}
{% if '@' not in request.path %}
<a href="/">
<img alt="site banner" class="primary_banner" src="{{ ('images/'~SITE_ID~'/banner.webp') | asset }}" width="100%">
</a>
{% endif %}
{% endblock %}
{% block mobileUserBanner %}
{% endblock %}
{% block mobileBanner %}
{% endblock %}
{% block postNav %}
{% endblock %}
{% block defaultContainer %}
<div class="container">
<div class="row justify-content-around" id="main-content-row">
<div class="col h-100 {% block customPadding %}{% if request.path.startswith('/@') %}user-gutters{% else %}custom-gutters{% endif %}{% endblock %}" id="main-content-col">
{% block desktopUserBanner %}
{% endblock %}
{% block desktopBanner %}
{% endblock %}
{% block searchText %}
{% endblock %}
{% block content %}
{% endblock %}
{% block pagenav %}
{% endblock %}
</div>
{% block sidebar %}
{% if home or p %}
{% include "sidebar_" + SITE_ID + ".html" %}
{% endif %}
{% endblock %}
</div>
</div>
{% endblock %}
{% block mobilenavbar %}
{% include "mobile_navigation_bar.html" %}
{% endblock %}
{% block actionsModal %}
{% endblock %}
{% block reportCommentModal %}
{% endblock %}
{% block GIFtoast %}
{% endblock %}
{% block GIFpicker %}
{% endblock %}
<div class="toast clipboard" id="toast-success" role="alert" aria-live="assertive" aria-atomic="true" data-bs-animation="true" data-bs-autohide="true" data-bs-delay="5000">
<div class="toast-body text-center">
<i class="fas fa-check-circle text-success mr-2"></i>Link copied to clipboard
</div>
</div>
<div class="toast" id="toast-post-success" style="position: fixed; bottom: 1.5rem; margin: 0 auto; left: 0; right: 0; width: 275px;" role="alert" aria-live="assertive" aria-atomic="true" data-bs-animation="true" data-bs-autohide="true" data-bs-delay="5000">
<div class="toast-body bg-success text-center text-white">
<i class="fas fa-comment-alt-smile mr-2"></i><span id="toast-post-success-text">Action successful!</span>
</div>
</div>
<div class="toast" id="toast-post-error" style="position: fixed; bottom: 1.5rem; margin: 0 auto; left: 0; right: 0; width: 275px;" role="alert" aria-live="assertive" aria-atomic="true" data-bs-animation="true" data-bs-autohide="true" data-bs-delay="5000">
<div class="toast-body bg-danger text-center text-white">
<i class="fas fa-exclamation-circle mr-2"></i><span id="toast-post-error-text">Error, please try again later.</span>
</div>
</div>
<script src="{{ 'js/lozad.js' | asset }}"></script>
{% if v %}
<script src="{{ 'js/formatting.js' | asset }}"></script>
{% endif %}
<script src="{{ 'js/lite-youtube.js' | asset }}"></script>
<script>
MicroModal.init();
</script>
</body>
</html>