diff options
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | got/view_tree.got | 4 | ||||
-rw-r--r-- | static/errline.png | bin | 0 -> 148 bytes | |||
m--------- | static/octicons | 0 | ||||
-rw-r--r-- | static/style.css | 35 |
5 files changed, 38 insertions, 4 deletions
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 @@ <h1>Index of {{.path | html}}</h1> <table> {{if ne .path "/"}} - <tr> + <tr class="tree parent"> <td><a href="..">parent directory</a></td> <td>tree</td> <td>-</td> </tr> {{end}} {{range $name, $file := .files}} - <tr> + <tr class="{{$file.Type}}"> <td><a href="{{$name | html}}">{{$name | html}}</a></td> <td>{{$file.Type | html}}</td> <td>{{if lt $file.Size 0}}-{{else}}{{$file.Size | html}}{{end}}</td> diff --git a/static/errline.png b/static/errline.png Binary files differnew file mode 100644 index 0000000..e2db09f --- /dev/null +++ b/static/errline.png diff --git a/static/octicons b/static/octicons new file mode 160000 +Subproject 720fb694000e7ecc378e94299f0ee5287418f9c 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; |