[bitbake-devel] [PATCH 05/12] toasterui: style the Toaster version information

Alex DAMIAN alexandru.damian at intel.com
Tue Feb 24 17:20:53 UTC 2015


From: Belen Barros Pena <belen.barros.pena at intel.com>

When debugging is turned on, we show some Toaster version
information in the top bar. Present it so that it can
be easily copied and pasted.

Signed-off-by: Belen Barros Pena <belen.barros.pena at intel.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian at intel.com>
---
 lib/toaster/toastergui/static/css/default.css  | 3 ++-
 lib/toaster/toastergui/static/js/libtoaster.js | 3 +++
 lib/toaster/toastergui/templates/base.html     | 2 +-
 lib/toaster/toastergui/views.py                | 7 ++++---
 lib/toaster/toastermain/settings.py            | 4 ++--
 5 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/lib/toaster/toastergui/static/css/default.css b/lib/toaster/toastergui/static/css/default.css
index 86cf67a..f97e6c4 100644
--- a/lib/toaster/toastergui/static/css/default.css
+++ b/lib/toaster/toastergui/static/css/default.css
@@ -5,7 +5,8 @@
 /* style the version information */
 .brand > a { color: #777; }
 .brand > a:hover { color: #999; text-decoration: none; }
-.icon-info-sign.get-help { color: #777; font-size: 16px; margin-left: 5px;}
+.icon-info-sign { color: #777; font-size: 16px; margin-left: 5px;}
+.icon-info-sign:hover { color: #999; cursor: pointer; }
 
 /* Style the breadcrumb */
 .breadcrumb { display: inline-block; background-color: transparent; }
diff --git a/lib/toaster/toastergui/static/js/libtoaster.js b/lib/toaster/toastergui/static/js/libtoaster.js
index 2dc5b0a..ea1522f 100644
--- a/lib/toaster/toastergui/static/js/libtoaster.js
+++ b/lib/toaster/toastergui/static/js/libtoaster.js
@@ -317,6 +317,9 @@ $(document).ready(function() {
     // initialise the tooltips for the download icons
     $(".icon-download-alt").tooltip({ container: 'body', html: true, delay: { show: 200 } });
 
+    // initialise popover for debug information
+    $(".icon-info-sign").popover( { placement: 'bottom', html: true, container: 'body' });
+
     // linking directly to tabs
     $(function(){
           var hash = window.location.hash;
diff --git a/lib/toaster/toastergui/templates/base.html b/lib/toaster/toastergui/templates/base.html
index 695ca5d..62cc7ad 100644
--- a/lib/toaster/toastergui/templates/base.html
+++ b/lib/toaster/toastergui/templates/base.html
@@ -61,7 +61,7 @@
             <span class="brand">
                 <a href="/">Toaster</a>
                 {% if DEBUG %}
-                    <i class="icon-info-sign get-help heading-help" data-placement="bottom" title="Version: {{TOASTER_VERSION}} <br /> Mode: {%if MANAGED%}build{%else%}analysis{%endif%}"></i>
+                    <i class="icon-info-sign" title="<strong>Toaster version information</strong>" data-content="<dl><dt>Branch</dt><dd>{{TOASTER_BRANCH}}</dd><dt>Revision</dt><dd>{{TOASTER_REVISION}}</dd><dt>Mode</dt><dd>{%if MANAGED%}Build{%else%}Analysis{%endif%}</dd></dl>"></i>
                 {% endif %}
             </span>
             <a class="pull-right manual" target="_blank" href="http://www.yoctoproject.org/documentation/toaster-manual">
diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
index 0284b1a..4960ba0 100755
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -1731,7 +1731,8 @@ if toastermain.settings.MANAGED:
             "projects": Project.objects.all(),
             "MANAGED" : toastermain.settings.MANAGED,
             "DEBUG" : toastermain.settings.DEBUG,
-            "TOASTER_VERSION": toastermain.settings.TOASTER_VERSION,
+            "TOASTER_BRANCH": toastermain.settings.TOASTER_BRANCH,
+            "TOASTER_REVISION" : toastermain.settings.TOASTER_REVISION,
         }
         if 'project_id' in request.session:
             try:
@@ -3104,8 +3105,8 @@ else:
             "projects": [],
             "MANAGED" : toastermain.settings.MANAGED,
             "DEBUG" : toastermain.settings.DEBUG,
-            "TOASTER_VERSION": toastermain.settings.TOASTER_VERSION,
-
+            "TOASTER_BRANCH": toastermain.settings.TOASTER_BRANCH,
+            "TOASTER_REVISION" : toastermain.settings.TOASTER_REVISION,
         }
 
 
diff --git a/lib/toaster/toastermain/settings.py b/lib/toaster/toastermain/settings.py
index a7304fa..80f26e0 100644
--- a/lib/toaster/toastermain/settings.py
+++ b/lib/toaster/toastermain/settings.py
@@ -232,8 +232,8 @@ from os.path import dirname as DN
 SITE_ROOT=DN(DN(os.path.abspath(__file__)))
 
 import subprocess
-TOASTER_VERSION = subprocess.Popen('git branch | grep "^* " | tr -d "* "', cwd = SITE_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
-TOASTER_VERSION += " " + subprocess.Popen('git rev-parse HEAD ', cwd = SITE_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
+TOASTER_BRANCH = subprocess.Popen('git branch | grep "^* " | tr -d "* "', cwd = SITE_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
+TOASTER_REVISION = subprocess.Popen('git rev-parse HEAD ', cwd = SITE_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
 
 ROOT_URLCONF = 'toastermain.urls'
 
-- 
1.9.1




More information about the bitbake-devel mailing list