mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
merge main and nav
This commit is contained in:
@@ -19,14 +19,18 @@ from app.utils.user import user_is_logged_in
|
||||
from notifications_utils.url_safe_token import generate_token
|
||||
|
||||
|
||||
# Hook to check for guidance routes
|
||||
# Hook to check for feature flags
|
||||
@main.before_request
|
||||
def check_guidance_feature():
|
||||
current_app.logger.warning("best practices 1234")
|
||||
current_app.logger.warning(current_app.config["FEATURE_BEST_PRACTICES_ENABLED"])
|
||||
def check_feature_flags():
|
||||
if (
|
||||
request.path.startswith("/best-practices")
|
||||
and not current_app.config["FEATURE_BEST_PRACTICES_ENABLED"]
|
||||
request.path.startswith("/guides/best-practices")
|
||||
and not current_app.config.get("FEATURE_BEST_PRACTICES_ENABLED", False)
|
||||
):
|
||||
abort(404)
|
||||
|
||||
if (
|
||||
request.path.startswith("/about")
|
||||
and not current_app.config.get("FEATURE_ABOUT_PAGE_ENABLED", False)
|
||||
):
|
||||
abort(404)
|
||||
|
||||
@@ -208,7 +212,7 @@ def trial_mode_new():
|
||||
)
|
||||
|
||||
|
||||
@main.route("/best-practices")
|
||||
@main.route("/guides/best-practices")
|
||||
@user_is_logged_in
|
||||
def best_practices():
|
||||
return render_template(
|
||||
@@ -217,7 +221,7 @@ def best_practices():
|
||||
)
|
||||
|
||||
|
||||
@main.route("/best-practices/clear-goals")
|
||||
@main.route("/guides/best-practices/clear-goals")
|
||||
@user_is_logged_in
|
||||
def clear_goals():
|
||||
return render_template(
|
||||
@@ -226,7 +230,7 @@ def clear_goals():
|
||||
)
|
||||
|
||||
|
||||
@main.route("/best-practices/rules-and-regulations")
|
||||
@main.route("/guides/best-practices/rules-and-regulations")
|
||||
@user_is_logged_in
|
||||
def rules_and_regulations():
|
||||
return render_template(
|
||||
@@ -235,7 +239,7 @@ def rules_and_regulations():
|
||||
)
|
||||
|
||||
|
||||
@main.route("/best-practices/establish-trust")
|
||||
@main.route("/guides/best-practices/establish-trust")
|
||||
@user_is_logged_in
|
||||
def establish_trust():
|
||||
return render_template(
|
||||
@@ -244,7 +248,7 @@ def establish_trust():
|
||||
)
|
||||
|
||||
|
||||
@main.route("/best-practices/write-for-action")
|
||||
@main.route("/guides/best-practices/write-for-action")
|
||||
@user_is_logged_in
|
||||
def write_for_action():
|
||||
return render_template(
|
||||
@@ -253,7 +257,7 @@ def write_for_action():
|
||||
)
|
||||
|
||||
|
||||
@main.route("/best-practices/multiple-languages")
|
||||
@main.route("/guides/best-practices/multiple-languages")
|
||||
@user_is_logged_in
|
||||
def multiple_languages():
|
||||
return render_template(
|
||||
@@ -262,7 +266,7 @@ def multiple_languages():
|
||||
)
|
||||
|
||||
|
||||
@main.route("/best-practices/benchmark-performance")
|
||||
@main.route("/guides/best-practices/benchmark-performance")
|
||||
@user_is_logged_in
|
||||
def benchmark_performance():
|
||||
return render_template(
|
||||
@@ -281,6 +285,7 @@ def why_text_messaging():
|
||||
|
||||
|
||||
@main.route("/using-notify/guidance")
|
||||
@main.route("/guides/using-notify/guidance")
|
||||
@user_is_logged_in
|
||||
def guidance_index():
|
||||
return render_template(
|
||||
@@ -292,6 +297,14 @@ def guidance_index():
|
||||
)
|
||||
|
||||
|
||||
@main.route("/about")
|
||||
def about_notify():
|
||||
return render_template(
|
||||
"views/about/about.html",
|
||||
navigation_links=about_notify_nav(),
|
||||
)
|
||||
|
||||
|
||||
@main.route("/using-notify/guidance/create-and-send-messages")
|
||||
@user_is_logged_in
|
||||
def create_and_send_messages():
|
||||
|
||||
@@ -27,6 +27,10 @@ def using_notify_nav():
|
||||
"name": "Get started",
|
||||
"link": "main.get_started",
|
||||
},
|
||||
{
|
||||
"name": "Guides",
|
||||
"link": "main.best_practices",
|
||||
},
|
||||
{
|
||||
"name": "Trial mode",
|
||||
"link": "main.trial_mode_new",
|
||||
@@ -106,7 +110,13 @@ def best_practices_nav():
|
||||
def about_notify_nav():
|
||||
return [
|
||||
{
|
||||
"name": "Why text messaging",
|
||||
"link": "main.why_text_messaging",
|
||||
"name": "About notify",
|
||||
"link": "main.about_notify",
|
||||
"sub_navigation_items": [
|
||||
{
|
||||
"name": "Why text messaging",
|
||||
"link": "main.why_text_messaging",
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user