Files
poky/bitbake/lib/toaster/toastergui/templates/bpackage.html
Dave Lerner d3e5632efb bitbake: toaster: sort on size in detail pages
[YOCTO 5778]

Implements the features described in the attachment to bugzilla 5778
   - new global changes to the format of size data, and
   - adding sorts by selected columns to specific detail pages.

Although new pagination and row search capabilities are shown on the
screen shots for the 5778 attachment, those features are specified in
a different bugzilla entry 5777 and are not implemented in this commit.

Also, the 5778 spec includes table sorting for the recipe package
detail page, but sorting for that page was not implemented in this
commit due to complications with sorting then returning to a page that
is only one URL fragment in a template.

The scope of file changes are described below.
Changes to support new 'size' field column formats...
    default.css - added sizecol class style (right justified)
    projecttags.py - changed filtered_filesizeformat to allow
        ".0" suffixes

Changes that add class 'sizecol, span2(as spec'd) ' to <th> and/or
<td> size columns were made to...
    dirinfo.py,
    package_built_dependencies.html,
    package_included_dependencies.html,
    recipe.html,
    bpackage.html, and
    target.html

More significant changes to support detail page table sorting
are:
    - tablesort.html: New created to implement the sort icons,
        directions, and table headings, and
        suppress sort handling if 'disable_sort' in context,
        without search or pagination elements ingrained
        in basetable_top. Confining the changes to this small file
        reduces the impact (testing and risk) on the larger set of
        files that arleady include basetable_top/bottom files.
    - view.py: Modified the following view functions with
        - trivial changes for size formatting to the views: target,
        - changes to package_built_detail, package_included_detail,
            package_included_reverse_dependencies to handle the sorting
            implementation as well as moving headings and size
            formatting for size columns from templates to the views.
    - Implementation of the detail sorting using above in:
            package_built_detail.html,
            package_included_detail.html, and
            package_included_reverse_dependencies.html
        to include the tablesort heading setup, format the size column,
        and iterate over the new sorted objects, suppressing sorts if
        table row count less than 2.

(Bitbake rev: d16126e9abfffde66ab70865a81997322847d44e)

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-09 17:00:02 +01:00

109 lines
4.1 KiB
HTML

{% extends "basebuildpage.html" %}
{% load projecttags %}
{% block localbreadcrumb %}
<li>Packages</li>
{% endblock %}
{% block nav-packages %}
<li class="active"><a href="{% url 'packages' build.pk %}">Packages</a></li>
{% endblock %}
{% 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>
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>
{% 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%}
No packages found
{%else%}
Packages
{%endif%}
</h1>
</div>
{% 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 %}
<button class="btn" type="submit" value="Search">Search</button>
<button class="btn btn-link" onclick="javascript:$('#search').val('');searchform.submit()">Show all packages</button>
</form>
</div>
</div>
{% else %}
{% include "basetable_top.html" %}
{% for package in objects %}
<tr class="data">
<!-- Package -->
<td><a href="{% url "package_built_detail" build.pk package.pk %}">{{package.name}}</a></td>
<!-- Package Version -->
<td>{%if package.version%}<a href="{% url "package_built_detail" build.pk package.pk %}">{{package.version}}-{{package.revision}}</a>{%endif%}</td>
<!-- Package Size -->
<td class="size sizecol">{{package.size|filtered_filesizeformat}}</td>
<!-- License -->
<td class="license">{{package.license}}</td>
{%if package.recipe%}
<!-- Recipe -->
<td class="recipe__name"><a href="{% url "recipe" build.pk package.recipe.pk %}">{{package.recipe.name}}</a></td>
<!-- Recipe Version -->
<td class="recipe__version"><a href="{% url "recipe" build.pk package.recipe.pk %}">{{package.recipe.version}}</a></td>
<!-- Layer -->
<td class="recipe__layer_version__layer__name">{{package.recipe.layer_version.layer.name}}</td>
<!-- Layer branch -->
<td class="recipe__layer_version__branch">{{package.recipe.layer_version.branch}}</td>
<!-- Layer commit -->
<td class="recipe__layer_version__layer__commit">
<a class="btn"
data-content="<ul class='unstyled'>
<li>{{package.recipe.layer_version.commit}}</li>
</ul>">
{{package.recipe.layer_version.commit|truncatechars:13}}
</a>
</td>
<!-- Layer directory -->
<td class="recipe__layer_version__layer__local_path">{{package.recipe.layer_version.layer.local_path}}</td>
{%else%}
<td class="recipe__name"></td>
<td class="recipe__version"></td>
<td class="recipe__layer_version__layer__name"></td>
<td class="recipe__layer_version__branch"></td>
<td class="recipe__layer_version__layer__commit"></td>
<td class="recipe__layer_version__layer__local_path"></td>
{%endif%}
</tr>
{% endfor %}
{% include "basetable_bottom.html" %}
{% endif %} {# objects.paginator.count #}
{% endif %} {# Empty #}
</div>
{% endblock %}