Mercurial > piecrust2
comparison piecrust/admin/views/publish.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 | 94fd4f07da83 |
children | 20f49786937c |
comparison
equal
deleted
inserted
replaced
960:8101692fdc11 | 961:b1a00c2c0c7f |
---|---|
2 import logging | 2 import logging |
3 from flask import request, g, url_for, render_template, Response | 3 from flask import request, g, url_for, render_template, Response |
4 from flask.ext.login import login_required | 4 from flask.ext.login import login_required |
5 from ..blueprint import foodtruck_bp | 5 from ..blueprint import foodtruck_bp |
6 from ..pubutil import PublishLogReader | 6 from ..pubutil import PublishLogReader |
7 from ..views import with_menu_context, with_base_data | |
8 | 7 |
9 | 8 |
10 logger = logging.getLogger(__name__) | 9 logger = logging.getLogger(__name__) |
11 | 10 |
12 | 11 |
23 site = g.site | 22 site = g.site |
24 pub_cfg = copy.deepcopy(site.piecrust_app.config.get('publish', {})) | 23 pub_cfg = copy.deepcopy(site.piecrust_app.config.get('publish', {})) |
25 if not pub_cfg: | 24 if not pub_cfg: |
26 data = {'error': "There are no publish targets defined in your " | 25 data = {'error': "There are no publish targets defined in your " |
27 "configuration file."} | 26 "configuration file."} |
28 with_base_data(data) | |
29 return render_template('error.html', **data) | 27 return render_template('error.html', **data) |
30 | 28 |
31 try: | 29 try: |
32 with open(site.publish_log_file, 'r') as fp: | 30 with open(site.publish_log_file, 'r') as fp: |
33 last_pub_log = fp.read() | 31 last_pub_log = fp.read() |