Merge pull request #327 from dod-ccpo/dummy-help-page

Dummy help page
This commit is contained in:
andrewdds 2018-09-25 11:08:56 -04:00 committed by GitHub
commit 2bbb859ad8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 251 additions and 54 deletions

View File

@ -8,6 +8,7 @@ UNPROTECTED_ROUTES = [
"dev.login_dev", "dev.login_dev",
"atst.login_redirect", "atst.login_redirect",
"atst.unauthorized", "atst.unauthorized",
"atst.helpdocs",
"static", "static",
] ]

View File

@ -12,7 +12,12 @@ bp = Blueprint("atst", __name__)
@bp.route("/") @bp.route("/")
def root(): def root():
return render_template("root.html") return render_template("login.html")
@bp.route("/help")
def helpdocs():
return render_template("help/index.html")
@bp.route("/home") @bp.route("/home")

View File

@ -4,15 +4,27 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
align-items: center;
padding: $gap * 2;
h5, .app-footer__info {
.browser-support { flex-grow: 1;
margin: 0;
padding: $gap * 2; .app-footer__info__title {
display: inline-block;
padding: 0;
margin: 0 $gap 0 0;
//margin: ($gap * 2);
}
.app-footer__info__link {
margin: (-$gap * 2) (-$gap);
}
} }
.browser-support { .app-footer__browser-support {
color: $color-gray; color: $color-gray;
margin: 0;
text-align: right; text-align: right;
dt, dd { dt, dd {
@include h5; @include h5;

View File

@ -24,6 +24,14 @@
margin-left: $gap; margin-left: $gap;
} }
&.topbar__link--home {
padding-left: $gap/2;
.topbar__link-label {
padding-left: $gap;
}
}
&.topbar__link--shield { &.topbar__link--shield {
width: $icon-bar-width; width: $icon-bar-width;
justify-content: center; justify-content: center;
@ -52,7 +60,7 @@
justify-content: flex-end; justify-content: flex-end;
-ms-flex-pack: start; -ms-flex-pack: start;
.topbar__link { .topbar__link--workspace {
&:first-child { &:first-child {
margin-right: auto; margin-right: auto;
} }
@ -75,4 +83,34 @@
} }
} }
} }
&.topbar--public {
background-color: $color-primary;
.topbar__navigation {
justify-content: flex-end;
-ms-flex-pack: justify;
}
.topbar__link {
color: $color-white;
.topbar__link-icon {
@include icon-style-inverted;
}
&.topbar__link--home {
padding-left: $gap;
}
&:first-child {
margin-right: auto;
}
&:hover {
background-color: $color-primary-darker;
}
}
}
} }

View File

@ -0,0 +1,67 @@
{% from "components/icon.html" import Icon %}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}JEDI Cloud{% endblock %}</title>
{% assets "css" %}
<link rel="stylesheet" href="{{ ASSET_URL }}" type="text/css">
{% endassets %}
<link rel="icon" type="image/x-icon" href="/static/img/favicon.ico">
</head>
<body>
<div id='app-root'>
<header class="topbar topbar--public">
<nav class="topbar__navigation">
<a href="{{ url_for('atst.home') }}" class="topbar__link topbar__link--home">
{{ Icon('shield', classes='topbar__link-icon') }}
<span class="topbar__link-label">JEDI Cloud</span>
</a>
{% if g.current_user %}
<a href="{{ url_for('atst.home') }}" class="topbar__link">
<span class="topbar__link-label">{{ g.current_user.first_name + " " + g.current_user.last_name }}</span>
{{ Icon('avatar', classes='topbar__link-icon') }}
</a>
<a href="{{ url_for('atst.logout') }}" class="topbar__link" title='Log out of JEDI Cloud'>
{{ Icon('logout', classes='topbar__link-icon') }}
</a>
{% else %}
<a href="{{ url_for('atst.home') }}" class="topbar__link" title='Log in'>
<span class="topbar__link-label">Log in</span>
{{ Icon('avatar', classes='topbar__link-icon') }}
</a>
{% endif %}
</nav>
</header>
{% block content %}{% endblock %}
<footer class='app-footer'>
<div class='app-footer__info'>
<h5 class='app-footer__info__title'>Joint Enterprise Defense Infrastructure</h5>
<a href='{{ url_for('atst.helpdocs') }}' class='icon-link app-footer__info__link' target='_blank' rel='noopener noreferrer'>
{{ Icon('help') }}
<span>JEDI Help</span>
</a>
</div>
<dl class='app-footer__browser-support'>
<dt>JEDI Cloud supported on these web browsers</dt>
<dd>Chrome</dd><dd>Firefox</dd><dd>Safari</dd><dd>Edge</dd><dd>IE11 on Windows 10</dd><dd>IE10 on Windows 7</dd>
</footer>
</div>
</body>
</html>

