Merge pull request #18 from dod-ccpo/move_test_data_into_backend
Move test data into backend
This commit is contained in:
commit
123d6ef3aa
@ -1,5 +1,6 @@
|
|||||||
import tornado.web
|
import tornado.web
|
||||||
from atst.handlers.main import MainHandler
|
from atst.handlers.main import MainHandler
|
||||||
|
from atst.handlers.workspace import Workspace
|
||||||
from atst.handlers.request import Request
|
from atst.handlers.request import Request
|
||||||
from atst.handlers.request_new import RequestNew
|
from atst.handlers.request_new import RequestNew
|
||||||
from atst.home import home
|
from atst.home import home
|
||||||
@ -9,7 +10,7 @@ def make_app(**kwargs):
|
|||||||
app = tornado.web.Application([
|
app = tornado.web.Application([
|
||||||
url( r"/", MainHandler, {'page': 'login'}, name='login' ),
|
url( r"/", MainHandler, {'page': 'login'}, name='login' ),
|
||||||
url( r"/home", MainHandler, {'page': 'home'}, name='home' ),
|
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", Request, {'page': 'requests'}, name='requests' ),
|
||||||
url( r"/requests/new", RequestNew, {'page': 'requests_new'}, name='request_new' ),
|
url( r"/requests/new", RequestNew, {'page': 'requests_new'}, name='request_new' ),
|
||||||
url( r"/requests/new/([0-9])", RequestNew, {'page': 'requests_new'}, name='request_form' ),
|
url( r"/requests/new/([0-9])", RequestNew, {'page': 'requests_new'}, name='request_form' ),
|
||||||
|
@ -1,8 +1,35 @@
|
|||||||
from atst.handler import BaseHandler
|
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):
|
class Request(BaseHandler):
|
||||||
def initialize(self, page):
|
def initialize(self, page):
|
||||||
self.page = page
|
self.page = page
|
||||||
|
|
||||||
def get(self):
|
def get(self):
|
||||||
self.render('requests.html.to', page = self.page)
|
self.render('requests.html.to', page = self.page, requests = mock_requests )
|
||||||
|
19
atst/handlers/workspace.py
Normal file
19
atst/handlers/workspace.py
Normal file
@ -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 )
|
@ -18,30 +18,17 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
{% for r in requests %}
|
||||||
<th scope="row"><a href="#">#36552612</a> <span class="usa-label">New</span></th>
|
<tr>
|
||||||
<td>5/17/2018</td>
|
<th scope="row"><a href="#">#{{ r['order_id'] }}</a>
|
||||||
<td>Friedrich Straat</td>
|
{% if r['is_new'] %}<span class="usa-label">New</span></th>{% end %}
|
||||||
<td>2</td>
|
<td>{{ r['date'] }}</td>
|
||||||
<td>Pending</td>
|
<td>{{ r['full_name'] }}</td>
|
||||||
|
<td>{{ r['app_count'] }}</td>
|
||||||
|
<td>{{ r['status'] }}</td>
|
||||||
<td><a href="">Download</a></td>
|
<td><a href="">Download</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
{% end %}
|
||||||
<th scope="row"><a href="">#87362910</a></th>
|
|
||||||
<td>10/2/2017</td>
|
|
||||||
<td>Pietro Quirinis</td>
|
|
||||||
<td>1</td>
|
|
||||||
<td>Complete</td>
|
|
||||||
<td><a href="">Download</a></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th scope="row"><a href="">#29938172</a></th>
|
|
||||||
<td>1/7/2017</td>
|
|
||||||
<td>Marina Borsetti</td>
|
|
||||||
<td>1</td>
|
|
||||||
<td>Denied</td>
|
|
||||||
<td><a href="">Download</a></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@ -9,22 +9,24 @@
|
|||||||
<table class="usa-table-borderless" width="100%">
|
<table class="usa-table-borderless" width="100%">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col" width="50%">Workplace Name</th>
|
<th scope="col" width="50%">Workspace Name</th>
|
||||||
<th scope="col" width="30%">Workplace Info</th>
|
<th scope="col" width="30%">Workspace Info</th>
|
||||||
<th scope="col" width="20%">Actions</th>
|
<th scope="col" width="20%">Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
{% for w in workspaces %}
|
||||||
|
<tr>
|
||||||
<th scope="row">
|
<th scope="row">
|
||||||
<a href="">Unclassified IaaS and PaaS for Defense Digital Service (DDS)</a><br>
|
<a href="">{{ w['name'] }}</a><br>
|
||||||
Task Order: #123456
|
Task Order: #{{ w['task_order']['number'] }}
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<span class="usa-label">23</span><br>Users
|
<span class="usa-label">{{ w['user_count'] }}</span><br>Users
|
||||||
</td>
|
</td>
|
||||||
<td><button class="usa-button-secondary">Launch</button></td>
|
<td><button class="usa-button-secondary">Launch</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{% end %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user