Use djLint

This commit is contained in:
2023-01-17 00:54:27 +01:00
parent a3a923156e
commit 7791dd3d91
12 changed files with 453 additions and 264 deletions

View File

@ -11,4 +11,3 @@ body {
max-height: 450px;
overflow-y: auto
}

View File

@ -1,5 +1,7 @@
{% extends "base.html" %}
{% block title %} | Add new feed{% endblock %}
{% block title %}
| Add new feed
{% endblock title %}
{% block content %}
<div class="p-2 border border-dark">
<form action="/add" method="post">
@ -7,30 +9,35 @@
<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"
placeholder="https://www.reddit.com/r/FreeGameFindings.rss">
<input name="feed_url"
type="text"
class="form-control bg-dark border-dark text-muted"
id="feed_url"
placeholder="https://www.reddit.com/r/FreeGameFindings.rss"/>
</div>
</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>
<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"
<select class="col-auto form-select bg-dark border-dark text-muted"
id="webhook_dropdown"
name="webhook_dropdown">
<option selected>Choose webhook...</option>
<option selected>
Choose webhook...
</option>
{% for hook in webhooks %}
<option value="{{ hook.name }}">{{ hook.name }}</option>
<option value="{{ hook.name }}">
{{ hook.name }}
</option>
{% endfor %}
</select>
</div>
</div>
<!-- Submit button -->
<div class="d-md-flex">
<button class="btn btn-dark btn-sm">Add feed</button>
</div>
</form>
</div>
{% endblock %}
{% endblock content %}

View File

@ -1,26 +1,36 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"
<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."/>
<meta name="keywords"
content="discord, rss, bot, notifications, announcements, updates, real-time, server, messages, news, events, feed."/>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65"
crossorigin="anonymous">
<link href="/static/styles.css" rel="stylesheet">
<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
<title>discord-rss-bot{% block title %}{% endblock %}</title>
{% block head %}{% endblock %}
</head>
<body class="text-white-50">
{% include "nav.html" %}
<div class="p-2 mb-2">
crossorigin="anonymous"/>
<link href="/static/styles.css" rel="stylesheet"/>
<link rel="icon" href="/static/favicon.ico" type="image/x-icon"/>
<title>discord-rss-bot
{% block title %}
{% endblock title %}
</title>
{% 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">
{% block content %}{% endblock %}
{% block content %}
{% endblock content %}
<footer class="d-flex flex-wrap justify-content-between align-items-center py-3 my-4 border-top">
<p class="col-md-4 mb-0 text-muted d-none d-md-block">Made by
<a class="text-muted"
href="https://github.com/TheLovinator1">TheLovinator</a>
<p class="col-md-4 mb-0 text-muted d-none d-md-block">
Made by
<a class="text-muted" href="https://github.com/TheLovinator1">TheLovinator</a>
</p>
<ul class="nav col-md-4 justify-content-end">
<li class="nav-item">
@ -38,10 +48,8 @@
</footer>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4"
crossorigin="anonymous">
</script>
</body>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous">
</script>
</body>
</html>

View File

@ -1,20 +1,21 @@
{% extends "base.html" %}
{% block title %} | Blacklist{% endblock %}
{% block title %}
| 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
<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>
@ -28,30 +29,40 @@
</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 %}">
<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 %}">
<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 (Not implemented yet)</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 %}" disabled>
<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 %}"
disabled/>
</div>
</div>
<!-- Add a hidden feed_url field to the form -->
<input type="hidden" name="feed_url" value="{{ feed.url }}">
<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 %}
{% endblock content %}

View File

