diff options
| author | David Reyna <David.Reyna@windriver.com> | 2014-03-25 18:53:08 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-28 13:44:52 +0000 |
| commit | 877dcd709e4cd54847e756e7a8dc1de6fa926967 (patch) | |
| tree | a6fc0240a28f80ebf5960baf00588c6079c7ea0b | |
| parent | 14a84434a1c76f5d0bef7a75f2c7529a9ff166cf (diff) | |
| download | poky-877dcd709e4cd54847e756e7a8dc1de6fa926967.tar.gz | |
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>
| -rw-r--r-- | bitbake/lib/toaster/toastergui/static/css/default.css | 4 | ||||
| -rwxr-xr-x | bitbake/lib/toaster/toastergui/static/img/toaster.png | bin | 0 -> 51986 bytes | |||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templates/bpackage.html | 34 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templates/build.html | 50 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templates/tasks.html | 34 |
5 files changed, 93 insertions, 29 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/css/default.css b/bitbake/lib/toaster/toastergui/static/css/default.css index d960f4bd83..260f5d46c3 100644 --- a/bitbake/lib/toaster/toastergui/static/css/default.css +++ b/bitbake/lib/toaster/toastergui/static/css/default.css | |||
| @@ -106,7 +106,9 @@ select { width: auto; } | |||
| 106 | .task-name { margin-left: 7px; } | 106 | .task-name { margin-left: 7px; } |
| 107 | .icon-hand-right {color: #ccccc; } | 107 | .icon-hand-right {color: #ccccc; } |
| 108 | .help-inline { margin: 5px; } | 108 | .help-inline { margin: 5px; } |
| 109 | 109 | .hero-unit { margin: 20px 0 30px; } | |
| 110 | .hero-unit > .close { font-size:40px; } | ||
| 111 | .hero-actions { margin-top: 30px; } | ||
| 110 | 112 | ||
| 111 | 113 | ||
| 112 | 114 | ||
diff --git a/bitbake/lib/toaster/toastergui/static/img/toaster.png b/bitbake/lib/toaster/toastergui/static/img/toaster.png new file mode 100755 index 0000000000..11bb5d51b1 --- /dev/null +++ b/bitbake/lib/toaster/toastergui/static/img/toaster.png | |||
| Binary files differ | |||
diff --git a/bitbake/lib/toaster/toastergui/templates/bpackage.html b/bitbake/lib/toaster/toastergui/templates/bpackage.html index 77f789484c..22609e227a 100644 --- a/bitbake/lib/toaster/toastergui/templates/bpackage.html +++ b/bitbake/lib/toaster/toastergui/templates/bpackage.html | |||
| @@ -12,8 +12,27 @@ | |||
| 12 | 12 | ||
| 13 | {% block buildinfomain %} | 13 | {% block buildinfomain %} |
| 14 | <div class="span10"> | 14 | <div class="span10"> |
| 15 | |||
| 16 | {% if not request.GET.filter and not request.GET.search and not objects.paginator.count %} | ||
| 17 | |||
| 18 | <!-- Empty - no data in database --> | ||
| 15 | <div class="page-header"> | 19 | <div class="page-header"> |
| 16 | <h1> | 20 | <div class="page-header"> |
| 21 | <h1> | ||
| 22 | Packages | ||
| 23 | </h1> | ||
| 24 | </div> | ||
| 25 | <div class="alert alert-info lead"> | ||
| 26 | <STRONG>No packages were built.</STRONG> How did this happen? Well, BitBake reuses as much stuff as possible. | ||
| 27 | If all of the packages needed were already built and available in your build infrastructure, Bitbake | ||
| 28 | will not rebuild any of them. This might be slightly confusing, but it does make everything faster. | ||
| 29 | </div> | ||
| 30 | </div> | ||
| 31 | |||
| 32 | {% else %} | ||
| 33 | |||
| 34 | <div class="page-header"> | ||
| 35 | <h1> | ||
| 17 | {% if request.GET.search and objects.paginator.count > 0 %} | 36 | {% if request.GET.search and objects.paginator.count > 0 %} |
| 18 | {{objects.paginator.count}} package{{objects.paginator.count|pluralize}} found | 37 | {{objects.paginator.count}} package{{objects.paginator.count|pluralize}} found |
| 19 | {%elif request.GET.search and objects.paginator.count == 0%} | 38 | {%elif request.GET.search and objects.paginator.count == 0%} |
| @@ -21,10 +40,10 @@ | |||
| 21 | {%else%} | 40 | {%else%} |
| 22 | Packages | 41 | Packages |
| 23 | {%endif%} | 42 | {%endif%} |
| 24 | </h1> | 43 | </h1> |
| 25 | </div> | 44 | </div> |
| 26 | 45 | ||
| 27 | {% if objects.paginator.count == 0 %} | 46 | {% if objects.paginator.count == 0 %} |
| 28 | <div class="row-fluid"> | 47 | <div class="row-fluid"> |
| 29 | <div class="alert"> | 48 | <div class="alert"> |
| 30 | <form class="no-results input-append" id="searchform"> | 49 | <form class="no-results input-append" id="searchform"> |
| @@ -35,8 +54,8 @@ | |||
| 35 | </div> | 54 | </div> |
| 36 | </div> | 55 | </div> |
| 37 | 56 | ||
| 38 | {% else %} | 57 | {% else %} |
| 39 | {% include "basetable_top.html" %} | 58 | {% include "basetable_top.html" %} |
| 40 | 59 | ||
| 41 | {% for package in objects %} | 60 | {% for package in objects %} |
| 42 | 61 | ||
| @@ -84,7 +103,8 @@ | |||
| 84 | </tr> | 103 | </tr> |
| 85 | {% endfor %} | 104 | {% endfor %} |
| 86 | 105 | ||
| 87 | {% include "basetable_bottom.html" %} | 106 | {% include "basetable_bottom.html" %} |
| 88 | {% endif %} | 107 | {% endif %} {# objects.paginator.count #} |
| 108 | {% endif %} {# Empty #} | ||
| 89 | </div> | 109 | </div> |
| 90 | {% endblock %} | 110 | {% endblock %} |
diff --git a/bitbake/lib/toaster/toastergui/templates/build.html b/bitbake/lib/toaster/toastergui/templates/build.html index 8f557e9686..38ab2bfd7b 100644 --- a/bitbake/lib/toaster/toastergui/templates/build.html +++ b/bitbake/lib/toaster/toastergui/templates/build.html | |||
| @@ -1,11 +1,30 @@ | |||
| 1 | {% extends "base.html" %} | 1 | {% extends "base.html" %} |
| 2 | 2 | ||
| 3 | 3 | {% load static %} | |
| 4 | {% load projecttags %} | 4 | {% load projecttags %} |
| 5 | {% load humanize %} | 5 | {% load humanize %} |
| 6 | 6 | ||
| 7 | {% block pagecontent %} | 7 | {% block pagecontent %} |
| 8 | <div class="row-fluid"> | 8 | <div class="row-fluid"> |
| 9 | {% if not objects.paginator.count and not request.GET.filter and not request.GET.search %} | ||
| 10 | <!-- Empty - no data in database --> | ||
| 11 | <div class="hero-unit span12"> | ||
| 12 | <button type="button" class="close" data-dismiss="alert">×</button> | ||
| 13 | <div class="row-fluid"> | ||
| 14 | <div class="span6"> | ||
| 15 | <h1>This is Toaster</h1> | ||
| 16 | <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> | ||
| 17 | <p class="hero-actions"> | ||
| 18 | <a class="btn btn-primary btn-large" href="https://www.yoctoproject.org/documentation/toaster-manual">Show me the manual</a> | ||
| 19 | <a class="btn btn-large" href="https://wiki.yoctoproject.org/wiki/Contribute_to_Toaster">I want to contribute</a> | ||
| 20 | </p> | ||
| 21 | </div> | ||
| 22 | <div class="span5"> | ||
| 23 | <a href="http://www.yoctoproject.org"><img src="{% static 'img/toaster.png' %}" class="thumbnail" alt="Yocto Project"/> </a> | ||
| 24 | </div> | ||
| 25 | </div> | ||
| 26 | </div> | ||
| 27 | {% endif %} | ||
| 9 | 28 | ||
| 10 | {%if mru.count > 0%} | 29 | {%if mru.count > 0%} |
| 11 | <div class="page-header top-air"> | 30 | <div class="page-header top-air"> |
| @@ -53,9 +72,20 @@ | |||
| 53 | 72 | ||
| 54 | {% endfor %}{%endif%} | 73 | {% endfor %}{%endif%} |
| 55 | 74 | ||
| 75 | {% if not objects.paginator.count and not request.GET.filter and not request.GET.search %} | ||
| 76 | <!-- Empty - no data in database --> | ||
| 77 | {% if mru.count == 0 %} | ||
| 78 | <div class="page-header top-air"> | ||
| 79 | <h1>All builds</h1> | ||
| 80 | </div> | ||
| 81 | <div class="alert alert-info lead"> | ||
| 82 | 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> | ||
| 83 | </div> | ||
| 84 | {% endif %} | ||
| 85 | {% else %} | ||
| 56 | <div class="page-header top-air"> | 86 | <div class="page-header top-air"> |
| 57 | <h1> | 87 | <h1> |
| 58 | {% if request.GET.filter or request.GET.search and objects.count > 0 %} | 88 | {% if request.GET.filter and objects.count or request.GET.search and objects.count > 0 %} |
| 59 | {{objects.paginator.count}} build{{objects.paginator.count|pluralize}} found | 89 | {{objects.paginator.count}} build{{objects.paginator.count|pluralize}} found |
| 60 | {%elif objects.paginator.count == 0%} | 90 | {%elif objects.paginator.count == 0%} |
| 61 | No builds | 91 | No builds |
| @@ -65,8 +95,8 @@ | |||
| 65 | </h1> | 95 | </h1> |
| 66 | </div> | 96 | </div> |
| 67 | 97 | ||
| 68 | {% if objects.paginator.count == 0 %} | 98 | {% if objects.paginator.count == 0 %} |
| 69 | <div class="row-fluid"> | 99 | <div class="row-fluid"> |
| 70 | <div class="alert"> | 100 | <div class="alert"> |
| 71 | <form class="no-results input-append" id="searchform"> | 101 | <form class="no-results input-append" id="searchform"> |
| 72 | <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 %} | 102 | <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 @@ | |||
| 74 | <button class="btn btn-link" onclick="javascript:$('#search').val('');searchform.submit()">Show all builds</button> | 104 | <button class="btn btn-link" onclick="javascript:$('#search').val('');searchform.submit()">Show all builds</button> |
| 75 | </form> | 105 | </form> |
| 76 | </div> | 106 | </div> |
| 77 | </div> | 107 | </div> |
| 78 | 108 | ||
| 79 | 109 | ||
| 80 | {% else %} | 110 | {% else %} |
| 81 | {% include "basetable_top.html" %} | 111 | {% include "basetable_top.html" %} |
| 82 | <!-- 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 --> | 112 | <!-- 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 --> |
| 83 | {% for build in objects %} | 113 | {% for build in objects %} |
| 84 | <tr class="data"> | 114 | <tr class="data"> |
| @@ -98,9 +128,9 @@ | |||
| 98 | {% endfor %} | 128 | {% endfor %} |
| 99 | 129 | ||
| 100 | 130 | ||
| 101 | {% include "basetable_bottom.html" %} | 131 | {% include "basetable_bottom.html" %} |
| 102 | 132 | {% endif %} {# objects.paginator.count #} | |
| 103 | {% endif %} | 133 | {% endif %} {# empty #} |
| 104 | </div><!-- end row-fluid--> | 134 | </div><!-- end row-fluid--> |
| 105 | 135 | ||
| 106 | {% endblock %} | 136 | {% endblock %} |
diff --git a/bitbake/lib/toaster/toastergui/templates/tasks.html b/bitbake/lib/toaster/toastergui/templates/tasks.html index 8c73dc230e..ca7e187f73 100644 --- a/bitbake/lib/toaster/toastergui/templates/tasks.html +++ b/bitbake/lib/toaster/toastergui/templates/tasks.html | |||
| @@ -36,19 +36,30 @@ | |||
| 36 | 36 | ||
| 37 | {% block buildinfomain %} | 37 | {% block buildinfomain %} |
| 38 | <div class="span10"> | 38 | <div class="span10"> |
| 39 | <div class="page-header"> | 39 | {% if not request.GET.filter and not request.GET.search and not objects.paginator.count %} |
| 40 | <h1> | 40 | <!-- Empty - no data in database --> |
| 41 | {% if request.GET.filter or request.GET.search and objects.paginator.count > 0 %} | 41 | <div class="page-header"> |
| 42 | <h1>{{title}}</h1> | ||
| 43 | </div> | ||
| 44 | <div class="alert alert-info lead"> | ||
| 45 | No data was recorded for this build. | ||
| 46 | </div> | ||
| 47 | |||
| 48 | {% else %} | ||
| 49 | |||
| 50 | <div class="page-header"> | ||
| 51 | <h1> | ||
| 52 | {% if request.GET.filter and objects.paginator.count > 0 or request.GET.search and objects.paginator.count > 0 %} | ||
| 42 | {{objects.paginator.count}} task{{objects.paginator.count|pluralize}} found | 53 | {{objects.paginator.count}} task{{objects.paginator.count|pluralize}} found |
| 43 | {%elif request.GET.filter or request.GET.search and objects.paginator.count == 0%} | 54 | {%elif request.GET.filter and objects.paginator.count == 0 or request.GET.search and objects.paginator.count == 0 %} |
| 44 | No tasks found | 55 | No tasks found |
| 45 | {%else%} | 56 | {%else%} |
| 46 | {{title}} | 57 | {{title}} |
| 47 | {%endif%} | 58 | {%endif%} |
| 48 | </h1> | 59 | </h1> |
| 49 | </div> | 60 | </div> |
| 50 | 61 | ||
| 51 | {% if objects.paginator.count == 0 %} | 62 | {% if objects.paginator.count == 0 %} |
| 52 | <div class="row-fluid"> | 63 | <div class="row-fluid"> |
| 53 | <div class="alert"> | 64 | <div class="alert"> |
| 54 | <form class="no-results input-append" id="searchform"> | 65 | <form class="no-results input-append" id="searchform"> |
| @@ -60,8 +71,8 @@ | |||
| 60 | </div> | 71 | </div> |
| 61 | 72 | ||
| 62 | 73 | ||
| 63 | {% else %} | 74 | {% else %} |
| 64 | {% include "basetable_top.html" %} | 75 | {% include "basetable_top.html" %} |
| 65 | 76 | ||
| 66 | {% for task in objects %} | 77 | {% for task in objects %} |
| 67 | <tr {{ task|task_color }} class="flash" id="{{task.order}}" name="{{task.order}}"> | 78 | <tr {{ task|task_color }} class="flash" id="{{task.order}}" name="{{task.order}}"> |
| @@ -102,7 +113,8 @@ | |||
| 102 | </tr> | 113 | </tr> |
| 103 | {% endfor %} | 114 | {% endfor %} |
| 104 | 115 | ||
| 105 | {% include "basetable_bottom.html" %} | 116 | {% include "basetable_bottom.html" %} |
| 106 | {% endif %} | 117 | {% endif %} {# objects.paginator.count #} |
| 118 | {% endif %} {# empty #} | ||
| 107 | </div> | 119 | </div> |
| 108 | {% endblock %} | 120 | {% endblock %} |
