mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 08:28:15 -04:00
Put banner on the choose sms template page
This commit is contained in:
@@ -37,11 +37,23 @@ from app.utils import (
|
|||||||
|
|
||||||
@main.route("/services/<service_id>/sms/send", methods=['GET'])
|
@main.route("/services/<service_id>/sms/send", methods=['GET'])
|
||||||
def choose_sms_template(service_id):
|
def choose_sms_template(service_id):
|
||||||
|
try:
|
||||||
|
jobs = job_api_client.get_job(service_id)['data']
|
||||||
|
except HTTPError as e:
|
||||||
|
if e.status_code == 404:
|
||||||
|
abort(404)
|
||||||
|
else:
|
||||||
|
raise e
|
||||||
|
print("="*80)
|
||||||
|
print(jobs)
|
||||||
|
print(len(jobs))
|
||||||
|
print(bool(len(jobs)))
|
||||||
return render_template(
|
return render_template(
|
||||||
'views/choose-sms-template.html',
|
'views/choose-sms-template.html',
|
||||||
templates=[
|
templates=[
|
||||||
Template(template) for template in templates_dao.get_service_templates(service_id)['data']
|
Template(template) for template in templates_dao.get_service_templates(service_id)['data']
|
||||||
],
|
],
|
||||||
|
has_jobs=len(jobs),
|
||||||
service_id=service_id
|
service_id=service_id
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,15 @@
|
|||||||
<form method="POST" enctype="multipart/form-data">
|
<form method="POST" enctype="multipart/form-data">
|
||||||
|
|
||||||
{% if templates %}
|
{% if templates %}
|
||||||
|
{% if not has_jobs %}
|
||||||
|
{{ banner(
|
||||||
|
"""
|
||||||
|
Send yourself a test message
|
||||||
|
""",
|
||||||
|
subhead='Next step',
|
||||||
|
type="tip"
|
||||||
|
)}}
|
||||||
|
{% endif %}
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
{% for template in templates %}
|
{% for template in templates %}
|
||||||
<div class="column-two-thirds">
|
<div class="column-two-thirds">
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ def test_choose_sms_template(app_,
|
|||||||
mock_login,
|
mock_login,
|
||||||
mock_get_user,
|
mock_get_user,
|
||||||
mock_check_verify_code,
|
mock_check_verify_code,
|
||||||
mock_get_service_templates):
|
mock_get_service_templates,
|
||||||
|
mock_get_jobs):
|
||||||
with app_.test_request_context():
|
with app_.test_request_context():
|
||||||
with app_.test_client() as client:
|
with app_.test_client() as client:
|
||||||
client.login(api_user_active)
|
client.login(api_user_active)
|
||||||
|
|||||||
Reference in New Issue
Block a user