@ -1,77 +1,241 @@
{% extends "base.html" %}(
{% block title %} | Custom message{% endblock %}
{% extends "base.html" %}
{% block title %}
| 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>
<br>
<li><code>{% raw %}{{feed_url}}{% endraw %}</code> will be replaced with the feed URL. You can use <code>\n</code> for new lines.</li>
<br>
<li><code>{% raw %}{{feed_author}}{% endraw %}</code> - {{feed.author}}</li>
<li><code>{% raw %}{{feed_added}}{% endraw %}</code> - {{feed.added}}</li>
<li><code>{% raw %}{{feed_last_exception}}{% endraw %}</code> - {{feed.last_exception}}</li>
<li><code>{% raw %}{{feed_last_updated}}{% endraw %}</code> - {{feed.last_updated}}</li>
<li><code>{% raw %}{{feed_link}}{% endraw %}</code> - {{feed.link}}</li>
<li><code>{% raw %}{{feed_subtitle}}{% endraw %}</code> - {{feed.subtitle}}</li>
<li><code>{% raw %}{{feed_title}}{% endraw %}</code> - {{feed.title}}</li>
<li><code>{% raw %}{{feed_updated}}{% endraw %}</code> - {{feed.updated}}</li>
<li><code>{% raw %}{{feed_updates_enabled}}{% endraw %}</code> - {{feed.updates_enabled}}</li>
<li><code>{% raw %}{{feed_url}}{% endraw %}</code> - {{feed.url}}</li>
<li><code>{% raw %}{{feed_user_title}}{% endraw %}</code> - {{feed.user_title}}</li>
<li><code>{% raw %}{{feed_version}}{% endraw %}</code> - {{feed.version}}</li>
<br>
<br/>
<li>
<code>
{% raw %}
{{ feed_author }}
{% endraw %}
</code>{{ feed.author }}
</li>
<li>
<code>
{% raw %}
{{ feed_added }}
{% endraw %}
</code>{{ feed.added }}
</li>
<li>
<code>
{% raw %}
{{ feed_last_exception }}
{% endraw %}
</code>{{ feed.last_exception }}
</li>
<li>
<code>
{% raw %}
{{ feed_last_updated }}
{% endraw %}
</code>{{ feed.last_updated }}
</li>
<li>
<code>
{% raw %}
{{ feed_link }}
{% endraw %}
</code>{{ feed.link }}
</li>
<li>
<code>
{% raw %}
{{ feed_subtitle }}
{% endraw %}
</code>{{ feed.subtitle }}
</li>
<li>
<code>
{% raw %}
{{ feed_title }}
{% endraw %}
</code>{{ feed.title }}
</li>
<li>
<code>
{% raw %}
{{ feed_updated }}
{% endraw %}
</code>{{ feed.updated }}
</li>
<li>
<code>
{% raw %}
{{ feed_updates_enabled }}
{% endraw %}
</code>{{ feed.updates_enabled }}
</li>
<li>
<code>
{% raw %}
{{ feed_url }}
{% endraw %}
</code>{{ feed.url }}
</li>
<li>
<code>
{% raw %}
{{ feed_user_title }}
{% endraw %}
</code>{{ feed.user_title }}
</li>
<li>
<code>
{% raw %}
{{ feed_version }}
{% endraw %}
</code>{{ feed.version }}
</li>
<br/>
{% if entry %}
<li><code>{% raw %}{{entry_added}}{% endraw %}</code> - {{entry.added}}</li>
<li><code>{% raw %}{{entry_author}}{% endraw %}</code> - {{entry.author}}</li>
<li><code>{% raw %}{{entry_content}}{% endraw %}</code> - {{entry.content[0].value|discord_markdown}}</li>
<li><code>{% raw %}{{entry_content_raw}}{% endraw %}</code> - {{entry.content[0].value}}</li>
<li><code>{% raw %}{{entry_id}}{% endraw %}</code> - {{entry.id}}</li>
<li><code>{% raw %}{{entry_important}}{% endraw %}</code> - {{entry.important}}</li>
<li><code>{% raw %}{{entry_link}}{% endraw %}</code> - {{entry.link}}</li>
<li><code>{% raw %}{{entry_published}}{% endraw %}</code> - {{entry.published}}</li>
<li><code>{% raw %}{{entry_read}}{% endraw %}</code> - {{entry.read}}</li>
<li><code>{% raw %}{{entry_read_modified}}{% endraw %}</code> - {{entry.read_modified}}</li>
<li><code>{% raw %}{{entry_summary}}{% endraw %}</code> - {{entry.summary|discord_markdown}}</li>
<li><code>{% raw %}{{entry_summary_raw}}{% endraw %}</code> - {{entry.summary}}</li>
<li><code>{% raw %}{{entry_title}}{% endraw %}</code> - {{entry.title}}</li>
<li><code>{% raw %}{{entry_updated}}{% endraw %}</code> - {{entry.updated}}</li>
<li>
<code>
{% raw %}
{{ entry_added }}
{% endraw %}
</code>{{ entry.added }}
</li>
<li>
<code>
{% raw %}
{{ entry_author }}
{% endraw %}
</code>{{ entry.author }}
</li>
<li>
<code>
{% raw %}
{{ entry_content }}
{% endraw %}
</code>{{ entry.content[0].value|discord_markdown }}
</li>
<li>
<code>
{% raw %}
{{ entry_content_raw }}
{% endraw %}
</code>{{ entry.content[0].value }}
</li>
<li>
<code>
{% raw %}
{{ entry_id }}
{% endraw %}
</code>{{ entry.id }}
</li>
<li>
<code>
{% raw %}
{{ entry_important }}
{% endraw %}
</code>{{ entry.important }}
</li>
<li>
<code>
{% raw %}
{{ entry_link }}
{% endraw %}
</code>{{ entry.link }}
</li>
<li>
<code>
{% raw %}
{{ entry_published }}
{% endraw %}
</code>{{ entry.published }}
</li>
<li>
<code>
{% raw %}
{{ entry_read }}
{% endraw %}
</code>{{ entry.read }}
</li>
<li>
<code>
{% raw %}
{{ entry_read_modified }}
{% endraw %}
</code>{{ entry.read_modified }}
</li>
<li>
<code>
{% raw %}
{{ entry_summary }}
{% endraw %}
</code>{{ entry.summary|discord_markdown }}
</li>
<li>
<code>
{% raw %}
{{ entry_summary_raw }}
{% endraw %}
</code>{{ entry.summary }}
</li>
<li>
<code>
{% raw %}
{{ entry_title }}
{% endraw %}
</code>{{ entry.title }}
</li>
<li>
<code>
{% raw %}
{{ entry_updated }}
{% endraw %}
</code>{{ entry.updated }}
</li>
</ul>
<ul class="list-inline">
<li>Examples:</li>
<li><code>{% raw %}Hello {{entry_author}}\n{{feed_title}}\n{{entry_read}}{% endraw %}</code></li>
<br>
<li>
<code>
{% raw %}
Hello {{ entry_author }}\n{{ feed_title }}\n{{ entry_read }}
{% endraw %}
</code>
</li>
<br/>
<li>Will become:</li>
<li><code style="white-space: pre-line">
Hello {{entry.author}}
{{feed.title}}
{{entry.read}}
</code></li>
<li>
<code>
<pre>
Hello {{ entry.author }}
{{ feed.title }}
{{ entry.read }}
</pre>
</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" value="{% if custom_message %}{{ custom_message }}{% endif %}">
<input name="custom_message"
type="text"
class="form-control bg-dark border-dark text-muted"
id="custom_message"
value="{% if custom_message %} {{ custom_message }}{% endif %}"/>
</div>
</div>
<!-- Add a hidden feed_url field to the form -->
<input type="hidden" name="feed_url" value="{{ feed.url }}">
<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 %}
{% endblock content %}

