diff options
author | Dave Lerner <dave.lerner@windriver.com> | 2014-03-21 13:43:18 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-25 21:32:17 +0000 |
commit | 7fa51314bdac0afccf2ddd6f57581eec7d78d57f (patch) | |
tree | 9ae3cda5d0ba4c1202eb6e4f725d5f545ce39744 /bitbake/lib/toaster/toastergui/templatetags/projecttags.py | |
parent | 64ba1fa80518cab3fba8d4dd418ebd0e79ebb6d1 (diff) | |
download | poky-7fa51314bdac0afccf2ddd6f57581eec7d78d57f.tar.gz |
bitbake: toaster: format packages with size = -1
Packages that have a size of -1 are virtual packages with limited
information. Such packages should be suppressed from the package
list page for an image. On dependency and reverse dependency lists of
package, such packages should appear in muted rows, without links,
and with help information.
The formatting rules are encapsulated into projecttags filters when
possible to minimize tests on size==-1 in the templates.
Testing the relevant pages with an HTML5 validator found a stray end
tag in package_detail_base which has been fixed in this commit.
[YOCTO #5966]
(Bitbake rev: 6cdd4067f766ef5680076c33a32b2dc5d622362c)
Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templatetags/projecttags.py')
-rw-r--r-- | bitbake/lib/toaster/toastergui/templatetags/projecttags.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py index 12c2468fa1..34c3c21d20 100644 --- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py +++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py | |||
@@ -110,8 +110,14 @@ def format_none_and_zero(value): | |||
110 | 110 | ||
111 | @register.filter | 111 | @register.filter |
112 | def filtered_filesizeformat(value): | 112 | def filtered_filesizeformat(value): |
113 | """Change output from fileformatsize to suppress trailing '.0' and change 'bytes' to 'B' | ||
114 | """ | 113 | """ |
114 | If the value is -1 return an empty string. Otherwise, | ||
115 | change output from fileformatsize to suppress trailing '.0' | ||
116 | and change 'bytes' to 'B'. | ||
117 | """ | ||
118 | if value == -1: | ||
119 | return '' | ||
120 | |||
115 | return filesizeformat(value).replace("bytes", "B").replace(".0", "") | 121 | return filesizeformat(value).replace("bytes", "B").replace(".0", "") |
116 | 122 | ||
117 | @register.filter | 123 | @register.filter |
@@ -228,4 +234,17 @@ def filter_sizeovertotal(package_object, total_size): | |||
228 | 234 | ||
229 | return '{:.1%}'.format(float(size)/float(total_size)) | 235 | return '{:.1%}'.format(float(size)/float(total_size)) |
230 | 236 | ||
237 | from django.utils.safestring import mark_safe | ||
238 | @register.filter | ||
239 | def format_vpackage_rowclass(size): | ||
240 | if size == -1: | ||
241 | return mark_safe('class="muted"') | ||
242 | return '' | ||
231 | 243 | ||
244 | @register.filter | ||
245 | def format_vpackage_namehelp(name): | ||
246 | r = name + ' ' | ||
247 | r += '<i class="icon-question-sign get-help hover-help"' | ||
248 | r += ' title = "' + name + ' only has dependency information available.">' | ||
249 | r += '</i>' | ||
250 | return mark_safe(r) | ||