[bitbake-devel] [PATCH 64/94] bitbake: webhob: refactor column hiding code
Alex DAMIAN
alexandru.damian at intel.com
Tue Sep 24 16:52:33 UTC 2013
From: Alexandru DAMIAN <alexandru.damian at intel.com>
We're refactoring the column show/hide code to get it
more generic, and easier to apply it to all table pages.
Signed-off-by: Alexandru DAMIAN <alexandru.damian at intel.com>
---
bitbake/lib/webhob/bldviewer/templates/build.html | 6 +++---
bitbake/lib/webhob/bldviewer/views.py | 6 +++++-
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/bitbake/lib/webhob/bldviewer/templates/build.html b/bitbake/lib/webhob/bldviewer/templates/build.html
index aa92929..5db72db 100644
--- a/bitbake/lib/webhob/bldviewer/templates/build.html
+++ b/bitbake/lib/webhob/bldviewer/templates/build.html
@@ -7,9 +7,9 @@
<div align="left" style="display:inline-block; width: 49%"> Search: <input type="search" id="filterstring" style="width: 30em" onkeyup="filterTableRows($('#filterstring').val())" autocomplete="off">
</div>
<div align="right" style="display: inline-block; width: 49%">Show/Hide columns:
-<span>Output: <input type="checkbox" id="ctoutput" onchange="showhideTableColumn(10, $('#ctoutput').is(':checked'))" checked autocomplete="off"></span> |
-<span>Log: <input type="checkbox" id="ctlog" onchange="showhideTableColumn(11, $('#ctlog').is(':checked'))"checked autocomplete="off"></span> |
-<span>Build Name: <input type="checkbox" id="ctbuildname" onchange="showhideTableColumn(13, $('#ctbuildname').is(':checked'))" checked autocomplete="off"></span> |
+{% for i in hideshowcols %}
+ <span>{{i.name}} <input type="checkbox" id="ct{{i.name}}" onchange="showhideTableColumn({{i.order}}, $('#ct{{i.name}}').is(':checked'))" checked autocomplete="off"></span> |
+{% endfor %}
</div>
</div>
<table border="1">
diff --git a/bitbake/lib/webhob/bldviewer/views.py b/bitbake/lib/webhob/bldviewer/views.py
index ab69c91..2ef905a 100644
--- a/bitbake/lib/webhob/bldviewer/views.py
+++ b/bitbake/lib/webhob/bldviewer/views.py
@@ -12,7 +12,11 @@ def build(request):
build_info = Build.objects.all()
logs = LogMessage.objects.all()
- context = {'builds': build_info, 'logs': logs }
+ context = {'builds': build_info, 'logs': logs ,
+ 'hideshowcols' : [
+ {'name': 'Output', 'order':10},
+ {'name': 'Log', 'order':11},
+ ]}
return render(request, template, context)
--
1.8.1.2
More information about the bitbake-devel
mailing list