diff --git a/copyparty/httpconn.py b/copyparty/httpconn.py index bc56e8d9..0f8c5dcd 100644 --- a/copyparty/httpconn.py +++ b/copyparty/httpconn.py @@ -28,13 +28,11 @@ class HttpConn(object): self.log_func = log_func self.log_src = "{} \033[36m{}".format(addr[0], addr[1]).ljust(26) - self.tpl_mounts = self.load_tpl("splash.html") - self.tpl_browser = self.load_tpl("browser.html") - self.tpl_msg = self.load_tpl("msg.html") - - def load_tpl(self, fn): - with open(self.respath(fn), "rb") as f: - return jinja2.Template(f.read().decode("utf-8")) + env = jinja2.Environment() + env.loader = jinja2.FileSystemLoader(os.path.join(E.mod, "web")) + self.tpl_mounts = env.get_template("splash.html") + self.tpl_browser = env.get_template("browser.html") + self.tpl_msg = env.get_template("msg.html") def respath(self, res_name): return os.path.join(E.mod, "web", res_name) diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index ff34ee5e..7a2e7381 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -54,51 +54,51 @@ a { color: #fff; background: #161616; } -thead a { +#files thead a { color: #999; font-weight: normal; } -tr:hover { +#files tr:hover { background: #1c1c1c; } -thead th { +#files thead th { padding: .5em 1.3em .3em 1.3em; } -thead th:last-child { +#files thead th:last-child { background: #444; border-radius: .7em 0 0 0; } -thead th:first-child { +#files thead th:first-child { background: #222; } -tbody, -thead th:nth-child(2) { +#files tbody, +#files thead th:nth-child(2) { background: #222; border-radius: 0 .7em 0 0; } -td { +#files td { margin: 0; padding: 0 .5em; } -tbody td:nth-child(3) { +#files tbody td:nth-child(3) { font-family: monospace; font-size: 1.3em; text-align: right; padding-right: 1em; white-space: nowrap; } -tbody td:first-child { +#files tbody td:first-child { padding-left: 1.5em; color: #888; } -tbody tr:first-child td { +#files tbody tr:first-child td { padding-top: .9em; } -tbody tr:last-child td { +#files tbody tr:last-child td { padding-bottom: 1.3em; border-bottom: .5em solid #444; } -thead th[style] { +#files thead th[style] { width: auto !important; } #path a { @@ -255,13 +255,3 @@ a.play.act { width: calc(100% - 10.5em); background: rgba(0,0,0,0.2); } -#bup { - padding: .5em .5em .5em .3em; - background: #2d2d2d; - border-radius: 0 0 1em 0; - border-right: .3em solid #3a3a3a; - max-width: 40em; -} -#bup input { - margin: .5em; -} diff --git a/copyparty/web/browser.html b/copyparty/web/browser.html index f7dfda68..b76aa10a 100644 --- a/copyparty/web/browser.html +++ b/copyparty/web/browser.html @@ -7,17 +7,14 @@ + {%- if can_upload %} + + {%- endif %}
{%- if can_upload %} -