From 370794a7410e87c952cbfb50f13e3fd106736e1e Mon Sep 17 00:00:00 2001 From: answerquest Date: Sat, 14 Apr 2018 09:39:58 +0530 Subject: [PATCH] v1.2.0 shapes bugfix --- README.md | 2 +- js/commonstyle.css | 60 +++++++++++++++++++++++++++++++++++++++++++++- web_wrapper.py | 6 +++-- 3 files changed, 64 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c46facd..805e6bc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # static-GTFS-manager A browser-based user interface for creating, editing, exporting of static GTFS (General Transit Feed Specification Reference) feeds for a public transit authority. -**Development Status** : V 1.1.0 is ready, open for Beta Testing. +**Development Status** : V 1.2.0 is ready, open for Beta Testing. This project is the result of a collaboration between WRI ([World Resources Institute](http://wri-india.org/)) and KMRL ([Kochi Metro Rail Limited](http://kochimetro.org)). diff --git a/js/commonstyle.css b/js/commonstyle.css index 09be6d1..b41f5c3 100644 --- a/js/commonstyle.css +++ b/js/commonstyle.css @@ -163,4 +163,62 @@ a.btn:hover { text-decoration: none; cursor: pointer; } -/* ####################################*/ \ No newline at end of file +/* ####################################*/ + +/* https://www.bootply.com/112999 custom colors to add to bootstrap options */ +/* apple colors */ +[class*='-dark'] { + background-color:#02243C; + color:#f0f0f0; +} +/* +[class*='-light'] { + background-color:#f9f9f9; + color:#999; +} +*/ +[class*='-blue'] { + background-color:#5195ce; + color:#fff; +} +[class*='-apple'] { + background-color:#005DB3; + color:#f8f8f8; +} +[class*='-gray'] { + background-color:#e6e6e6; + color:#666; +} +[class*='-green'] { + background-color:#5BC236; + color:#fff; +} + +/* hover and active */ +[class*='-dark']:hover,[class*='-dark']:focus { + background-color:#12254d; + color:#fff; +} +/* +was interfering with well divs on main page. +[class*='-light']:hover,[class*='-light']:active { + background-color:#eeeeee; + color:#fff; +} +*/ +[class*='-blue']:hover,[class*='-blue']:active { + background-color:#62a6df; + color:#fff; +} +[class*='-apple']:hover,[class*='-apple']:active { + background-color:#116ec4; + color:#fff; +} +[class*='-gray']:hover,[class*='-gray']:active { + background-color:#d5d5d5; + color:#fff; +} +[class*='-green']:hover,[class*='-green']:active { + background-color:#6cd347; + color:#fff; +} diff --git a/web_wrapper.py b/web_wrapper.py index 68fe549..43a1052 100644 --- a/web_wrapper.py +++ b/web_wrapper.py @@ -895,9 +895,11 @@ def get(self): shapeArray = readTableDB(dbfile, 'shapes', key='shape_id', value=shape_id) - returnJson = shapeArray + # need to sort this array before returning it. See https://github.com/WRI-Cities/static-GTFS-manager/issues/22 + sortedShapeArray = sorted(shapeArray, key=lambda k: k['shape_pt_sequence']) + # from https://stackoverflow.com/a/73050/4355695 - self.write(json.dumps(returnJson)) + self.write(json.dumps(sortedShapeArray)) # time check, from https://stackoverflow.com/a/24878413/4355695 end = time.time() print("shape GET call took {} seconds.".format(round(end-start,2)))