diff --git a/atst/app.py b/atst/app.py index bf6eb385..3c2d014b 100644 --- a/atst/app.py +++ b/atst/app.py @@ -7,6 +7,7 @@ from redis import StrictRedis from atst.handlers.main import Main from atst.handlers.root import Root from atst.handlers.login_redirect import LoginRedirect +from atst.handlers.workspaces import Workspaces from atst.handlers.workspace import Workspace from atst.handlers.request import Request from atst.handlers.request_financial_verification import RequestFinancialVerification @@ -46,7 +47,7 @@ def make_app(config, deps, **kwargs): ), url( r"/workspaces", - Workspace, + Workspaces, {"page": "workspaces", "authz_client": deps["authz_client"]}, name="workspaces", ), @@ -111,6 +112,7 @@ def make_app(config, deps, **kwargs): url(r"/users", Main, {"page": "users"}, name="users"), url(r"/reports", Main, {"page": "reports"}, name="reports"), url(r"/calculator", Main, {"page": "calculator"}, name="calculator"), + url(r"/workspaces/(\S+)", Workspace, {}, name="workspace"), ] if not ENV == "production": diff --git a/atst/domain/workspaces.py b/atst/domain/workspaces.py new file mode 100644 index 00000000..3ff3a2ec --- /dev/null +++ b/atst/domain/workspaces.py @@ -0,0 +1,67 @@ +import tornado.gen + + +class Projects(object): + + def __init__(self): + pass + + def create(self, creator_id, body): + pass + + def get(self, project_id): + pass + + def get_many(self, workspace_id): + return [ + { + "id": "187c9bea-9541-45d7-801f-cf8e7a642e93", + "name": "Code.mil", + "environments": [ + { + "id": "b1154fdd-31c9-437f-b580-2e4d757de5cb", + "name": "Development", + }, + { + "id": "b1e2077a-6a3d-4e7f-a80c-bf1143433adf", + "name": "Sandbox" + }, + { + "id": "8ea95eea-7cc0-4500-adf7-8a13eaa6b752", + "name": "production", + }, + ], + }, + { + "id": "ececfd73-b19d-45aa-9199-a950ba2c7269", + "name": "Digital Dojo", + "environments": [ + { + "id": "f56167cb-ca3d-4e29-8b60-91052957a118", + "name": "Development", + }, + { + "id": "7c18689c-5b77-4b68-8d64-d4d8a830bf47", + "name": "production", + }, + ], + }, + ] + + def update(self, request_id, request_delta): + pass + + +class Members(object): + + def __init__(self): + pass + + def create(self, creator_id, body): + pass + + def get(self, request_id): + pass + + def update(self, request_id, request_delta): + pass diff --git a/atst/handlers/workspace.py b/atst/handlers/workspace.py index d6672843..5a1f80ec 100644 --- a/atst/handlers/workspace.py +++ b/atst/handlers/workspace.py @@ -1,22 +1,15 @@ -from atst.handler import BaseHandler import tornado -mock_workspaces = [ - { - "name": "Unclassified IaaS and PaaS for Defense Digital Service (DDS)", - "id": "5966187a-eff9-44c3-aa15-4de7a65ac7ff", - "task_order": {"number": 123456}, - "user_count": 23, - } -] +from atst.handler import BaseHandler +from atst.domain.workspaces import Projects class Workspace(BaseHandler): - def initialize(self, page, authz_client): - self.page = page - self.authz_client = authz_client + def initialize(self): + self.projects_repo = Projects() - @tornado.gen.coroutine @tornado.web.authenticated - def get(self): - self.render("workspaces.html.to", page=self.page, workspaces=mock_workspaces) + @tornado.gen.coroutine + def get(self, workspace_id): + projects = self.projects_repo.get_many(workspace_id) + self.render("workspace.html.to", projects=projects) diff --git a/atst/handlers/workspaces.py b/atst/handlers/workspaces.py new file mode 100644 index 00000000..c7e06451 --- /dev/null +++ b/atst/handlers/workspaces.py @@ -0,0 +1,22 @@ +from atst.handler import BaseHandler +import tornado + +mock_workspaces = [ + { + "name": "Unclassified IaaS and PaaS for Defense Digital Service (DDS)", + "id": "5966187a-eff9-44c3-aa15-4de7a65ac7ff", + "task_order": {"number": 123456}, + "user_count": 23, + } +] + + +class Workspaces(BaseHandler): + def initialize(self, page, authz_client): + self.page = page + self.authz_client = authz_client + + @tornado.gen.coroutine + @tornado.web.authenticated + def get(self): + self.render("workspaces.html.to", page=self.page, workspaces=mock_workspaces) diff --git a/templates/workspace.html.to b/templates/workspace.html.to new file mode 100644 index 00000000..838ddfde --- /dev/null +++ b/templates/workspace.html.to @@ -0,0 +1,26 @@ +{% extends "base.html.to" %} + +{% block content %} + +
+
+ + + + + + + + {% for p in projects %} + + + + {% end %} + +
Name
{{ p['name'] }}
+
+
+ + +{% end %} +