View File

@ -1,3 +1,12 @@
{% from "components/icon.html" import Icon %}
<footer class='app-footer'> <footer class='app-footer'>
<h5>Joint Enterprise Defense Infrastructure</h5> <div class='app-footer__info'>
<h5 class='app-footer__info__title'>Joint Enterprise Defense Infrastructure</h5>
<a href='{{ url_for('atst.helpdocs') }}' class='icon-link app-footer__info__link' target='_blank' rel='noopener noreferrer'>
{{ Icon('help') }}
<span>JEDI Help</span>
</a>
</div>
</footer> </footer>

View File

@ -1,3 +1,5 @@
{% from "components/icon.html" import Icon %}
<p> <p>
We will review and respond to your request in 3 business days. Youll be notified via email or phone. We will review and respond to your request in 3 business days. Youll be notified via email or phone.
</p> </p>
@ -6,6 +8,10 @@
While your request is being reviewed, your next step is to create a Task Order associated with JEDI Cloud. Please contact a Contracting Officer (KO), Contracting Officer Representative (COR), or a Financial Manager to help with this step. While your request is being reviewed, your next step is to create a Task Order associated with JEDI Cloud. Please contact a Contracting Officer (KO), Contracting Officer Representative (COR), or a Financial Manager to help with this step.
</p> </p>
<p> <div class='alert__actions'>
Learn more about the JEDI Cloud Task Order and the Financial Verification process. <a href='/help' class='icon-link'>
</p> {{ Icon('help') }}
Learn more about the JEDI Cloud Task Order and the Financial Verification process.
</a>
</div>

View File

@ -1,3 +1,5 @@
{% from "components/icon.html" import Icon %}
<h1> <h1>
Request submitted. Approval pending. Request submitted. Approval pending.
</h1> </h1>
@ -30,6 +32,9 @@
Once the Task Order has been created, you will be asked to provide details about the task order in the Financial Verification step. Once the Task Order has been created, you will be asked to provide details about the task order in the Financial Verification step.
</p> </p>
<p> <div class='alert__actions'>
Learn more about the JEDI Cloud Task Order and the Financial Verification process. <a href='/help' class='icon-link'>
</p> {{ Icon('help') }}
Learn more about the JEDI Cloud Task Order and the Financial Verification process.
</a>
</div>

View File

@ -1,3 +1,5 @@
{% from "components/icon.html" import Icon %}
<p> <p>
The next step is to create a Task Order associated with JEDI Cloud. The next step is to create a Task Order associated with JEDI Cloud.
Please contact a Contracting Officer (KO), Contracting Officer Please contact a Contracting Officer (KO), Contracting Officer
@ -7,6 +9,11 @@
Once the Task Order has been created, you will be asked to provide Once the Task Order has been created, you will be asked to provide
details about the task order in the Financial Verification step. details about the task order in the Financial Verification step.
</p> </p>
<p>
<i>Learn more</i> about the JEDI Cloud Task Order and the Financial Verification process. <div class='alert__actions'>
</p> <a href='/help' class='icon-link'>
{{ Icon('help') }}
Learn more about the JEDI Cloud Task Order and the Financial Verification process.
</a>
</div>

57
templates/help/index.html Normal file
View File

