mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-24 12:21:22 -05:00
Add left hand navigation
Due to the way the navigation dictionaries are built this mean being less smart about the view method for the guidance pages.
This commit is contained in:
@@ -7,7 +7,6 @@ from flask import (
|
||||
url_for,
|
||||
)
|
||||
from flask_login import current_user
|
||||
from jinja2.exceptions import TemplateNotFound
|
||||
from notifications_utils.international_billing_rates import (
|
||||
INTERNATIONAL_BILLING_RATES,
|
||||
)
|
||||
@@ -17,7 +16,11 @@ from app import email_branding_client, letter_branding_client, status_api_client
|
||||
from app.main import main
|
||||
from app.main.forms import FieldWithNoneOption, SearchByNameForm
|
||||
from app.main.views.feedback import QUESTION_TICKET_TYPE
|
||||
from app.main.views.sub_navigation_dictionaries import features_nav, pricing_nav
|
||||
from app.main.views.sub_navigation_dictionaries import (
|
||||
features_nav,
|
||||
pricing_nav,
|
||||
using_notify_nav,
|
||||
)
|
||||
from app.utils import get_logo_cdn_domain, user_is_logged_in
|
||||
|
||||
|
||||
@@ -91,6 +94,7 @@ def how_to_pay():
|
||||
|
||||
|
||||
@main.route('/delivery-and-failure')
|
||||
@main.route('/features/messages-status')
|
||||
def delivery_and_failure():
|
||||
return redirect(url_for('.message_status'), 301)
|
||||
|
||||
@@ -219,7 +223,10 @@ def letter_template():
|
||||
|
||||
@main.route('/documentation')
|
||||
def documentation():
|
||||
return render_template('views/documentation.html')
|
||||
return render_template(
|
||||
'views/documentation.html',
|
||||
navigation_links=using_notify_nav(),
|
||||
)
|
||||
|
||||
|
||||
@main.route('/integration-testing')
|
||||
@@ -298,43 +305,87 @@ def using_notify():
|
||||
), 410
|
||||
|
||||
|
||||
@main.route('/features/messages-status')
|
||||
@main.route('/using-notify/delivery-status')
|
||||
def message_status():
|
||||
return render_template(
|
||||
'views/message-status.html',
|
||||
navigation_links=features_nav()
|
||||
navigation_links=using_notify_nav(),
|
||||
)
|
||||
|
||||
|
||||
@main.route('/features/get-started')
|
||||
def get_started_old():
|
||||
return redirect(url_for('.get_started'), 301)
|
||||
|
||||
|
||||
@main.route('/using-notify/get-started')
|
||||
def get_started():
|
||||
return render_template(
|
||||
'views/get-started.html'
|
||||
'views/get-started.html',
|
||||
navigation_links=using_notify_nav(),
|
||||
)
|
||||
|
||||
|
||||
@main.route('/trial-mode')
|
||||
@main.route('/features/trial-mode')
|
||||
def trial_mode():
|
||||
return redirect(url_for('.trial_mode_new'), 301)
|
||||
|
||||
|
||||
@main.route('/features/trial-mode')
|
||||
@main.route('/using-notify/trial-mode')
|
||||
def trial_mode_new():
|
||||
return render_template(
|
||||
'views/trial-mode.html',
|
||||
navigation_links=features_nav()
|
||||
navigation_links=using_notify_nav(),
|
||||
)
|
||||
|
||||
|
||||
@main.route('/guidance')
|
||||
@main.route('/guidance/<slug>')
|
||||
def guidance(slug='index'):
|
||||
try:
|
||||
return render_template(
|
||||
'views/guidance/{}.html'.format(slug)
|
||||
)
|
||||
except TemplateNotFound:
|
||||
abort(404)
|
||||
@main.route('/using-notify/guidance')
|
||||
def guidance_index():
|
||||
return render_template(
|
||||
'views/guidance/index.html',
|
||||
navigation_links=using_notify_nav(),
|
||||
)
|
||||
|
||||
|
||||
@main.route('/using-notify/guidance/branding-and-customisation')
|
||||
def branding_and_customisation():
|
||||
return render_template(
|
||||
'views/guidance/branding-and-customisation.html',
|
||||
navigation_links=using_notify_nav(),
|
||||
)
|
||||
|
||||
|
||||
@main.route('/using-notify/guidance/create-and-send-messages')
|
||||
def create_and_send_messages():
|
||||
return render_template(
|
||||
'views/guidance/create-and-send-messages.html',
|
||||
navigation_links=using_notify_nav(),
|
||||
)
|
||||
|
||||
|
||||
@main.route('/using-notify/guidance/edit-and-format-messages')
|
||||
def edit_and_format_messages():
|
||||
return render_template(
|
||||
'views/guidance/edit-and-format-messages.html',
|
||||
navigation_links=using_notify_nav(),
|
||||
)
|
||||
|
||||
|
||||
@main.route('/using-notify/guidance/send-files-by-email')
|
||||
def send_files_by_email():
|
||||
return render_template(
|
||||
'views/guidance/send-files-by-email.html',
|
||||
navigation_links=using_notify_nav(),
|
||||
)
|
||||
|
||||
|
||||
@main.route('/using-notify/guidance/upload-a-letter')
|
||||
def upload_a_letter():
|
||||
return render_template(
|
||||
'views/guidance/upload-a-letter.html',
|
||||
navigation_links=using_notify_nav(),
|
||||
)
|
||||
|
||||
|
||||
# --- Redirects --- #
|
||||
|
||||
@@ -62,27 +62,27 @@ def using_notify_nav():
|
||||
},
|
||||
{
|
||||
"name": "Guidance",
|
||||
"link": "main.guidance",
|
||||
"link": "main.guidance_index",
|
||||
"sub_navigation_items": [
|
||||
{
|
||||
"name": "Create and send messages",
|
||||
"link": "main.features_email",
|
||||
"link": "main.create_and_send_messages",
|
||||
},
|
||||
{
|
||||
"name": "Edit and format messages",
|
||||
"link": "main.features_sms",
|
||||
"link": "main.edit_and_format_messages",
|
||||
},
|
||||
{
|
||||
"name": "Branding and customisation",
|
||||
"link": "main.features_letters",
|
||||
"link": "main.branding_and_customisation",
|
||||
},
|
||||
{
|
||||
"name": "Send files by email",
|
||||
"link": "main.features_letters",
|
||||
"link": "main.send_files_by_email",
|
||||
},
|
||||
{
|
||||
"name": "Upload your own letters",
|
||||
"link": "main.features_letters",
|
||||
"link": "main.upload_a_letter",
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
@@ -196,8 +196,14 @@ class HeaderNavigation(Navigation):
|
||||
'get_example_csv',
|
||||
'get_notifications_as_json',
|
||||
'get_started',
|
||||
'get_started_old',
|
||||
'go_to_dashboard_after_tour',
|
||||
'guidance',
|
||||
'guidance_index',
|
||||
'branding_and_customisation',
|
||||
'create_and_send_messages',
|
||||
'edit_and_format_messages',
|
||||
'send_files_by_email',
|
||||
'upload_a_letter',
|
||||
'history',
|
||||
'inbound_sms_admin',
|
||||
'inbox',
|
||||
@@ -520,8 +526,14 @@ class MainNavigation(Navigation):
|
||||
'get_example_csv',
|
||||
'get_notifications_as_json',
|
||||
'get_started',
|
||||
'get_started_old',
|
||||
'go_to_dashboard_after_tour',
|
||||
'guidance',
|
||||
'guidance_index',
|
||||
'branding_and_customisation',
|
||||
'create_and_send_messages',
|
||||
'edit_and_format_messages',
|
||||
'send_files_by_email',
|
||||
'upload_a_letter',
|
||||
'history',
|
||||
'how_to_pay',
|
||||
'inbound_sms_admin',
|
||||
@@ -752,8 +764,14 @@ class CaseworkNavigation(Navigation):
|
||||
'get_example_csv',
|
||||
'get_notifications_as_json',
|
||||
'get_started',
|
||||
'get_started_old',
|
||||
'go_to_dashboard_after_tour',
|
||||
'guidance',
|
||||
'guidance_index',
|
||||
'branding_and_customisation',
|
||||
'create_and_send_messages',
|
||||
'edit_and_format_messages',
|
||||
'send_files_by_email',
|
||||
'upload_a_letter',
|
||||
'history',
|
||||
'how_to_pay',
|
||||
'inbound_sms_admin',
|
||||
@@ -1041,8 +1059,14 @@ class OrgNavigation(Navigation):
|
||||
'get_example_csv',
|
||||
'get_notifications_as_json',
|
||||
'get_started',
|
||||
'get_started_old',
|
||||
'go_to_dashboard_after_tour',
|
||||
'guidance',
|
||||
'guidance_index',
|
||||
'branding_and_customisation',
|
||||
'create_and_send_messages',
|
||||
'edit_and_format_messages',
|
||||
'send_files_by_email',
|
||||
'upload_a_letter',
|
||||
'history',
|
||||
'how_to_pay',
|
||||
'inbound_sms_admin',
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
"text": "Delivery status"
|
||||
},
|
||||
{
|
||||
"href": url_for("main.guidance"),
|
||||
"href": url_for("main.guidance_index"),
|
||||
"text": "Guidance"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
<h2 class="heading-medium" id="personalised-messages">Personalised content</h2>
|
||||
<p>Notify makes it easy to send personalised messages from a single template.</p>
|
||||
<p>See <a href="{{ url_for('.guidance', slug='edit-and-format-messages', _anchor='personalised-content') }}">how to personalise your content</a>.</p>
|
||||
<p>See <a href="{{ url_for('.edit_and_format_messages', _anchor='personalised-content') }}">how to personalise your content</a>.</p>
|
||||
|
||||
<h2 class="heading-medium" id="bulk-sending">Bulk sending</h2>
|
||||
<p>To send a batch of messages at once, upload a list of contact details to Notify. If you’re sending emails and text messages, you can also schedule the date and time you want them to be sent.</p>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
<h3 class="heading heading-small" id="branding">Email branding</h3>
|
||||
<p>Add your organisation’s logo and brand colour to email templates.</p>
|
||||
<p>See <a href="{{ url_for('.guidance', slug='branding-and-customisation', _anchor='email-branding') }}">how to change your email branding</a>.</p>
|
||||
<p>See <a href="{{ url_for('.branding_and_customisation', _anchor='email-branding') }}">how to change your email branding</a>.</p>
|
||||
|
||||
<h3 class="heading heading-small" id="send-files">Send files by email</h3>
|
||||
<p>Notify offers a safe and reliable way to send files by email.</p>
|
||||
@@ -41,7 +41,7 @@
|
||||
<h3 class="heading heading-small" id="reply-to">Add a reply-to address</h3>
|
||||
<p>Notify lets you choose the email address that users reply to.</p>
|
||||
<p>Emails with a reply-to address seem more trustworthy and are less likely to be labelled as spam.</p>
|
||||
<p>See <a href="{{ url_for('.guidance', slug='branding-and-customisation', _anchor='reply-to-address') }}">how to add a reply-to address</a>.</p>
|
||||
<p>See <a href="{{ url_for('.branding_and_customisation', _anchor='reply-to-address') }}">how to add a reply-to address</a>.</p>
|
||||
|
||||
<h2 class="heading heading-medium">Pricing</h2>
|
||||
<p>It’s free to send emails through Notify.</p>
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
|
||||
<h3 class="heading-small" id="branding">Branding</h3>
|
||||
<p>Add your organisation’s logo to your letter templates.</p>
|
||||
<p>See <a href="{{ url_for('.guidance', slug='branding-and-customisation', _anchor='letter-branding') }}">how to change your letter branding</a>.</p>
|
||||
<p>See <a href="{{ url_for('.branding_and_customisation', _anchor='letter-branding') }}">how to change your letter branding</a>.</p>
|
||||
|
||||
<h3 class="heading heading-small" id="upload-letters">Upload your own letters</h3>
|
||||
<p>You can create reusable letter templates in Notify, or upload and send your own letters with the Notify API.</p>
|
||||
<p>See <a href="{{ url_for('.guidance', slug='upload-a-letter') }}">how to upload a letter</a>.</p>
|
||||
<p>See <a href="{{ url_for('.upload_a_letter') }}">how to upload a letter</a>.</p>
|
||||
<p>Or, if you’re using our API, read our <a href="{{ url_for('.documentation') }}">documentation</a>.</p>
|
||||
|
||||
<h2 class="heading heading-medium">Pricing</h2>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<h3 class="heading heading-small" id="sender">Show people who your texts are from</h3>
|
||||
<p>When you send a text message with Notify, the sender name tells people who it's from.</p>
|
||||
<p>See <a href="{{ url_for('.guidance', slug='branding-and-customisation', _anchor='text-message-sender') }}">how to change the text message sender</a>.</p>
|
||||
<p>See <a href="{{ url_for('.branding_and_customisation', _anchor='text-message-sender') }}">how to change the text message sender</a>.</p>
|
||||
|
||||
<h2 class="heading heading-medium">Pricing<h2>
|
||||
<p>Each service you add has a free annual allowance. After that it costs 1.58 pence (plus VAT) to send a text to a UK number.</p>
|
||||
|
||||
@@ -15,17 +15,17 @@
|
||||
<p>It explains how to:</p>
|
||||
|
||||
<ul class="list list-bullet">
|
||||
<li><a href="{{ url_for('.guidance', slug='create-and-send-messages') }}">create and send messages</a></li>
|
||||
<li><a href="{{ url_for('.guidance', slug='edit-and-format-messages') }}">edit and format messages</a></li>
|
||||
<li>add <a href="{{ url_for('.guidance', slug='branding-and-customisation') }}">branding and customisation</a></li>
|
||||
<li><a href="{{ url_for('.guidance', slug='send-files-by-email') }}">send files by email</a></li>
|
||||
<li><a href="{{ url_for('.guidance', slug='upload-a-letter') }}">upload your own letters</a></li>
|
||||
<li><a href="{{ url_for('.create_and_send_messages') }}">create and send messages</a></li>
|
||||
<li><a href="{{ url_for('.edit_and_format_messages') }}">edit and format messages</a></li>
|
||||
<li>add <a href="{{ url_for('.branding_and_customisation') }}">branding and customisation</a></li>
|
||||
<li><a href="{{ url_for('.send_files_by_email') }}">send files by email</a></li>
|
||||
<li><a href="{{ url_for('.upload_a_letter') }}">upload your own letters</a></li>
|
||||
</ul>
|
||||
|
||||
<h2 class="heading-medium">More information</h2>
|
||||
|
||||
<p>The GOV.UK Service Manual has advice on:</p>
|
||||
|
||||
|
||||
<ul class="list list-bullet">
|
||||
<li><a href="https://www.gov.uk/service-manual/design/sending-emails-and-text-messages">planning and writing text messages and emails</a></li>
|
||||
<li><a href="https://www.gov.uk/service-manual/design/writing-effective-letters">writing effective letters</a></li>
|
||||
|
||||
@@ -80,7 +80,10 @@ def test_robots(client):
|
||||
'cookies', 'privacy', 'pricing', 'terms', 'roadmap',
|
||||
'features', 'documentation', 'security',
|
||||
'message_status', 'features_email', 'features_sms',
|
||||
'features_letters', 'how_to_pay', 'get_started'
|
||||
'features_letters', 'how_to_pay', 'get_started',
|
||||
'guidance_index', 'branding_and_customisation',
|
||||
'create_and_send_messages', 'edit_and_format_messages',
|
||||
'send_files_by_email', 'upload_a_letter',
|
||||
])
|
||||
def test_static_pages(
|
||||
client_request,
|
||||
@@ -277,23 +280,3 @@ def test_letter_spec_redirect_with_non_logged_in_user(client_request):
|
||||
'/documentation/images/notify-pdf-letter-spec-v2.4.pdf'
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def test_guidance_index(client_request):
|
||||
client_request.get('main.guidance')
|
||||
|
||||
|
||||
@pytest.mark.parametrize('slug', (
|
||||
'branding-and-customisation',
|
||||
'create-and-send-messages',
|
||||
'edit-and-format-messages',
|
||||
'index',
|
||||
'send-files-by-email',
|
||||
'upload-a-letter',
|
||||
))
|
||||
def test_guidance_pages(client_request, slug):
|
||||
client_request.get('main.guidance', slug=slug)
|
||||
|
||||
|
||||
def test_guidance_404s_for_page_that_doesnt_exist(client_request):
|
||||
client_request.get('main.guidance', slug='foo', _expected_status=404)
|
||||
|
||||
Reference in New Issue
Block a user