View File

@ -1,26 +1,27 @@
{% extends "base.html" %}
{% block title %} | {{ feed.title }}{% endblock %}
{% block 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.link }}">{{ feed.title }}</a></h2>
<h2>
<a class="text-muted text-decoration-none" href="{{ feed.link }}">{{ 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 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>
@ -30,46 +31,30 @@
<button class="btn btn-danger btn-sm" name="feed_url" value="{{ feed.url }}">Pause</button>
</form>
{% endif %}
<a class="text-muted" href="/whitelist?feed_url={{ feed.url|encode_url }}">Whitelist</a>
<a class="text-muted" href="/blacklist?feed_url={{ feed.url|encode_url }}">Blacklist</a>
<a class="text-muted"
href="/whitelist?feed_url={{ feed.url|encode_url }}">Whitelist</a>
<a class="text-muted"
href="/blacklist?feed_url={{ feed.url|encode_url }}">Blacklist</a>
<a class="text-muted" href="/custom?feed_url={{ feed.url|encode_url }}">Custom message</a>
</div>
{% for entry in entries %}
<div class="p-2 mb-2 border border-dark">
{% if entry|entry_is_blacklisted %}
<span class="text-danger">Blacklisted</span>
{% endif %}
{% if entry|entry_is_whitelisted %}
<span class="text-success">Whitelisted</span>
{% endif %}
{% if entry|entry_is_blacklisted %}<span class="text-danger">Blacklisted</span>{% endif %}
{% if entry|entry_is_whitelisted %}<span class="text-success">Whitelisted</span>{% endif %}
<h2>
<a class="text-muted text-decoration-none" href="{{ entry.link }}">
{{ entry.title }}
</a>
<a class="text-muted text-decoration-none" href="{{ entry.link }}">{{ entry.title }}</a>
</h2>
{% if entry.author %}
By {{ entry.author }} @
{% endif %}
{% if entry.author %}By {{ entry.author }} @{% endif %}
{% if entry.published %}
{{ entry.published.strftime('%Y-%m-%d, %T') }}
{% endif %}
{% if entry.summary%}
<div class="text-muted">
{{ entry.summary|discord_markdown }}
</div>
{% if entry.summary %}
<div class="text-muted">{{ entry.summary|discord_markdown }}</div>
{% elif entry.content[0].value %}
<div class="text-muted">
{{ entry.content[0].value|discord_markdown }}
</div>
<div class="text-muted">{{ entry.content[0].value|discord_markdown }}</div>
{% else %}
<div class="text-muted">
No content available.
</div>
<div class="text-muted">No content available.</div>
{% endif %}
</div>
{% endfor %}
{% endblock %}
{% endblock content %}

View File

@ -11,10 +11,10 @@
{% if feed_count.broken %}
- <span class="text-danger">
{% else %}
- <span>
-<span>
{% endif %}
{{ feed_count.broken }} broken</span>
{{ feed_count.broken }} broken
</span>
<!-- How many enabled feeds -->
<!-- Make amount of enabled feeds yellow if some are disabled. -->
{% if feed_count.total != feed_count.updates_enabled %}
@ -22,9 +22,7 @@
{% else %}
- <span>
{% endif %}
{{ feed_count.updates_enabled }} enabled
</span>
{{ feed_count.updates_enabled }} enabled</span>
<!-- How many entries -->
- {{ entry_count.total }} entries
<abbr title="Average entries per day for the past 1, 3 and 12 months">
@ -33,43 +31,40 @@
{{ 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">{{ hook_from_context.name }}
<ul class="list-group">
{{ hook_from_context.name }}
{% 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 %}
<a class="text-muted"
href="/feed?feed_url={{ feed.url|encode_url }}">{{ feed.url }}
{% 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 %}
<a class="text-muted" href="/feed?feed_url={{ feed.url|encode_url }}">{{ feed.url }}
{% 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 %}
</a>
{% endif %}
{% endfor %}
</ul>
</div>
{% endfor %}
{% else %}
{% else %}
<p>
No feeds yet. Add one <a class="text-muted" href="/add">here</a>.
</p>
{% endif %}
<!-- Show feeds without webhooks -->
{% if broken_feeds %}
{% 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:
<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>
{% endfor %}
</ul>
</div>
{% endif %}
</ul>
{% endblock %}
{% endif %}
</ul>
{% endblock content %}

View File

@ -1,6 +1,9 @@
<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">
@ -17,13 +20,13 @@
<a class="nav-link" href="/webhooks">Add webhook</a>
</li>
</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">
<li class="nav-item d-none d-md-block">

View File

@ -1,8 +1,10 @@
{% extends "base.html" %}
{% block title %} | Search{% endblock %}
{% block title %}
| 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 }}
{% endblock %}
{% endblock content %}

View File

@ -1,5 +1,7 @@
{% extends "base.html" %}
{% block title %} | Add new webhook{% endblock %}
{% block title %}
| Add new webhook
{% endblock title %}
{% block content %}
<div class="p-2 border border-dark">
<form action="/add_webhook" method="post">
@ -7,27 +9,28 @@
<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"
<input name="webhook_name"
type="text"
class="form-control bg-dark border-dark text-muted"
id="webhook_name"
placeholder="TheLovinator #RSS">
placeholder="TheLovinator #RSS"/>
</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"
<input name="webhook_url"
type="text"
class="form-control bg-dark border-dark text-muted"
id="webhook_url"
placeholder="https://discord.com/api/webhooks/1011224189471124054/CQMa4hJN4gz...">
placeholder="https://discord.com/api/webhooks/1011224189471124054/CQMa4hJN4gz..."/>
</div>
</div>
{# Submit button #}
<div class="d-md-flex">
<button class="btn btn-dark btn-sm">Add webhook</button>
</div>
</form>
</div>
{% endblock %}
{% endblock content %}

View File

@ -1,20 +1,21 @@
{% extends "base.html" %}
{% block title %} | Blacklist{% endblock %}
{% block title %}
| 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
<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>
@ -29,28 +30,33 @@
</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 %}">
<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 %}">
<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 (Not implemented yet)</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 %}" disabled>
<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 %}"
disabled/>
</div>
</div>
<!-- Add a hidden feed_url field to the form -->
<input type="hidden" name="feed_url" value="{{ feed.url }}">
<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 %}
{% endblock content %}

View File

@ -32,3 +32,9 @@ profile = "black"
[tool.black]
line-length = 120
target-version = ["py311"]
[tool.djlint]
ignore = "D018,J018"
profile = "jinja"
max_line_length = 120
format_attribute_template_tags = true