summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-04-26 17:18:07 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-06 10:12:16 +0100
commitfce42a28cc2c32d90c072ab8561190c8531f9acd (patch)
tree77ad9cf45ec01749bc53b97344f6a77e663e1db4 /bitbake/lib/toaster
parentd3b5b0b4bb517db077d06d6339bb4b2987c031bf (diff)
downloadpoky-fce42a28cc2c32d90c072ab8561190c8531f9acd.tar.gz
bitbake: toaster: customrecipe Only show download icon or button if it's possible
If the based on recipe has not yet been checked out/cloned we cannot generate the custom image recipe file that uses it. So disable/remove the option to download it. [YOCTO #9425] (Bitbake rev: f08651a954358e9c6ce4d69de285e4cd9e1408ae) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster')
-rw-r--r--bitbake/lib/toaster/toastergui/tables.py4
-rw-r--r--bitbake/lib/toaster/toastergui/templates/customrecipe.html13
2 files changed, 15 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py
index 2cc2f4eb7b..d375da434f 100644
--- a/bitbake/lib/toaster/toastergui/tables.py
+++ b/bitbake/lib/toaster/toastergui/tables.py
@@ -508,10 +508,12 @@ class CustomImagesTable(ToasterTable):
508 508
509 recipe_file_template = ''' 509 recipe_file_template = '''
510 <code>{{data.name}}_{{data.version}}.bb</code> 510 <code>{{data.name}}_{{data.version}}.bb</code>
511 {% if data.get_base_recipe_file %}
511 <a href="{% url 'customrecipedownload' extra.pid data.pk %}"> 512 <a href="{% url 'customrecipedownload' extra.pid data.pk %}">
512 <i class="icon-download-alt" data-original-title="Download recipe 513 <i class="icon-download-alt" data-original-title="Download recipe
513 file"></i> 514 file"></i>
514 </a>''' 515 </a>
516 {% endif %}'''
515 517
516 self.add_column(title="Recipe file", 518 self.add_column(title="Recipe file",
517 static_data_name='recipe_file_download', 519 static_data_name='recipe_file_download',
diff --git a/bitbake/lib/toaster/toastergui/templates/customrecipe.html b/bitbake/lib/toaster/toastergui/templates/customrecipe.html
index ea3c9c7324..aeb4466a20 100644
--- a/bitbake/lib/toaster/toastergui/templates/customrecipe.html
+++ b/bitbake/lib/toaster/toastergui/templates/customrecipe.html
@@ -4,6 +4,7 @@
4{% load static %} 4{% load static %}
5{% block pagecontent %} 5{% block pagecontent %}
6 6
7{% with recipe.get_base_recipe_file as base_recipe_file %}
7<div class="section"> 8<div class="section">
8 <ul class="breadcrumb"> 9 <ul class="breadcrumb">
9 <li> 10 <li>
@@ -99,8 +100,15 @@
99 <a class="btn btn-large span6 build-custom-image" href="#" style="width: 50%"> 100 <a class="btn btn-large span6 build-custom-image" href="#" style="width: 50%">
100 Build {{recipe.name}} 101 Build {{recipe.name}}
101 </a> 102 </a>
102 <a href="{% url 'customrecipedownload' project.id recipe.id %}" class="btn btn-large span6" style="width: 50%"> 103 <a href="{% url 'customrecipedownload' project.id recipe.id %}" class="btn btn-large span6" style="width: 50%"
104 {% if not base_recipe_file %}
105 disabled="disabled"
106 {% endif %}>
103 Download recipe file 107 Download recipe file
108 {% if not base_recipe_file %}
109 <i class="icon-question-sign get-help"
110 data-original-title="The {{recipe.name}} recipe cannot yet be downloaded as the Based on recipe '{{recipe.base_recipe.name}}' has not yet been fetched"></i>
111 {% endif %}
104 </a> 112 </a>
105 </div> 113 </div>
106 <div id="no-results-special-{{table_name}}" class="air" style="display:none;"> 114 <div id="no-results-special-{{table_name}}" class="air" style="display:none;">
@@ -177,7 +185,9 @@
177 <dt>Recipe file</dt> 185 <dt>Recipe file</dt>
178 <dd> 186 <dd>
179 <code>{{recipe.name}}_{{recipe.version}}.bb</code> 187 <code>{{recipe.name}}_{{recipe.version}}.bb</code>
188 {% if base_recipe_path %}
180 <a href="{% url 'customrecipedownload' project.pk recipe.pk %}"><i class="icon-share" title="" data-original-title="View recipe file"></i></a> 189 <a href="{% url 'customrecipedownload' project.pk recipe.pk %}"><i class="icon-share" title="" data-original-title="View recipe file"></i></a>
190 {% endif %}
181 </dd> 191 </dd>
182 <dt>Layer</dt> 192 <dt>Layer</dt>
183 <dd><a href="{% url 'layerdetails' project.id recipe.layer_version.pk %}">{{recipe.layer_version.layer.name}}</a></dd> 193 <dd><a href="{% url 'layerdetails' project.id recipe.layer_version.pk %}">{{recipe.layer_version.layer.name}}</a></dd>
@@ -220,4 +230,5 @@
220 </div> 230 </div>
221 </div> 231 </div>
222 232
233{% endwith %}{# end base_recipe_file #}
223 {% endblock %} 234 {% endblock %}