add logo and some design improvements

Former-commit-id: 916036cffb778b05ff84d480a9da8efc009f10b2 [formerly 8de4733a98a66e0eb5a9ddd1d1a53386ff530e84] [formerly 5c61518b266a64e96e94849149474872a24140e6 [formerly 4a7a7e6cf4]]
Former-commit-id: fd9c83b3a4cbbacb94e52880eb5239068793e1d3 [formerly ea245824e0def3fe308a6c6abe38cc4b60844849]
Former-commit-id: 0072b82addcaa2b103cca604b34bda0913be6c43
pull/726/head
Henrique Dias 2017-06-26 21:09:03 +01:00
parent c67cb0cbfa
commit 08df67a48e
3 changed files with 29 additions and 31 deletions

View File

@ -347,11 +347,6 @@ header a:hover {
color: inherit;
}
header p i {
font-size: 1em !important;
color: rgba(255, 255, 255, .31);
}
header>div {
display: flex;
width: 100%;
@ -359,17 +354,6 @@ header>div {
align-items: center;
}
header p {
display: inline-block;
margin: 0;
vertical-align: middle;
}
header p a,
header p a:hover {
color: inherit;
}
header .action span {
display: none;
}
@ -432,11 +416,10 @@ main {
height: 4em;
}
#top-bar>div:nth-child(1) {
#top-bar svg {
height: 2.5em;
margin-right: 1em;
font-weight: 500;
font-size: 1.5em;
line-height: 2;
vertical-align: middle;
}
@ -575,9 +558,7 @@ main {
* * * * * * * * * * * * * * * */
#bottom-bar {
background-color: #fafafa;
border-top: 1px solid rgba(0, 0, 0, 0.075);
/* border-bottom: 1px solid rgba(0, 0, 0, 0.075); */
height: 3.8em;
}
@ -1161,9 +1142,6 @@ footer a:hover {
.mobile-only {
display: inherit !important;
}
#top-bar>div:nth-child(1) {
display: none;
}
#bottom-bar>*:first-child {
max-width: calc(100% - 16em) !important;
}

View File

@ -12,12 +12,23 @@
<style>{{ CSS .User.StyleSheet }}</style>
{{- end -}}
<script>
var data = {
user: JSON.parse('{{ Marshal .User }}'),
webdavURL: "{{ .WebDavURL }}",
baseURL: "{{.BaseURL}}",
prefixURL:"{{ .PrefixURL }}"
}
</script>
<!-- TODO: remove this one after moving the JS to ^^ -->
<script>
var user = JSON.parse('{{ Marshal .User }}'),
webdavURL = "{{ .WebDavURL }}",
baseURL = "{{.BaseURL}}",
prefixURL = "{{ .PrefixURL }}";
</script>
<script src="{{ .BaseURL }}/_internal/js/common.js" defer></script>
{{- if .IsDir }}
<script src="{{ .BaseURL }}/_internal/js/listing.js" defer></script>
@ -30,7 +41,11 @@
<body>
<header>
<div id="top-bar">
<div><p>File Manager</p></div>
<svg id="content" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 144 144">
<circle cx="72" cy="72" r="72" fill="#2979ff"/>
<circle cx="72" cy="72" r="48" fill="#40c4ff"/>
<circle cx="72" cy="72" r="24" fill="#fff"/>
</svg>
<div id="search">
<i class="material-icons" title="Search">search</i>
<input type="text" aria-label="Write here to search" placeholder="Search or execute a command...">
@ -40,9 +55,7 @@
</div>
</div>
<div class="action" id="logout" tabindex="0" role="button" aria-label="Log out">
<i class="material-icons" title="Logout">exit_to_app</i>
</div>
</div>
<div id="bottom-bar">
@ -85,10 +98,14 @@
</div>
<nav id="sidebar">
<a class="action" href="{{ .BaseURL }}">
<a class="action" href="{{ .BaseURL }}/">
<i class="material-icons">folder</i>
<span>My Files</span>
</a>
<div class="action" id="logout" tabindex="0" role="button" aria-label="Log out">
<i class="material-icons" title="Logout">exit_to_app</i>
<span>Logout</span>
</div>
</nav>
<main>
@ -107,6 +124,6 @@
{{ template "templates" . }}
<footer>Served with <a rel="noopener noreferrer" href="https://caddyserver.com">Caddy</a> and <a rel="noopener noreferrer" href="https://github.com/hacdias/caddy-filemanager">File Manager</a>.</footer>
<footer>Served with <a rel="noopener noreferrer" href="https://github.com/hacdias/caddy-filemanager">File Manager</a>.</footer>
</body>
</html>

View File

@ -95,6 +95,9 @@ func (m *FileManager) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, er
code, err = download(w, r, f)
case !f.IsDir && r.URL.Query().Get("checksum") != "":
code, err = checksum(w, r, f)
case r.URL.Query().Get("raw") == "true" && !f.IsDir:
http.ServeFile(w, r, f.Path)
code, err = 0, nil
case f.IsDir:
code, err = serveListing(w, r, m, u, f)
default: