Move mock data into server

This commit is contained in:
Brian Duggan 2018-05-31 10:51:23 -04:00
parent 309f689ebd
commit 2732ccfb12
2 changed files with 38 additions and 24 deletions

View File

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

View File

@ -18,30 +18,17 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for r in requests %}
<tr> <tr>
<th scope="row"><a href="#">#36552612</a> <span class="usa-label">New</span></th> <th scope="row"><a href="#">#{{ r['order_id'] }}</a>
<td>5/17/2018</td> {% if r['is_new'] %}<span class="usa-label">New</span></th>{% end %}
<td>Friedrich Straat</td> <td>{{ r['date'] }}</td>
<td>2</td> <td>{{ r['full_name'] }}</td>
<td>Pending</td> <td>{{ r['app_count'] }}</td>
<td><a href="">Download</a></td> <td>{{ r['status'] }}</td>
</tr>
<tr>
<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> <td><a href="">Download</a></td>
</tr> </tr>
{% end %}
</tbody> </tbody>
</table> </table>