quickly implement index page / new form distinction for requests
This commit is contained in:
parent
5667aedce4
commit
9d4b618070
@ -1,6 +1,7 @@
|
|||||||
import tornado.web
|
import tornado.web
|
||||||
from atst.handlers.main import MainHandler
|
from atst.handlers.main import MainHandler
|
||||||
from atst.handlers.request import Request
|
from atst.handlers.request import Request
|
||||||
|
from atst.handlers.request_new import RequestNew
|
||||||
from atst.home import home
|
from atst.home import home
|
||||||
from tornado.web import url
|
from tornado.web import url
|
||||||
|
|
||||||
@ -10,8 +11,8 @@ def make_app(**kwargs):
|
|||||||
url( r"/home", MainHandler, {'page': 'home'}, name='home' ),
|
url( r"/home", MainHandler, {'page': 'home'}, name='home' ),
|
||||||
url( r"/accounts", MainHandler, {'page': 'accounts'}, name='accounts' ),
|
url( r"/accounts", MainHandler, {'page': 'accounts'}, name='accounts' ),
|
||||||
url( r"/requests", Request, {'page': 'requests'}, name='requests' ),
|
url( r"/requests", Request, {'page': 'requests'}, name='requests' ),
|
||||||
url( r"/requests/new", Request, {'page': 'requests_new'}, name='request_new' ),
|
url( r"/requests/new", RequestNew, {'page': 'requests_new'}, name='request_new' ),
|
||||||
url( r"/requests/([0-9])", Request, {'page': 'requests'}, name='request_form' ),
|
url( r"/requests/new/([0-9])", RequestNew, {'page': 'requests_new'}, name='request_form' ),
|
||||||
url( r"/users", MainHandler, {'page': 'users'}, name='users' ),
|
url( r"/users", MainHandler, {'page': 'users'}, name='users' ),
|
||||||
url( r"/reports", MainHandler, {'page': 'reports'}, name='reports' ),
|
url( r"/reports", MainHandler, {'page': 'reports'}, name='reports' ),
|
||||||
url( r"/calculator", MainHandler, {'page': 'calculator'}, name='calculator' ),
|
url( r"/calculator", MainHandler, {'page': 'calculator'}, name='calculator' ),
|
||||||
|
@ -1,31 +1,9 @@
|
|||||||
from atst.handler import BaseHandler
|
from atst.handler import BaseHandler
|
||||||
|
|
||||||
class Request(BaseHandler):
|
class Request(BaseHandler):
|
||||||
screens = [
|
|
||||||
{ 'title' : 'Details of Use',
|
|
||||||
'subitems' : [
|
|
||||||
{'title' : 'Application Details',
|
|
||||||
'id' : 'application-details'},
|
|
||||||
{'title' : 'Computation',
|
|
||||||
'id' : 'computation' },
|
|
||||||
{'title' : 'Storage',
|
|
||||||
'id' : 'storage' },
|
|
||||||
{'title' : 'Usage',
|
|
||||||
'id' : 'usage' },
|
|
||||||
]},
|
|
||||||
{ 'title' : 'Organizational Info', },
|
|
||||||
{ 'title' : 'Funding/Contracting', },
|
|
||||||
{ 'title' : 'Readiness Survey', },
|
|
||||||
{ 'title' : 'Review & Submit', }
|
|
||||||
]
|
|
||||||
|
|
||||||
def initialize(self, page):
|
def initialize(self, page):
|
||||||
self.page = page
|
self.page = page
|
||||||
|
|
||||||
def get(self, screen = 1):
|
def get(self):
|
||||||
self.render( 'requests/screen-%d.html.to' % int(screen),
|
self.render('requests.html.to', page = self.page)
|
||||||
page = self.page,
|
|
||||||
screens = self.screens,
|
|
||||||
current = int(screen),
|
|
||||||
next_screen = int(screen) + 1 )
|
|
||||||
|
|
||||||
|
31
atst/handlers/request_new.py
Normal file
31
atst/handlers/request_new.py
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
from atst.handler import BaseHandler
|
||||||
|
|
||||||
|
class RequestNew(BaseHandler):
|
||||||
|
screens = [
|
||||||
|
{ 'title' : 'Details of Use',
|
||||||
|
'subitems' : [
|
||||||
|
{'title' : 'Application Details',
|
||||||
|
'id' : 'application-details'},
|
||||||
|
{'title' : 'Computation',
|
||||||
|
'id' : 'computation' },
|
||||||
|
{'title' : 'Storage',
|
||||||
|
'id' : 'storage' },
|
||||||
|
{'title' : 'Usage',
|
||||||
|
'id' : 'usage' },
|
||||||
|
]},
|
||||||
|
{ 'title' : 'Organizational Info', },
|
||||||
|
{ 'title' : 'Funding/Contracting', },
|
||||||
|
{ 'title' : 'Readiness Survey', },
|
||||||
|
{ 'title' : 'Review & Submit', }
|
||||||
|
]
|
||||||
|
|
||||||
|
def initialize(self, page):
|
||||||
|
self.page = page
|
||||||
|
|
||||||
|
def get(self, screen = 1):
|
||||||
|
self.render( 'requests/screen-%d.html.to' % int(screen),
|
||||||
|
page = self.page,
|
||||||
|
screens = self.screens,
|
||||||
|
current = int(screen),
|
||||||
|
next_screen = int(screen) + 1 )
|
||||||
|
|
@ -49,21 +49,6 @@
|
|||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<a class="href="/requests">‹ All requests</a>
|
<a class="href="/requests">‹ All requests</a>
|
||||||
<h1>New Request</h1>
|
|
||||||
|
|
||||||
|
|
||||||
<aside class="usa-width-one-fourth usa-layout-docs-sidenav">
|
|
||||||
{% include 'requests/sidebar.html.to' %}
|
|
||||||
</aside>
|
|
||||||
<div class="usa-width-three-fourths usa-layout-docs-main_content">
|
|
||||||
|
|
||||||
{% block form %}
|
|
||||||
form goes here
|
|
||||||
{% end %}
|
|
||||||
{% block next %}
|
|
||||||
<a class='usa-button usa-button-primary' href='{{ reverse_url('request_form',next_screen) }}'>Save & Continue</a>
|
|
||||||
{% end %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{% extends '../requests.html.to' %}
|
{% extends '../requests_new.html.to' %}
|
||||||
|
|
||||||
{% block form %}
|
{% block form %}
|
||||||
<h2>Details of Use</h2>
|
<h2>Details of Use</h2>
|
||||||
@ -158,7 +158,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<div class="usa-width-three-fourths usa-layout-docs-main_content">
|
<div class="usa-width-three-fourths usa-layout-docs-main_content">
|
||||||
<h2 id="details-of-use">Details of Use</h2>
|
<h2 id="details-of-use">Details of Use</h2>
|
||||||
<p class="usa-font-lead">
|
<p class="usa-font-lead">
|
||||||
@ -166,4 +166,4 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{% extends '../requests.html.to' %}
|
{% extends '../requests_new.html.to' %}
|
||||||
|
|
||||||
{% block form %}
|
{% block form %}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{% extends '../requests.html.to' %}
|
{% extends '../requests_new.html.to' %}
|
||||||
|
|
||||||
{% block form %}
|
{% block form %}
|
||||||
<h2>Funding/Contracting</h2>
|
<h2>Funding/Contracting</h2>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{% extends '../requests.html.to' %}
|
{% extends '../requests_new.html.to' %}
|
||||||
|
|
||||||
{% block form %}
|
{% block form %}
|
||||||
<h2>Readiness Survey</h2>
|
<h2>Readiness Survey</h2>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{% extends '../requests.html.to' %}
|
{% extends '../requests_new.html.to' %}
|
||||||
|
|
||||||
{% block form %}
|
{% block form %}
|
||||||
<h2>Review & Submit</h2>
|
<h2>Review & Submit</h2>
|
||||||
|
@ -4,7 +4,67 @@
|
|||||||
|
|
||||||
<main class="usa-section usa-content" id="main-content">
|
<main class="usa-section usa-content" id="main-content">
|
||||||
|
|
||||||
|
<h1>Requests <a class="usa-button usa-button-secondary">New Request</a></h1>
|
||||||
|
|
||||||
|
<table class="usa-table-borderless" width="100%">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Order ID</th>
|
||||||
|
<th scope="col">Request Date</th>
|
||||||
|
<th scope="col">Requester</th>
|
||||||
|
<th scope="col">Total Apps</th>
|
||||||
|
<th scope="col">Status</th>
|
||||||
|
<th scope="col">Actions</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><a href="#">#36552612</a> <span class="usa-label">New</span></th>
|
||||||
|
<td>5/17/2018</td>
|
||||||
|
<td>Friedrich Straat</td>
|
||||||
|
<td>2</td>
|
||||||
|
<td>Pending</td>
|
||||||
|
<td><a href="">Download</a></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>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<br><br>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<a class="href="/requests">‹ All requests</a>
|
||||||
<h1>New Request</h1>
|
<h1>New Request</h1>
|
||||||
|
|
||||||
|
|
||||||
|
<aside class="usa-width-one-fourth usa-layout-docs-sidenav">
|
||||||
|
{% include 'requests/sidebar.html.to' %}
|
||||||
|
</aside>
|
||||||
|
<div class="usa-width-three-fourths usa-layout-docs-main_content">
|
||||||
|
|
||||||
|
{% block form %}
|
||||||
|
form goes here
|
||||||
|
{% end %}
|
||||||
|
{% block next %}
|
||||||
|
<a class='usa-button usa-button-primary' href='{{ reverse_url('request_form',next_screen) }}'>Save & Continue</a>
|
||||||
|
{% end %}
|
||||||
|
</div>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
{% end %}
|
{% end %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user