mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 02:23:19 -04:00
Consolidate page templates for emails + texts
Use one page template for each of: - choosing a message template - adding recipients - checking an email message - looking at a job This commit consolidates the two templates into one, and adds logic to show the SMS message pattern or the email message pattern depending on the type of template. It also gives email templates a bit more width, because the body and the from address tend to be quite long.
This commit is contained in:
@@ -13,6 +13,7 @@ from utils.template import Template
|
||||
from app import job_api_client
|
||||
from app.main import main
|
||||
from app.main.dao import templates_dao
|
||||
from app.main.dao import services_dao
|
||||
|
||||
now = time.strftime('%H:%M')
|
||||
|
||||
@@ -37,6 +38,7 @@ def view_jobs(service_id):
|
||||
@main.route("/services/<service_id>/jobs/<job_id>")
|
||||
@login_required
|
||||
def view_job(service_id, job_id):
|
||||
service = services_dao.get_service_by_id_or_404(service_id)
|
||||
try:
|
||||
job = job_api_client.get_job(service_id, job_id)['data']
|
||||
messages = []
|
||||
@@ -58,7 +60,8 @@ def view_job(service_id, job_id):
|
||||
template=Template(
|
||||
templates_dao.get_service_template_or_404(service_id, job['template'])['data']
|
||||
),
|
||||
service_id=service_id
|
||||
service_id=service_id,
|
||||
service=service
|
||||
)
|
||||
except HTTPError as e:
|
||||
if e.status_code == 404:
|
||||
|
||||
Reference in New Issue
Block a user