comparison foodtruck/views/publish.py @ 629:40e897e2f11e

admin: Make the publish UI handle new kinds of target configurations.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 08 Feb 2016 23:29:21 -0800
parents e2e955a3bb25
children 3885421c29a3
comparison
equal deleted inserted replaced
628:14c51f5accc9 629:40e897e2f11e
31 data['url_run'] = url_for('publish') 31 data['url_run'] = url_for('publish')
32 data['site_title'] = site.piecrust_app.config.get('site/title', site.name) 32 data['site_title'] = site.piecrust_app.config.get('site/title', site.name)
33 data['targets'] = [] 33 data['targets'] = []
34 for tn in sorted(pub_cfg.keys()): 34 for tn in sorted(pub_cfg.keys()):
35 tc = pub_cfg[tn] 35 tc = pub_cfg[tn]
36 desc = None
37 if isinstance(tc, dict):
38 desc = tc.get('description')
36 data['targets'].append({ 39 data['targets'].append({
37 'name': tn, 40 'name': tn,
38 'description': tc.get('description'), 41 'description': desc
39 'cmd': tc.get('cmd')
40 }) 42 })
41 43
42 with_menu_context(data) 44 with_menu_context(data)
43 45
44 return render_template('publish.html', **data) 46 return render_template('publish.html', **data)