mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
Adjusted and added static page views logic
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from flask import (render_template, url_for, redirect, request, abort)
|
||||
from flask import (render_template, url_for, redirect, request)
|
||||
from app.main import main
|
||||
from app import convert_to_boolean
|
||||
from app.main.forms import SearchTemplatesForm
|
||||
@@ -7,6 +7,8 @@ from flask_login import (login_required, current_user)
|
||||
from notifications_utils.template import HTMLEmailTemplate
|
||||
from notifications_utils.international_billing_rates import INTERNATIONAL_BILLING_RATES
|
||||
|
||||
from app.main.views.sub_navigation_dictionaries import features_nav
|
||||
|
||||
|
||||
@main.route('/')
|
||||
def index():
|
||||
@@ -54,16 +56,6 @@ def design_content():
|
||||
return render_template('views/design-patterns-content-guidance.html')
|
||||
|
||||
|
||||
@main.route('/information-security')
|
||||
def information_security():
|
||||
return render_template('views/information-security.html')
|
||||
|
||||
|
||||
@main.route('/terms')
|
||||
def terms():
|
||||
return render_template('views/terms-of-use.html')
|
||||
|
||||
|
||||
@main.route('/_email')
|
||||
def email_template():
|
||||
return str(HTMLEmailTemplate({'subject': 'foo', 'content': (
|
||||
@@ -109,34 +101,77 @@ def email_template():
|
||||
|
||||
@main.route('/documentation')
|
||||
def documentation():
|
||||
abort(410)
|
||||
return render_template('views/documentation.html')
|
||||
|
||||
|
||||
@main.route('/integration_testing')
|
||||
@main.route('/integration_testing', endpoint='old_integration_testing')
|
||||
@main.route('/integration-testing')
|
||||
def integration_testing():
|
||||
return render_template('views/integration_testing.html')
|
||||
|
||||
|
||||
@main.route('/roadmap')
|
||||
def roadmap():
|
||||
return render_template('views/roadmap.html')
|
||||
|
||||
|
||||
@main.route('/features')
|
||||
def features():
|
||||
return render_template('views/features.html')
|
||||
|
||||
|
||||
@main.route('/using_notify')
|
||||
def using_notify():
|
||||
return render_template('views/using-notify.html')
|
||||
|
||||
|
||||
@main.route('/information-risk-management')
|
||||
def information_risk_management():
|
||||
return render_template('views/information-risk-management.html')
|
||||
if request.endpoint == "main.old_integration_testing":
|
||||
return redirect(url_for('.integration_testing'), code=301)
|
||||
else:
|
||||
return render_template('views/integration-testing.html')
|
||||
|
||||
|
||||
@main.route('/callbacks')
|
||||
def callbacks():
|
||||
return render_template('views/callbacks.html')
|
||||
|
||||
|
||||
# --- Features --- #
|
||||
|
||||
@main.route('/features')
|
||||
def features():
|
||||
return render_template(
|
||||
'views/features.html',
|
||||
navigation_links=features_nav()
|
||||
)
|
||||
|
||||
|
||||
@main.route('/roadmap', endpoint='old_roadmap')
|
||||
@main.route('/features/roadmap', endpoint='roadmap')
|
||||
def roadmap():
|
||||
if request.endpoint == "main.old_roadmap":
|
||||
return redirect(url_for('.roadmap'), code=301)
|
||||
else:
|
||||
return render_template(
|
||||
'views/roadmap.html',
|
||||
navigation_links=features_nav()
|
||||
)
|
||||
|
||||
|
||||
@main.route('/information-risk-management', endpoint='information_risk_management')
|
||||
@main.route('/features/security', endpoint='security')
|
||||
def security():
|
||||
if request.endpoint == "main.information_risk_management":
|
||||
return redirect(url_for('.security'), code=301)
|
||||
else:
|
||||
return render_template(
|
||||
'views/security.html',
|
||||
navigation_links=features_nav()
|
||||
)
|
||||
|
||||
|
||||
@main.route('/terms', endpoint='old_terms')
|
||||
@main.route('/features/terms', endpoint='terms')
|
||||
def terms():
|
||||
if request.endpoint != "main.terms":
|
||||
return redirect(url_for('.terms'), code=301)
|
||||
else:
|
||||
return render_template(
|
||||
'views/terms-of-use.html',
|
||||
navigation_links=features_nav()
|
||||
)
|
||||
|
||||
|
||||
@main.route('/information-security', endpoint='information_security')
|
||||
@main.route('/using_notify', endpoint='old_using_notify')
|
||||
@main.route('/features/using-notify')
|
||||
def using_notify():
|
||||
if request.endpoint != "main.using_notify":
|
||||
return redirect(url_for('.using_notify'), code=301)
|
||||
else:
|
||||
return render_template(
|
||||
'views/using-notify.html',
|
||||
navigation_links=features_nav()
|
||||
)
|
||||
|
||||
28
app/main/views/sub_navigation_dictionaries.py
Normal file
28
app/main/views/sub_navigation_dictionaries.py
Normal file
@@ -0,0 +1,28 @@
|
||||
def features_nav():
|
||||
return [
|
||||
{
|
||||
"name": "Features",
|
||||
"link": "main.features",
|
||||
},
|
||||
{
|
||||
"name": "Roadmap",
|
||||
"link": "main.roadmap",
|
||||
},
|
||||
{
|
||||
"name": "Security",
|
||||
"link": "main.security",
|
||||
},
|
||||
{
|
||||
"name": "Performance",
|
||||
"link": "https://www.gov.uk/performance/govuk-notify",
|
||||
"external_link": True,
|
||||
},
|
||||
{
|
||||
"name": "Terms of use",
|
||||
"link": "main.terms",
|
||||
},
|
||||
{
|
||||
"name": "Using Notify",
|
||||
"link": "main.using_notify",
|
||||
},
|
||||
]
|
||||
Reference in New Issue
Block a user