Skip to content
Snippets Groups Projects
Commit ba3f321f authored by Julian's avatar Julian
Browse files

Moved all templates to subfolders, closes #47

parent 7cbbf8b4
No related branches found
No related tags found
No related merge requests found
Showing
with 12 additions and 12 deletions
File moved
......@@ -21,7 +21,7 @@ def mail_acl_check():
@bp.route("/")
@register_navbar('Mail', icon='envelope', blueprint=bp, visible=mail_acl_check)
def index():
return render_template('mail_list.html', mails=Mail.query.all())
return render_template('mail/list.html', mails=Mail.query.all())
@bp.route("/<uid>")
@bp.route("/new")
......@@ -29,7 +29,7 @@ def show(uid=None):
mail = Mail()
if uid is not None:
mail = Mail.query.filter_by(uid=uid).first_or_404()
return render_template('mail.html', mail=mail)
return render_template('mail/show.html', mail=mail)
@bp.route("/<uid>/update", methods=['POST'])
@bp.route("/new", methods=['POST'])
......
File moved
File moved
......@@ -21,12 +21,12 @@ def setup():
recovery_methods = RecoveryCodeMethod.query.filter_by(dn=user.dn).all()
totp_methods = TOTPMethod.query.filter_by(dn=user.dn).all()
webauthn_methods = WebauthnMethod.query.filter_by(dn=user.dn).all()
return render_template('setup.html', totp_methods=totp_methods, webauthn_methods=webauthn_methods, recovery_methods=recovery_methods)
return render_template('mfa/setup.html', totp_methods=totp_methods, webauthn_methods=webauthn_methods, recovery_methods=recovery_methods)
@bp.route('/setup/disable', methods=['GET'])
@login_required()
def disable():
return render_template('disable.html')
return render_template('mfa/disable.html')
@bp.route('/setup/disable', methods=['POST'])
@login_required()
......@@ -65,7 +65,7 @@ def setup_recovery():
methods.append(method)
db.session.add(method)
db.session.commit()
return render_template('setup_recovery.html', methods=methods)
return render_template('mfa/setup_recovery.html', methods=methods)
@bp.route('/setup/totp', methods=['GET'])
@login_required()
......@@ -73,7 +73,7 @@ def setup_totp():
user = get_current_user()
method = TOTPMethod(user)
session['mfa_totp_key'] = method.key
return render_template('setup_totp.html', method=method, name=request.values['name'])
return render_template('mfa/setup_totp.html', method=method, name=request.values['name'])
@bp.route('/setup/totp', methods=['POST'])
@login_required()
......@@ -218,7 +218,7 @@ def auth():
session['user_mfa'] = True
if session.get('user_mfa'):
return redirect(request.values.get('ref', url_for('index')))
return render_template('auth.html', ref=request.values.get('ref'), totp_methods=totp_methods,
return render_template('mfa/auth.html', ref=request.values.get('ref'), totp_methods=totp_methods,
webauthn_methods=webauthn_methods, recovery_methods=recovery_methods)
@bp.route('/auth', methods=['POST'])
......
......@@ -117,7 +117,7 @@ def error():
args = dict(request.values)
err = args.pop('error', 'unknown')
error_description = args.pop('error_description', '')
return render_template('error.html', error=err, error_description=error_description, args=args)
return render_template('oauth2/error.html', error=err, error_description=error_description, args=args)
@bp.app_url_defaults
def inject_logout_params(endpoint, values):
......@@ -131,4 +131,4 @@ def logout():
return redirect(request.values.get('ref', '/'))
client_ids = request.values['client_ids'].split(',')
clients = [OAuth2Client.from_id(client_id) for client_id in client_ids]
return render_template('logout.html', clients=clients)
return render_template('oauth2/logout.html', clients=clients)
File moved
......@@ -49,18 +49,18 @@ def role_acl_check():
@bp.route("/")
@register_navbar('Roles', icon='key', blueprint=bp, visible=role_acl_check)
def index():
return render_template('role_list.html', roles=Role.query.all())
return render_template('role/list.html', roles=Role.query.all())
@bp.route("/new")
def new():
return render_template('role.html', role=Role(), groups=Group.query.all(), roles=Role.query.all())
return render_template('role/show.html', role=Role(), groups=Group.query.all(), roles=Role.query.all())
@bp.route("/<int:roleid>")
def show(roleid=None):
# prefetch all users so the ldap orm can cache them and doesn't run one ldap query per user
User.query.all()
role = Role.query.filter_by(id=roleid).one()
return render_template('role.html', role=role, groups=Group.query.all(), roles=Role.query.all())
return render_template('role/show.html', role=role, groups=Group.query.all(), roles=Role.query.all())
@bp.route("/<int:roleid>/update", methods=['POST'])
@bp.route("/new", methods=['POST'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment