comparison piecrust/admin/views/dashboard.py @ 961:b1a00c2c0c7f

admin: Use URL routes for static assets. This removes the need for `base_url` and other workarounds for when the admin panel is under a sub-folder.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 07 Oct 2017 12:16:04 -0700
parents 8101692fdc11
children 8adc27285d93
comparison
equal deleted inserted replaced
960:8101692fdc11 961:b1a00c2c0c7f
8 from piecrust.sources.fs import FSContentSourceBase 8 from piecrust.sources.fs import FSContentSourceBase
9 from piecrust.sources.interfaces import IInteractiveSource 9 from piecrust.sources.interfaces import IInteractiveSource
10 from piecrust.uriutil import split_uri 10 from piecrust.uriutil import split_uri
11 from ..textutil import text_preview 11 from ..textutil import text_preview
12 from ..blueprint import foodtruck_bp, load_user 12 from ..blueprint import foodtruck_bp, load_user
13 from ..views import with_menu_context, with_base_data 13 from ..views import with_menu_context
14 14
15 15
16 logger = logging.getLogger(__name__) 16 logger = logging.getLogger(__name__)
17 17
18 18
133 return redirect(url_for('.index')) 133 return redirect(url_for('.index'))
134 data['message'] = ( 134 data['message'] = (
135 "User '%s' doesn't exist or password is incorrect." % 135 "User '%s' doesn't exist or password is incorrect." %
136 username) 136 username)
137 137
138 with_base_data(data)
139 return render_template('login.html', **data) 138 return render_template('login.html', **data)
140 139
141 140
142 @foodtruck_bp.route('/logout') 141 @foodtruck_bp.route('/logout')
143 @login_required 142 @login_required