mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 22:40:31 -04:00
Change step 1 of tour to only show the template
We’ve made a few changes to the tour recently, without changing the help text on the left hand side of the screen. So the stuff you see on the right side of the screen doesn’t quite sync up any more. This commit adds an extra, introductory page that just shows the template and a next button, which better matches the ‘every message starts with a template’ help text.
This commit is contained in:
@@ -88,8 +88,9 @@
|
||||
background: $govuk-blue;
|
||||
color: $white;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 0;
|
||||
padding: $gutter;
|
||||
height: 475px;
|
||||
height: 425px;
|
||||
overflow: hidden;
|
||||
box-shadow: inset 0 -1em 1.6em 0 rgba(0, 0, 0, 0.05);
|
||||
|
||||
|
||||
@@ -80,10 +80,9 @@ def add_service():
|
||||
)
|
||||
|
||||
return redirect(url_for(
|
||||
'main.send_test',
|
||||
'main.start_tour',
|
||||
service_id=service_id,
|
||||
template_id=example_sms_template['data']['id'],
|
||||
help=1
|
||||
))
|
||||
else:
|
||||
return render_template(
|
||||
|
||||
@@ -18,7 +18,7 @@ from notifications_utils.recipients import first_column_headings
|
||||
from notifications_python_client.errors import HTTPError
|
||||
|
||||
from app.main import main
|
||||
from app.utils import user_has_permissions, get_template
|
||||
from app.utils import user_has_permissions, get_template, get_help_argument
|
||||
from app.template_previews import TemplatePreview, get_page_count_for_letter
|
||||
from app.main.forms import (
|
||||
ChooseTemplateType,
|
||||
@@ -73,6 +73,34 @@ def view_template(service_id, template_id):
|
||||
)
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/start-tour/<uuid:template_id>")
|
||||
@login_required
|
||||
@user_has_permissions(
|
||||
'view_activity',
|
||||
'send_texts',
|
||||
'send_emails',
|
||||
'manage_templates',
|
||||
'manage_api_keys',
|
||||
admin_override=True, any_=True
|
||||
)
|
||||
def start_tour(service_id, template_id):
|
||||
|
||||
template = service_api_client.get_service_template(service_id, str(template_id))['data']
|
||||
|
||||
if template['template_type'] != 'sms':
|
||||
abort(404)
|
||||
|
||||
return render_template(
|
||||
'views/templates/start-tour.html',
|
||||
template=get_template(
|
||||
template,
|
||||
current_service,
|
||||
show_recipient=True,
|
||||
),
|
||||
help='1',
|
||||
)
|
||||
|
||||
|
||||
@main.route("/services/<service_id>/templates")
|
||||
@main.route("/services/<service_id>/templates/<template_type>")
|
||||
@login_required
|
||||
|
||||
21
app/templates/views/templates/start-tour.html
Normal file
21
app/templates/views/templates/start-tour.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/textbox.html" import textbox %}
|
||||
{% from "components/api-key.html" import api_key %}
|
||||
|
||||
{% block service_page_title %}
|
||||
{{ template.name }}
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
|
||||
<h1 class="heading-large">{{ template.name }}</h1>
|
||||
|
||||
{{ template|string }}
|
||||
|
||||
<div class="page-footer">
|
||||
<a href="{{ url_for('.send_test', service_id=current_service.id, template_id=template.id, help=2) }}" class="button">Next</a>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user