From e32cda84c670957dc887c627435882c377a48a55 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 15 Nov 2016 01:19:51 -0500 Subject: icons --- .gitmodules | 3 +++ got/view_tree.got | 4 ++-- static/errline.png | Bin 0 -> 148 bytes static/octicons | 1 + static/style.css | 35 +++++++++++++++++++++++++++++++++-- 5 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 static/errline.png create mode 160000 static/octicons diff --git a/.gitmodules b/.gitmodules index fea77d9..c11e884 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "static/codemirror"] path = static/codemirror url = https://github.com/codemirror/CodeMirror +[submodule "static/octicons"] + path = static/octicons + url = https://github.com/primer/octicons diff --git a/got/view_tree.got b/got/view_tree.got index 09f564b..3b0b9eb 100644 --- a/got/view_tree.got +++ b/got/view_tree.got @@ -2,14 +2,14 @@

Index of {{.path | html}}

{{if ne .path "/"}} - + {{end}} {{range $name, $file := .files}} - + diff --git a/static/errline.png b/static/errline.png new file mode 100644 index 0000000..e2db09f Binary files /dev/null and b/static/errline.png differ diff --git a/static/octicons b/static/octicons new file mode 160000 index 0000000..720fb69 --- /dev/null +++ b/static/octicons @@ -0,0 +1 @@ +Subproject commit 720fb694000e7ecc378e94299f0ee5287418f9c4 diff --git a/static/style.css b/static/style.css index 2ce7fa8..2e1db2a 100644 --- a/static/style.css +++ b/static/style.css @@ -1,12 +1,41 @@ * { box-sizing: border-box; } + +/* tree */ body > table { width: 100%; } body > table tr > td:nth-child(3) { text-align: right; } +body > table tr:hover { + box-shadow: inset 0 0 0 1px #bcd; +} + +/* Make room for 4 16x16 icon on the left, with 5px padding on either + * side */ +body > table tr td:first-of-type { + padding-left: 24px; + background-size: 14px 16px; + background-repeat: no-repeat; + background-position: 5px 5px; + margin-left: 20px; +} +body > table tr.tree td:first-of-type { + background-image: url("/static/octicons/lib/svg/file-directory.svg"); +} +body > table tr.tree.parent td:first-of-type { + background-image: url("/static/octicons/lib/svg/arrow-up.svg"); +} +body > table tr.blob td:first-of-type { + background-image: url("/static/octicons/lib/svg/file.svg"); +} +body > table tr.commit td:first-of-type { + background-image: url("/static/octicons/lib/svg/file-submodule.svg"); +} + +/* blob */ body > form { display: block; border: solid 1px black; @@ -35,6 +64,7 @@ input[type=file] { border-radius: 4px; } +/* misc */ kbd, code, samp, tt, pre { background: #DDDDFF; white-space: pre; @@ -54,17 +84,18 @@ aside { opacity: 0.7; } +/* CodeMirror */ .CodeMirror { /* match Firefox's built-in style for textearea */ border: 1px solid rgb(232, 232, 231); } .CodeMirror .cm-trailingspace { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAYAAAB/qH1jAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QUXCToH00Y1UgAAACFJREFUCNdjPMDBUc/AwNDAAAFMTAwMDA0OP34wQgX/AQBYgwYEx4f9lQAAAABJRU5ErkJggg==); + background-image: url("errline.png"); background-position: bottom left; background-repeat: repeat-x; } .CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word) { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAYAAAB/qH1jAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QUXCToH00Y1UgAAACFJREFUCNdjPMDBUc/AwNDAAAFMTAwMDA0OP34wQgX/AQBYgwYEx4f9lQAAAABJRU5ErkJggg==) !important; + background-image: url("errline.png"); background-position: bottom left !important; background-repeat: repeat-x !important; background-color: transparent !important; -- cgit v1.2.3
parent directory tree -
{{$name | html}} {{$file.Type | html}} {{if lt $file.Size 0}}-{{else}}{{$file.Size | html}}{{end}}