nicer web page for mobiles

This commit is contained in:
Ville Rantanen
2021-06-10 09:46:00 +03:00
parent 425229b39d
commit 0e64f3d5fb

View File

@@ -271,7 +271,7 @@ def get_filelink(path, fname, images=False, media=False):
if media and is_videofile(fname): if media and is_videofile(fname):
fname_str = get_videostr(fname) fname_str = get_videostr(fname)
return ( return (
'<tr><td><a class="link_file" href="%s">%s</a><td class="right">%s</td><td class="right bytes">%s</td><td class="right">%s</td></tr>\n' '<tr class="row_file"><td><a class="link_file" href="%s">&nbsp;&nbsp;%s</a><td class="right">%s</td><td class="right bytes">%s</td><td class="right">%s</td></tr>\n'
% (urllib.parse.quote(fname), fname_str, fsstr, fsstrb, fdstr) % (urllib.parse.quote(fname), fname_str, fsstr, fsstrb, fdstr)
) )
@@ -307,7 +307,7 @@ def get_pathlink(path, dname):
fdate = time.localtime(os.path.getmtime(os.path.join(path, dname))) fdate = time.localtime(os.path.getmtime(os.path.join(path, dname)))
fdstr = time.strftime("%Y/%m/%d %H:%M:%S", fdate) fdstr = time.strftime("%Y/%m/%d %H:%M:%S", fdate)
return ( return (
'<tr><td><a class="link_dir" href="%s">&#8627;&nbsp;%s/</a><td class="right">[DIR]</td><td class="right bytes">0</td><td class="right">%s</td></tr>\n' '<tr class="row_dir"><td><a class="link_dir" href="%s">&#8627;&nbsp;%s/</a><td class="right">[DIR]</td><td class="right bytes">0</td><td class="right">%s</td></tr>\n'
% (urllib.parse.quote(dname), dname, fdstr) % (urllib.parse.quote(dname), dname, fdstr)
) )
@@ -455,20 +455,22 @@ def get_header(opts):
body { body {
color: #222; color: #222;
font: 14px monospace; font: 14px monospace;
padding: 20px; padding: 0;
background: #CCC; background: #CCC;
} }
h1 { h1 {
text-align: center;
padding: 20px 0 12px 0; padding: 20px 0 12px 0;
margin: 0; margin: 0 0 0 70px;
font-family: sans-serif; font-family: sans-serif;
} }
.container { .container {
margin: 20px;
box-shadow: 0 5px 10px -5px rgba(0,0,0,0.5); box-shadow: 0 5px 10px -5px rgba(0,0,0,0.5);
position: relative; position: relative;
background: #eee; background: #eee;
border-top-left-radius: 6em; border-top-left-radius: 70px;
display: inline-block;
min-width: calc(100% - 40px);
} }
table { table {
background-color: #F3F3F3; background-color: #F3F3F3;
@@ -494,6 +496,9 @@ def get_header(opts):
display: block; display: block;
padding: 5px 10px; padding: 5px 10px;
} }
td a.link_dir {
font-weight: bold;
}
th a { th a {
padding-left: 0 padding-left: 0
} }
@@ -504,10 +509,13 @@ def get_header(opts):
padding-left: 5px; padding-left: 5px;
} }
tr:nth-of-type(odd) { tr:nth-of-type(odd) {
background-color: #DDD; background-color: #e1e1e1;
} }
tr:hover td { tr.row_dir:hover td {
background-color:#BBB; background-color: #fbe6b3;
}
tr.row_file:hover td {
background-color: #f9cba2;
} }
tr:hover td a { tr:hover td a {
color: #222; color: #222;