feat: prettier website
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<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' %}">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div>
|
||||
<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">
|
||||
</a>
|
||||
<a href="https://github.com/eneller/epub2go-web">
|
||||
@@ -17,40 +20,43 @@
|
||||
</a></div>
|
||||
<search>
|
||||
<form onsubmit="submitSearch(event)">
|
||||
<input type="su" id="searchInput" placeholder="Search">
|
||||
<input type="su" id="searchInput" placeholder="Suchen">
|
||||
</form>
|
||||
</search>
|
||||
</header>
|
||||
<table id="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Title</th>
|
||||
<th>Author</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in books %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href= {{ item.url }} target="_blank" rel="noopener noreferrer">
|
||||
<img src="{% static 'open-link.svg' %}" alt="Open Link" class="table-icon">
|
||||
</a>
|
||||
</td>
|
||||
<td class="table-data">
|
||||
<a href="./?t= {{ item.url }}">
|
||||
{{ item.title }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a> {{ item.author }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<footer>
|
||||
</footer>
|
||||
<main>
|
||||
<!-- TODO use dl here-->
|
||||
<table id="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Title</th>
|
||||
<th>Author</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in books %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href= {{ item.url }} target="_blank" rel="noopener noreferrer">
|
||||
<img src="{% static 'open-link.svg' %}" alt="Open Link" class="table-icon">
|
||||
</a>
|
||||
</td>
|
||||
<td class="table-data">
|
||||
<a href="./?t= {{ item.url }}">
|
||||
{{ item.title }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a> {{ item.author }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</main>
|
||||
<footer>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
<script src="{% static 'script.js' %}"></script>
|
||||
Reference in New Issue
Block a user