Add routing and pages for managing templates

So that users can see what it the flow is like to:
- add new templates
- edit existing templates
This commit is contained in:
Chris Hill-Scott
2015-12-20 00:00:01 +00:00
parent 5e0777b696
commit ba48707371
10 changed files with 124 additions and 69 deletions

View File

@@ -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')

View File

@@ -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'))