From 0c6580f323cc2a9225d13d7e04c1bf336a8dbf55 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Wed, 24 Jan 2018 20:55:29 +0200 Subject: [PATCH] some styling --- code/static/css/styles.css | 53 ++++++ code/static/js/tablesort.js | 320 ++++++++++++++++++++++++++++++++++++ code/templates/layout.html | 4 +- code/templates/list.html | 52 +++--- 4 files changed, 407 insertions(+), 22 deletions(-) create mode 100755 code/static/css/styles.css create mode 100755 code/static/js/tablesort.js diff --git a/code/static/css/styles.css b/code/static/css/styles.css new file mode 100755 index 0000000..8017ff4 --- /dev/null +++ b/code/static/css/styles.css @@ -0,0 +1,53 @@ +html{ + min-height: 100%; + position: relative; +} + +body{ + color: slategray; + background-color: ghostwhite; + min-height: 600px; + font: 14px/1.3 'Segoe UI',Arial, sans-serif; +} + +a:visited { + color: darkslategray; +} +a:link { + color: slategray; +} + + + +/* list view */ + +.clear { + clear: both; +} + +#list_title { + float:left; + margin-left: 5em; +} + +#list_menu { + float:right; + padding: 8px; + border: 4px solid lightslategray; + background-color: #f3f3fb; +} +#list_table { + border-collapse: collapse; +} +td { + min-width: 10em; + padding: 0px; +} +tr:nth-child(even) { + background: #f3f3fb +} + + +.td_right { + text-align: right; +} diff --git a/code/static/js/tablesort.js b/code/static/js/tablesort.js new file mode 100755 index 0000000..bf95908 --- /dev/null +++ b/code/static/js/tablesort.js @@ -0,0 +1,320 @@ +/* +Table sorting script by Joost de Valk, check it out at http://www.joostdevalk.nl/code/sortable-table/. +Based on a script from http://www.kryogenix.org/code/browser/sorttable/. +Distributed under the MIT license: http://www.kryogenix.org/code/browser/licence.html . +Edited, removed image support and a tags from headers, Ville Rantanen 2015 + +Copyright (c) 1997-2007 Stuart Langridge, Joost de Valk. + +Version 1.5.7 +*/ + +/* You can change these values */ +var europeandate = true; +var alternate_row_colors = false; + +/* Don't change anything below this unless you know what you're doing */ +addEvent(window, "load", sortables_init); + +var SORT_COLUMN_INDEX; +var thead = false; + +function sortables_init() { + // Find all tables with class sortable and make them sortable + if (!document.getElementsByTagName) return; + tbls = document.getElementsByTagName("table"); + for (ti=0;ti 0) { + if (t.tHead && t.tHead.rows.length > 0) { + var firstRow = t.tHead.rows[t.tHead.rows.length-1]; + thead = true; + } else { + var firstRow = t.rows[0]; + } + } + if (!firstRow) return; + + // We have a first row: assume it's the header, and make its contents clickable links + for (var i=0;i'+txt+'  ↕'; + } + } + if (alternate_row_colors) { + alternate(t); + } +} + +function ts_getInnerText(el) { + if (typeof el == "string") return el; + if (typeof el == "undefined") { return el }; + if (el.innerText) return el.innerText; //Not needed but it is faster + var str = ""; + + var cs = el.childNodes; + var l = cs.length; + for (var i = 0; i < l; i++) { + switch (cs[i].nodeType) { + case 1: //ELEMENT_NODE + str += ts_getInnerText(cs[i]); + break; + case 3: //TEXT_NODE + str += cs[i].nodeValue; + break; + } + } + return str; +} + +function ts_resortTable(lnk, clid) { + var span; + for (var ci=0;ci Flees - - + +
diff --git a/code/templates/list.html b/code/templates/list.html index 950753f..203654d 100644 --- a/code/templates/list.html +++ b/code/templates/list.html @@ -1,41 +1,53 @@ {% extends "layout.html" %} {% block body %} -

{{ name }}

+

{{ name }}

+
{% if upload %} - + upload -
- -

- -

+
+
+ + + +
+
{% else %} - Grayed out + upload +
+ + +
{% endif %} -
+
{% if public %} - Share is public + Share is public {% else %} Share is private {% endif %} -
+
+
{% if expire %} Share expires {{ expire }} {% else %} Share never expires {% endif %} -
- - - - + + +
+
name - size - mtime -
+ + + + + {% for entry in entries %} {% endfor %} +
Name + Size + Mod.Time +
{{ entry.name }} - {{ entry.size|safe }} + {{ entry.size|safe }} {{ entry.mtime|safe }} +
{% endblock %}