Skip to contentSkip to conversation

toaster: fix layout for command-line builds in recent builds area

PATCH In review Elliot Smith 3 participants 3 messages Jun 30, 2016 – Jul 4, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toaster: fix layout for command-line builds in recent builds area

Command-line builds were displayed incorrectly, so that the HTML elements for other builds were being "consumed" by the command-line build elements due to incorrect positioning of element end tags.

Fix by ensuring end tags close elements in the right places.

As the indentation was all over the place in the most recent builds section template, it was almost impossible to see what the problem was. So that was fixed, too.

[YOCTO #9842]

---
 .../toaster/toastergui/templates/mrb_section.html  | 247 ++++++++++-----------
 1 file changed, 123 insertions(+), 124 deletions(-)
bitbake/lib/toaster/toastergui/templates/mrb_section.html +123 -124
index 4b4e3e6..b164269 100644
@@ -3,6 +3,7 @@
 {% load project_url_tag %}
 {% load humanize %}
 <script src="{% static 'js/mrbsection.js' %}"></script>
+
 <script>
   $(document).ready(function () {
     var ctx = {
@@ -18,165 +19,163 @@
   });
 </script>
 
-{%if mru %}
+{% if mru %}
 
-  {%if mrb_type == 'project' %}
-  <h2>
-    Latest project builds
+  {% if mrb_type == 'project' %}
+    <h2>
+      Latest project builds
 
-    {% if project.is_default %}
-    <span class="glyphicon glyphicon-question-sign get-help heading-help" title="" data-original-title="Builds in this project cannot be started from Toaster: they are started from the command line"></span>
-    {% endif %}
-  </h2>
+      {% if project.is_default %}
+        <span class="glyphicon glyphicon-question-sign get-help heading-help" data-original-title="Builds in this project cannot be started from Toaster: they are started from the command line"></span>
+        {% endif %}
+    </h2>
   {% else %}
     <div class="page-header">
-      <h1>
-      Latest builds
-      </h1>
+      <h1>Latest builds</h1>
     </div>
   {% endif %}
+
   <div id="latest-builds">
-  {% for build in mru %}
-  <div data-latest-build-result="{{ build.id }}" class="alert build-result {%if build.outcome == build.SUCCEEDED%}alert-success{%elif build.outcome == build.FAILED%}alert-danger{%else%}alert-info{%endif%}">
+    {% for build in mru %}
+      <div data-latest-build-result="{{build.id}}" class="alert build-result {% if build.outcome == build.SUCCEEDED %}alert-success{% elif build.outcome == build.FAILED %}alert-danger{% else %}alert-info{% endif %}">
         {% if mrb_type != 'project' %}
-        <div class="row project-name">
-          <div class="col-md-12">
-            <small>
-              <a class="alert-link text-uppercase" href={% project_url build.project %}>{{build.project.name}}</a>
-            </small>
+          <div class="row project-name">
+            <div class="col-md-12">
+              <small>
+                <a class="alert-link text-uppercase" href={% project_url build.project %}>{{build.project.name}}</a>
+              </small>
+            </div>
           </div>
-        </div>
         {% endif %}
+
         <div class="row">
           <div class="col-md-3">
-    {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
-              <a href="{%url 'builddashboard' build.pk%}" class="alert-link">
-    {% endif %}
+            {% if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
+              <a href="{% url 'builddashboard' build.pk %}" class="alert-link">
+            {% endif %}
+
             {% if build.target_set.all.count > 0 %}
-                <span data-toggle="tooltip"
-                  {% if build.target_set.all.count > 1 %}
-                    {{build.get_sorted_target_list.0.target}}
-                    title="Recipes:
-                    {% for target in build.get_sorted_target_list %}
-                        {% if target.task %}
-                            {{target.target}}:{{target.task}}
-                        {% else %}
-                            {{target.target}}
-                        {% endif %}
-                    {% endfor %}"
-                  {% endif %}
-                >
+              <span data-toggle="tooltip"
+                {% if build.target_set.all.count > 1 %}
+                  {{build.get_sorted_target_list.0.target}}
+                  title="Recipes:
+                  {% for target in build.get_sorted_target_list %}
+                    {% if target.task %}
+                      {{target.target}}:{{target.task}}
+                    {% else %}
+                      {{target.target}}
+                    {% endif %}
+                  {% endfor %}"
+                {% endif %}
+              >
                 {% if build.target_set.all.0.task %}
-                    {{build.get_sorted_target_list.0.target}}:{{build.target_set.all.0.task}}
+                  {{build.get_sorted_target_list.0.target}}:{{build.target_set.all.0.task}}
                 {% else %}
-                    {{build.get_sorted_target_list.0.target}}
+                  {{build.get_sorted_target_list.0.target}}
                 {% endif %}
+
                 {% if build.target_set.all.count > 1 %}
-                    (+{{build.target_set.all.count|add:"-1"}})
+                  (+{{build.target_set.all.count|add:"-1"}})
                 {% endif %}
-                </span>
-             {% endif %}
-    {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
-                </a>
-    {% endif %}
-            </div>
-    {% if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
+              </span>
+            {% endif %}
+            {% if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
+              </a>
+            {% endif %}
+          </div>
+
+          {% if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
             <div class="col-md-2">
-                {% if build.completed_on|format_build_date  %}
-                    {{ build.completed_on|date:'d/m/y H:i' }}
-                {% else %}
-                    {{ build.completed_on|date:'H:i' }}
-                {% endif %}
+              {% if build.completed_on|format_build_date  %}
+                {{build.completed_on|date:'d/m/y H:i'}}
+              {% else %}
+                {{ build.completed_on|date:'H:i' }}
+              {% endif %}
             </div>
-    {% endif %}
-    {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
+          {% endif %}
+
+          {% if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
             <div class="col-md-2">
-      {% if  build.errors.count %}
+              {% if build.errors.count %}
                 <span class="glyphicon glyphicon-minus-sign"></span>
-                <a href="{%url 'builddashboard' build.pk%}#errors" class="alert-link">{{build.errors.count}} error{{build.errors.count|pluralize}}</a>
-      {% endif %}
+                <a href="{%url 'builddashboard' build.pk%}#errors" class="alert-link">
+                  {{build.errors.count}} error{{build.errors.count|pluralize}}
+                </a>
+              {% endif %}
             </div>
+
             <div class="col-md-2">
-      {% if  build.warnings.count %}
+              {% if build.warnings.count %}
                 <span class="glyphicon glyphicon-warning-sign build-warnings"></span>
-                <a href="{%url 'builddashboard' build.pk%}#warnings" class="alert-link build-warnings">{{build.warnings.count}} warning{{build.warnings.count|pluralize}}</a>
-      {% endif %}
+                <a href="{%url 'builddashboard' build.pk%}#warnings" class="alert-link build-warnings">
+                  {{build.warnings.count}} warning{{build.warnings.count|pluralize}}
+                </a>
+              {% endif %}
             </div>
+
             <div class="col-md-3">
               Build time: <a class="alert-link" href="{% url 'buildtime' build.pk %}">{{ build.timespent_seconds|sectohms }}
               </a>
+
               {% if build.project.is_default %}
-                  <span class="pull-right glyphicon glyphicon-question-sign get-help
-                  {% if build.outcome == build.SUCCEEDED %}
-                      get-help-green
-                  {% elif build.outcome == build.FAILED %}
-                      get-help-red
-                  {% else %}
-                      get-help-blue
-                  {% endif %}
-                  " title="Builds in this project cannot be started from Toaster: they are started from the command line">
-                  </span>
+                <span class="pull-right glyphicon glyphicon-question-sign get-help {% if build.outcome == build.SUCCEEDED %}get-help-green{% elif build.outcome == build.FAILED %}get-help-red{% else %}get-help-blue{% endif %}"
+                title="Builds in this project cannot be started from Toaster: they are started from the command line">
+                </span>
               {% else %}
-                  <a href="#" class="run-again-btn alert-link
-                      {% if build.outcome == build.SUCCEEDED %}
-                          success
-                      {% elif build.outcome == build.FAILED %}
-                          danger
-                      {% else %}
-                          info
-                      {%endif%}
-                      pull-right"
-                      data-request-url="{% url 'xhr_buildrequest' build.project.pk %}"
-                      data-target='{{build.target_set.all|get_tasks|json}}'>
-                      <span class="glyphicon glyphicon-repeat"></span>
-                      Rebuild
-                  </a>
+                <a href="#" class="run-again-btn alert-link {% if build.outcome == build.SUCCEEDED %}success{% elif build.outcome == build.FAILED %}danger{% else %}info{% endif %} pull-right"
+                data-request-url="{% url 'xhr_buildrequest' build.project.pk %}"
+                data-target='{{build.target_set.all|get_tasks|json}}'>
+                  <span class="glyphicon glyphicon-repeat"></span>
+                  Rebuild
+                </a>
               {% endif %}
             </div>
-    {%endif%}
+          {% endif %}
 
-    {%if build.outcome == build.IN_PROGRESS %}
-    <div class="col-md-4" style="display:none" id="cancelling-msg-{{build.buildrequest.pk}}">
-      Cancelling the build ...
-    </div>
-    <div class="col-md-4 col-md-offset-1 progress-info">
-      <div class="progress" id="build-pc-done-title-{{build.pk}}">
-        <div id="build-pc-done-bar-{{build.pk}}" style="width: {{build.completeper}}%;" class="progress-bar"></div>
-      </div>
-    </div>
-    <div class="col-md-4 progress-info"><span id="build-pc-done-{{build.pk}}">{{build.completeper}}</span>% of tasks complete
-    {# No build cancel for command line builds project #}
-    {% if build.project.is_default %}
-    <span class="glyphicon glyphicon-question-sign get-help get-help-blue pull-right" title="Builds in this project cannot be cancelled from Toaster: they can only be cancelled from the command line"></span>
-    {% else %}
-      <a href="#" class="cancel-build-btn pull-right alert-link"
-          data-buildrequest-id={{build.buildrequest.pk}}
-          data-request-url="{% url 'xhr_buildrequest' build.project.pk %}" >
-        <span class="glyphicon glyphicon-remove-circle"></span>
-        Cancel
-      </a>
-    </div>
-    {% endif %}
+          {% if build.outcome == build.IN_PROGRESS %}
+            <div class="col-md-4" style="display:none" id="cancelling-msg-{{build.buildrequest.pk}}">
+              Cancelling the build ...
+            </div>
 
-    {%endif%} {# end if in progress #}
+            <div class="col-md-4 col-md-offset-1 progress-info">
+              <div class="progress" id="build-pc-done-title-{{build.pk}}">
+                <div id="build-pc-done-bar-{{build.pk}}" style="width: {{build.completeper}}%;" class="progress-bar">
+                </div>
+              </div>
+            </div>
 
-    {% if build.outcome == build.CANCELLED %}
-    <div class="col-md-6">
-      Build cancelled
-    </div>
-    <div class="col-md-3">
-      <a href="#" class="info pull-right run-again-btn alert-link"
-        data-request-url="{% url 'xhr_buildrequest' build.project.pk %}"
-        data-target='{{build.target_set.all|get_tasks|json}}'>
-        <span class="glyphicon glyphicon-repeat"></span>
-        Rebuild
-      </a>
-    </div>
-    {% endif %}
-  </div>
-</div>
-  {% endfor %}
-  </div>
+            <div class="col-md-4 progress-info">
+              <span id="build-pc-done-{{build.pk}}">{{build.completeper}}</span>% of tasks complete
+              {# No build cancel for command line builds project #}
+              {% if build.project.is_default %}
+                <span class="glyphicon glyphicon-question-sign get-help get-help-blue pull-right" title="Builds in this project cannot be cancelled from Toaster: they can only be cancelled from the command line"></span>
+              {% else %}
+                <a href="#" class="cancel-build-btn pull-right alert-link"
+                data-buildrequest-id={{build.buildrequest.pk}}
+                data-request-url="{% url 'xhr_buildrequest' build.project.pk %}">
+                  <span class="glyphicon glyphicon-remove-circle"></span>
+                  Cancel
+                </a>
+              {% endif %}
+            </div>
+          {% endif %} {# end if in progress #}
 
-{%endif%}
+          {% if build.outcome == build.CANCELLED %}
+            <div class="col-md-6">
+              Build cancelled
+            </div>
 
+            <div class="col-md-3">
+              <a href="#" class="info pull-right run-again-btn alert-link"
+              data-request-url="{% url 'xhr_buildrequest' build.project.pk %}"
+              data-target='{{build.target_set.all|get_tasks|json}}'>
+                <span class="glyphicon glyphicon-repeat"></span>
+                Rebuild
+              </a>
+            </div>
+          {% endif %}
+        </div>
+      </div>
+    {% endfor %}
+  </div>
+{% endif %}
\ No newline at end of file
Signature · 1 line
2.7.4
#1 lore raw
Quoted 10 lines · On 30/06/2016 10:56, "[email protected] on behalf of Elliot…

Command-line builds were displayed incorrectly, so that the HTML elements for other builds were being "consumed" by the command-line build elements due to incorrect positioning of element end tags.

Fix by ensuring end tags close elements in the right places.

As the indentation was all over the place in the most recent builds section template, it was almost impossible to see what the problem was. So that was fixed, too.

Thanks for this. It looks great.

Cheers

Belén

Quoted 383 lines

[YOCTO #9842]

---
.../toaster/toastergui/templates/mrb_section.html | 247
++++++++++-----------

1 file changed, 123 insertions(+), 124 deletions(-)
bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -0
index 4b4e3e6..b164269 100644
@@ -3,6 +3,7 @@
 {% load project_url_tag %}
 {% load humanize %}

<script src="{% static 'js/mrbsection.js' %}"></script> +
<script>

  $(document).ready(function () {
    var ctx = {
bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -0
@@ -18,165 +19,163 @@
  });

</script>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +4 -6
-{%if mru %}
+{% if mru %}
 
-  {%if mrb_type == 'project' %}
-  <h2>
-    Latest project builds
+  {% if mrb_type == 'project' %}
+    <h2>
+      Latest project builds
 
-    {% if project.is_default %}
-    <span class="glyphicon glyphicon-question-sign get-help

heading-help" title="" data-original-title="Builds in this project cannot be started from Toaster: they are started from the command line"></span>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +2 -2
-    {% endif %}
-  </h2>
+      {% if project.is_default %}
+        <span class="glyphicon glyphicon-question-sign get-help

heading-help" data-original-title="Builds in this project cannot be started from Toaster: they are started from the command line"></span>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +4 -5
+        {% endif %}
+    </h2>
  {% else %}
    <div class="page-header">
-      <h1>
-      Latest builds
-      </h1>
+      <h1>Latest builds</h1>
    </div>
  {% endif %}
+
  <div id="latest-builds">
-  {% for build in mru %}
-  <div data-latest-build-result="{{ build.id }}" class="alert

build-result {%if build.outcome == build.SUCCEEDED%}alert-success{%elif build.outcome == build.FAILED%}alert-danger{%else%}alert-info{%endif%}">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +2 -0
+    {% for build in mru %}
+      <div data-latest-build-result="{{build.id}}" class="alert

build-result {% if build.outcome == build.SUCCEEDED %}alert-success{% elif build.outcome == build.FAILED %}alert-danger{% else %}alert-info{% endif %}">

        {% if mrb_type != 'project' %}
bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -4
-        <div class="row project-name">
-          <div class="col-md-12">
-            <small>
-              <a class="alert-link text-uppercase" href={% project_url

build.project %}>{{build.project.name}}</a>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +4 -1
-            </small>
+          <div class="row project-name">
+            <div class="col-md-12">
+              <small>
+                <a class="alert-link text-uppercase" href={% project_url

build.project %}>{{build.project.name}}</a>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +3 -2
+              </small>
+            </div>
          </div>
-        </div>
        {% endif %}
+
        <div class="row">
          <div class="col-md-3">
-    {%if build.outcome == build.SUCCEEDED or build.outcome ==

build.FAILED %}
- <a href="{%url 'builddashboard' build.pk%}"
class="alert-link">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +1 -1
-    {% endif %}
+            {% if build.outcome == build.SUCCEEDED or build.outcome ==

build.FAILED %}
+ <a href="{% url 'builddashboard' build.pk %}"
class="alert-link">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +15 -14
+            {% endif %}
+
            {% if build.target_set.all.count > 0 %}
-                <span data-toggle="tooltip"
-                  {% if build.target_set.all.count > 1 %}
-                    {{build.get_sorted_target_list.0.target}}
-                    title="Recipes:
-                    {% for target in build.get_sorted_target_list %}
-                        {% if target.task %}
-                            {{target.target}}:{{target.task}}
-                        {% else %}
-                            {{target.target}}
-                        {% endif %}
-                    {% endfor %}"
-                  {% endif %}
-                >
+              <span data-toggle="tooltip"
+                {% if build.target_set.all.count > 1 %}
+                  {{build.get_sorted_target_list.0.target}}
+                  title="Recipes:
+                  {% for target in build.get_sorted_target_list %}
+                    {% if target.task %}
+                      {{target.target}}:{{target.task}}
+                    {% else %}
+                      {{target.target}}
+                    {% endif %}
+                  {% endfor %}"
+                {% endif %}
+              >
                {% if build.target_set.all.0.task %}
-                 

{{build.get_sorted_target_list.0.target}}:{{build.target_set.all.0.task}} + {{build.get_sorted_target_list.0.target}}:{{build.target_set.all.0.task}}

                {% else %}
bitbake/lib/toaster/toastergui/templates/mrb_section.html +3 -5
-                    {{build.get_sorted_target_list.0.target}}
+                  {{build.get_sorted_target_list.0.target}}
                {% endif %}
+
                {% if build.target_set.all.count > 1 %}
-                    (+{{build.target_set.all.count|add:"-1"}})
+                  (+{{build.target_set.all.count|add:"-1"}})
                {% endif %}
-                </span>
-             {% endif %}
-    {%if build.outcome == build.SUCCEEDED or build.outcome ==

build.FAILED %}

bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -4
-                </a>
-    {% endif %}
-            </div>
-    {% if build.outcome == build.SUCCEEDED or build.outcome ==

build.FAILED %}

bitbake/lib/toaster/toastergui/templates/mrb_section.html +3 -0
+              </span>
+            {% endif %}
+            {% if build.outcome == build.SUCCEEDED or build.outcome ==

build.FAILED %}

bitbake/lib/toaster/toastergui/templates/mrb_section.html +5 -0
+              </a>
+            {% endif %}
+          </div>
+
+          {% if build.outcome == build.SUCCEEDED or build.outcome ==

build.FAILED %}

            <div class="col-md-2">
bitbake/lib/toaster/toastergui/templates/mrb_section.html +5 -7
-                {% if build.completed_on|format_build_date  %}
-                    {{ build.completed_on|date:'d/m/y H:i' }}
-                {% else %}
-                    {{ build.completed_on|date:'H:i' }}
-                {% endif %}
+              {% if build.completed_on|format_build_date  %}
+                {{build.completed_on|date:'d/m/y H:i'}}
+              {% else %}
+                {{ build.completed_on|date:'H:i' }}
+              {% endif %}
            </div>
-    {% endif %}
-    {%if build.outcome == build.SUCCEEDED or build.outcome ==

build.FAILED %}

bitbake/lib/toaster/toastergui/templates/mrb_section.html +3 -0
+          {% endif %}
+
+          {% if build.outcome == build.SUCCEEDED or build.outcome ==

build.FAILED %}

            <div class="col-md-2">
bitbake/lib/toaster/toastergui/templates/mrb_section.html +1 -2
-      {% if  build.errors.count %}
+              {% if build.errors.count %}
                <span class="glyphicon glyphicon-minus-sign"></span>
-                <a href="{%url 'builddashboard' build.pk%}#errors"

class="alert-link">{{build.errors.count}}
error{{build.errors.count|pluralize}}</a>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +1 -1
-      {% endif %}
+                <a href="{%url 'builddashboard' build.pk%}#errors"

class="alert-link">
+ {{build.errors.count}}
error{{build.errors.count|pluralize}}

bitbake/lib/toaster/toastergui/templates/mrb_section.html +4 -1
+                </a>
+              {% endif %}
            </div>
+
            <div class="col-md-2">
-      {% if  build.warnings.count %}
+              {% if build.warnings.count %}
                <span class="glyphicon glyphicon-warning-sign

build-warnings"></span>
- <a href="{%url 'builddashboard' build.pk%}#warnings"
class="alert-link build-warnings">{{build.warnings.count}} warning{{build.warnings.count|pluralize}}</a>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +1 -1
-      {% endif %}
+                <a href="{%url 'builddashboard' build.pk%}#warnings"

class="alert-link build-warnings">
+ {{build.warnings.count}}
warning{{build.warnings.count|pluralize}}

bitbake/lib/toaster/toastergui/templates/mrb_section.html +3 -0
+                </a>
+              {% endif %}
            </div>
+
            <div class="col-md-3">
              Build time: <a class="alert-link" href="{% url 'buildtime'

build.pk %}">{{ build.timespent_seconds|sectohms }}

              </a>
bitbake/lib/toaster/toastergui/templates/mrb_section.html +1 -1
+
              {% if build.project.is_default %}
-                  <span class="pull-right glyphicon

glyphicon-question-sign get-help

bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -8
-                  {% if build.outcome == build.SUCCEEDED %}
-                      get-help-green
-                  {% elif build.outcome == build.FAILED %}
-                      get-help-red
-                  {% else %}
-                      get-help-blue
-                  {% endif %}
-                  " title="Builds in this project cannot be started from

Toaster: they are started from the command line">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +1 -1
-                  </span>
+                <span class="pull-right glyphicon

glyphicon-question-sign get-help {% if build.outcome == build.SUCCEEDED %}get-help-green{% elif build.outcome == build.FAILED %}get-help-red{% else %}get-help-blue{% endif %}"
+ title="Builds in this project cannot be started from
Toaster: they are started from the command line">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +1 -10
+                </span>
              {% else %}
-                  <a href="#" class="run-again-btn alert-link
-                      {% if build.outcome == build.SUCCEEDED %}
-                          success
-                      {% elif build.outcome == build.FAILED %}
-                          danger
-                      {% else %}
-                          info
-                      {%endif%}
-                      pull-right"
-                      data-request-url="{% url 'xhr_buildrequest'

build.project.pk %}"
- data-target='{{build.target_set.all|get_tasks|json}}'>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +1 -3
-                      <span class="glyphicon glyphicon-repeat"></span>
-                      Rebuild
-                  </a>
+                <a href="#" class="run-again-btn alert-link {% if

build.outcome == build.SUCCEEDED %}success{% elif build.outcome == build.FAILED %}danger{% else %}info{% endif %} pull-right"
+ data-request-url="{% url 'xhr_buildrequest'
build.project.pk %}"

bitbake/lib/toaster/toastergui/templates/mrb_section.html +5 -3
+                data-target='{{build.target_set.all|get_tasks|json}}'>
+                  <span class="glyphicon glyphicon-repeat"></span>
+                  Rebuild
+                </a>
              {% endif %}
            </div>
-    {%endif%}
+          {% endif %}
 
-    {%if build.outcome == build.IN_PROGRESS %}
-    <div class="col-md-4" style="display:none"

id="cancelling-msg-{{build.buildrequest.pk}}">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -5
-      Cancelling the build ...
-    </div>
-    <div class="col-md-4 col-md-offset-1 progress-info">
-      <div class="progress" id="build-pc-done-title-{{build.pk}}">
-        <div id="build-pc-done-bar-{{build.pk}}" style="width:

{{build.completeper}}%;" class="progress-bar"></div>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -3
-      </div>
-    </div>
-    <div class="col-md-4 progress-info"><span

id="build-pc-done-{{build.pk}}">{{build.completeper}}</span>% of tasks complete

bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -3
-    {# No build cancel for command line builds project #}
-    {% if build.project.is_default %}
-    <span class="glyphicon glyphicon-question-sign get-help

get-help-blue pull-right" title="Builds in this project cannot be cancelled from Toaster: they can only be cancelled from the command line"></span>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -4
-    {% else %}
-      <a href="#" class="cancel-build-btn pull-right alert-link"
-          data-buildrequest-id={{build.buildrequest.pk}}
-          data-request-url="{% url 'xhr_buildrequest' build.project.pk

%}" >

bitbake/lib/toaster/toastergui/templates/mrb_section.html +2 -5
-        <span class="glyphicon glyphicon-remove-circle"></span>
-        Cancel
-      </a>
-    </div>
-    {% endif %}
+          {% if build.outcome == build.IN_PROGRESS %}
+            <div class="col-md-4" style="display:none"

id="cancelling-msg-{{build.buildrequest.pk}}">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +4 -1
+              Cancelling the build ...
+            </div>
 
-    {%endif%} {# end if in progress #}
+            <div class="col-md-4 col-md-offset-1 progress-info">
+              <div class="progress"

id="build-pc-done-title-{{build.pk}}">
+ <div id="build-pc-done-bar-{{build.pk}}" style="width:
{{build.completeper}}%;" class="progress-bar">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +5 -17
+                </div>
+              </div>
+            </div>
 
-    {% if build.outcome == build.CANCELLED %}
-    <div class="col-md-6">
-      Build cancelled
-    </div>
-    <div class="col-md-3">
-      <a href="#" class="info pull-right run-again-btn alert-link"
-        data-request-url="{% url 'xhr_buildrequest' build.project.pk %}"
-        data-target='{{build.target_set.all|get_tasks|json}}'>
-        <span class="glyphicon glyphicon-repeat"></span>
-        Rebuild
-      </a>
-    </div>
-    {% endif %}
-  </div>
-</div>
-  {% endfor %}
-  </div>
+            <div class="col-md-4 progress-info">
+              <span

id="build-pc-done-{{build.pk}}">{{build.completeper}}</span>% of tasks complete

bitbake/lib/toaster/toastergui/templates/mrb_section.html +3 -0
+              {# No build cancel for command line builds project #}
+              {% if build.project.is_default %}
+                <span class="glyphicon glyphicon-question-sign get-help

get-help-blue pull-right" title="Builds in this project cannot be cancelled from Toaster: they can only be cancelled from the command line"></span>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +2 -0
+              {% else %}
+                <a href="#" class="cancel-build-btn pull-right

alert-link"

bitbake/lib/toaster/toastergui/templates/mrb_section.html +2 -0
+                data-buildrequest-id={{build.buildrequest.pk}}
+                data-request-url="{% url 'xhr_buildrequest'

build.project.pk %}">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +12 -1
+                  <span class="glyphicon glyphicon-remove-circle"></span>
+                  Cancel
+                </a>
+              {% endif %}
+            </div>
+          {% endif %} {# end if in progress #}
 
-{%endif%}
+          {% if build.outcome == build.CANCELLED %}
+            <div class="col-md-6">
+              Build cancelled
+            </div>
 
+            <div class="col-md-3">
+              <a href="#" class="info pull-right run-again-btn

alert-link"
+ data-request-url="{% url 'xhr_buildrequest'
build.project.pk %}"

bitbake/lib/toaster/toastergui/templates/mrb_section.html +11 -0
+              data-target='{{build.target_set.all|get_tasks|json}}'>
+                <span class="glyphicon glyphicon-repeat"></span>
+                Rebuild
+              </a>
+            </div>
+          {% endif %}
+        </div>
+      </div>
+    {% endfor %}
+  </div>
+{% endif %}
\ No newline at end of file
Signature · 7 lines
2.7.4

-- 
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster
#2 lore raw

Thanks. Applied to toaster-next and sent to bitbake-devel

Michael

Quoted 403 lines · Belen
Quoted 10 lines · On 30/06/2016 10:56, "[email protected] on behalf of Elliot…

Command-line builds were displayed incorrectly, so that the HTML elements for other builds were being "consumed" by the command-line build elements due to incorrect positioning of element end tags.

Fix by ensuring end tags close elements in the right places.

As the indentation was all over the place in the most recent builds section template, it was almost impossible to see what the problem was. So that was fixed, too.

Thanks for this. It looks great.

Cheers

Belén

Quoted 382 lines

[YOCTO #9842]

---
.../toaster/toastergui/templates/mrb_section.html | 247
++++++++++-----------

1 file changed, 123 insertions(+), 124 deletions(-)
bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -0
index 4b4e3e6..b164269 100644
@@ -3,6 +3,7 @@
 {% load project_url_tag %}
 {% load humanize %}

<script src="{% static 'js/mrbsection.js' %}"></script> +
<script>

   $(document).ready(function () {
     var ctx = {
bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -0
@@ -18,165 +19,163 @@
   });

</script>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +4 -6
-{%if mru %}
+{% if mru %}
 
-  {%if mrb_type == 'project' %}
-  <h2>
-    Latest project builds
+  {% if mrb_type == 'project' %}
+    <h2>
+      Latest project builds
 
-    {% if project.is_default %}
-    <span class="glyphicon glyphicon-question-sign get-help

heading-help" title="" data-original-title="Builds in this project cannot be started from Toaster: they are started from the command line"></span>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +2 -2
-    {% endif %}
-  </h2>
+      {% if project.is_default %}
+        <span class="glyphicon glyphicon-question-sign get-help

heading-help" data-original-title="Builds in this project cannot be started from Toaster: they are started from the command line"></span>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +4 -5
+        {% endif %}
+    </h2>
   {% else %}
     <div class="page-header">
-      <h1>
-      Latest builds
-      </h1>
+      <h1>Latest builds</h1>
     </div>
   {% endif %}
+
   <div id="latest-builds">
-  {% for build in mru %}
-  <div data-latest-build-result="{{ build.id }}" class="alert

build-result {%if build.outcome == build.SUCCEEDED%}alert-success{%elif build.outcome == build.FAILED%}alert-danger{%else%}alert-info{%endif%}">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +2 -0
+    {% for build in mru %}
+      <div data-latest-build-result="{{build.id}}" class="alert

build-result {% if build.outcome == build.SUCCEEDED %}alert-success{% elif build.outcome == build.FAILED %}alert-danger{% else %}alert-info{% endif %}">

         {% if mrb_type != 'project' %}
bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -4
-        <div class="row project-name">
-          <div class="col-md-12">
-            <small>
-              <a class="alert-link text-uppercase" href={% project_url

build.project %}>{{build.project.name}}</a>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +4 -1
-            </small>
+          <div class="row project-name">
+            <div class="col-md-12">
+              <small>
+                <a class="alert-link text-uppercase" href={% project_url

build.project %}>{{build.project.name}}</a>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +3 -2
+              </small>
+            </div>
           </div>
-        </div>
         {% endif %}
+
         <div class="row">
           <div class="col-md-3">
-    {%if build.outcome == build.SUCCEEDED or build.outcome ==

build.FAILED %}
- <a href="{%url 'builddashboard' build.pk%}"
class="alert-link">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +1 -1
-    {% endif %}
+            {% if build.outcome == build.SUCCEEDED or build.outcome ==

build.FAILED %}
+ <a href="{% url 'builddashboard' build.pk %}"
class="alert-link">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +15 -14
+            {% endif %}
+
             {% if build.target_set.all.count > 0 %}
-                <span data-toggle="tooltip"
-                  {% if build.target_set.all.count > 1 %}
-                    {{build.get_sorted_target_list.0.target}}
-                    title="Recipes:
-                    {% for target in build.get_sorted_target_list %}
-                        {% if target.task %}
-                            {{target.target}}:{{target.task}}
-                        {% else %}
-                            {{target.target}}
-                        {% endif %}
-                    {% endfor %}"
-                  {% endif %}
-                >
+              <span data-toggle="tooltip"
+                {% if build.target_set.all.count > 1 %}
+                  {{build.get_sorted_target_list.0.target}}
+                  title="Recipes:
+                  {% for target in build.get_sorted_target_list %}
+                    {% if target.task %}
+                      {{target.target}}:{{target.task}}
+                    {% else %}
+                      {{target.target}}
+                    {% endif %}
+                  {% endfor %}"
+                {% endif %}
+              >
                 {% if build.target_set.all.0.task %}
-

{{build.get_sorted_target_list.0.target}}:{{build.target_set.all.0.task}} + {{build.get_sorted_target_list.0.target}}:{{build.target_set.all.0.task}}

                 {% else %}
bitbake/lib/toaster/toastergui/templates/mrb_section.html +3 -5
-                    {{build.get_sorted_target_list.0.target}}
+                  {{build.get_sorted_target_list.0.target}}
                 {% endif %}
+
                 {% if build.target_set.all.count > 1 %}
-                    (+{{build.target_set.all.count|add:"-1"}})
+                  (+{{build.target_set.all.count|add:"-1"}})
                 {% endif %}
-                </span>
-             {% endif %}
-    {%if build.outcome == build.SUCCEEDED or build.outcome ==

build.FAILED %}

bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -4
-                </a>
-    {% endif %}
-            </div>
-    {% if build.outcome == build.SUCCEEDED or build.outcome ==

build.FAILED %}

bitbake/lib/toaster/toastergui/templates/mrb_section.html +3 -0
+              </span>
+            {% endif %}
+            {% if build.outcome == build.SUCCEEDED or build.outcome ==

build.FAILED %}

bitbake/lib/toaster/toastergui/templates/mrb_section.html +5 -0
+              </a>
+            {% endif %}
+          </div>
+
+          {% if build.outcome == build.SUCCEEDED or build.outcome ==

build.FAILED %}

             <div class="col-md-2">
bitbake/lib/toaster/toastergui/templates/mrb_section.html +5 -7
-                {% if build.completed_on|format_build_date  %}
-                    {{ build.completed_on|date:'d/m/y H:i' }}
-                {% else %}
-                    {{ build.completed_on|date:'H:i' }}
-                {% endif %}
+              {% if build.completed_on|format_build_date  %}
+                {{build.completed_on|date:'d/m/y H:i'}}
+              {% else %}
+                {{ build.completed_on|date:'H:i' }}
+              {% endif %}
             </div>
-    {% endif %}
-    {%if build.outcome == build.SUCCEEDED or build.outcome ==

build.FAILED %}

bitbake/lib/toaster/toastergui/templates/mrb_section.html +3 -0
+          {% endif %}
+
+          {% if build.outcome == build.SUCCEEDED or build.outcome ==

build.FAILED %}

             <div class="col-md-2">
bitbake/lib/toaster/toastergui/templates/mrb_section.html +1 -2
-      {% if  build.errors.count %}
+              {% if build.errors.count %}
                 <span class="glyphicon glyphicon-minus-sign"></span>
-                <a href="{%url 'builddashboard' build.pk%}#errors"

class="alert-link">{{build.errors.count}}
error{{build.errors.count|pluralize}}</a>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +1 -1
-      {% endif %}
+                <a href="{%url 'builddashboard' build.pk%}#errors"

class="alert-link">
+ {{build.errors.count}}
error{{build.errors.count|pluralize}}

bitbake/lib/toaster/toastergui/templates/mrb_section.html +4 -1
+                </a>
+              {% endif %}
             </div>
+
             <div class="col-md-2">
-      {% if  build.warnings.count %}
+              {% if build.warnings.count %}
                 <span class="glyphicon glyphicon-warning-sign

build-warnings"></span>
- <a href="{%url 'builddashboard' build.pk%}#warnings"
class="alert-link build-warnings">{{build.warnings.count}} warning{{build.warnings.count|pluralize}}</a>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +1 -1
-      {% endif %}
+                <a href="{%url 'builddashboard' build.pk%}#warnings"

class="alert-link build-warnings">
+ {{build.warnings.count}}
warning{{build.warnings.count|pluralize}}

bitbake/lib/toaster/toastergui/templates/mrb_section.html +3 -0
+                </a>
+              {% endif %}
             </div>
+
             <div class="col-md-3">
               Build time: <a class="alert-link" href="{% url 'buildtime'

build.pk %}">{{ build.timespent_seconds|sectohms }}

               </a>
bitbake/lib/toaster/toastergui/templates/mrb_section.html +1 -1
+
               {% if build.project.is_default %}
-                  <span class="pull-right glyphicon

glyphicon-question-sign get-help

bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -8
-                  {% if build.outcome == build.SUCCEEDED %}
-                      get-help-green
-                  {% elif build.outcome == build.FAILED %}
-                      get-help-red
-                  {% else %}
-                      get-help-blue
-                  {% endif %}
-                  " title="Builds in this project cannot be started from

Toaster: they are started from the command line">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +1 -1
-                  </span>
+                <span class="pull-right glyphicon

glyphicon-question-sign get-help {% if build.outcome == build.SUCCEEDED %}get-help-green{% elif build.outcome == build.FAILED %}get-help-red{% else %}get-help-blue{% endif %}"
+ title="Builds in this project cannot be started from
Toaster: they are started from the command line">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +1 -10
+                </span>
               {% else %}
-                  <a href="#" class="run-again-btn alert-link
-                      {% if build.outcome == build.SUCCEEDED %}
-                          success
-                      {% elif build.outcome == build.FAILED %}
-                          danger
-                      {% else %}
-                          info
-                      {%endif%}
-                      pull-right"
-                      data-request-url="{% url 'xhr_buildrequest'

build.project.pk %}"
- data-target='{{build.target_set.all|get_tasks|json}}'>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +1 -3
-                      <span class="glyphicon glyphicon-repeat"></span>
-                      Rebuild
-                  </a>
+                <a href="#" class="run-again-btn alert-link {% if

build.outcome == build.SUCCEEDED %}success{% elif build.outcome == build.FAILED %}danger{% else %}info{% endif %} pull-right"
+ data-request-url="{% url 'xhr_buildrequest'
build.project.pk %}"

bitbake/lib/toaster/toastergui/templates/mrb_section.html +5 -3
+                data-target='{{build.target_set.all|get_tasks|json}}'>
+                  <span class="glyphicon glyphicon-repeat"></span>
+                  Rebuild
+                </a>
               {% endif %}
             </div>
-    {%endif%}
+          {% endif %}
 
-    {%if build.outcome == build.IN_PROGRESS %}
-    <div class="col-md-4" style="display:none"

id="cancelling-msg-{{build.buildrequest.pk}}">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -5
-      Cancelling the build ...
-    </div>
-    <div class="col-md-4 col-md-offset-1 progress-info">
-      <div class="progress" id="build-pc-done-title-{{build.pk}}">
-        <div id="build-pc-done-bar-{{build.pk}}" style="width:

{{build.completeper}}%;" class="progress-bar"></div>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -3
-      </div>
-    </div>
-    <div class="col-md-4 progress-info"><span

id="build-pc-done-{{build.pk}}">{{build.completeper}}</span>% of tasks complete

bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -3
-    {# No build cancel for command line builds project #}
-    {% if build.project.is_default %}
-    <span class="glyphicon glyphicon-question-sign get-help

get-help-blue pull-right" title="Builds in this project cannot be cancelled from Toaster: they can only be cancelled from the command line"></span>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +0 -4
-    {% else %}
-      <a href="#" class="cancel-build-btn pull-right alert-link"
-          data-buildrequest-id={{build.buildrequest.pk}}
-          data-request-url="{% url 'xhr_buildrequest' build.project.pk

%}" >

bitbake/lib/toaster/toastergui/templates/mrb_section.html +2 -5
-        <span class="glyphicon glyphicon-remove-circle"></span>
-        Cancel
-      </a>
-    </div>
-    {% endif %}
+          {% if build.outcome == build.IN_PROGRESS %}
+            <div class="col-md-4" style="display:none"

id="cancelling-msg-{{build.buildrequest.pk}}">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +4 -1
+              Cancelling the build ...
+            </div>
 
-    {%endif%} {# end if in progress #}
+            <div class="col-md-4 col-md-offset-1 progress-info">
+              <div class="progress"

id="build-pc-done-title-{{build.pk}}">
+ <div id="build-pc-done-bar-{{build.pk}}" style="width:
{{build.completeper}}%;" class="progress-bar">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +5 -17
+                </div>
+              </div>
+            </div>
 
-    {% if build.outcome == build.CANCELLED %}
-    <div class="col-md-6">
-      Build cancelled
-    </div>
-    <div class="col-md-3">
-      <a href="#" class="info pull-right run-again-btn alert-link"
-        data-request-url="{% url 'xhr_buildrequest' build.project.pk %}"
-        data-target='{{build.target_set.all|get_tasks|json}}'>
-        <span class="glyphicon glyphicon-repeat"></span>
-        Rebuild
-      </a>
-    </div>
-    {% endif %}
-  </div>
-</div>
-  {% endfor %}
-  </div>
+            <div class="col-md-4 progress-info">
+              <span

id="build-pc-done-{{build.pk}}">{{build.completeper}}</span>% of tasks complete

bitbake/lib/toaster/toastergui/templates/mrb_section.html +3 -0
+              {# No build cancel for command line builds project #}
+              {% if build.project.is_default %}
+                <span class="glyphicon glyphicon-question-sign get-help

get-help-blue pull-right" title="Builds in this project cannot be cancelled from Toaster: they can only be cancelled from the command line"></span>

bitbake/lib/toaster/toastergui/templates/mrb_section.html +2 -0
+              {% else %}
+                <a href="#" class="cancel-build-btn pull-right

alert-link"

bitbake/lib/toaster/toastergui/templates/mrb_section.html +2 -0
+                data-buildrequest-id={{build.buildrequest.pk}}
+                data-request-url="{% url 'xhr_buildrequest'

build.project.pk %}">

bitbake/lib/toaster/toastergui/templates/mrb_section.html +12 -1
+                  <span class="glyphicon glyphicon-remove-circle"></span>
+                  Cancel
+                </a>
+              {% endif %}
+            </div>
+          {% endif %} {# end if in progress #}
 
-{%endif%}
+          {% if build.outcome == build.CANCELLED %}
+            <div class="col-md-6">
+              Build cancelled
+            </div>
 
+            <div class="col-md-3">
+              <a href="#" class="info pull-right run-again-btn

alert-link"
+ data-request-url="{% url 'xhr_buildrequest'
build.project.pk %}"

bitbake/lib/toaster/toastergui/templates/mrb_section.html +11 -0
+              data-target='{{build.target_set.all|get_tasks|json}}'>
+                <span class="glyphicon glyphicon-repeat"></span>
+                Rebuild
+              </a>
+            </div>
+          {% endif %}
+        </div>
+      </div>
+    {% endfor %}
+  </div>
+{% endif %}
\ No newline at end of file
Signature · 7 lines
2.7.4

-- 
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster