Stuff and things

This commit is contained in:
2024-10-30 18:45:02 +01:00
parent 14a78b4717
commit 7ba3716b98
32 changed files with 1225 additions and 1150 deletions

View File

@ -1,39 +1,32 @@
{% extends "base.html" %}
{% block title %}
| Add new feed
| Add new feed
{% endblock title %}
{% block content %}
<div class="p-2 border border-dark">
<form action="/add" method="post">
<!-- Feed URL -->
<div class="row pb-2">
<label for="feed_url" class="col-sm-2 col-form-label">RSS feed URL</label>
<div class="col-sm-10">
<input name="feed_url"
type="text"
class="form-control bg-dark border-dark text-muted"
id="feed_url" />
</div>
<div class="p-2 border border-dark">
<form action="/add" method="post">
<!-- Feed URL -->
<div class="row pb-2">
<label for="feed_url" class="col-sm-2 col-form-label">Feed URL</label>
<div class="col-sm-10">
<input name="feed_url" type="text" class="form-control bg-dark border-dark text-muted" id="feed_url" />
</div>
<!-- Webhook dropdown -->
<div class="row pb-2">
<label for="webhook_dropdown" class="col-sm-2 col-form-label">Which webhook should we send entries to?</label>
<div class="col-sm-10">
<select class="col-auto form-select bg-dark border-dark text-muted"
id="webhook_dropdown"
name="webhook_dropdown">
<option selected>Choose webhook...</option>
{% for hook in webhooks %}<option value="{{ hook.name }}">{{- hook.name -}}</option>{% endfor %}
</select>
</div>
<div class="form-text">
You can add more webhooks <a class="text-muted" href="/add_webhook">here</a>
</div>
</div>
<!-- Webhook dropdown -->
<div class="row pb-2">
<label for="webhook_dropdown" class="col-sm-2 col-form-label">Webhook</label>
<div class="col-sm-10">
<select class="col-auto form-select bg-dark border-dark text-muted" id="webhook_dropdown"
name="webhook_dropdown">
<option selected>Choose webhook...</option>
{% for hook in webhooks %}<option value="{{ hook.name }}">{{- hook.name -}}</option>{% endfor %}
</select>
</div>
<!-- Submit button -->
<div class="d-md-flex">
<button class="btn btn-dark btn-sm">Add feed</button>
</div>
</form>
</div>
</div>
<!-- Submit button -->
<div class="d-md-flex">
<button class="btn btn-dark btn-sm">Add feed</button>
</div>
</form>
</div>
{% endblock content %}

View File