@ -0,0 +1,57 @@
{% extends "base_public.html" %}
{% from "components/sidenav_item.html" import SidenavItem %}
{% from "components/alert.html" import Alert %}
{% block title %}Help | JEDI Cloud{% endblock %}
{% block content %}
<div class='global-layout'>
<div class='global-navigation sidenav'>
<ul>
{{ SidenavItem("Help Topic",
href="/help",
active=g.matchesPath('/help'),
subnav=[
{"label":"Sub Topic", "href":"/help", "active": False},
{"label":"Sub Topic", "href":"/help", "active": False},
{"label":"Another Sub Topic", "href":"/help", "active": False},
]
)}}
{{ SidenavItem("Another Help Topic",
href="/help",
active=False
)}}
{{ SidenavItem("One More Help Topic",
href="/help",
active=False
)}}
</ul>
</div>
<div class='global-panel-container'>
{{ Alert('Sample Content',
message='This is a sample help page intended to demonstrate the layout of a JEDI Cloud help documentation page.',
) }}
<div class='panel'>
<div class='panel__heading panel__heading--divider'>
<h1>
<div class='h4'>JEDI Cloud Help Documentation</div>
<span class='h1'>Help Topic</span>
</h1>
</div>
<div class='panel__content'>
<p>So you see, since we're a small operation, we don't fall into the...uh...jurisdiction of the Empire. So you're part of the mining guild then? No, not actually. Our operation is small enough not to be noticed...which is advantageous for everybody since our customers are anxious to avoid attracting attention to themselves. Aren't you afraid the Empire's going to find out about this little operation and shut you down? That's always been a danger looming like a shadow over everything we've built here. But things have developed that will insure security. I've just made a deal that will keep the Empire out of here forever. We would be honored if you would join us. I had no choice. They arrived right before you did. I'm sorry. I'm sorry, too.</p>
<p>Now will you move along, little fella? We're got a lot of work to do. No! No, no! Stay and help you, I will. Find your friend, hmm? I'm not looking for a friend, I'm looking for a Jedi Master. Oohhh. Jedi Master. Yoda. You seek Yoda. You know him? Mmm. Take you to him, I will. Yes, yes. But now, we must eat. Come. Good food. Come. Come, come. Stay here and watch after the camp, Artoo.</p>
<p>Well done. Hold them in the security tower - and keep it quiet. Move. What do you think you're doing? We're getting out of here. I knew all along it had to be a mistake. Do you think that after what you did to Han we're going to trust you? I had no choice... What are you doing? Trust him, trust him! Oh, so we understand, don't we, Chewie? He had no choice. I'm just trying to help... We don't need any of your help. H-a-a-a... What? It sounds like Han. There's still a chance to save Han...I mean, at the East Platform... Chewie. I'm terribly sorry about all this. After all, he's only a Wookiee.</p>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -1,20 +1,10 @@
{% from "components/alert.html" import Alert %} {% from "components/alert.html" import Alert %}
<!DOCTYPE html> {% extends "base_public.html" %}
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}JEDI Cloud{% endblock %}</title>
{% assets "css" %}
<link rel="stylesheet" href="{{ ASSET_URL }}" type="text/css">
{% endassets %}
<link rel="icon" type="image/x-icon" href="/static/img/favicon.ico">
</head>
<body>
<div id='app-root'> {% block title %}Sign in | JEDI Cloud{% endblock %}
{% block content %}
<div class='global-layout login-layout'> <div class='global-layout login-layout'>
<div class='global-panel-container login-container'> <div class='global-panel-container login-container'>
@ -38,7 +28,7 @@
{ {
'label': 'Learn More', 'label': 'Learn More',
'icon': 'help', 'icon': 'help',
'href': '/' 'href': '/help'
} }
] ]
) }} ) }}
@ -47,16 +37,6 @@
</div> </div>
</div> </div>
<footer class='app-footer'> {% endblock %}
<h5>Joint Enterprise Defense Infrastructure</h5>
<dl class='browser-support'>
<dt>JEDI Cloud supported on these web browsers</dt>
<dd>Chrome</dd><dd>Firefox</dd><dd>Safari</dd><dd>Edge</dd><dd>IE11 on Windows 10</dd><dd>IE10 on Windows 7</dd>
</footer>
</div>
</body>
</html>

View File

