frontend tweaks

This commit is contained in:
eneller
2025-03-20 20:53:19 +01:00
parent aa66c06f88
commit c1f813d70c
3 changed files with 13 additions and 9 deletions

View File

@@ -12,7 +12,7 @@ import logging
logger = logging.getLogger(__name__) #TODO configure logging
converter = GBConvert(downloaddir=settings.MEDIA_ROOT)
books = get_all_books()# TODO get from pickle
books = sorted(get_all_books(), key= lambda b: b.title)# TODO get from pickle
gbnetloc = urlparse(allbooks_url).netloc
def index(request: HttpRequest):
@@ -21,6 +21,7 @@ def index(request: HttpRequest):
'http_host': request.META['HTTP_HOST'],
'books': books,
'book_count': len(books),
'allbooks_url': allbooks_url,
}
targetParam = request.GET.get('t', None)

View File

@@ -5,7 +5,11 @@
--fg:#444;
--fg-deemph: #777;
}
html{
font-family: serif;
}
body{
background-color: var(--bg);
margin:40px auto;
max-width:800px;
line-height:1.4;
@@ -18,15 +22,10 @@ h1,h2,h3{
line-height:1.2;
letter-spacing: -2%;
}
/* custom styles here */
body{
background-color: var(--bg);
font-family: serif;
}
header{
text-align: center;
justify-content: center;
margin-bottom: 4%;
}
small{
color: var(--fg-deemph);
@@ -35,9 +34,13 @@ small{
width: 100%;
}
#searchInput {
background-color: var(--bg);
width: 100%;
padding: .2em;
font-size: larger;
border-radius: 10px;
border-color: var(--bg-acc);
box-shadow: var(--bg-acc) 2px 2px;
}
th{
text-align: left;
@@ -65,5 +68,5 @@ a:hover, a:any-link{
display: block;
width: 100%;
height: 100%;
padding: 3px;
padding: 1px;
}

View File

@@ -18,7 +18,7 @@
<input type="search" id="searchInput" placeholder="Suche nach Titel" minlength="3">
</form>
</search>
<small>Im Moment finden sich hier {{ book_count }} Bücher. </small>
<small>Im Moment finden sich hier <a href="{{ allbooks_url }}">{{ book_count }} Bücher.</a> </small>
<a href="javascript:void(window.open('http://{{ http_host }}/?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>