@ -1,40 +1,34 @@
{% extends "base.html" %}
{% block title %}
| Add new webhook
| Add new webhook
{% endblock title %}
{% block content %}
<div class="p-2 border border-dark">
<form action="/add_webhook" method="post">
{# Webhook name #}
<div class="row pb-2">
<label for="webhook_name" class="col-sm-2 col-form-label">Webhook Name</label>
<div class="col-sm-10">
<input name="webhook_name"
type="text"
class="form-control bg-dark border-dark text-muted"
id="webhook_name" />
</div>
<div class="p-2 border border-dark">
<form action="/add_webhook" method="post">
{# Webhook name #}
<div class="row pb-2">
<label for="webhook_name" class="col-sm-2 col-form-label">Webhook Name</label>
<div class="col-sm-10">
<input name="webhook_name" type="text" class="form-control bg-dark border-dark text-muted" id="webhook_name" />
</div>
{# Webhook URL #}
<div class="row pb-2">
<label for="webhook_url" class="col-sm-2 col-form-label">Webhook URL</label>
<div class="col-sm-10">
<input name="webhook_url"
type="text"
class="form-control bg-dark border-dark text-muted"
id="webhook_url" />
</div>
<div class="form-text">
You can append ?thread_id=THREAD_ID to the end
of the URL to send messages to a thread. You can get
the thread ID by right-clicking on the thread and
Copy Thread ID.
</div>
</div>
{# Webhook URL #}
<div class="row pb-2">
<label for="webhook_url" class="col-sm-2 col-form-label">Webhook URL</label>
<div class="col-sm-10">
<input name="webhook_url" type="text" class="form-control bg-dark border-dark text-muted" id="webhook_url" />
</div>
{# Submit button #}
<div class="d-md-flex">
<button class="btn btn-dark btn-sm">Add webhook</button>
<div class="form-text">
You can append ?thread_id=THREAD_ID to the end
of the URL to send messages to a thread. You can get
the thread ID by right-clicking on the thread and
Copy Thread ID.
</div>
</form>
</div>
</div>
{# Submit button #}
<div class="d-md-flex">
<button class="btn btn-dark btn-sm">Add webhook</button>
</div>
</form>
</div>
{% endblock content %}

View File

@ -1,12 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description"
content="Stay updated with the latest news and events with our easy-to-use RSS bot. Never miss a message or announcement again with real-time notifications directly to your Discord server." />
content="Stay updated with the latest news and events with our easy-to-use RSS bot. Never miss a message or announcement again with real-time notifications directly to your Discord server." />
<meta name="keywords"
content="discord, rss, bot, notifications, announcements, updates, real-time, server, messages, news, events, feed." />
content="discord, rss, bot, notifications, announcements, updates, real-time, server, messages, news, events, feed." />
<link href="/static/bootstrap.min.css" rel="stylesheet" />
<link href="/static/styles.css" rel="stylesheet" />
<link rel="icon" href="/static/favicon.ico" type="image/x-icon" />
@ -17,11 +18,19 @@
{% block head %}
{% endblock head %}
</head>
<body class="text-white-50">
{% include "nav.html" %}
<div class="p-2 mb-2">
<div class="container-fluid">
<div class="d-grid p-2">
{% if messages %}
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<pre>{{ messages }}</pre>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endif %}
{% block content %}
{% endblock content %}
<footer class="d-flex flex-wrap justify-content-between align-items-center py-3 my-4 border-top">
@ -32,11 +41,11 @@
<ul class="nav col-md-4 justify-content-end">
<li class="nav-item">
<a href="https://github.com/TheLovinator1/discord-rss-bot/issues"
class="nav-link px-2 text-muted">Report an issue</a>
class="nav-link px-2 text-muted">Report an issue</a>
</li>
<li class="nav-item">
<a href="https://github.com/TheLovinator1/discord-rss-bot/issues"
class="nav-link px-2 text-muted">Send feedback</a>
class="nav-link px-2 text-muted">Send feedback</a>
</li>
</ul>
</footer>
@ -45,4 +54,5 @@
</div>
<script src="/static/bootstrap.min.js" defer></script>
</body>
</html>

View File

@ -1,67 +1,55 @@
{% extends "base.html" %}
{% block title %}
| Blacklist
| Blacklist
{% endblock title %}
{% block content %}
<div class="p-2 border border-dark">
<form action="/blacklist" method="post">
<!-- Feed URL -->
<div class="row pb-2">
<div class="col-sm-12">
<div class="form-text">
<ul class="list-inline">
<li>
Comma separated list of words to blacklist. If a word is found in the
corresponding blacklists, the feed will not be sent.
</li>
<li>Whitelist always takes precedence over blacklist. Leave empty to disable.</li>
<li>Words are case-insensitive. No spaces should be used before or after the comma.</li>
<li>
Correct:
<code>
<div class="p-2 border border-dark">
<form action="/blacklist" method="post">
<!-- Feed URL -->
<div class="row pb-2">
<div class="col-sm-12">
<div class="form-text">
<ul class="list-inline">
<li>
Comma separated list of words to blacklist. If a word is found in the
corresponding blacklists, the feed will not be sent.
</li>
<li>Whitelist always takes precedence over blacklist. Leave empty to disable.</li>
<li>Words are case-insensitive. No spaces should be used before or after the comma.</li>
<li>
Correct:
<code>
primogem,events,gameplay preview,special program
</code>
</li>
<li>
Wrong:
<code>
</li>
<li>
Wrong:
<code>
primogem, events, gameplay preview, special program
</code>
</li>
</ul>
</div>
<label for="blacklist_title" class="col-sm-6 col-form-label">Blacklist - Title</label>
<input name="blacklist_title"
type="text"
class="form-control bg-dark border-dark text-muted"
id="blacklist_title"
value="{%- if blacklist_title -%}{{ blacklist_title }}{%- endif -%}" />
<label for="blacklist_summary" class="col-sm-6 col-form-label">Blacklist - Summary</label>
<input name="blacklist_summary"
type="text"
class="form-control bg-dark border-dark text-muted"
id="blacklist_summary"
value="{%- if blacklist_summary -%}{{ blacklist_summary }}{%- endif -%}" />
<label for="blacklist_content" class="col-sm-6 col-form-label">Blacklist - Content</label>
<input name="blacklist_content"
type="text"
class="form-control bg-dark border-dark text-muted"
id="blacklist_content"
value="{%- if blacklist_content -%}{{ blacklist_content }}{%- endif -%}" />
<label for="blacklist_author" class="col-sm-6 col-form-label">Blacklist - Author</label>
<input name="blacklist_author"
type="text"
class="form-control bg-dark border-dark text-muted"
id="blacklist_author"
value="{%- if blacklist_author -%}{{ blacklist_author }}{%- endif -%}" />
</li>
</ul>
</div>
<label for="blacklist_title" class="col-sm-6 col-form-label">Blacklist - Title</label>
<input name="blacklist_title" type="text" class="form-control bg-dark border-dark text-muted"
id="blacklist_title" value="{%- if blacklist_title -%}{{ blacklist_title }}{%- endif -%}" />
<label for="blacklist_summary" class="col-sm-6 col-form-label">Blacklist - Summary</label>
<input name="blacklist_summary" type="text" class="form-control bg-dark border-dark text-muted"
id="blacklist_summary" value="{%- if blacklist_summary -%}{{ blacklist_summary }}{%- endif -%}" />
<label for="blacklist_content" class="col-sm-6 col-form-label">Blacklist - Content</label>
<input name="blacklist_content" type="text" class="form-control bg-dark border-dark text-muted"
id="blacklist_content" value="{%- if blacklist_content -%}{{ blacklist_content }}{%- endif -%}" />
<label for="blacklist_author" class="col-sm-6 col-form-label">Blacklist - Author</label>
<input name="blacklist_author" type="text" class="form-control bg-dark border-dark text-muted"
id="blacklist_author" value="{%- if blacklist_author -%}{{ blacklist_author }}{%- endif -%}" />
</div>
<!-- Add a hidden feed_url field to the form -->
<input type="hidden" name="feed_url" value="{{ feed.url }}" />
<!-- Submit button -->
<div class="d-md-flex">
<button class="btn btn-dark btn-sm">Update blacklist</button>
</div>
</form>
</div>
</div>
<!-- Add a hidden feed_url field to the form -->
<input type="hidden" name="feed_url" value="{{ feed.url }}" />
<!-- Submit button -->
<div class="d-md-flex">
<button class="btn btn-dark btn-sm">Update blacklist</button>
</div>
</form>
</div>
{% endblock content %}

View File

@ -1,259 +1,252 @@
{% extends "base.html" %}
{% block title %}
| Custom message
| Custom message
{% endblock title %}
{% block content %}
<div class="p-2 border border-dark">
<form action="/custom" method="post">
<!-- Feed URL -->
<div class="row pb-2">
<div class="col-sm-12">
<div class="form-text">
<ul class="list-inline">
<li>You can modify the message that is sent to Discord.</li>
<li>You can use \n to create a new line.</li>
<li>
You can remove the embed from links by adding < and > around the link. (For example <
{% raw %}
{{ entry_link }}
{% endraw %}
>)
</li>
<br/>
<li>
<code>
<div class="p-2 border border-dark">
<form action="/custom" method="post">
<!-- Feed URL -->
<div class="row pb-2">
<div class="col-sm-12">
<div class="form-text">
<ul class="list-inline">
<li>You can modify the message that is sent to Discord.</li>
<li>You can use \n to create a new line.</li>
<li>
You can remove the embed from links by adding < and> around the link. (For example <
{% raw %} {{ entry_link }} {% endraw %}>)
</li>
<br />
<li>
<code>
{% raw %}
{{ feed_author }}
{% endraw %}
</code>{{ feed.author }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ feed_added }}
{% endraw %}
</code>{{ feed.added }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ feed_last_exception }}
{% endraw %}
</code>{{ feed.last_exception }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ feed_last_updated }}
{% endraw %}
</code>{{ feed.last_updated }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ feed_link }}
{% endraw %}
</code>{{ feed.link }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ feed_subtitle }}
{% endraw %}
</code>{{ feed.subtitle }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ feed_title }}
{% endraw %}
</code>{{ feed.title }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ feed_updated }}
{% endraw %}
</code>{{ feed.updated }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ feed_updates_enabled }}
{% endraw %}
</code>{{ feed.updates_enabled }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ feed_url }}
{% endraw %}
</code>{{ feed.url }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ feed_user_title }}
{% endraw %}
</code>{{ feed.user_title }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ feed_version }}
{% endraw %}
</code>{{ feed.version }}
</li>
<br/>
{% if entry %}
<li>
<code>
</li>
<br />
{% if entry %}
<li>
<code>
{% raw %}
{{ entry_added }}
{% endraw %}
</code>{{ entry.added }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ entry_author }}
{% endraw %}
</code>{{ entry.author }}
</li>
{% if entry.content %}
<li>
<code>
</li>
{% if entry.content %}
<li>
<code>
{% raw %}
{{ entry_content }}
{% endraw %}
</code>{{ entry.content[0].value|discord_markdown }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ entry_content_raw }}
{% endraw %}
</code>{{ entry.content[0].value }}
</li>
{% endif %}
<li>
<code>
</li>
{% endif %}
<li>
<code>
{% raw %}
{{ entry_id }}
{% endraw %}
</code>{{ entry.id }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ entry_important }}
{% endraw %}
</code>{{ entry.important }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ entry_link }}
{% endraw %}
</code>{{ entry.link }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ entry_published }}
{% endraw %}
</code>{{ entry.published }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ entry_read }}
{% endraw %}
</code>{{ entry.read }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ entry_read_modified }}
{% endraw %}
</code>{{ entry.read_modified }}
</li>
{% if entry.summary %}
<li>
<code>
</li>
{% if entry.summary %}
<li>
<code>
{% raw %}
{{ entry_summary }}
{% endraw %}
</code>{{ entry.summary|discord_markdown }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ entry_summary_raw }}
{% endraw %}
</code>{{ entry.summary }}
</li>
{% endif %}
<li>
<code>
</li>
{% endif %}
<li>
<code>
{% raw %}
{{ entry_title }}
{% endraw %}
</code>{{ entry.title }}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ entry_text }}
{% endraw %}
</code> Same as entry_content if it exists, otherwise entry_summary
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{ entry_updated }}
{% endraw %}
</code>{{ entry.updated }}
</li>
<br/>
<li>
<code>
</li>
<br />
<li>
<code>
{% raw %}
{{ image_1 }}
{% endraw %}
</code>First image in the entry if it exists
</li>
</ul>
<ul class="list-inline">
<li>Examples:</li>
<li>
<code>
</li>
</ul>
<ul class="list-inline">
<li>Examples:</li>
<li>
<code>
{% raw %}
{{ feed_title }}\n{{ entry_content }}
{% endraw %}
</code>
</li>
</ul>
{% else %}
Something went wrong, there was no entry found. If this feed has entries and you still see this message, please contact the developer.
{% endif %}
</div>
<label for="custom_message" class="col-sm-6 col-form-label">Message</label>
<input name="custom_message"
type="text"
class="form-control bg-dark border-dark text-muted"
id="custom_message"
{% if custom_message %}
value="{{- custom_message -}}"
{% endif %}/>
</li>
</ul>
{% else %}
Something went wrong, there was no entry found. If this feed has entries and you still see this
message, please contact the developer.
{% endif %}
</div>
<label for="custom_message" class="col-sm-6 col-form-label">Message</label>
<input name="custom_message" type="text" class="form-control bg-dark border-dark text-muted"
id="custom_message" {% if custom_message %} value="{{- custom_message -}}" {% endif %} />
</div>
<!-- Add a hidden feed_url field to the form -->
<input type="hidden" name="feed_url" value="{{ feed.url }}"/>
<!-- Submit button -->
<div class="d-md-flex">
<button class="btn btn-dark btn-sm">Update message</button>
</div>
</form>
</div>
</div>
<!-- Add a hidden feed_url field to the form -->
<input type="hidden" name="feed_url" value="{{ feed.url }}" />
<!-- Submit button -->
<div class="d-md-flex">
<button class="btn btn-dark btn-sm">Update message</button>
</div>
</form>
</div>
{% endblock content %}

