Patchwork [bitbake-devel,62/94] bitbake: webhob: add toggle column functionality to build page

login
register
mail settings
Submitter Alexandru DAMIAN
Date Sept. 24, 2013, 4:52 p.m.
Message ID <b9b020b217ab7e13193e670b2d834e56edc282fc.1380041477.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/58841/
State New
Headers show

Comments

Alexandru DAMIAN - Sept. 24, 2013, 4:52 p.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

We add demo toggle column functionality for the Simple interface,
webhob builds page.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 bitbake/lib/webhob/bldviewer/templates/base.html  | 15 +++++++++++++++
 bitbake/lib/webhob/bldviewer/templates/build.html |  6 ++++++
 bitbake/lib/webhob/bldviewer/views.py             |  3 ++-
 3 files changed, 23 insertions(+), 1 deletion(-)

Patch

diff --git a/bitbake/lib/webhob/bldviewer/templates/base.html b/bitbake/lib/webhob/bldviewer/templates/base.html
index ab3c3b7..3f056a0 100644
--- a/bitbake/lib/webhob/bldviewer/templates/base.html
+++ b/bitbake/lib/webhob/bldviewer/templates/base.html
@@ -3,9 +3,24 @@ 
 <html>
 	<head>
 		<title>WebHob Simple Explorer</title>
+<script src="/static/js/jquery-2.0.3.js">
+</script>
+<script src="/static/js/bootstrap.js">
+</script>
+<link href="/static/css/bootstrap.css" rel="stylesheet" type="text/css">
 	</head>
 
 <body>
+<script>
+function showhideTableColumn(i, sh) {
+    if (sh)
+        $('td:nth-child('+i+'),th:nth-child('+i+')').show();
+    else
+        $('td:nth-child('+i+'),th:nth-child('+i+')').hide();
+g
+}
+</script>
+
 <div>Menu: <a href="/simple/build/">All Builds</a>&nbsp;|&nbsp;<a href="/simple/layer/">All Layers</a>
 </div>
 {% block pagecontent %}
diff --git a/bitbake/lib/webhob/bldviewer/templates/build.html b/bitbake/lib/webhob/bldviewer/templates/build.html
index 20aa310..e30801b 100644
--- a/bitbake/lib/webhob/bldviewer/templates/build.html
+++ b/bitbake/lib/webhob/bldviewer/templates/build.html
@@ -5,6 +5,12 @@ 
 
     <table border="1">
 
+<div align="right" style="display: float">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> |
+</div>
+
     {% load projecttags %}
 
         <tr>
diff --git a/bitbake/lib/webhob/bldviewer/views.py b/bitbake/lib/webhob/bldviewer/views.py
index 7f97312..ab69c91 100644
--- a/bitbake/lib/webhob/bldviewer/views.py
+++ b/bitbake/lib/webhob/bldviewer/views.py
@@ -4,8 +4,9 @@  from django.db.models import Q
 from django.shortcuts import render
 from orm.models import Build, Task, Layer, Layer_Version, Recipe, Package, LogMessage
 from orm.models import Task_Dependency, Package_Dependency
+from django.views.decorators.cache import cache_control
 
-
+@cache_control(no_store=True)
 def build(request):
     template = 'build.html'
     build_info = Build.objects.all()