diff --git a/atst/app.py b/atst/app.py index 2cba648c..d5ae8215 100644 --- a/atst/app.py +++ b/atst/app.py @@ -1,5 +1,6 @@ import tornado.web from atst.handlers.main import MainHandler +from atst.handlers.workspace import Workspace from atst.handlers.request import Request from atst.handlers.request_new import RequestNew from atst.home import home @@ -9,7 +10,7 @@ def make_app(**kwargs): app = tornado.web.Application([ url( r"/", MainHandler, {'page': 'login'}, name='login' ), url( r"/home", MainHandler, {'page': 'home'}, name='home' ), - url( r"/workspaces", MainHandler, {'page': 'workspaces'}, name='workspaces' ), + url( r"/workspaces", Workspace, {'page': 'workspaces'}, name='workspaces' ), url( r"/requests", Request, {'page': 'requests'}, name='requests' ), url( r"/requests/new", RequestNew, {'page': 'requests_new'}, name='request_new' ), url( r"/requests/new/([0-9])", RequestNew, {'page': 'requests_new'}, name='request_form' ), diff --git a/atst/handlers/request.py b/atst/handlers/request.py index b3a99f14..3ec27477 100644 --- a/atst/handlers/request.py +++ b/atst/handlers/request.py @@ -1,8 +1,35 @@ from atst.handler import BaseHandler +mock_requests = [ + { + 'order_id' : 36552612, + 'date' : '5/17/2018', + 'is_new' : True, + 'full_name' : 'Friedrich Straat', + 'app_count' : 2, + 'status' : 'Pending' + }, + { + 'order_id' : 87362910, + 'date' : '10/2/2017', + 'is_new' : False, + 'full_name' : 'Pietro Quirinis', + 'app_count' : 1, + 'status' : 'Complete' + }, + { + 'order_id' : 29938172, + 'date' : '1/7/2017', + 'is_new' : False, + 'full_name' : 'Marina Borsetti', + 'app_count' : 1, + 'status' : 'Denied' + }, + ] + class Request(BaseHandler): def initialize(self, page): self.page = page def get(self): - self.render('requests.html.to', page = self.page) \ No newline at end of file + self.render('requests.html.to', page = self.page, requests = mock_requests ) diff --git a/atst/handlers/workspace.py b/atst/handlers/workspace.py new file mode 100644 index 00000000..ceb5587b --- /dev/null +++ b/atst/handlers/workspace.py @@ -0,0 +1,19 @@ +from atst.handler import BaseHandler + +mock_workspaces = [ + { + 'name' : 'Unclassified IaaS and PaaS for Defense Digital Service (DDS)', + 'task_order' : { + 'number' : 123456, + }, + 'user_count' : 23, + } + ] + +class Workspace(BaseHandler): + + def initialize(self, page): + self.page = page + + def get(self): + self.render( 'workspaces.html.to', page = self.page, workspaces = mock_workspaces ) diff --git a/templates/requests.html.to b/templates/requests.html.to index 0ba0eecd..6fb11d8c 100644 --- a/templates/requests.html.to +++ b/templates/requests.html.to @@ -18,30 +18,17 @@ - - #36552612 New - 5/17/2018 - Friedrich Straat - 2 - Pending + {% for r in requests %} + + #{{ r['order_id'] }} + {% if r['is_new'] %}New{% end %} + {{ r['date'] }} + {{ r['full_name'] }} + {{ r['app_count'] }} + {{ r['status'] }} Download - - - #87362910 - 10/2/2017 - Pietro Quirinis - 1 - Complete - Download - - - #29938172 - 1/7/2017 - Marina Borsetti - 1 - Denied - Download - + + {% end %} diff --git a/templates/workspaces.html.to b/templates/workspaces.html.to index c6f4dbd0..17167397 100644 --- a/templates/workspaces.html.to +++ b/templates/workspaces.html.to @@ -9,22 +9,24 @@ - - + + - + {% for w in workspaces %} + + {% end %}
Workplace NameWorkplace InfoWorkspace NameWorkspace Info Actions
- Unclassified IaaS and PaaS for Defense Digital Service (DDS)
- Task Order: #123456 + {{ w['name'] }}
+ Task Order: #{{ w['task_order']['number'] }}
- 23
Users + {{ w['user_count'] }}
Users