View File

@ -1,15 +1,15 @@
{% extends "base.html" %}
{% block title %}
| Embed
| Embed
{% endblock title %}
{% block content %}
<div class="p-2 border border-dark">
<form action="/embed" method="post">
<div class="row pb-2">
<div class="col-sm-12">
<div class="form-text">
<ul class="list-inline">
<br/>
<div class="p-2 border border-dark">
<form action="/embed" method="post">
<div class="row pb-2">
<div class="col-sm-12">
<div class="form-text">
<ul class="list-inline">
<br />
<li>
<code>
{% raw %}
@ -94,218 +94,170 @@
{% endraw %}
</code>{{feed.version}}
</li>
<br/>
<br />
{% if entry %}
<li>
<code>
<li>
<code>
{% raw %}
{{entry_added}}
{% endraw %}
</code>{{entry.added}}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{entry_author}}
{% endraw %}
</code>{{entry.author}}
</li>
{% if entry.content %}
<li>
<code>
</li>
{% if entry.content %}
<li>
<code>
{% raw %}
{{entry_content}}
{% endraw %}
</code>{{entry.content[0].value|discord_markdown}}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{entry_content_raw}}
{% endraw %}
</code>{{entry.content[0].value}}
</li>
{% endif %}
<li>
<code>
</li>
{% endif %}
<li>
<code>
{% raw %}
{{entry_id}}
{% endraw %}
</code>{{entry.id}}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{entry_important}}
{% endraw %}
</code>{{entry.important}}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{entry_link}}
{% endraw %}
</code>{{entry.link}}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{entry_published}}
{% endraw %}
</code>{{entry.published}}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{entry_read}}
{% endraw %}
</code>{{entry.read}}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{entry_read_modified}}
{% endraw %}
</code>{{entry.read_modified}}
</li>
{% if entry.summary %}
<li>
<code>
</li>
{% if entry.summary %}
<li>
<code>
{% raw %}
{{entry_summary}}
{% endraw %}
</code>{{entry.summary|discord_markdown}}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{entry_summary_raw}}
{% endraw %}
</code>{{entry.summary}}
</li>
{% endif %}
<li>
<code>
</li>
{% endif %}
<li>
<code>
{% raw %}
{{entry_title}}
{% endraw %}
</code>{{entry.title}}
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{entry_text}}
{% endraw %}
</code> Same as entry_content if it exists, otherwise entry_summary
</li>
<li>
<code>
</li>
<li>
<code>
{% raw %}
{{entry_updated}}
{% endraw %}
</code>{{entry.updated}}
</li>
<br/>
<li>
<code>
</li>
<br />
<li>
<code>
{% raw %}
{{image_1}}
{% endraw %}
</code>First image in the entry if it exists
</li>
</ul>
</li>
</ul>
{% else %}
Something went wrong, there was no entry found. If this feed has entries and you still see this message, please contact the developer.
Something went wrong, there was no entry found. If this feed has entries and you still see this
message, please contact the developer.
{% endif %}
</div>
<label for="title" class="col-sm-6 col-form-label">Title</label>
<input name="title"
type="text"
class="form-control bg-dark border-dark text-muted"
id="title"
{% if title %}
value="{{- title -}}"
{% endif %}/>
<label for="description" class="col-sm-6 col-form-label">Description</label>
<input name="description"
type="text"
class="form-control bg-dark border-dark text-muted"
id="description"
{% if description %}
value="{{- description -}}"
{% endif %}/>
<label for="color" class="col-sm-6 col-form-label">Embed color</label>
<input name="color"
type="color"
class="form-control form-control-color bg-dark border-dark text-muted"
id="color"
{% if color %}
value="{{- color -}}"
{% endif %}/>
<label for="author_name" class="col-sm-6 col-form-label">Author name</label>
<input name="author_name"
type="text"
class="form-control bg-dark border-dark text-muted"
id="author_name"
{% if author_name %}
value="{{- author_name -}}"
{% endif %}/>
<label for="author_url" class="col-sm-6 col-form-label">Author URL</label>
<input name="author_url"
type="text"
class="form-control bg-dark border-dark text-muted"
id="author_url"
{% if author_url %}
value="{{- author_url -}}"
{% endif %}/>
<label for="author_icon_url" class="col-sm-6 col-form-label">Author icon URL</label>
<input name="author_icon_url"
type="text"
class="form-control bg-dark border-dark text-muted"
id="author_icon_url"
{% if author_icon_url %}
value="{{- author_icon_url -}}"
{% endif %}/>
<label for="image_url" class="col-sm-6 col-form-label">Image URL - Add {% raw %}{{image_1}}{% endraw %} for first image</label>
<input name="image_url"
type="text"
class="form-control bg-dark border-dark text-muted"
id="image_url"
{% if image_url %}
value="{{- image_url -}}"
{% endif %}/>
<label for="thumbnail_url" class="col-sm-6 col-form-label">Thumbnail</label>
<input name="thumbnail_url"
type="text"
class="form-control bg-dark border-dark text-muted"
id="thumbnail_url"
{% if thumbnail_url %}
value="{{- thumbnail_url -}}"
{% endif %}/>
<label for="footer_text" class="col-sm-6 col-form-label">Footer text</label>
<input name="footer_text"
type="text"
class="form-control bg-dark border-dark text-muted"
id="footer_text"
{% if footer_text %}
value="{{- footer_text -}}"
{% endif %}/>
<label for="footer_icon_url" class="col-sm-6 col-form-label">Footer icon</label>
<input name="footer_icon_url"
type="text"
class="form-control bg-dark border-dark text-muted"
id="footer_icon_url"
{% if footer_icon_url %}
value="{{- footer_icon_url -}}"
{% endif %}/>
</div>
<label for="title" class="col-sm-6 col-form-label">Title</label>
<input name="title" type="text" class="form-control bg-dark border-dark text-muted" id="title"
{% if title %} value="{{- title -}}" {% endif %} />
<label for="description" class="col-sm-6 col-form-label">Description</label>
<input name="description" type="text" class="form-control bg-dark border-dark text-muted"
id="description" {% if description %} value="{{- description -}}" {% endif %} />
<label for="color" class="col-sm-6 col-form-label">Embed color</label>
<input name="color" type="color" class="form-control form-control-color bg-dark border-dark text-muted"
id="color" {% if color %} value="{{- color -}}" {% endif %} />
<label for="author_name" class="col-sm-6 col-form-label">Author name</label>
<input name="author_name" type="text" class="form-control bg-dark border-dark text-muted"
id="author_name" {% if author_name %} value="{{- author_name -}}" {% endif %} />
<label for="author_url" class="col-sm-6 col-form-label">Author URL</label>
<input name="author_url" type="text" class="form-control bg-dark border-dark text-muted" id="author_url"
{% if author_url %} value="{{- author_url -}}" {% endif %} />
<label for="author_icon_url" class="col-sm-6 col-form-label">Author icon URL</label>
<input name="author_icon_url" type="text" class="form-control bg-dark border-dark text-muted"
id="author_icon_url" {% if author_icon_url %} value="{{- author_icon_url -}}" {% endif %} />
<label for="image_url" class="col-sm-6 col-form-label">Image URL - Add {% raw %}{{image_1}}{% endraw %}
for first image</label>
<input name="image_url" type="text" class="form-control bg-dark border-dark text-muted" id="image_url"
{% if image_url %} value="{{- image_url -}}" {% endif %} />
<label for="thumbnail_url" class="col-sm-6 col-form-label">Thumbnail</label>
<input name="thumbnail_url" type="text" class="form-control bg-dark border-dark text-muted"
id="thumbnail_url" {% if thumbnail_url %} value="{{- thumbnail_url -}}" {% endif %} />
<label for="footer_text" class="col-sm-6 col-form-label">Footer text</label>
<input name="footer_text" type="text" class="form-control bg-dark border-dark text-muted"
id="footer_text" {% if footer_text %} value="{{- footer_text -}}" {% endif %} />
<label for="footer_icon_url" class="col-sm-6 col-form-label">Footer icon</label>
<input name="footer_icon_url" type="text" class="form-control bg-dark border-dark text-muted"
id="footer_icon_url" {% if footer_icon_url %} value="{{- footer_icon_url -}}" {% endif %} />
</div>
<!-- Add a hidden feed_url field to the form -->
<input type="hidden" name="feed_url" value="{{ feed.url }}"/>
<!-- Submit button -->
<div class="d-md-flex">
<button class="btn btn-dark btn-sm">Update embed</button>
</div>
</form>
</div>
</div>
<!-- Add a hidden feed_url field to the form -->
<input type="hidden" name="feed_url" value="{{ feed.url }}" />
<!-- Submit button -->
<div class="d-md-flex">
<button class="btn btn-dark btn-sm">Update embed</button>
</div>
</form>
</div>
{% endblock content %}

