bitbake: toaster: add support for empty states in pages

Add support for empty states in the top build page,
the all packages page, and the all tasks page.

[YOCTO #4865]

(Bitbake rev: eaff7b50d7102c97b75df185b9ef917970319d59)

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
David Reyna
2014-03-25 18:53:08 -07:00
committed by Richard Purdie
parent 14a84434a1
commit 877dcd709e
5 changed files with 93 additions and 29 deletions

View File

@@ -106,7 +106,9 @@ select { width: auto; }
.task-name { margin-left: 7px; }
.icon-hand-right {color: #ccccc; }
.help-inline { margin: 5px; }
.hero-unit { margin: 20px 0 30px; }
.hero-unit > .close { font-size:40px; }
.hero-actions { margin-top: 30px; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@@ -12,8 +12,27 @@
{% block buildinfomain %}
<div class="span10">
{% if not request.GET.filter and not request.GET.search and not objects.paginator.count %}
<!-- Empty - no data in database -->
<div class="page-header">
<h1>
<div class="page-header">
<h1>
Packages
</h1>
</div>
<div class="alert alert-info lead">
<STRONG>No packages were built.</STRONG> How did this happen? Well, BitBake reuses as much stuff as possible.
If all of the packages needed were already built and available in your build infrastructure, Bitbake
will not rebuild any of them. This might be slightly confusing, but it does make everything faster.
</div>
</div>
{% else %}
<div class="page-header">
<h1>
{% if request.GET.search and objects.paginator.count > 0 %}
{{objects.paginator.count}} package{{objects.paginator.count|pluralize}} found
{%elif request.GET.search and objects.paginator.count == 0%}
@@ -21,10 +40,10 @@
{%else%}
Packages
{%endif%}
</h1>
</h1>
</div>
{% if objects.paginator.count == 0 %}
{% if objects.paginator.count == 0 %}
<div class="row-fluid">
<div class="alert">
<form class="no-results input-append" id="searchform">
@@ -35,8 +54,8 @@
</div>
</div>
{% else %}
{% include "basetable_top.html" %}
{% else %}
{% include "basetable_top.html" %}
{% for package in objects %}
@@ -84,7 +103,8 @@
</tr>
{% endfor %}
{% include "basetable_bottom.html" %}
{% endif %}
{% include "basetable_bottom.html" %}
{% endif %} {# objects.paginator.count #}
{% endif %} {# Empty #}
</div>
{% endblock %}

View File

@@ -1,11 +1,30 @@
{% extends "base.html" %}
{% load static %}
{% load projecttags %}
{% load humanize %}
{% block pagecontent %}
<div class="row-fluid">
{% if not objects.paginator.count and not request.GET.filter and not request.GET.search %}
<!-- Empty - no data in database -->
<div class="hero-unit span12">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<div class="row-fluid">
<div class="span6">
<h1>This is Toaster</h1>
<p>A web interface to <a href="http://www.yoctoproject.org/tools-resources/projects/bitbake">BitBake</a>, the <a href="http://www.yoctoproject.org">Yocto Project</a> build system.</p>
<p class="hero-actions">
<a class="btn btn-primary btn-large" href="https://www.yoctoproject.org/documentation/toaster-manual">Show me the manual</a>
<a class="btn btn-large" href="https://wiki.yoctoproject.org/wiki/Contribute_to_Toaster">I want to contribute</a>
</p>
</div>
<div class="span5">
<a href="http://www.yoctoproject.org"><img src="{% static 'img/toaster.png' %}" class="thumbnail" alt="Yocto Project"/> </a>
</div>
</div>
</div>
{% endif %}
{%if mru.count > 0%}
<div class="page-header top-air">
@@ -53,9 +72,20 @@
{% endfor %}{%endif%}
{% if not objects.paginator.count and not request.GET.filter and not request.GET.search %}
<!-- Empty - no data in database -->
{% if mru.count == 0 %}
<div class="page-header top-air">
<h1>All builds</h1>
</div>
<div class="alert alert-info lead">
Toaster has not recorded any builds yet. Go build something with <a href="http://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html#test-run">Knotty</a> or <a href="https://www.yoctoproject.org/documentation/hob-manual">Hob</a>
</div>
{% endif %}
{% else %}
<div class="page-header top-air">
<h1>
{% if request.GET.filter or request.GET.search and objects.count > 0 %}
{% if request.GET.filter and objects.count or request.GET.search and objects.count > 0 %}
{{objects.paginator.count}} build{{objects.paginator.count|pluralize}} found
{%elif objects.paginator.count == 0%}
No builds
@@ -65,8 +95,8 @@
</h1>
</div>
{% if objects.paginator.count == 0 %}
<div class="row-fluid">
{% if objects.paginator.count == 0 %}
<div class="row-fluid">
<div class="alert">
<form class="no-results input-append" id="searchform">
<input id="search" name="search" class="input-xxlarge" type="text" value="{{request.GET.search}}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="add-on btn" tabindex="-1"><i class="icon-remove"></i></a>{% endif %}
@@ -74,11 +104,11 @@
<button class="btn btn-link" onclick="javascript:$('#search').val('');searchform.submit()">Show all builds</button>
</form>
</div>
</div>
</div>
{% else %}
{% include "basetable_top.html" %}
{% else %}
{% include "basetable_top.html" %}
<!-- Table data rows; the order needs to match the order of "tablecols" definitions; and the <td class value needs to match the tablecols clclass value for show/hide buttons to work -->
{% for build in objects %}
<tr class="data">
@@ -98,9 +128,9 @@
{% endfor %}
{% include "basetable_bottom.html" %}
{% endif %}
{% include "basetable_bottom.html" %}
{% endif %} {# objects.paginator.count #}
{% endif %} {# empty #}
</div><!-- end row-fluid-->
{% endblock %}

View File

@@ -36,19 +36,30 @@
{% block buildinfomain %}
<div class="span10">
<div class="page-header">
<h1>
{% if request.GET.filter or request.GET.search and objects.paginator.count > 0 %}
{% if not request.GET.filter and not request.GET.search and not objects.paginator.count %}
<!-- Empty - no data in database -->
<div class="page-header">
<h1>{{title}}</h1>
</div>
<div class="alert alert-info lead">
No data was recorded for this build.
</div>
{% else %}
<div class="page-header">
<h1>
{% if request.GET.filter and objects.paginator.count > 0 or request.GET.search and objects.paginator.count > 0 %}
{{objects.paginator.count}} task{{objects.paginator.count|pluralize}} found
{%elif request.GET.filter or request.GET.search and objects.paginator.count == 0%}
{%elif request.GET.filter and objects.paginator.count == 0 or request.GET.search and objects.paginator.count == 0 %}
No tasks found
{%else%}
{{title}}
{%endif%}
</h1>
</div>
</h1>
</div>
{% if objects.paginator.count == 0 %}
{% if objects.paginator.count == 0 %}
<div class="row-fluid">
<div class="alert">
<form class="no-results input-append" id="searchform">
@@ -60,8 +71,8 @@
</div>
{% else %}
{% include "basetable_top.html" %}
{% else %}
{% include "basetable_top.html" %}
{% for task in objects %}
<tr {{ task|task_color }} class="flash" id="{{task.order}}" name="{{task.order}}">
@@ -102,7 +113,8 @@
</tr>
{% endfor %}
{% include "basetable_bottom.html" %}
{% endif %}
{% include "basetable_bottom.html" %}
{% endif %} {# objects.paginator.count #}
{% endif %} {# empty #}
</div>
{% endblock %}