From 86af8fcaa42e7f806db2db23d0a1f6d2173855a5 Mon Sep 17 00:00:00 2001 From: Anastasia Gradova Date: Thu, 21 Dec 2023 20:43:52 -0700 Subject: [PATCH] Updated get-started to render from markdown --- app/content/get-started.md | 50 +++++++++++++++++++++++++++ app/main/views/index.py | 23 +++++++++++-- app/templates/views/get-started.html | 51 +--------------------------- 3 files changed, 72 insertions(+), 52 deletions(-) create mode 100644 app/content/get-started.md diff --git a/app/content/get-started.md b/app/content/get-started.md new file mode 100644 index 000000000..ab5cffdac --- /dev/null +++ b/app/content/get-started.md @@ -0,0 +1,50 @@ +

Get started

+ +
    +
  1. +

    Check if Notify.gov is right for you

    +

    Read about our features, pricing and roadmap.

    +
  2. + +
  3. +

    Create an account

    + {% if not current_user.is_authenticated %} +

    Create an account for free and add your first Notify service. When you add a new service it will start in trial mode.

    + {% else %} +

    Create an account for free and add your first Notify service. When you add a new service, it will start in trial mode.

    + {% endif %} +
  4. + +
  5. +

    Write some messages

    +

    Add message templates with examples of the content you plan to send. You can use our guidance to help you.

    +
  6. + +
  7. +

    Set up your service

    + {% if not current_user.is_authenticated or not current_service %} +

    Review your settings to add message branding and sender information.

    +

    Add team members and check their permissions.

    + {% else %} +

    Review your settings to add message branding and sender information.

    +

    Add team members and check their permissions.

    + {% endif %} +
  8. + + + +
  9. +

    Start sending messages

    + {% if not current_user.is_authenticated or not current_service %} +

    When you’re ready to send messages to people outside your team, go to the Settings page and select Request to go live. We’ll approve your request within one working day.

    + {% else %} +

    You should request to go live when you’re ready to send messages to people outside your team. We’ll approve your request within one working day.

    + {% endif %} + +
  10. + +
diff --git a/app/main/views/index.py b/app/main/views/index.py index 30818db99..b26086e84 100644 --- a/app/main/views/index.py +++ b/app/main/views/index.py @@ -4,12 +4,17 @@ from flask import ( make_response, redirect, render_template, + render_template_string, request, - url_for, + url_for ) from flask_login import current_user +from flask.helpers import get_root_path from notifications_utils.template import HTMLEmailTemplate +import markdown +import os + from app import email_branding_client, status_api_client from app.main import main from app.main.forms import FieldWithNoneOption @@ -17,6 +22,19 @@ from app.main.views.pricing import CURRENT_SMS_RATE from app.main.views.sub_navigation_dictionaries import features_nav, using_notify_nav from app.utils.user import user_is_logged_in +#Should find a better home +def get_md(mdf): + APP_ROOT = get_root_path('notifications-admin') + file = 'app/content/' + mdf + '.md' + md_file = os.path.join(APP_ROOT, file) + with open(md_file) as f: + content_text = f.read() + + md_render = markdown.markdown(content_text) + jn_render = render_template_string(md_render) + + return jn_render + @main.route("/") def index(): @@ -256,7 +274,7 @@ def get_started_old(): def get_started(): return render_template( "views/get-started.html", - navigation_links=using_notify_nav(), + navigation_links=using_notify_nav(), content=get_md('get-started') ) @@ -324,6 +342,7 @@ def send_files_by_email(): ) + # --- Redirects --- # diff --git a/app/templates/views/get-started.html b/app/templates/views/get-started.html index 7b6ad500c..e1da9961e 100644 --- a/app/templates/views/get-started.html +++ b/app/templates/views/get-started.html @@ -9,55 +9,6 @@ {% block content_column_content %} -

Get started

- -
    -
  1. -

    Check if Notify.gov is right for you

    -

    Read about our features, pricing and roadmap.

    -
  2. - -
  3. -

    Create an account

    - {% if not current_user.is_authenticated %} -

    Create an account for free and add your first Notify service. When you add a new service it will start in trial mode.

    - {% else %} -

    Create an account for free and add your first Notify service. When you add a new service, it will start in trial mode.

    - {% endif %} -
  4. - -
  5. -

    Write some messages

    -

    Add message templates with examples of the content you plan to send. You can use our guidance to help you.

    -
  6. - -
  7. -

    Set up your service

    - {% if not current_user.is_authenticated or not current_service %} -

    Review your settings to add message branding and sender information.

    -

    Add team members and check their permissions.

    - {% else %} -

    Review your settings to add message branding and sender information.

    -

    Add team members and check their permissions.

    - {% endif %} -
  8. - - - -
  9. -

    Start sending messages

    - {% if not current_user.is_authenticated or not current_service %} -

    When you’re ready to send messages to people outside your team, go to the Settings page and select Request to go live. We’ll approve your request within one working day.

    - {% else %} -

    You should request to go live when you’re ready to send messages to people outside your team. We’ll approve your request within one working day.

    - {% endif %} - -
  10. - -
+{{ content | safe }} {% endblock %}