mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05:00
Make banner on template page real
This commit is contained in:
@@ -3,6 +3,7 @@ from flask_login import login_required
|
||||
|
||||
from app.main import main
|
||||
from app.main.forms import TemplateForm
|
||||
from app import job_api_client
|
||||
from app.main.dao.services_dao import get_service_by_id
|
||||
from app.main.dao import templates_dao as tdao
|
||||
from app.main.dao import services_dao as sdao
|
||||
@@ -13,6 +14,7 @@ from client.errors import HTTPError
|
||||
@login_required
|
||||
def manage_service_templates(service_id):
|
||||
try:
|
||||
jobs = job_api_client.get_job(service_id)['data']
|
||||
templates = tdao.get_service_templates(service_id)['data']
|
||||
except HTTPError as e:
|
||||
if e.status_code == 404:
|
||||
@@ -22,6 +24,7 @@ def manage_service_templates(service_id):
|
||||
return render_template(
|
||||
'views/manage-templates.html',
|
||||
service_id=service_id,
|
||||
has_jobs=bool(jobs),
|
||||
templates=[tdao.TemplatesBrowsableItem(x) for x in templates])
|
||||
|
||||
|
||||
|
||||
@@ -11,13 +11,16 @@ GOV.UK Notify | Manage templates
|
||||
|
||||
<h1 class="heading-large">Templates</h1>
|
||||
|
||||
{{ banner(
|
||||
'<a href="{}">Try sending a text message</a>'.format(
|
||||
url_for(".choose_sms_template", service_id=service_id)
|
||||
)|safe,
|
||||
subhead='Next step',
|
||||
type="tip"
|
||||
)}}
|
||||
|
||||
{% if not has_jobs %}
|
||||
{{ banner(
|
||||
'<a href="{}">Try sending a text message</a>'.format(
|
||||
url_for(".choose_sms_template", service_id=service_id)
|
||||
)|safe,
|
||||
subhead='Next step',
|
||||
type="tip"
|
||||
)}}
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="column-two-thirds">
|
||||
|
||||
Reference in New Issue
Block a user