feat: prettier website

This commit is contained in:
eneller
2025-03-16 23:35:32 +01:00
parent 7f54cb5b29
commit 09561d1bfd
3 changed files with 57 additions and 33 deletions

View File

@@ -1,6 +1,7 @@
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpRequest, HttpResponse, FileResponse from django.http import HttpRequest, HttpResponse, FileResponse
from django.conf import settings from django.conf import settings
from celery import shared_task
from epub2go.convert import get_all_books, Book, GBConvert, allbooks_url from epub2go.convert import get_all_books, Book, GBConvert, allbooks_url
@@ -18,6 +19,7 @@ def index(request: HttpRequest):
context = { context = {
'title': 'epub2go', 'title': 'epub2go',
'books': books, 'books': books,
'book_count': len(books),
} }
targetParam = request.GET.get('t', None) targetParam = request.GET.get('t', None)
@@ -40,6 +42,7 @@ def validateUrl(param)->bool :
return False return False
@shared_task
def getEpub(param): def getEpub(param):
# TODO validate / sanitize input # TODO validate / sanitize input
# TODO check for existing file and age # TODO check for existing file and age

View File

@@ -1,3 +1,18 @@
/* this is part of the http://bettermotherfuckingwebsite.com/ */
body{
margin:40px auto;
max-width:650px;
line-height:1.6;
font-size:18px;
color:#444;
padding:0
10px}
h1,h2,h3{
line-height:1.2
}
/* custom styles here */
tr:nth-child(even){ tr:nth-child(even){
background-color: #EEEEEE; background-color: #EEEEEE;
} }

View File

@@ -1,15 +1,18 @@
{% load static %} {% load static %}
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="de">
<head> <head>
<title>{{ title }}</title> <title>{{ title }}</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0" >
<link rel="stylesheet" type="text/css" href="{% static 'styles.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'styles.css' %}">
</head> </head>
<body> <body>
<header> <header>
<div> <div>
<h1>{{ title }}</h1> <h1>{{ title }}</h1>
<a href="javascript:void(window.open('./?t='+encodeURIComponent(window.location.toString())))" title="Add this to your bookmarks"> <!--TODO fix domain part as variable--> <p>Im Moment finden sich hier {{ book_count }} Bücher. </p>
<a href="javascript:void(window.open('./?t='+encodeURIComponent(window.location.toString())))" title="Als Lesezeichen speichern"> <!--TODO fix domain part as variable-->
<img src="{% static 'bookmark.svg' %}" alt="Bookmarklet" class="header-icon"> <img src="{% static 'bookmark.svg' %}" alt="Bookmarklet" class="header-icon">
</a> </a>
<a href="https://github.com/eneller/epub2go-web"> <a href="https://github.com/eneller/epub2go-web">
@@ -17,10 +20,12 @@
</a></div> </a></div>
<search> <search>
<form onsubmit="submitSearch(event)"> <form onsubmit="submitSearch(event)">
<input type="su" id="searchInput" placeholder="Search"> <input type="su" id="searchInput" placeholder="Suchen">
</form> </form>
</search> </search>
</header> </header>
<main>
<!-- TODO use dl here-->
<table id="table"> <table id="table">
<thead> <thead>
<tr> <tr>
@@ -49,8 +54,9 @@
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
<footer> </main>
</footer> <footer>
</footer>
</body> </body>
</html> </html>
<script src="{% static 'script.js' %}"></script> <script src="{% static 'script.js' %}"></script>