minor tweaks

This commit is contained in:
eneller
2025-03-20 15:02:23 +01:00
parent b65d878981
commit 518a8a1744
7 changed files with 41 additions and 20 deletions

1
.gitignore vendored
View File

@@ -372,3 +372,4 @@ pyrightconfig.json
# End of https://www.toptal.com/developers/gitignore/api/python,django,visualstudiocode,intellij+all # End of https://www.toptal.com/developers/gitignore/api/python,django,visualstudiocode,intellij+all
staticfiles/

View File

@@ -8,6 +8,7 @@ dependencies = [
"celery>=5.4.0", "celery>=5.4.0",
"django>=5.1.6", "django>=5.1.6",
"epub2go", "epub2go",
"python-dotenv>=1.0.1",
"pywatchman>=2.0.0", "pywatchman>=2.0.0",
] ]

View File

@@ -123,6 +123,7 @@ STATIC_URL = "static/"
STATICFILES_DIRS = [ STATICFILES_DIRS = [
PROJ_DIR / "static/", PROJ_DIR / "static/",
] ]
STATIC_ROOT = PROJ_DIR/ "staticfiles"
MEDIA_URL = "media/" MEDIA_URL = "media/"
MEDIA_ROOT = PROJ_DIR / "media/" MEDIA_ROOT = PROJ_DIR / "media/"

View File

@@ -15,10 +15,10 @@ function submitSearch(event){
event.preventDefault(); event.preventDefault();
search(); search();
} }
function search(searchStr = searchInput.value){ function search(searchStr = searchInput.value.toLowerCase()){
function showMatch(tr){ function showMatch(tr){
// match search with list // match search with list
let searchSuccess = Array.from(tr.getElementsByClassName('table-data')).map(e => e.textContent) let searchSuccess = Array.from(tr.getElementsByClassName('table-data')).map(e => e.textContent.toLowerCase())
.join(' ') .join(' ')
.indexOf(searchStr) > -1; .indexOf(searchStr) > -1;
if (searchSuccess) tr.style.display = ""; if (searchSuccess) tr.style.display = "";

View File

@@ -1,23 +1,27 @@
/* this is part of the http://bettermotherfuckingwebsite.com/ */ :root{
--bg:#faf0e673;
--bg-acc:#EEEEEE;
--bg-hover: #DDDDDD;
--fg:#444;
--fg-deemph: #777;
}
body{ body{
margin:40px auto; margin:40px auto;
max-width:650px; max-width:650px;
line-height:1.6; line-height:1.4;
font-size:18px; font-size:18px;
color:#444; color:var(--fg);
padding:0 10px; padding:0 10px;
} }
h1,h2,h3{ h1,h2,h3{
line-height:1.2 line-height:1.2;
letter-spacing: -2%;
} }
/* custom styles here */ /* custom styles here */
:root{
--white:#faf0e673;
}
body{ body{
background-color: var(--white); background-color: var(--bg);
font-family: serif; font-family: serif;
} }
header{ header{
@@ -25,16 +29,16 @@ header{
justify-content: center; justify-content: center;
} }
small{ small{
color: #777; color: var(--fg-deemph);
} }
.searchbar{ .searchbar{
width: fit-content; width: fit-content;
} }
tr:nth-child(even){ tr:nth-child(even){
background-color: #EEEEEE; background-color: var(--bg-acc);
} }
tr:hover{ tr:hover{
background-color: #DDDDDD; background-color: var(--bg-hover);
transition: all 2ms; transition: all 2ms;
} }
.inline-icon, .header-icon{ .inline-icon, .header-icon{
@@ -43,6 +47,7 @@ tr:hover{
} }
.header-icon{ .header-icon{
padding: .5em; padding: .5em;
fill: var(--fg-deemph);
} }
a:hover, a:any-link{ a:hover, a:any-link{
text-decoration: none; text-decoration: none;

View File

@@ -11,18 +11,20 @@
<header> <header>
<div> <div>
<h1>{{ title }}</h1> <h1>{{ title }}</h1>
<a href="javascript:void(window.open('http://{{ http_host }}/?t=' + encodeURIComponent(window.location.toString())))" title="Als Lesezeichen speichern"><!--TODO fix domain part as variable--> <h2>1 Click Download für Literatur</h2>
<img src="{% static 'bookmark.svg' %}" alt="Bookmarklet" class="header-icon"> </div>
</a>
<a href="https://github.com/eneller/epub2go-web">
<img src="{% static 'github.svg' %}" alt="GitHub" class="header-icon">
</a></div>
<search> <search>
<form onsubmit="submitSearch(event)" class="searchbar"> <form onsubmit="submitSearch(event)" class="searchbar">
<input type="search" id="searchInput" placeholder="Suche nach Titel" minlength="3"> <input type="search" id="searchInput" placeholder="Suche nach Titel" minlength="3">
</form> </form>
</search> </search>
<small>Im Moment finden sich hier {{ book_count }} Bücher. </small> <small>Im Moment finden sich hier {{ book_count }} Bücher. </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>
<a href="https://github.com/eneller/epub2go-web">
<img src="{% static 'github.svg' %}" alt="GitHub" class="header-icon">
</a>
</header> </header>
<main> <main>
<!-- NOTE use dl here?--> <!-- NOTE use dl here?-->

11
uv.lock generated
View File

@@ -201,6 +201,7 @@ dependencies = [
{ name = "celery" }, { name = "celery" },
{ name = "django" }, { name = "django" },
{ name = "epub2go" }, { name = "epub2go" },
{ name = "python-dotenv" },
{ name = "pywatchman" }, { name = "pywatchman" },
] ]
@@ -209,6 +210,7 @@ requires-dist = [
{ name = "celery", specifier = ">=5.4.0" }, { name = "celery", specifier = ">=5.4.0" },
{ name = "django", specifier = ">=5.1.6" }, { name = "django", specifier = ">=5.1.6" },
{ name = "epub2go", git = "https://github.com/eneller/epub2go.py" }, { name = "epub2go", git = "https://github.com/eneller/epub2go.py" },
{ name = "python-dotenv", specifier = ">=1.0.1" },
{ name = "pywatchman", specifier = ">=2.0.0" }, { name = "pywatchman", specifier = ">=2.0.0" },
] ]
@@ -268,6 +270,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892 }, { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892 },
] ]
[[package]]
name = "python-dotenv"
version = "1.0.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/bc/57/e84d88dfe0aec03b7a2d4327012c1627ab5f03652216c63d49846d7a6c58/python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca", size = 39115 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/6a/3e/b68c118422ec867fa7ab88444e1274aa40681c606d59ac27de5a5588f082/python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a", size = 19863 },
]
[[package]] [[package]]
name = "pywatchman" name = "pywatchman"
version = "2.0.0" version = "2.0.0"