mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Add stubbed template_id to template pages
So that we can get a better sense of what the URLs look like. Leaving unsigned for now because we don’t know if the ID will be a string or int or…
This commit is contained in:
@@ -14,12 +14,29 @@ def manage_templates(service_id):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@main.route("/services/<int:service_id>/templates/template", methods=['GET', 'POST'])
|
@main.route("/services/<int:service_id>/templates/add", methods=['GET', 'POST'])
|
||||||
@login_required
|
@login_required
|
||||||
def add_template(service_id):
|
def add_template(service_id):
|
||||||
|
|
||||||
form = TemplateForm()
|
form = TemplateForm()
|
||||||
|
|
||||||
|
if request.method == 'GET':
|
||||||
|
return render_template(
|
||||||
|
'views/edit-template.html',
|
||||||
|
h1='Add template',
|
||||||
|
form=form,
|
||||||
|
service_id=service_id
|
||||||
|
)
|
||||||
|
elif request.method == 'POST':
|
||||||
|
return redirect(url_for('.manage_templates', service_id=service_id))
|
||||||
|
|
||||||
|
|
||||||
|
@main.route("/services/<int:service_id>/templates/<template_id>", methods=['GET', 'POST'])
|
||||||
|
@login_required
|
||||||
|
def edit_template(service_id, template_id):
|
||||||
|
|
||||||
|
form = TemplateForm()
|
||||||
|
|
||||||
form.template_name.data = 'Reminder'
|
form.template_name.data = 'Reminder'
|
||||||
form.template_body.data = 'Vehicle tax: Your vehicle tax for ((registration number)) expires on ((date)). Tax your vehicle at www.gov.uk/vehicle-tax' # noqa
|
form.template_body.data = 'Vehicle tax: Your vehicle tax for ((registration number)) expires on ((date)). Tax your vehicle at www.gov.uk/vehicle-tax' # noqa
|
||||||
|
|
||||||
@@ -32,20 +49,3 @@ def add_template(service_id):
|
|||||||
)
|
)
|
||||||
elif request.method == 'POST':
|
elif request.method == 'POST':
|
||||||
return redirect(url_for('.manage_templates', service_id=service_id))
|
return redirect(url_for('.manage_templates', service_id=service_id))
|
||||||
|
|
||||||
|
|
||||||
@main.route("/services/<int:service_id>/templates/template/add", methods=['GET', 'POST'])
|
|
||||||
@login_required
|
|
||||||
def edit_template(service_id):
|
|
||||||
|
|
||||||
form = TemplateForm()
|
|
||||||
|
|
||||||
if request.method == 'GET':
|
|
||||||
return render_template(
|
|
||||||
'views/edit-template.html',
|
|
||||||
h1='Add template',
|
|
||||||
form=form,
|
|
||||||
service_id=service_id
|
|
||||||
)
|
|
||||||
elif request.method == 'POST':
|
|
||||||
return redirect(url_for('.manage_templates', service_id=service_id))
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ GOV.UK Notify | Notifications activity
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Sent with template <a href="{{ url_for('.edit_template', service_id=service_id) }}">{{ template_used }}</a> at {{ uploaded_file_time }}
|
Sent with template <a href="{{ url_for('.edit_template', service_id=service_id, template_id=1) }}">{{ template_used }}</a> at {{ uploaded_file_time }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{% call(item) list_table(
|
{% call(item) list_table(
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ GOV.UK Notify | Manage templates
|
|||||||
<p>Here's where you can view templates, choose to add one, or edit/delete one.</p>
|
<p>Here's where you can view templates, choose to add one, or edit/delete one.</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a href="{{ url_for('.edit_template', service_id=service_id) }}">Here is my first template</a>
|
<a href="{{ url_for('.edit_template', service_id=service_id, template_id=1) }}">Here is my first template</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a class="button" href="{{ url_for('.edit_template', service_id=service_id) }}" role="button">Add a new message template</a>
|
<a class="button" href="{{ url_for('.add_template', service_id=service_id) }}" role="button">Add a new message template</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user