# HG changeset patch # User Ludovic Chabant # Date 1455002961 28800 # Node ID 40e897e2f11e95d55a302e66697f5591520c97b7 # Parent 14c51f5accc941914a5e8af3cfac312d16a2ae4b admin: Make the publish UI handle new kinds of target configurations. diff -r 14c51f5accc9 -r 40e897e2f11e foodtruck/templates/publish.html --- a/foodtruck/templates/publish.html Mon Feb 08 23:28:39 2016 -0800 +++ b/foodtruck/templates/publish.html Mon Feb 08 23:29:21 2016 -0800 @@ -5,9 +5,8 @@ {% for target in targets %}
-

{{target.name}}

+

{{target.name}}

{% if target.description %}
{{target.description}}
{% endif %} - {% if target.cmd %}

Run {{target.cmd}}.

{% endif %}
diff -r 14c51f5accc9 -r 40e897e2f11e foodtruck/views/publish.py --- a/foodtruck/views/publish.py Mon Feb 08 23:28:39 2016 -0800 +++ b/foodtruck/views/publish.py Mon Feb 08 23:29:21 2016 -0800 @@ -33,10 +33,12 @@ data['targets'] = [] for tn in sorted(pub_cfg.keys()): tc = pub_cfg[tn] + desc = None + if isinstance(tc, dict): + desc = tc.get('description') data['targets'].append({ 'name': tn, - 'description': tc.get('description'), - 'cmd': tc.get('cmd') + 'description': desc }) with_menu_context(data)