Improve HTML
This commit is contained in:
@ -1,13 +1,21 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Index{% endblock %}
|
||||
{% block content %}
|
||||
{# Home / Add #}
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="/">Home</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Add</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="p-2 mb-2 border border-dark rounded">
|
||||
<form action="/add" method="post">
|
||||
{# Feed URL #}
|
||||
<div class="row mb-3">
|
||||
<label for="feed_url" class="col-sm-2 col-form-label">Feed URL</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="feed_url"
|
||||
<input name="feed_url" type="text" class="form-control" id="feed_url"
|
||||
placeholder="https://www.reddit.com/r/FreeGameFindings.rss">
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,14 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
{% block 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"
|
||||
integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65"
|
||||
crossorigin="anonymous">
|
||||
<title>RSS - {% block title %}{% endblock %}</title>
|
||||
{% endblock %}
|
||||
<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"
|
||||
integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65"
|
||||
crossorigin="anonymous">
|
||||
<title>RSS - {% block title %}{% endblock %}</title>
|
||||
{% block head %}{% endblock %}
|
||||
</head>
|
||||
<body class="text-white-50" style="background: #111111;">
|
||||
{% include "nav.html" %}
|
||||
@ -21,13 +20,17 @@
|
||||
.com/TheLovinator1">TheLovinator</a>
|
||||
</p>
|
||||
<ul class="nav col-md-4 justify-content-end">
|
||||
<li class="nav-item"><a href="mailto:tlovinator@gmail.com"
|
||||
class="nav-link px-2 text-muted">Email</a>
|
||||
<li class="nav-item">
|
||||
<a href="mailto:tlovinator@gmail.com" class="nav-link px-2 text-muted">Email</a>
|
||||
</li>
|
||||
<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>
|
||||
</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>
|
||||
</li>
|
||||
<li class="nav-item"><a href="https://github.com/TheLovinator1/discord-rss-bot/issues"
|
||||
class="nav-link px-2 text-muted">Send 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">Feature request</a></li>
|
||||
</ul>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -13,6 +13,22 @@
|
||||
{% if feed.last_exception %} Last exception: {{ feed.last_exception }} <br> {% endif %}
|
||||
{% if not feed.updates_enabled %} <span style="color: red"> Updates disabled! </span> <br>{% endif %}
|
||||
</div>
|
||||
<div class="btn-toolbar" role="group">
|
||||
<div class="btn-group me-2" role="group">
|
||||
<form action="/check" method="post">
|
||||
<button class="btn btn-primary" type="submit" name="feed_url" value="{{ feed.url }}">
|
||||
Send new entries to Discord
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="btn-group me-2" role="group">
|
||||
<form action="/remove" method="post">
|
||||
<button class="btn btn-danger" type="submit" name="feed_url" value="{{ feed.url }}">
|
||||
Remove feed
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-2 mb-2 border border-dark rounded" style="background:#0F0F0F">
|
||||
{% for entry in entries %}
|
||||
{# Only add <hr> if the entry is not the first one #}
|
||||
@ -65,17 +81,5 @@
|
||||
{% if entry.read_modified %} Read modified: {{ entry.read_modified.strftime('%Y-%m-%d, %T') }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<form action="/check" method="post">
|
||||
<button type="submit" name="feed_url" value="{{ feed.url }}">
|
||||
Send new entries to Discord.
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<form action="/remove" method="post">
|
||||
<button type="submit" name="feed_url" value="{{ feed.url }}">
|
||||
Remove feed.
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
@ -1,59 +1,60 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Index{% endblock %}
|
||||
{% block head %}
|
||||
<script>
|
||||
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
|
||||
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
|
||||
return new bootstrap.Tooltip(tooltipTriggerEl)
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<!-- List all feeds -->
|
||||
{% for tag in tags %}
|
||||
{{ tag }}
|
||||
{% endfor %}
|
||||
<ul>
|
||||
<!-- Check if any feeds -->
|
||||
{% if feeds %}
|
||||
{% for feed in feeds %}
|
||||
<p><a class="text-muted" href="/feed/{{ feed.url }}">{{ feed.url }}</a></p>
|
||||
{% if feed.last_exception %}
|
||||
<li class="text-danger">
|
||||
Last exception: {{ feed.last_exception.type_name }}: {{ feed.last_exception.value_str }}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p>No feeds yet. Add one <a class="text-muted" href="/add">here</a>.</p>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
|
||||
<!-- Feed stats -->
|
||||
<hr>
|
||||
<ul>
|
||||
<li>
|
||||
<p>
|
||||
{{ feed_count.total }} feeds
|
||||
{% if feed_count.broken %}
|
||||
- {{ feed_count.broken }} broken
|
||||
<span class="text-danger">
|
||||
{% else %}
|
||||
<span>
|
||||
{% endif %}
|
||||
- {{ feed_count.broken }} broken</span>
|
||||
{% if feed_count.total != feed_count.updates_enabled %}
|
||||
- {{ feed_count.updates_enabled }} enabled
|
||||
<span class="text-warning">
|
||||
{% else %}
|
||||
<span>
|
||||
{% endif %}
|
||||
- {{ feed_count.updates_enabled }} enabled
|
||||
</span>
|
||||
- {{ entry_count.total }} entries
|
||||
<span data-bs-toggle="tooltip" title="Entries per day average 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) }})
|
||||
</span>
|
||||
</p>
|
||||
</li>
|
||||
{% for hook_from_context in webhooks %}
|
||||
<div class="p-2 mb-2 border border-dark">
|
||||
<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 %}
|
||||
<li class="list-group-item" style="background:#111111">
|
||||
<a class="text-muted" href="/feed/{{ feed.url }}">{{ feed.url }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p>
|
||||
No feeds yet. Add one <a class="text-muted" href="/add">here</a>.
|
||||
</p>
|
||||
{% endif %}
|
||||
</ul>
|
||||
<!-- Feed entries stats -->
|
||||
<ul>
|
||||
<li>
|
||||
<p>{{ entry_count.total }} entries total</p>
|
||||
{% if entry_count.read != entry_count.total %}
|
||||
<p>{{ entry_count.total - entry_count.read }} unread entries</p>
|
||||
{% endif %}
|
||||
{% if entry_count.important %}
|
||||
<p>Important: {{ entry_count.important }} entries</p>
|
||||
{% endif %}
|
||||
{% if entry_count.has_enclosures %}
|
||||
<p>Has enclosures: {{ entry_count.has_enclosures }} entries</p>
|
||||
{% endif %}
|
||||
<p>1 Month average: {{ entry_count.averages[0]|round(2) }} entries per day</p>
|
||||
<p>3 Months average: {{ entry_count.averages[1]|round(2) }} entries per day</p>
|
||||
<p>12 Months average: {{ entry_count.averages[2]|round(2) }} entries per day</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{% endblock %}
|
Reference in New Issue
Block a user