diff --git a/atst/ui_methods.py b/atst/ui_methods.py deleted file mode 100644 index a3ccbbba..00000000 --- a/atst/ui_methods.py +++ /dev/null @@ -1,27 +0,0 @@ -import os -import re - - -def navigationContext(self): - return ( - "workspace" - if re.match("\/workspaces\/[A-Za-z0-9]*", self.request.uri) - else "global" - ) - - -def dev(self): - return os.getenv("FLASK_ENV", "dev") == "dev" - - -def matchesPath(self, href): - return re.match("^" + href, self.request.uri) - - -def modal(self, body): - return self.render_string("components/modal.html.to", body=body) - - -def modalOpen(self): - # For now, just check a dummy URL param - return self.get_argument("modal", False) diff --git a/atst/ui_modules.py b/atst/ui_modules.py deleted file mode 100644 index 9dbeec8e..00000000 --- a/atst/ui_modules.py +++ /dev/null @@ -1,67 +0,0 @@ -import re - - -class Alert(UIModule): - def render(self, title, message=None, actions=None, level="info"): - return self.render_string( - "components/alert.html.to", - title=title, - message=message, - actions=actions, - level=level, - ) - - -class TextInput(UIModule): - def render(self, field, placeholder=""): - return self.render_string( - "components/text_input.html.to", - field=field, - label=re.sub("<[^<]+?>", "", str(field.label)), - errors=field.errors, - placeholder=placeholder, - description=field.description, - ) - - -class OptionsInput(UIModule): - def render(self, field, inline=False): - return self.render_string( - "components/options_input.html.to", - field=field, - label=re.sub("<[^<]+?>", "", str(field.label)), - errors=field.errors, - description=field.description, - inline=inline, - ) - - -class Icon(UIModule): - def render(self, name, classes=""): - with open("static/icons/%s.svg" % name) as svg: - return self.render_string( - "components/icon.html.to", svg=svg.read(), name=name, classes=classes - ) - - -class SidenavItem(UIModule): - def render(self, label, href, active=False, icon=None, subnav=None): - return self.render_string( - "navigation/_sidenav_item.html.to", - label=label, - href=href, - active=active, - icon=icon, - subnav=subnav, - ) - - -class EmptyState(UIModule): - def render(self, message, actionLabel, actionHref, icon=None): - return self.render_string( - "components/empty_state.html.to", - message=message, - actionLabel=actionLabel, - actionHref=actionHref, - icon=icon, - )