Improve HTML

This commit is contained in:
2022-12-09 17:07:28 +01:00
parent 7639eeae1b
commit 2a45573cd9
3 changed files with 40 additions and 36 deletions

View File

@ -9,10 +9,10 @@
</ol> </ol>
</nav> </nav>
<div class="p-2 mb-2 border border-dark rounded"> <div class="p-2 border border-dark">
<form action="/add" method="post"> <form action="/add" method="post">
{# Feed URL #} {# Feed URL #}
<div class="row mb-3"> <div class="row mb-4">
<label for="feed_url" class="col-sm-2 col-form-label">Feed URL</label> <label for="feed_url" class="col-sm-2 col-form-label">Feed URL</label>
<div class="col-sm-10"> <div class="col-sm-10">
<input name="feed_url" type="text" class="form-control" id="feed_url" <input name="feed_url" type="text" class="form-control" id="feed_url"
@ -21,7 +21,7 @@
</div> </div>
{# Webhook dropdown #} {# Webhook dropdown #}
<div class="row mb-3"> <div class="row mb-4">
<label for="webhook_dropdown" class="col-sm-2">Which webhook should we send entries to?</label> <label for="webhook_dropdown" class="col-sm-2">Which webhook should we send entries to?</label>
<div class="col-sm-10"> <div class="col-sm-10">
<select class="col-auto form-select" id="webhook_dropdown" name="webhook_dropdown"> <select class="col-auto form-select" id="webhook_dropdown" name="webhook_dropdown">

View File

@ -1,27 +1,39 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} | {{ feed.title }}{% endblock %} {% block title %} | {{ feed.title }}{% endblock %}
{% block content %} {% block content %}
<div class="p-2 mb-2"> <a class="text-muted" href="{{ feed.link }}">
<a class="text-muted" href="{{ feed.link }}"><h2>{{ feed.title }}</h2></a> <h2>{{ feed.title }}
{% if feed.url %} Subtitle: {{ feed.subtitle }} <br> {% endif %} {% if not feed.updates_enabled %}
{% if feed.url %} {{ feed.url }} <br> {% endif %} - <span style="color: red">disabled</span>
{% if feed.updated %} Updated: {{ feed.updated.strftime('%Y-%m-%d, %T') }} <br> {% endif %} {% endif %}
{% if feed.version %} Version: {{ feed.version }} <br>{% endif %} </h2>
{% if feed.user_title %} User title: {{ feed.user_title }} <br>{% endif %}
{% if feed.added %} Added on: {{ feed.added.strftime('%Y-%m-%d, %T') }} <br> {% endif %} </a>
{% if feed.last_update %} Last update: {{ feed.last_update }} <br> {% endif %} {% if feed.url %}
{% if feed.last_exception %} Last exception: {{ feed.last_exception }} <br> {% endif %} {{ feed.url }}
{% if not feed.updates_enabled %} <span style="color: red"> Updates disabled! </span> <br>{% endif %} {% endif %}
</div> {% if feed.subtitle %}
<small class="text-muted">{{ feed.subtitle }}</small>
{% endif %}
{% if feed.added %}
Added: {{ feed.added.strftime('%Y-%m-%d, %T') }}
{% endif %}
{% if feed.last_exception %}
Last exception: {{ feed.last_exception }}
{% endif %}
<div class="btn-toolbar" role="group"> <div class="btn-toolbar" role="group">
<div class="btn-group me-2" role="group"> <div class="btn-group me-1" role="group">
<form action="/check" method="post"> <form action="/check" method="post">
<button class="btn btn-primary" type="submit" name="feed_url" value="{{ feed.url }}"> <button class="btn btn-primary" type="submit" name="feed_url" value="{{ feed.url }}">
Send new entries to Discord Send new entries to Discord
</button> </button>
</form> </form>
</div> </div>
<div class="btn-group me-2" role="group"> <div class="btn-group" role="group">
<form action="/remove" method="post"> <form action="/remove" method="post">
<button class="btn btn-danger" type="submit" name="feed_url" value="{{ feed.url }}"> <button class="btn btn-danger" type="submit" name="feed_url" value="{{ feed.url }}">
Remove feed Remove feed
@ -29,40 +41,37 @@
</form> </form>
</div> </div>
</div> </div>
<div class="p-2 mb-2 border border-dark rounded" style="background:#0F0F0F"> <div class="p-2 border border-dark" style="background:#0F0F0F">
{% for entry in entries %} {% for entry in entries %}
{# Only add <hr> if the entry is not the first one #}
{% if loop.index > 1 %} {% if loop.index > 1 %}
<hr> <hr>
{% endif %} {% endif %}
<a class="text-muted" href="{{ entry.link }}"><h2>{{ entry.title }}</h2></a> <a class="text-muted" href="{{ entry.link }}">
By {{ entry.author }} <br> <h2>{{ entry.title }}</h2>
<br> </a>
By {{ entry.author }}
{% if entry.published %} {% if entry.published %}
{# Published: 2022-12-07, 08:10:22 #} @ {{ entry.published.strftime('%Y-%m-%d, %T') }}
Published: {{ entry.published.strftime('%Y-%m-%d, %T') }} <br>
{% endif %} {% endif %}
{% if entry.updated %}
{# Updated: 2022-12-07, 08:10:22 #}
Updated: {{ entry.updated.strftime('%Y-%m-%d, %T') }} <br>
{% endif %}
{# Add a button to get the summary #}
<p> <p>
{# Add a button to get the summary #}
{% if entry.summary %} {% if entry.summary %}
<a class="btn btn-primary" data-bs-toggle="collapse" href="#collapse_summary_{{ loop.index }}" <a class="btn btn-primary" data-bs-toggle="collapse" href="#collapse_summary_{{ loop.index }}"
role="button">Summary</a> role="button">Summary</a>
{% endif %} {% endif %}
{# Add a button to get the content #}
{% if entry.content %} {% if entry.content %}
<a class="btn btn-primary" data-bs-toggle="collapse" href="#collapse_content_{{ loop.index }}" <a class="btn btn-primary" data-bs-toggle="collapse" href="#collapse_content_{{ loop.index }}"
role="button">Content</a> role="button">Content</a>
{% endif %} {% endif %}
</p> </p>
{% if entry.summary %} {% if entry.summary %}
{# This is hidden by default, it is only visible if we click the button from above #}
<div class="collapse" id="collapse_summary_{{ loop.index }}"> <div class="collapse" id="collapse_summary_{{ loop.index }}">
<div class="card card-body text-muted border border-dark" style="background: #111111;"> <div class="card card-body text-muted border border-dark" style="background: #111111;">
{{ entry.summary | safe }} {{ entry.summary | safe }}
@ -70,16 +79,13 @@
</div> </div>
{% endif %} {% endif %}
{% if entry.content %} {% if entry.content %}
{# This is hidden by default, it is only visible if we click the button from above #}
<div class="collapse" id="collapse_content_{{ loop.index }}"> <div class="collapse" id="collapse_content_{{ loop.index }}">
<div class="card card-body text-muted border border-dark" style="background: #111111;"> <div class="card card-body text-muted border border-dark" style="background: #111111;">
{{ entry.content[0].value | safe }} {{ entry.content[0].value | safe }}
</div> </div>
</div> </div>
{% endif %} {% endif %}
{# Read modified: 2022-12-07, 08:25:25 #}
{% if entry.read_modified %} Read modified: {{ entry.read_modified.strftime('%Y-%m-%d, %T') }}
{% endif %}
{% endfor %} {% endfor %}
</div> </div>
{% endblock %} {% endblock %}

View File

@ -1,7 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}{% endblock %}
{% block content %} {% block content %}
<!-- List all feeds --> <!-- List all feeds -->
<ul> <ul>
<!-- Check if any feeds --> <!-- Check if any feeds -->