add stub implementation for workspace members

This commit is contained in:
dandds 2018-07-26 13:48:07 -04:00
parent c594d88804
commit 5f7b37d0f8
4 changed files with 72 additions and 4 deletions

View File

@ -9,6 +9,7 @@ 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.workspace_members import WorkspaceMembers
from atst.handlers.request import Request
from atst.handlers.request_financial_verification import RequestFinancialVerification
from atst.handlers.request_new import RequestNew
@ -112,6 +113,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+)/members", WorkspaceMembers, {}, name="workspace_members"),
url(r"/workspaces/(\S+)", Workspace, {}, name="workspace"),
]

View File

@ -22,10 +22,7 @@ class Projects(object):
"id": "b1154fdd-31c9-437f-b580-2e4d757de5cb",
"name": "Development",
},
{
"id": "b1e2077a-6a3d-4e7f-a80c-bf1143433adf",
"name": "Sandbox"
},
{"id": "b1e2077a-6a3d-4e7f-a80c-bf1143433adf", "name": "Sandbox"},
{
"id": "8ea95eea-7cc0-4500-adf7-8a13eaa6b752",
"name": "production",
@ -63,5 +60,33 @@ class Members(object):
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

View 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)

View 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 %}