bitbake: toaster: port Installed packages table to ToasterTable

(Bitbake rev: 2418c092abd9a503becf5e786125f8cdddd8652c)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Michael Wood
2016-05-26 16:12:23 +01:00
committed by Richard Purdie
parent b2a68f5511
commit caae3b6206
5 changed files with 75 additions and 288 deletions

View File

@@ -17,9 +17,7 @@
{% endblock %}
{% block buildinfomain %}
<div class="col-md-10">
<div class="page-header">
<h1>
{% if request.GET.search and objects.paginator.count > 0 %}
@@ -31,8 +29,6 @@
{% endif %}
</h1>
</div>
<div id="navTab">
<ul class="nav nav-pills">
<li class="active">
@@ -50,113 +46,11 @@
</ul>
<div id="image-packages" class="tab-pane">
{% if objects.paginator.count == 0 %}
<div class="alert">
<form class="no-results input-append" id="searchform">
<input id="search" name="search" class="input-xxlarge" type="text" value="{% if request.GET.search %}{{request.GET.search}}{% endif %}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="input-append-addon btn" tabindex="-1"><i class="glyphicon glyphicon-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>
{% else %}
{% include "basetable_top.html" %}
{% for package in objects %}
<tr>
{# order of the table data must match the columns defined in template's context tablecols #}
<td class="package_name">
<a href="{% url 'package_included_detail' build.id target.id package.id %}">
{{package.name}}
</a>
{% if package.installed_name and package.name != package.installed_name %}
<span class="muted"> as {{package.installed_name}}</span>
<i class="icon-question-sign get-help hover-help" title='{{package.name|add:" was renamed at packaging time and was installed in your image as "|add:package.installed_name}}'></i>
{% endif %}
</td>
<td class="package_version">
<a href="{% url 'package_included_detail' build.id target.id package.id %}">
{{package.version|filtered_packageversion:package.revision}}
</a>
</td>
<td class="license">
{{package.license}}
</td>
<td class="size sizecol">
{{package.size|filtered_installedsize:package.installed_size|filtered_filesizeformat}}
</td>
<td class="size_over_total sizecol">
{{package|filter_sizeovertotal:packages_sum}}
</td>
<td class="depends">
{% with deps=package.runtime_dependencies %}
{% with deps_count=deps|length %}
{% if deps_count > 0 %}
<a class="btn"
title="<a href='{% url "package_included_dependencies" build.id target.id package.id %}'>{{package.name}}</a> dependencies"
data-content="<ul class='list-unstyled'>
{% for i in deps|dictsort:'depends_on.name' %}
<li><a href='{% url "package_included_detail" build.pk target.id i.depends_on.pk %}'>{{i.depends_on.name}}</a></li>
{% endfor %}
</ul>">
{{deps_count}}
</a>
{% endif %}
{% endwith %}
{% endwith %}
</td>
<td class="brought_in_by">
{% with rdeps=package.reverse_runtime_dependencies %}
{% with rdeps_count=rdeps|length %}
{% if rdeps_count > 0 %}
<a class="btn"
title="<a href='{% url "package_included_reverse_dependencies" build.id target.id package.id %}'>{{package.name}}</a> reverse dependencies"
data-content="<ul class='list-unstyled'>
{% for i in rdeps|dictsort:'package.name' %}
<li><a href='{% url "package_included_detail" build.id target.id i.package.id %}'>{{i.package.name}}</a></li>
{% endfor %}
</ul>">
{{rdeps_count}}
</a>
{% endif %}
{% endwith %}
{% endwith %}
</td>
<td class="recipe_name">
{% if package.recipe.version %}
<a href="{% url 'recipe' build.id package.recipe_id %}">
{{ package.recipe.name }}
</a>
{% endif %}
</td>
<td class="recipe_version">
{% if package.recipe.version %}
<a href="{% url 'recipe' build.id package.recipe_id %}">
{{ package.recipe.version }}
</a>
{% endif %}
</td>
<td class="layer_name">
{{ package.recipe.layer_version.layer.name }}
</td>
<td class="layer_branch">
{{ package.recipe.layer_version.branch}}
</td>
<td class="layer_commit">
<a class="btn"
data-content="<ul class='list-unstyled'>
<li>{{package.recipe.layer_version.commit}}</li>
</ul>">
{{package.recipe.layer_version.commit|truncatechars:13}}
</a>
</td>
</tr>
{% endfor %}
{% include "basetable_bottom.html" %}
{% endif %}
{# xhr_table_url is just the current url so leave it blank #}
{% with xhr_table_url='' %}
{% include "toastertable.html" %}
{% endwith %}
</div> <!-- tabpane -->
</div> <!--span 10-->
</div> <!--navTab -->>
<!-- col-md-10 -->
{% endblock buildinfomain %}