comparison piecrust/admin/views/publish.py @ 952:94fd4f07da83

admin: Fix more URL prefix issues, improve publishing.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 05 Oct 2017 00:29:14 -0700
parents 5b4c02ed9bb2
children b1a00c2c0c7f
comparison
equal deleted inserted replaced
951:c50ff76e0596 952:94fd4f07da83
26 data = {'error': "There are no publish targets defined in your " 26 data = {'error': "There are no publish targets defined in your "
27 "configuration file."} 27 "configuration file."}
28 with_base_data(data) 28 with_base_data(data)
29 return render_template('error.html', **data) 29 return render_template('error.html', **data)
30 30
31 try:
32 with open(site.publish_log_file, 'r') as fp:
33 last_pub_log = fp.read()
34 except OSError:
35 last_pub_log = None
36
31 data = {} 37 data = {}
32 data['url_run'] = url_for('.publish') 38 data['url_run'] = url_for('.publish')
33 data['site_title'] = site.piecrust_app.config.get('site/title', 39 data['site_title'] = site.piecrust_app.config.get('site/title',
34 "Unnamed Website") 40 "Unnamed Website")
35 data['targets'] = [] 41 data['targets'] = []
40 desc = tc.get('description') 46 desc = tc.get('description')
41 data['targets'].append({ 47 data['targets'].append({
42 'name': tn, 48 'name': tn,
43 'description': desc 49 'description': desc
44 }) 50 })
51
52 data['last_log'] = last_pub_log
45 53
46 with_menu_context(data) 54 with_menu_context(data)
47 55
48 return render_template('publish.html', **data) 56 return render_template('publish.html', **data)
49 57