@ -2,17 +2,25 @@
<header class="topbar"> <header class="topbar">
<nav class="topbar__navigation"> <nav class="topbar__navigation">
<a href="{{ url_for('atst.home') }}" class="topbar__link topbar__link--shield" title="JEDI Cloud Home"> {% if not workspace %}
{{ Icon('shield', classes='topbar__link-icon') }} <a href="{{ url_for('atst.home') }}" class="topbar__link topbar__link--home">
</a> {{ Icon('shield', classes='topbar__link-icon') }}
<span class="topbar__link-label">JEDI Cloud</span>
</a>
{% else %}
<a href="{{ url_for('atst.home') }}" class="topbar__link topbar__link--shield" title="JEDI Cloud Home">
{{ Icon('shield', classes='topbar__link-icon') }}
</a>
{% endif %}
<div class="topbar__context {% if workspace %}topbar__context--workspace{% endif %}"> <div class="topbar__context {% if workspace %}topbar__context--workspace{% endif %}">
{% set topbar_link = url_for("workspaces.show_workspace", workspace_id=workspace.id) if workspace else url_for("atst.home") %} {% if workspace %}
<a href="{{ topbar_link }}" class="topbar__link"> <a href="{{ url_for("workspaces.show_workspace", workspace_id=workspace.id) }}" class="topbar__link topbar__link--workspace">
<span class="topbar__link-label">{{ ("Workspace " + workspace.name) if workspace else "JEDI Cloud" }}</span> <span class="topbar__link-label">{{ ("Workspace " + workspace.name) }}</span>
</a> </a>
{% endif %}
<a href="/" class="topbar__link"> <a href="{{ url_for('atst.home') }}" class="topbar__link">
<span class="topbar__link-label">{{ g.current_user.first_name + " " + g.current_user.last_name }}</span> <span class="topbar__link-label">{{ g.current_user.first_name + " " + g.current_user.last_name }}</span>
{{ Icon('avatar', classes='topbar__link-icon') }} {{ Icon('avatar', classes='topbar__link-icon') }}
</a> </a>

View File

@ -10,7 +10,7 @@
message="<p>Track your monthly and cumulative expenditures for your workspace, projects, and environments below.</p>\ message="<p>Track your monthly and cumulative expenditures for your workspace, projects, and environments below.</p>\
<p>Please note that the projected spend is based on the <em>average expense over the last three completed months</em> and therefore does not account for future changes that might be made in scale or configuration of your cloud services.</p>", <p>Please note that the projected spend is based on the <em>average expense over the last three completed months</em> and therefore does not account for future changes that might be made in scale or configuration of your cloud services.</p>",
actions=[ actions=[
{"label": "Learn More", "href": "/", "icon": "info"} {"label": "Learn More", "href": url_for('atst.helpdocs'), "icon": "info"}
] ) }} ] ) }}
<div class='funding-summary-row'> <div class='funding-summary-row'>

View File

@ -6,6 +6,7 @@ from .mocks import DOD_SDN_INFO, DOD_SDN, FIXTURE_EMAIL_ADDRESS
from atst.domain.users import Users from atst.domain.users import Users
from atst.domain.roles import Roles from atst.domain.roles import Roles
from atst.domain.exceptions import NotFoundError from atst.domain.exceptions import NotFoundError
from atst.domain.auth import UNPROTECTED_ROUTES
from .factories import UserFactory from .factories import UserFactory
@ -68,6 +69,8 @@ def test_unsuccessful_login_redirect(client, monkeypatch):
# checks that all of the routes in the app are protected by auth # checks that all of the routes in the app are protected by auth
def is_unprotected(rule):
return rule.endpoint in UNPROTECTED_ROUTES
def test_routes_are_protected(client, app): def test_routes_are_protected(client, app):
@ -75,7 +78,7 @@ def test_routes_are_protected(client, app):
args = [1] * len(rule.arguments) args = [1] * len(rule.arguments)
mock_args = dict(zip(rule.arguments, args)) mock_args = dict(zip(rule.arguments, args))
_n, route = rule.build(mock_args) _n, route = rule.build(mock_args)
if route in UNPROTECTED_ROUTES or "/static" in route: if is_unprotected(rule) or "/static" in route:
continue continue
if "GET" in rule.methods: if "GET" in rule.methods:
@ -89,7 +92,6 @@ def test_routes_are_protected(client, app):
assert resp.headers["Location"] == "http://localhost/" assert resp.headers["Location"] == "http://localhost/"
UNPROTECTED_ROUTES = ["/", "/login-dev", "/login-redirect", "/unauthorized"]
# this implicitly relies on the test config and test CRL in tests/fixtures/crl # this implicitly relies on the test config and test CRL in tests/fixtures/crl