commit
d6a91e5e52
@ -7,7 +7,9 @@ from redis import StrictRedis
|
|||||||
from atst.handlers.main import Main
|
from atst.handlers.main import Main
|
||||||
from atst.handlers.root import Root
|
from atst.handlers.root import Root
|
||||||
from atst.handlers.login_redirect import LoginRedirect
|
from atst.handlers.login_redirect import LoginRedirect
|
||||||
|
from atst.handlers.workspaces import Workspaces
|
||||||
from atst.handlers.workspace import Workspace
|
from atst.handlers.workspace import Workspace
|
||||||
|
from atst.handlers.workspace_members import WorkspaceMembers
|
||||||
from atst.handlers.request import Request
|
from atst.handlers.request import Request
|
||||||
from atst.handlers.request_financial_verification import RequestFinancialVerification
|
from atst.handlers.request_financial_verification import RequestFinancialVerification
|
||||||
from atst.handlers.request_new import RequestNew
|
from atst.handlers.request_new import RequestNew
|
||||||
@ -46,7 +48,7 @@ def make_app(config, deps, **kwargs):
|
|||||||
),
|
),
|
||||||
url(
|
url(
|
||||||
r"/workspaces",
|
r"/workspaces",
|
||||||
Workspace,
|
Workspaces,
|
||||||
{"page": "workspaces", "authz_client": deps["authz_client"]},
|
{"page": "workspaces", "authz_client": deps["authz_client"]},
|
||||||
name="workspaces",
|
name="workspaces",
|
||||||
),
|
),
|
||||||
@ -111,6 +113,8 @@ def make_app(config, deps, **kwargs):
|
|||||||
url(r"/users", Main, {"page": "users"}, name="users"),
|
url(r"/users", Main, {"page": "users"}, name="users"),
|
||||||
url(r"/reports", Main, {"page": "reports"}, name="reports"),
|
url(r"/reports", Main, {"page": "reports"}, name="reports"),
|
||||||
url(r"/calculator", Main, {"page": "calculator"}, name="calculator"),
|
url(r"/calculator", Main, {"page": "calculator"}, name="calculator"),
|
||||||
|
url(r"/workspaces/(\S+)/members", WorkspaceMembers, {}, name="workspace_members"),
|
||||||
|
url(r"/workspaces/(\S+)", Workspace, {}, name="workspace"),
|
||||||
]
|
]
|
||||||
|
|
||||||
if not ENV == "production":
|
if not ENV == "production":
|
||||||
|
92
atst/domain/workspaces.py
Normal file
92
atst/domain/workspaces.py
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
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 get_many(self, workspace_id):
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
"first_name": "Danny",
|
||||||
|
"last_name": "Knight",
|
||||||
|
"email": "dknight@thenavy.mil",
|
||||||
|
"dod_id": "1257892124",
|
||||||
|
"workspace_role": "Developer",
|
||||||
|
"status": "Pending",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"first_name": "Mario",
|
||||||
|
"last_name": "Hudson",
|
||||||
|
"email": "mhudson@thearmy.mil",
|
||||||
|
"dod_id": "4357892125",
|
||||||
|
"workspace_role": "CCPO",
|
||||||
|
"status": "Active",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"first_name": "Louise",
|
||||||
|
"last_name": "Greer",
|
||||||
|
"email": "lgreer@theairforce.mil",
|
||||||
|
"dod_id": "7257892125",
|
||||||
|
"workspace_role": "Admin",
|
||||||
|
"status": "Pending",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
def update(self, request_id, request_delta):
|
||||||
|
pass
|
@ -1,22 +1,15 @@
|
|||||||
from atst.handler import BaseHandler
|
|
||||||
import tornado
|
import tornado
|
||||||
|
|
||||||
mock_workspaces = [
|
from atst.handler import BaseHandler
|
||||||
{
|
from atst.domain.workspaces import Projects
|
||||||
"name": "Unclassified IaaS and PaaS for Defense Digital Service (DDS)",
|
|
||||||
"id": "5966187a-eff9-44c3-aa15-4de7a65ac7ff",
|
|
||||||
"task_order": {"number": 123456},
|
|
||||||
"user_count": 23,
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class Workspace(BaseHandler):
|
class Workspace(BaseHandler):
|
||||||
def initialize(self, page, authz_client):
|
def initialize(self):
|
||||||
self.page = page
|
self.projects_repo = Projects()
|
||||||
self.authz_client = authz_client
|
|
||||||
|
|
||||||
@tornado.gen.coroutine
|
|
||||||
@tornado.web.authenticated
|
@tornado.web.authenticated
|
||||||
def get(self):
|
@tornado.gen.coroutine
|
||||||
self.render("workspaces.html.to", page=self.page, workspaces=mock_workspaces)
|
def get(self, workspace_id):
|
||||||
|
projects = self.projects_repo.get_many(workspace_id)
|
||||||
|
self.render("workspace.html.to", projects=projects)
|
||||||
|
15
atst/handlers/workspace_members.py
Normal file
15
atst/handlers/workspace_members.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import tornado
|
||||||
|
|
||||||
|
from atst.handler import BaseHandler
|
||||||
|
from atst.domain.workspaces import Members
|
||||||
|
|
||||||
|
|
||||||
|
class WorkspaceMembers(BaseHandler):
|
||||||
|
def initialize(self):
|
||||||
|
self.members_repo = Members()
|
||||||
|
|
||||||
|
@tornado.web.authenticated
|
||||||
|
@tornado.gen.coroutine
|
||||||
|
def get(self, workspace_id):
|
||||||
|
members = self.members_repo.get_many(workspace_id)
|
||||||
|
self.render("workspace_members.html.to", members=members)
|
22
atst/handlers/workspaces.py
Normal file
22
atst/handlers/workspaces.py
Normal file
@ -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)
|
26
templates/workspace.html.to
Normal file
26
templates/workspace.html.to
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{% extends "base.html.to" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<div class="panel">
|
||||||
|
<div class='responsive-table-wrapper'>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Name</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for p in projects %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ p['name'] }}</td>
|
||||||
|
</tr>
|
||||||
|
{% end %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{% end %}
|
||||||
|
|
26
templates/workspace_members.html.to
Normal file
26
templates/workspace_members.html.to
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{% extends "base.html.to" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<div class="panel">
|
||||||
|
<div class='responsive-table-wrapper'>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Name</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for m in members %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ m['first_name'] }} {{ m['last_name'] }}</td>
|
||||||
|
</tr>
|
||||||
|
{% end %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{% end %}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user