Skip to contentSkip to conversation

toaster: Fix the download icon

PATCH In review Belen Barros Pena 2 participants 2 messages Nov 10, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 toaster: Fix the download icon

From: Belen Barros Pena <[email protected]>

The 'all builds' page was missing the download icon next to the outcome icon, which allows you to download a build log from the 'all builds' page.

This patch brings it back.

It also adds a check in the project builds page to make sure the download icon only appears if the build generates a cooker log, since builds that fail at the build request stage do not generate a cooker log.

---
 bitbake/lib/toaster/toastergui/templates/builds.html        |  8 +++++++-
 bitbake/lib/toaster/toastergui/templates/projectbuilds.html | 11 ++++++-----
 2 files changed, 13 insertions(+), 6 deletions(-)
bitbake/lib/toaster/toastergui/templates/builds.html +7 -1
index a27a121..c3cc266 100644
@@ -62,7 +62,13 @@
         {% for build in objects %}
         <tr class="data" data-table-build-result="{{ build.id }}">
             <td class="outcome">
-                <a href="{% url "builddashboard" build.id %}">{%if build.outcome == build.SUCCEEDED%}<i class="icon-ok-sign success"></i>{%elif build.outcome == build.FAILED%}<i class="icon-minus-sign error"></i>{%else%}{%endif%}</a> &nbsp;
+                <a href="{% url "builddashboard" build.id %}">{%if build.outcome == build.SUCCEEDED%}<i class="icon-ok-sign success"></i>{%elif build.outcome == build.FAILED%}<i class="icon-minus-sign error"></i>{%else%}{%endif%}</a>
+                {% if build.cooker_log_path %}
+                  &nbsp;
+                  <a href="{% url 'build_artifact' build.id "cookerlog" build.id %}">
+                    <i class="icon-download-alt" title="Download build log"></i>
+                  </a>
+                {% endif %}
             </td>
             <td class="target">
                 {% for t in build.target_set.all %}
bitbake/lib/toaster/toastergui/templates/projectbuilds.html +6 -5
index bb38284..3402fc4 100644
@@ -63,11 +63,12 @@
         {% for build in objects %} {# if we have a build, just display it #}
         <tr class="data">
             <td class="outcome"><a href="{% url "builddashboard" build.id %}">{%if build.outcome == build.SUCCEEDED%}<i class="icon-ok-sign success"></i>{%elif build.outcome == build.FAILED%}<i class="icon-minus-sign error"></i>{%else%}{%endif%}</a>
-                   {% if build.project %}
-                        &nbsp; <a href="{% url 'build_artifact' build.id "cookerlog" build.id %}">
-                            <i class="icon-download-alt" title="" data-original-title="Download build log"></i>
-                        </a>
-                    {% endif %}
+              {% if build.cooker_log_path %}
+                &nbsp;
+                <a href="{% url 'build_artifact' build.id "cookerlog" build.id %}">
+                  <i class="icon-download-alt" title="Download build log"></i>
+                </a>
+              {% endif %}
             </td>
 
             <td class="target">
Signature · 1 line
2.4.9 (Apple Git-60)
#1 lore raw

Thanks upstreamed and pushed to toaster-next with additions to make commit message more descriptive.

Quoted 60 lines · Belen Barros Pena

From: Belen Barros Pena <[email protected]>

The 'all builds' page was missing the download icon next to the outcome icon, which allows you to download a build log from the 'all builds' page.

This patch brings it back.

It also adds a check in the project builds page to make sure the download icon only appears if the build generates a cooker log, since builds that fail at the build request stage do not generate a cooker log.

---
  bitbake/lib/toaster/toastergui/templates/builds.html        |  8 +++++++-
  bitbake/lib/toaster/toastergui/templates/projectbuilds.html | 11 ++++++-----
  2 files changed, 13 insertions(+), 6 deletions(-)
bitbake/lib/toaster/toastergui/templates/builds.html +7 -1
index a27a121..c3cc266 100644
@@ -62,7 +62,13 @@
          {% for build in objects %}
          <tr class="data" data-table-build-result="{{ build.id }}">
              <td class="outcome">
-                <a href="{% url "builddashboard" build.id %}">{%if build.outcome == build.SUCCEEDED%}<i class="icon-ok-sign success"></i>{%elif build.outcome == build.FAILED%}<i class="icon-minus-sign error"></i>{%else%}{%endif%}</a> &nbsp;
+                <a href="{% url "builddashboard" build.id %}">{%if build.outcome == build.SUCCEEDED%}<i class="icon-ok-sign success"></i>{%elif build.outcome == build.FAILED%}<i class="icon-minus-sign error"></i>{%else%}{%endif%}</a>
+                {% if build.cooker_log_path %}
+                  &nbsp;
+                  <a href="{% url 'build_artifact' build.id "cookerlog" build.id %}">
+                    <i class="icon-download-alt" title="Download build log"></i>
+                  </a>
+                {% endif %}
              </td>
              <td class="target">
                  {% for t in build.target_set.all %}
bitbake/lib/toaster/toastergui/templates/projectbuilds.html +6 -5
index bb38284..3402fc4 100644
@@ -63,11 +63,12 @@
          {% for build in objects %} {# if we have a build, just display it #}
          <tr class="data">
              <td class="outcome"><a href="{% url "builddashboard" build.id %}">{%if build.outcome == build.SUCCEEDED%}<i class="icon-ok-sign success"></i>{%elif build.outcome == build.FAILED%}<i class="icon-minus-sign error"></i>{%else%}{%endif%}</a>
-                   {% if build.project %}
-                        &nbsp; <a href="{% url 'build_artifact' build.id "cookerlog" build.id %}">
-                            <i class="icon-download-alt" title="" data-original-title="Download build log"></i>
-                        </a>
-                    {% endif %}
+              {% if build.cooker_log_path %}
+                &nbsp;
+                <a href="{% url 'build_artifact' build.id "cookerlog" build.id %}">
+                  <i class="icon-download-alt" title="Download build log"></i>
+                </a>
+              {% endif %}
              </td>
 
              <td class="target">