diff --git a/app/main/__init__.py b/app/main/__init__.py index a7134aef1..7b77dcc48 100644 --- a/app/main/__init__.py +++ b/app/main/__init__.py @@ -4,5 +4,5 @@ main = Blueprint('main', __name__) from app.main.views import ( - index, sign_in, register, two_factor, verify, sms, add_service, code_not_received, jobs, dashboard + index, sign_in, register, two_factor, verify, sms, add_service, code_not_received, jobs, dashboard, templates ) diff --git a/app/main/views/index.py b/app/main/views/index.py index 446d52dec..9c9ef1f6c 100644 --- a/app/main/views/index.py +++ b/app/main/views/index.py @@ -9,12 +9,6 @@ def index(): return render_template('views/signedout.html') -@main.route("/dashboard") -@login_required -def dashboard(): - return render_template('views/dashboard.html') - - @main.route("/govuk") def govuk(): return render_template('views/govuk_template.html') @@ -70,11 +64,6 @@ def apikeys(): return render_template('views/api-keys.html') -@main.route("/manage-templates") -def managetemplates(): - return render_template('views/manage-templates.html') - - -@main.route("/edit-template") -def edittemplate(): - return render_template('views/edit-template.html') +@main.route("/verification-not-received") +def verificationnotreceived(): + return render_template('views/verification-not-received.html') diff --git a/app/main/views/templates.py b/app/main/views/templates.py new file mode 100644 index 000000000..ff80cb353 --- /dev/null +++ b/app/main/views/templates.py @@ -0,0 +1,32 @@ +from flask import request, render_template, redirect, url_for + +from app.main import main + + +@main.route("/templates") +def manage_templates(): + return render_template('views/manage-templates.html') + + +@main.route("/templates/template", methods=['GET', 'POST']) +def add_template(): + if request.method == 'GET': + return render_template( + 'views/edit-template.html', + template_name='Reminder', + template_body='Vehicle tax: Your vehicle tax for ((registration number)) expires on ((date)). Tax your vehicle at www.gov.uk/vehicle-tax', # noqa + h1='Edit template' + ) + elif request.method == 'POST': + return redirect(url_for('.manage_templates')) + + +@main.route("/templates/template/add", methods=['GET', 'POST']) +def edit_template(): + if request.method == 'GET': + return render_template( + 'views/edit-template.html', + h1='Add template' + ) + elif request.method == 'POST': + return redirect(url_for('.manage_templates')) diff --git a/app/templates/components/submit-form.html b/app/templates/components/submit-form.html index cd879a238..012d0a580 100644 --- a/app/templates/components/submit-form.html +++ b/app/templates/components/submit-form.html @@ -1,11 +1,9 @@ -{% macro submit_form(button_text, back_link) %} +{% macro submit_form(button_text, back_link=False) %}
Here's where you can edit an exiting template (including delete) or add a new one
+ - - {% endblock %} diff --git a/app/templates/views/manage-templates.html b/app/templates/views/manage-templates.html index 1554f3b09..4c4fa8d88 100644 --- a/app/templates/views/manage-templates.html +++ b/app/templates/views/manage-templates.html @@ -7,15 +7,17 @@ GOV.UK Notify | Manage templates {% block maincolumn_content %} -Here's where you can view templates, choose to add one, or edit/delete one.
+Here's where you can view templates, choose to add one, or edit/delete one.
- + -- Add a new message template -
++ Add a new message template +
{% endblock %} diff --git a/app/templates/views/send-sms.html b/app/templates/views/send-sms.html index ce07dc69e..75d81ffeb 100644 --- a/app/templates/views/send-sms.html +++ b/app/templates/views/send-sms.html @@ -24,7 +24,7 @@ {% endfor %}- or create a new template + or create a new template