Add favicon, /all has GET page for new feeds, and a base.html template
This commit is contained in:
		
							
								
								
									
										24
									
								
								discord_rss_bot/templates/add.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								discord_rss_bot/templates/add.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
{% extends "base.html" %}
 | 
			
		||||
{% block title %}Index{% endblock %}
 | 
			
		||||
{% block content %}
 | 
			
		||||
    <form action="/add" method="post">
 | 
			
		||||
        <label>
 | 
			
		||||
            <input type="text" name="feed_url" placeholder="Feed URL" class="form-control" aria-label="Feed url">
 | 
			
		||||
        </label>
 | 
			
		||||
 | 
			
		||||
        <div class="input-group mb-3">
 | 
			
		||||
            <label for="webhook_dropdown" class="input-group-text">Webhook</label>
 | 
			
		||||
            <select class="form-select" aria-label="Default webhook" id="webhook_dropdown"
 | 
			
		||||
                    name="webhook_dropdown">
 | 
			
		||||
                <option selected>Choose...</option>
 | 
			
		||||
                {% for hook in webhooks %}
 | 
			
		||||
                    <option value="{{ hook.name }}">{{ hook.name }}</option>
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
            </select>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="input-group mb-3">
 | 
			
		||||
            <input type="submit" value="Add feed">
 | 
			
		||||
        </div>
 | 
			
		||||
    </form>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
							
								
								
									
										24
									
								
								discord_rss_bot/templates/base.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								discord_rss_bot/templates/base.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
<!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 %}
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
<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>
 | 
			
		||||
<div id="content">{% block content %}{% endblock %}</div>
 | 
			
		||||
<footer>
 | 
			
		||||
    {% block footer %}
 | 
			
		||||
        <a href="https://github.com/TheLovinator1/discord-rss-bot">RSS Bot</a> by TheLovinator1
 | 
			
		||||
    {% endblock %}
 | 
			
		||||
</footer>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
@@ -1,33 +1,28 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
<head>
 | 
			
		||||
    <meta charset="UTF-8">
 | 
			
		||||
    <title>Feed</title>
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
URL: {{ feed.url }} <br>
 | 
			
		||||
Title: {{ feed.title }} <br>
 | 
			
		||||
Updated: {{ feed.updated }} <br>
 | 
			
		||||
Link: {{ feed.link }} <br>
 | 
			
		||||
Author: {{ feed.author }} <br>
 | 
			
		||||
Subtitle: {{ feed.subtitle }} <br>
 | 
			
		||||
Version: {{ feed.version }} <br>
 | 
			
		||||
User title: {{ feed.user_title }} <br>
 | 
			
		||||
Added on: {{ feed.added }} <br>
 | 
			
		||||
Last update: {{ feed.last_update }} <br>
 | 
			
		||||
Last exception: {{ feed.last_exception }} <br>
 | 
			
		||||
Updates enabled: {{ feed.updates_enabled }} <br>
 | 
			
		||||
{% extends "base.html" %}
 | 
			
		||||
{% block title %}Feed{% endblock %}
 | 
			
		||||
{% block content %}
 | 
			
		||||
    URL: {{ feed.url }} <br>
 | 
			
		||||
    Title: {{ feed.title }} <br>
 | 
			
		||||
    Updated: {{ feed.updated }} <br>
 | 
			
		||||
    Link: {{ feed.link }} <br>
 | 
			
		||||
    Author: {{ feed.author }} <br>
 | 
			
		||||
    Subtitle: {{ feed.subtitle }} <br>
 | 
			
		||||
    Version: {{ feed.version }} <br>
 | 
			
		||||
    User title: {{ feed.user_title }} <br>
 | 
			
		||||
    Added on: {{ feed.added }} <br>
 | 
			
		||||
    Last update: {{ feed.last_update }} <br>
 | 
			
		||||
    Last exception: {{ feed.last_exception }} <br>
 | 
			
		||||
    Updates enabled: {{ feed.updates_enabled }} <br>
 | 
			
		||||
 | 
			
		||||
<form action="/check" method="post">
 | 
			
		||||
    <button type="submit" name="feed_url" value="{{ feed.url }}">
 | 
			
		||||
        Send new entries to Discord.
 | 
			
		||||
    </button>
 | 
			
		||||
</form>
 | 
			
		||||
    <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>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
    <form action="/remove" method="post">
 | 
			
		||||
        <button type="submit" name="feed_url" value="{{ feed.url }}">
 | 
			
		||||
            Remove feed.
 | 
			
		||||
        </button>
 | 
			
		||||
    </form>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
@@ -1,73 +1,49 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
<head>
 | 
			
		||||
    <meta charset="UTF-8">
 | 
			
		||||
    <title>Index</title>
 | 
			
		||||
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
 | 
			
		||||
<!-- Create a new feed -->
 | 
			
		||||
<form action="/add" method="post">
 | 
			
		||||
    <label>
 | 
			
		||||
        <input type="text" name="feed_url" placeholder="Feed URL">
 | 
			
		||||
    </label>
 | 
			
		||||
    <label for="webhook_dropdown">Choose:</label>
 | 
			
		||||
    <select id="webhook_dropdown" name="webhook_dropdown">
 | 
			
		||||
        {% for hook in webhooks %}
 | 
			
		||||
            <!-- {{ hook.name }} {{ hook.value }} -->
 | 
			
		||||
            <option value="{{ hook.name }}">{{ hook.name }}</option>
 | 
			
		||||
        {% endfor %}
 | 
			
		||||
    </select>
 | 
			
		||||
    <input type="submit" value="Add feed">
 | 
			
		||||
