From 8875a75fc28d6062c7c9623d5ef2697ff93a90ec Mon Sep 17 00:00:00 2001 From: Andrew Croce Date: Fri, 20 Jul 2018 08:23:01 -0400 Subject: [PATCH] Add UI Method to check if the current URL path matches a link href --- atst/app.py | 2 ++ atst/ui_methods.py | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 atst/ui_methods.py diff --git a/atst/app.py b/atst/app.py index 07f40411..625e2a74 100644 --- a/atst/app.py +++ b/atst/app.py @@ -16,6 +16,7 @@ from atst.home import home from atst.api_client import ApiClient from atst.sessions import RedisSessions from atst import ui_modules +from atst import ui_methods ENV = os.getenv("TORNADO_ENV", "dev") @@ -101,6 +102,7 @@ def make_app(config, deps, **kwargs): cookie_secret=config["default"]["COOKIE_SECRET"], debug=config["default"].getboolean("DEBUG"), ui_modules=ui_modules, + ui_methods=ui_methods, **kwargs, ) app.config = config diff --git a/atst/ui_methods.py b/atst/ui_methods.py new file mode 100644 index 00000000..d5c5bf78 --- /dev/null +++ b/atst/ui_methods.py @@ -0,0 +1,2 @@ +def matchesPath(self, href): + return self.request.uri.startswith(href)