New frontent and article grouping #1

Merged
mdivecky merged 16 commits from new-frontend into main 2023-08-17 11:32:35 +02:00
6 changed files with 145 additions and 155 deletions
Showing only changes of commit 41575bf4a9 - Show all commits

15
.editorconfig Normal file
View file

@ -0,0 +1,15 @@
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.{html,py}]
indent_style = tab
indent_size = 4
[*.html]
indent_style = tab
indent_size = 2

View file

@ -1,42 +1,23 @@
<!DOCTYPE html> {% extends "base.html" %}
<html lang="en" class="h100">
<head> {% block body %}
{% include 'parts/head.html' %}
<style>
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 60px; /* Margin bottom by footer height */
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
}
</style>
</head>
<body class="d-flex flex-column h-100">
<!-- Begin page content -->
<main class="flex-shrink-0"> <main class="flex-shrink-0">
<div class="container"> <div class="container">
<h1 class="mt-5">Headliner</h1> <h1 class="mt-5">Headliner</h1>
<p class="lead">Headliner is monitoring rss feeds of czech news websites for changes in article headlines. Just <p class="lead">
because it might be interesting.</p> Headliner is monitoring rss feeds of czech news websites for changes in
<p>See <a href="https://git.nolog.cz/mdivecky/headline">the source code</a>, but be aware that it's not too nice. article headlines. Just because it might be interesting.
Feel free to improve it.</p> </p>
<p>If you want to access the raw data collected by this tool, you can <a href="https://git.nolog.cz/NoLog.cz/headline-exports">download the full archive from our git</a></p> <p>
See <a href="https://git.nolog.cz/mdivecky/headline">the source code</a>,
but be aware that it's not too nice. Feel free to improve it.
</p>
<p>
If you want to access the raw data collected by this tool, you can
<a href="https://git.nolog.cz/NoLog.cz/headline-exports"
>download the full archive from our git</a
>
</p>
</div> </div>
</main> </main>
{% endblock body %}
{% include 'parts/footer.html' %}
</body>
</html>

25
view/templates/base.html Normal file
View file

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Headliner</title>
<link
rel="shortcut icon"
href="{{ url_for('static', filename='favicon.ico') }}"
/>
<link
rel="stylesheet"
href="{{ url_for('static', filename='main.css') }}"
/>
<script
defer
data-domain="headline.beta.nolog.cz"
src="https://plausible.nolog.cz/js/plausible.js"
></script>
</head>
<body>
{% block body %}{% endblock %}
{% include 'parts/footer.html' %}
</body>
</html>

View file

@ -1,12 +1,6 @@
<!DOCTYPE html> {% extends "base.html" %}
<html lang="en">
<head>
{% include 'parts/head.html' %}
</head>
<body>
{% block body %}
<div class="container"> <div class="container">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-hover"> <table class="table table-hover">
@ -25,11 +19,9 @@
<td>{{ feed.unique_tag }}</td> <td>{{ feed.unique_tag }}</td>
{% endfor %} {% endfor %}
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
{% include 'parts/footer.html' %} {% endblock body %}
</body>
</html>

View file

@ -1,36 +1,23 @@
<!DOCTYPE html> {% extends "base.html" %}
<html lang="en">
<head> {% block body %}
{% include 'parts/head.html' %}
<style>
/* Longer name hidden by default */
span.long {
display: none;
}
/* On hover, hide the short name */
.expanded:hover span.short {
display: none;
}
/* On hover, display the longer name. */
.expanded:hover span.long {
display: block;
}
</style>
</head>
<body>
<div class="container"> <div class="container">
<form> <form>
<div class="d-flex"> <div class="d-flex">
<input class="m-2 form-control" type="text" id="search" name="search" value="{{ search|e }}" /> <input
<input class="m-2 btn btn-primary" type="submit" formenctype="application/x-www-form-urlencoded" formmethod="get" value="Hledat" /> class="m-2 form-control"
type="text"
id="search"
name="search"
value="{{ search|e }}"
/>
<input
class="m-2 btn btn-primary"
type="submit"
formenctype="application/x-www-form-urlencoded"
formmethod="get"
value="Hledat"
/>
</div> </div>
</form> </form>
<div class="table-responsive"> <div class="table-responsive">
@ -48,7 +35,11 @@
{% for diff in diffs %} {% for diff in diffs %}
<tr> <tr>
<td>{{ diff.diff_time }}</td> <td>{{ diff.diff_time }}</td>
<td><a href='{{ diff.article_url }}' target="_blank">{{ diff.feed_name }}</a></td> <td>
<a href="{{ diff.article_url }}" target="_blank"
>{{ diff.feed_name }}</a
>
</td>
<td>{{ diff.diff_html|safe }}</td> <td>{{ diff.diff_html|safe }}</td>
<td class="expanded"> <td class="expanded">
<span class="short">{{ diff.title_orig|truncate(15) }} </span> <span class="short">{{ diff.title_orig|truncate(15) }} </span>
@ -65,16 +56,9 @@
</div> </div>
<div class="container text-center"> <div class="container text-center">
<div class="row"> <div class="row">
<div class="col"> <div class="col">{{ pagination.links }}</div>
{{ pagination.links }} <div class="col">{{ pagination.info }}</div>
</div>
<div class="col">
{{ pagination.info }}
</div> </div>
</div> </div>
</div> </div>
</div> {% endblock body %}
{% include 'parts/footer.html' %}
</body>
</html>

View file

@ -1,7 +0,0 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Headliner</title>
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='main.css') }}">
<script defer data-domain="headline.beta.nolog.cz" src="https://plausible.nolog.cz/js/plausible.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">