</form>
 | 
			
		||||
 | 
			
		||||
<!-- List all feeds -->
 | 
			
		||||
{% for tag in tags %}
 | 
			
		||||
 | 
			
		||||
    {{ tag }}
 | 
			
		||||
 | 
			
		||||
{% endfor %}
 | 
			
		||||
<ul>
 | 
			
		||||
    <!-- Check if any feeds -->
 | 
			
		||||
    {% if feeds %}
 | 
			
		||||
        {% for feed in feeds %}
 | 
			
		||||
            <form action="/feed" method="post">
 | 
			
		||||
                <button type="submit" name="feed_url" value="{{ feed.url }}">
 | 
			
		||||
                    {{ feed.url }}
 | 
			
		||||
                </button>
 | 
			
		||||
            </form>
 | 
			
		||||
        {% endfor %}
 | 
			
		||||
    {% else %}
 | 
			
		||||
        <p>No feeds yet</p>
 | 
			
		||||
    {% endif %}
 | 
			
		||||
</ul>
 | 
			
		||||
{% extends "base.html" %}
 | 
			
		||||
{% block title %}Index{% endblock %}
 | 
			
		||||
{% block content %}
 | 
			
		||||
    <!-- List all feeds -->
 | 
			
		||||
    {% for tag in tags %}
 | 
			
		||||
        {{ tag }}
 | 
			
		||||
    {% endfor %}
 | 
			
		||||
    <ul>
 | 
			
		||||
        <!-- Check if any feeds -->
 | 
			
		||||
        {% if feeds %}
 | 
			
		||||
            {% for feed in feeds %}
 | 
			
		||||
                <form action="/feed" method="post">
 | 
			
		||||
                    <button type="submit" name="feed_url" value="{{ feed.url }}">
 | 
			
		||||
                        {{ feed.url }}
 | 
			
		||||
                    </button>
 | 
			
		||||
                </form>
 | 
			
		||||
            {% endfor %}
 | 
			
		||||
        {% else %}
 | 
			
		||||
            <p>No feeds yet</p>
 | 
			
		||||
        {% endif %}
 | 
			
		||||
    </ul>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<!-- Feed stats -->
 | 
			
		||||
<hr>
 | 
			
		||||
<ul>
 | 
			
		||||
    <li>
 | 
			
		||||
        <p>Feed stats:</p>
 | 
			
		||||
        <p>Total: {{ feed_count.total }} feeds</p>
 | 
			
		||||
        <p>Broken: {{ feed_count.broken }} feeds</p>
 | 
			
		||||
        <p>Enabled: {{ feed_count.updates_enabled }} feeds</p>
 | 
			
		||||
    </li>
 | 
			
		||||
</ul>
 | 
			
		||||
<!-- Feed entries stats -->
 | 
			
		||||
<ul>
 | 
			
		||||
    <li>
 | 
			
		||||
        <p>Feed entries:</p>
 | 
			
		||||
        <p>Total: {{ entry_count.total }} entries</p>
 | 
			
		||||
        <p>Read: {{ entry_count.read }} entries</p>
 | 
			
		||||
        <p>Important: {{ entry_count.important }} entries</p>
 | 
			
		||||
        <p>Has enclosures: {{ entry_count.has_enclosures }} entries</p>
 | 
			
		||||
        <p>1 Month: {{ entry_count.averages[0]|round(2) }} entries per day</p>
 | 
			
		||||
        <p>3 Months: {{ entry_count.averages[1]|round(2) }} entries per day</p>
 | 
			
		||||
        <p>12 Months: {{ entry_count.averages[2]|round(2) }} entries per day</p>
 | 
			
		||||
    <!-- Feed stats -->
 | 
			
		||||
    <hr>
 | 
			
		||||
    <ul>
 | 
			
		||||
        <li>
 | 
			
		||||
            <p>Feed stats:</p>
 | 
			
		||||
            <p>Total: {{ feed_count.total }} feeds</p>
 | 
			
		||||
            <p>Broken: {{ feed_count.broken }} feeds</p>
 | 
			
		||||
            <p>Enabled: {{ feed_count.updates_enabled }} feeds</p>
 | 
			
		||||
        </li>
 | 
			
		||||
    </ul>
 | 
			
		||||
    <!-- Feed entries stats -->
 | 
			
		||||
    <ul>
 | 
			
		||||
        <li>
 | 
			
		||||
            <p>Feed entries:</p>
 | 
			
		||||
            <p>Total: {{ entry_count.total }} entries</p>
 | 
			
		||||
            <p>Read: {{ entry_count.read }} entries</p>
 | 
			
		||||
            <p>Important: {{ entry_count.important }} entries</p>
 | 
			
		||||
            <p>Has enclosures: {{ entry_count.has_enclosures }} entries</p>
 | 
			
		||||
            <p>1 Month: {{ entry_count.averages[0]|round(2) }} entries per day</p>
 | 
			
		||||
            <p>3 Months: {{ entry_count.averages[1]|round(2) }} entries per day</p>
 | 
			
		||||
            <p>12 Months: {{ entry_count.averages[2]|round(2) }} entries per day</p>
 | 
			
		||||
 | 
			
		||||
    </li>
 | 
			
		||||
</ul>
 | 
			
		||||
        </li>
 | 
			
		||||
    </ul>
 | 
			
		||||
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
		Reference in New Issue
	
	Block a user