mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05: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'])
|
||||
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(
|
||||
'views/choose-sms-template.html',
|
||||
templates=[
|
||||
Template(template) for template in templates_dao.get_service_templates(service_id)['data']
|
||||
],
|
||||
has_jobs=len(jobs),
|
||||
service_id=service_id
|
||||
)
|
||||
|
||||
|
||||
@@ -14,6 +14,15 @@
|
||||
<form method="POST" enctype="multipart/form-data">
|
||||
|
||||
{% if templates %}
|
||||
{% if not has_jobs %}
|
||||
{{ banner(
|
||||
"""
|
||||
Send yourself a test message
|
||||
""",
|
||||
subhead='Next step',
|
||||
type="tip"
|
||||
)}}
|
||||
{% endif %}
|
||||
<div class="grid-row">
|
||||
{% for template in templates %}
|
||||
<div class="column-two-thirds">
|
||||
|
||||
@@ -9,7 +9,8 @@ def test_choose_sms_template(app_,
|
||||
mock_login,
|
||||
mock_get_user,
|
||||
mock_check_verify_code,
|
||||
mock_get_service_templates):
|
||||
mock_get_service_templates,
|
||||
mock_get_jobs):
|
||||
with app_.test_request_context():
|
||||
with app_.test_client() as client:
|
||||
client.login(api_user_active)
|
||||
|
||||
Reference in New Issue
Block a user