View File

@ -1,68 +1,84 @@
{% extends "base.html" %}
{% block title %}
| {{ feed.title }}
| {{ feed.title }}
{% endblock title %}
{% block content %}
<div class="p-2 mb-2 border border-dark">
<!-- The feed title. -->
<h2>
<a class="text-muted text-decoration-none" href="{{ feed.url }}">{{ feed.title }}</a>
</h2>
{% if not feed.updates_enabled %}<span class="text-danger">Disabled</span>{% endif %}
{% if feed.last_exception %}
<h3 class="text-danger">{{ feed.last_exception.type_name }}:</h3>
<code>{{ feed.last_exception.value_str }}</code>
<pre><code>{{ feed.last_exception.traceback_str }}</code></pre>
{% endif %}
<form action="/remove" method="post">
<button class="btn btn-danger btn-sm"
name="feed_url"
value="{{ feed.url }}"
onclick="return confirm('Are you sure you want to delete this feed?')">Remove</button>
</form>
{% if not feed.updates_enabled %}
<form action="/unpause" method="post">
<button class="btn btn-dark btn-sm" name="feed_url" value="{{ feed.url }}">Unpause</button>
</form>
{% else %}
<form action="/pause" method="post">
<button class="btn btn-danger btn-sm" name="feed_url" value="{{ feed.url }}">Pause</button>
</form>
{% endif %}
{% if should_send_embed == True %}
<form action="/use_text" method="post">
<button class="btn btn-dark btn-sm" name="feed_url" value="{{ feed.url }}">
Send text messages instead of embeds
</button>
</form>
{% else %}
<form action="/use_embed" method="post">
<button class="btn btn-dark btn-sm" name="feed_url" value="{{ feed.url }}">
Send embeds instead of text messages
</button>
</form>
{% endif %}
<a class="text-muted"
href="/whitelist?feed_url={{ feed.url|encode_url }}">Whitelist</a>
<br />
<a class="text-muted"
href="/blacklist?feed_url={{ feed.url|encode_url }}">Blacklist</a>
<br />
<a class="text-muted" href="/custom?feed_url={{ feed.url|encode_url }}">Customize message
{% if not should_send_embed %}(Active){% endif %}
</a>
<br />
<a class="text-muted" href="/embed?feed_url={{ feed.url|encode_url }}">Customize embed
{% if should_send_embed %}(Active){% endif %}
</a>
<br />
</div>
{# HTML is created in main.create_html_for_feed #}
<pre>
{{ html|safe }}
</pre>
{% if show_more_button %}
<a class="btn btn-dark"
href="/feed_more?feed_url={{ feed.url|encode_url }}">Show more (Note: This view is not optimized at all, so be ready to wait a while)</a>
<div class="card mb-3 border border-dark p-3 text-light">
<!-- Feed Title -->
<h2>
<a class="text-muted" href="{{ feed.url }}">{{ feed.title }}</a> ({{ total_entries }} entries)
</h2>
{% if not feed.updates_enabled %}
<span class="badge bg-danger">Disabled</span>
{% endif %}
{% if feed.last_exception %}
<div class="mt-3">
<h5 class="text-danger">{{ feed.last_exception.type_name }}:</h5>
<code class="d-block">{{ feed.last_exception.value_str }}</code>
<button class="btn btn-secondary btn-sm mt-2" type="button" data-bs-toggle="collapse"
data-bs-target="#exceptionDetails" aria-expanded="false" aria-controls="exceptionDetails">
Show Traceback
</button>
<div class="collapse" id="exceptionDetails">
<pre><code>{{ feed.last_exception.traceback_str }}</code></pre>
</div>
</div>
{% endif %}
<!-- Feed Actions -->
<div class="mt-3 d-flex flex-wrap gap-2">
<form action="/remove" method="post" class="d-inline">
<button class="btn btn-danger btn-sm" name="feed_url" value="{{ feed.url }}"
onclick="return confirm('Are you sure you want to delete this feed?')">Remove</button>
</form>
{% if not feed.updates_enabled %}
<form action="/unpause" method="post" class="d-inline">
<button class="btn btn-secondary btn-sm" name="feed_url" value="{{ feed.url }}">Unpause</button>
</form>
{% else %}
<form action="/pause" method="post" class="d-inline">
<button class="btn btn-danger btn-sm" name="feed_url" value="{{ feed.url }}">Pause</button>
</form>
{% endif %}
{% if should_send_embed %}
<form action="/use_text" method="post" class="d-inline">
<button class="btn btn-dark btn-sm" name="feed_url" value="{{ feed.url }}">
Send text message instead of embed
</button>
</form>
{% else %}
<form action="/use_embed" method="post" class="d-inline">
<button class="btn btn-dark btn-sm" name="feed_url" value="{{ feed.url }}">
Send embed instead of text message
</button>
</form>
{% endif %}
</div>
<!-- Additional Links -->
<div class="mt-3">
<a class="text-muted d-block" href="/whitelist?feed_url={{ feed.url|encode_url }}">Whitelist</a>
<a class="text-muted d-block" href="/blacklist?feed_url={{ feed.url|encode_url }}">Blacklist</a>
<a class="text-muted d-block" href="/custom?feed_url={{ feed.url|encode_url }}">
Customize message {% if not should_send_embed %}(Currently active){% endif %}
</a>
<a class="text-muted d-block" href="/embed?feed_url={{ feed.url|encode_url }}">
Customize embed {% if should_send_embed %}(Currently active){% endif %}
</a>
</div>
</div>
{# Rendered HTML content #}
<pre>{{ html|safe }}</pre>
{% if show_more_entires_button %}
<a class="btn btn-dark mt-3"
href="/feed?feed_url={{ feed.url|encode_url }}&starting_after={{ last_entry.id|encode_url }}">
Show more entries
</a>
{% endif %}
{% endblock content %}

View File

@ -1,88 +1,92 @@
{% extends "base.html" %}
{% block content %}
<!-- List all feeds -->
<ul>
<!-- Check if any feeds -->
{% if feeds %}
<p>
{{ feed_count.total }} feed{{'s' if feed_count.total > 1 else "" }}
<!-- How many broken feeds -->
<!-- Make broken feed text red if true. -->
{% if feed_count.broken %}
- <span class="text-danger">{{ feed_count.broken }} broken</span>
{% else %}
- {{ feed_count.broken }} broken
{% endif %}
<!-- How many enabled feeds -->
<!-- Make amount of enabled feeds yellow if some are disabled. -->
{% if feed_count.total != feed_count.updates_enabled %}
- <span class="text-warning">{{ feed_count.updates_enabled }} enabled</span>
{% else %}
- {{ feed_count.updates_enabled }} enabled
{% endif %}
<!-- How many entries -->
- {{ entry_count.total }} entries
<abbr title="Average entries per day for the past 1, 3 and 12 months">
({{ entry_count.averages[0]|round(1) }},
{{ entry_count.averages[1]|round(1) }},
{{ entry_count.averages[2]|round(1) }})
</abbr>
</p>
<!-- Loop through the webhooks and add the feeds connected to them. -->
{% for hook_from_context in webhooks %}
<div class="p-2 mb-2 border border-dark">
<ul class="list-group">
<h1 class="h5">
<a class="text-muted" href="/webhooks">{{ hook_from_context.name }}</a>
</h1>
{% for feed_webhook in feeds %}
{% set feed = feed_webhook["feed"] %}
{% set hook_from_feed = feed_webhook["webhook"] %}
{% if hook_from_context.url == hook_from_feed %}
<div>
<a class="text-muted" href="/feed?feed_url={{ feed.url|encode_url }}">{{ feed.url }}</a>
{% if not feed.updates_enabled %}<span class="text-warning">Disabled</span>{% endif %}
{% if feed.last_exception %}<span class="text-danger">({{ feed.last_exception.value_str }})</span>{% endif %}
</div>
{% endif %}
{% endfor %}
</ul>
</div>
{% endfor %}
<!-- List all feeds -->
<ul>
<!-- Check if any feeds -->
{% if feeds %}
<p>
{{ feed_count.total }} feed{{'s' if feed_count.total > 1 else "" }}
<!-- How many broken feeds -->
<!-- Make broken feed text red if true. -->
{% if feed_count.broken %}
- <span class="text-danger">{{ feed_count.broken }} broken</span>
{% else %}
<p>
Hello there!
</br>
You need to add a webhook to get started and then add a feed. You can find both options in the menu above.
</br>
</br>
If you have any questions or suggestions, feel free to contact me on <a class="text-muted" href="mailto:tlovinator@gmail.com">tlovinator@gmail.com</a> or TheLovinator#9276 on Discord.
</br>
Thanks!
</p>
{% endif %}
<!-- Show feeds without webhooks -->
{% if broken_feeds %}
- {{ feed_count.broken }} broken
{% endif %}
<!-- How many enabled feeds -->
<!-- Make amount of enabled feeds yellow if some are disabled. -->
{% if feed_count.total != feed_count.updates_enabled %}
- <span class="text-warning">{{ feed_count.updates_enabled }} enabled</span>
{% else %}
- {{ feed_count.updates_enabled }} enabled
{% endif %}
<!-- How many entries -->
- {{ entry_count.total }} entries
<abbr title="Average entries per day for the past 1, 3 and 12 months">
({{ entry_count.averages[0]|round(1) }},
{{ entry_count.averages[1]|round(1) }},
{{ entry_count.averages[2]|round(1) }})
</abbr>
</p>
<!-- Loop through the webhooks and add the feeds connected to them. -->
{% for hook_from_context in webhooks %}
<div class="p-2 mb-2 border border-dark">
<h2 class="h5">
<a class="text-muted" href="/webhooks">{{ hook_from_context.name }}</a>
</h2>
<ul class="list-group">
{% for feed_webhook in feeds %}
{% set feed = feed_webhook["feed"] %}
{% set hook_from_feed = feed_webhook["webhook"] %}
{% if hook_from_context.url == hook_from_feed %}
<div>
<a class="text-muted" href="/feed?feed_url={{ feed.url|encode_url }}">{{ feed.url }}</a>
{% if not feed.updates_enabled %}<span class="text-warning">Disabled</span>{% endif %}
{% if feed.last_exception %}<span
class="text-danger">({{ feed.last_exception.value_str }})</span>{% endif %}
</div>
{% endif %}
{% endfor %}
</ul>
</div>
{% endfor %}
{% else %}
<p>
Hello there!
<br>
You need to add a webhook <a class="text-muted" href="/add_webhook">here</a> to get started. After that, you can
add feeds <a class="text-muted" href="/add">here</a>. You can find both of these links in the navigation bar
above.
<br>
<br>
If you have any questions or suggestions, feel free to contact me on <a class="text-muted"
href="mailto:tlovinator@gmail.com">tlovinator@gmail.com</a> or TheLovinator#9276 on Discord.
<br>
<br>
Thanks!
</p>
{% endif %}
<!-- Show feeds without webhooks -->
{% if broken_feeds %}
<div class="p-2 mb-2 border border-dark">
<ul class="list-group text-danger">
Feeds without webhook:
{% for broken_feed in broken_feeds %}
<a class="text-muted"
href="/feed?feed_url={{ broken_feed.url|encode_url }}">{{ broken_feed.url }}</a>
<a class="text-muted" href="/feed?feed_url={{ broken_feed.url|encode_url }}">{{ broken_feed.url }}</a>
{% endfor %}
</ul>
</div>
{% endif %}
<!-- Show feeds that has no attached webhook -->
{% if feeds_without_attached_webhook %}
{% endif %}
<!-- Show feeds that has no attached webhook -->
{% if feeds_without_attached_webhook %}
<div class="p-2 mb-2 border border-dark">
<ul class="list-group text-danger">
Feeds without attached webhook:
{% for feed in feeds_without_attached_webhook %}
<a class="text-muted" href="/feed?feed_url={{ feed.url|encode_url }}">{{ feed.url }}</a>
<a class="text-muted" href="/feed?feed_url={{ feed.url|encode_url }}">{{ feed.url }}</a>
{% endfor %}
</ul>
</div>
{% endif %}
{% endif %}
</ul>
{% endblock content %}

View File

@ -1,9 +1,6 @@
<nav class="navbar navbar-expand-md navbar-dark p-2 mb-3 border-bottom border-warning">
<div class="container-fluid">
<button class="navbar-toggler ms-auto"
type="button"
data-bs-toggle="collapse"
data-bs-target="#collapseNavbar">
<button class="navbar-toggler ms-auto" type="button" data-bs-toggle="collapse" data-bs-target="#collapseNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse" id="collapseNavbar">
@ -22,10 +19,8 @@
</ul>
{# Search #}
<form action="/search" method="get" class="ms-auto w-50 input-group">
<input name="query"
class="form-control bg-dark border-dark text-muted"
type="search"
placeholder="Search" />
<input name="query" class="form-control bg-dark border-dark text-muted" type="search"
placeholder="Search" />
</form>
{# Donate button #}
<ul class="navbar-nav ms-auto">

View File

@ -1,10 +1,10 @@
{% extends "base.html" %}
{% block title %}
| Search
| Search
{% endblock title %}
{% block content %}
<div class="p-2 border border-dark text-muted">
Your search for "{{- query -}}" returned {{- search_amount.total -}} results.
</div>
{{- search_html | safe -}}
<div class="p-2 border border-dark text-muted">
Your search for "{{- query -}}" returned {{- search_amount.total -}} results.
</div>
{{- search_html | safe -}}
{% endblock content %}

View File

@ -1,48 +1,55 @@
{% extends "base.html" %}
{% block title %}
| Webhooks
| Webhooks
{% endblock title %}
{% block content %}
{# List all available webhooks #}
<h3>Available webhooks</h3>
<ul class="list-inline">
<a class="btn btn-primary" href="/add_webhook">Add new</a>
<br />
{% for hook in hooks_with_data %}
<div class="p-2 border border-dark text-muted">
<h3>{{ hook.custom_name }}</h3>
<div class="container my-4 text-light">
{% for hook in hooks_with_data %}
<div class="border border-dark mb-4 shadow-sm p-3">
<div class="text-muted">
<h4>{{ hook.custom_name }}</h4>
<ul class="list-unstyled">
<li>
<strong>Name</strong>: {{ hook.name }}
<strong>
<abbr title="Name configured in Discord">
Discord name:</strong> {{ hook.name }}
</abbr>
</li>
<li>
<strong>Webhook URL</strong>: <a class="text-muted" href="{{ hook.url }}">{{ hook.url }}</a>
<strong>Webhook:</strong>
<a class="text-muted"
href="{{ hook.url }}">{{ hook.url | replace("https://discord.com/api/webhooks", "") }}</a>
</li>
<br />
<form action="/modify_webhook" method="post">
<input type="hidden" name="old_hook" value="{{- hook.url -}}" />
<div class="row pb-2">
<label for="new_hook" class="col-sm-1 col-form-label">Modify webhook</label>
<div class="col-sm-9">
<input name="new_hook"
type="text"
class="form-control bg-dark border-dark text-muted"
id="new_hook" />
</div>
<button type="submit" class="btn btn-primary col-sm-1 ">Modify</button>
<div class="form-text">
You can append ?thread_id=THREAD_ID to the end
of the URL to send messages to a thread. You can get
the thread ID by right-clicking on the thread and
Copy Thread ID.
</div>
</div>
</form>
<form action="/delete_webhook" method="post">
<input type="hidden" name="webhook_url" value="{{- hook.url -}}" />
<button type="submit" class="btn btn-danger">Delete</button>
</form>
</div>
<br />
{% endfor %}
</ul>
</ul>
<hr>
<form action="/modify_webhook" method="post" class="row g-3">
<input type="hidden" name="old_hook" value="{{ hook.url }}" />
<div class="col-md-8">
<label for="new_hook" class="form-label">Modify Webhook</label>
<input type="text" name="new_hook" id="new_hook" class="form-control border text-muted bg-dark"
placeholder="Enter new webhook URL" />
</div>
<div class="col-md-4 d-flex align-items-end">
<button type="submit" class="btn btn-primary w-100">Modify</button>
</div>
</form>
</div>
<div class="d-flex justify-content-between mt-2">
<form action="/delete_webhook" method="post">
<input type="hidden" name="webhook_url" value="{{ hook.url }}" />
<button type="submit" class="btn btn-danger"
onclick="return confirm('Are you sure you want to delete this webhook?');">Delete</button>
</form>
</div>
</div>
{% endfor %}
<div class="border border-dark p-3">
You can append <code>?thread_id=THREAD_ID</code> to the URL to send messages to a thread.
</div>
<br>
<div class="text-end">
<a class="btn btn-primary mb-3" href="/add_webhook">Add New Webhook</a>
</div>
</div>
{% endblock content %}

View File

@ -1,67 +1,55 @@
{% extends "base.html" %}
{% block title %}
| Blacklist
| Blacklist
{% endblock title %}
{% block content %}
<div class="p-2 border border-dark">
<form action="/whitelist" method="post">
<!-- Feed URL -->
<div class="row pb-2">
<div class="col-sm-12">
<div class="form-text">
<ul class="list-inline">
<li>
Comma separated list of words to whitelist. Only send message to
Discord if one of these words are present in the corresponding fields.
</li>
<li>Whitelist always takes precedence over blacklist. Leave empty to disable.</li>
<li>Words are case-insensitive. No spaces should be used before or after the comma.</li>
<li>
Correct:
<code>
<div class="p-2 border border-dark">
<form action="/whitelist" method="post">
<!-- Feed URL -->
<div class="row pb-2">
<div class="col-sm-12">
<div class="form-text">
<ul class="list-inline">
<li>
Comma separated list of words to whitelist. Only send message to
Discord if one of these words are present in the corresponding fields.
</li>
<li>Whitelist always takes precedence over blacklist. Leave empty to disable.</li>
<li>Words are case-insensitive. No spaces should be used before or after the comma.</li>
<li>
Correct:
<code>
primogem,events,gameplay preview,special program
</code>
</li>
<li>
Wrong:
<code>
</li>
<li>
Wrong:
<code>
primogem, events, gameplay preview, special program
</code>
</li>
</ul>
</div>
<label for="whitelist_title" class="col-sm-6 col-form-label">Whitelist - Title</label>
<input name="whitelist_title"
type="text"
class="form-control bg-dark border-dark text-muted"
id="whitelist_title"
value="{%- if whitelist_title -%}{{ whitelist_title }} {%- endif -%}" />
<label for="whitelist_summary" class="col-sm-6 col-form-label">Whitelist - Summary</label>
<input name="whitelist_summary"
type="text"
class="form-control bg-dark border-dark text-muted"
id="whitelist_summary"
value="{%- if whitelist_summary -%}{{ whitelist_summary }}{%- endif -%}" />
<label for="whitelist_content" class="col-sm-6 col-form-label">Whitelist - Content</label>
<input name="whitelist_content"
type="text"
class="form-control bg-dark border-dark text-muted"
id="whitelist_content"
value="{%- if whitelist_content -%}{{ whitelist_content }}{%- endif -%}" />
<label for="whitelist_author" class="col-sm-6 col-form-label">Whitelist - Author</label>
<input name="whitelist_author"
type="text"
class="form-control bg-dark border-dark text-muted"
id="whitelist_author"
value="{%- if whitelist_author -%} {{ whitelist_author }} {%- endif -%}" />
</li>
</ul>
</div>
<label for="whitelist_title" class="col-sm-6 col-form-label">Whitelist - Title</label>
<input name="whitelist_title" type="text" class="form-control bg-dark border-dark text-muted"
id="whitelist_title" value="{%- if whitelist_title -%}{{ whitelist_title }} {%- endif -%}" />
<label for="whitelist_summary" class="col-sm-6 col-form-label">Whitelist - Summary</label>
<input name="whitelist_summary" type="text" class="form-control bg-dark border-dark text-muted"
id="whitelist_summary" value="{%- if whitelist_summary -%}{{ whitelist_summary }}{%- endif -%}" />
<label for="whitelist_content" class="col-sm-6 col-form-label">Whitelist - Content</label>
<input name="whitelist_content" type="text" class="form-control bg-dark border-dark text-muted"
id="whitelist_content" value="{%- if whitelist_content -%}{{ whitelist_content }}{%- endif -%}" />
<label for="whitelist_author" class="col-sm-6 col-form-label">Whitelist - Author</label>
<input name="whitelist_author" type="text" class="form-control bg-dark border-dark text-muted"
id="whitelist_author" value="{%- if whitelist_author -%} {{ whitelist_author }} {%- endif -%}" />
</div>
<!-- Add a hidden feed_url field to the form -->
<input type="hidden" name="feed_url" value="{{ feed.url }}" />
<!-- Submit button -->
<div class="d-md-flex">
<button class="btn btn-dark btn-sm">Update whitelist</button>
</div>
</form>
</div>
</div>
<!-- Add a hidden feed_url field to the form -->
<input type="hidden" name="feed_url" value="{{ feed.url }}" />
<!-- Submit button -->
<div class="d-md-flex">
<button class="btn btn-dark btn-sm">Update whitelist</button>
</div>
</form>
</div>
{% endblock content %}