From 09561d1bfdcfb49c2ea9cdeda8196e3a2b53b40c Mon Sep 17 00:00:00 2001 From: eneller Date: Sun, 16 Mar 2025 23:35:32 +0100 Subject: [PATCH] feat: prettier website --- src/core/views.py | 3 ++ src/epub2go_web/static/styles.css | 15 ++++++ src/epub2go_web/templates/index.html | 72 +++++++++++++++------------- 3 files changed, 57 insertions(+), 33 deletions(-) diff --git a/src/core/views.py b/src/core/views.py index 7c8dadd..ec267eb 100644 --- a/src/core/views.py +++ b/src/core/views.py @@ -1,6 +1,7 @@ from django.shortcuts import render from django.http import HttpRequest, HttpResponse, FileResponse from django.conf import settings +from celery import shared_task from epub2go.convert import get_all_books, Book, GBConvert, allbooks_url @@ -18,6 +19,7 @@ def index(request: HttpRequest): context = { 'title': 'epub2go', 'books': books, + 'book_count': len(books), } targetParam = request.GET.get('t', None) @@ -40,6 +42,7 @@ def validateUrl(param)->bool : return False +@shared_task def getEpub(param): # TODO validate / sanitize input # TODO check for existing file and age diff --git a/src/epub2go_web/static/styles.css b/src/epub2go_web/static/styles.css index b5bc829..40318b6 100644 --- a/src/epub2go_web/static/styles.css +++ b/src/epub2go_web/static/styles.css @@ -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){ background-color: #EEEEEE; } diff --git a/src/epub2go_web/templates/index.html b/src/epub2go_web/templates/index.html index cec3167..8ecb037 100644 --- a/src/epub2go_web/templates/index.html +++ b/src/epub2go_web/templates/index.html @@ -1,15 +1,18 @@ {% load static %} - + {{ title }} + +

{{ title }}

- +

Im Moment finden sich hier {{ book_count }} Bücher.

+
Bookmarklet @@ -17,40 +20,43 @@
- +
- - - - - - - - - - {% for item in books %} - - - - - - {% endfor %} - -
TitleAuthor
- - Open Link - - - - {{ item.title }} - - - {{ item.author }} -
- +
+ + + + + + + + + + + {% for item in books %} + + + + + + {% endfor %} + +
TitleAuthor
+ + Open Link + + + + {{ item.title }} + + + {{ item.author }} +
+
+ \ No newline at end of file