Patchwork [bitbake-devel,03/14] toaster: Display task description

login
register
mail settings
Submitter Alexandru DAMIAN
Date March 31, 2014, 4:47 p.m.
Message ID <4db519c5b37cfdce37e4b2afaef75109295ff800.1396284354.git.alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/69709/
State New
Headers show

Comments

Alexandru DAMIAN - March 31, 2014, 4:47 p.m.
From: Ravi Chintakunta <ravi.chintakunta@timesys.com>

Display task description as content of help bubble for a task.

[YOCTO #5748]

Signed-off-by: Ravi Chintakunta <ravi.chintakunta@timesys.com>
---
 lib/toaster/orm/models.py                    | 7 +++++++
 lib/toaster/toastergui/templates/recipe.html | 2 +-
 lib/toaster/toastergui/templates/tasks.html  | 2 +-
 3 files changed, 9 insertions(+), 2 deletions(-)

Patch

diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index 4975433..9c15ebf 100644
--- a/lib/toaster/orm/models.py
+++ b/lib/toaster/orm/models.py
@@ -174,6 +174,13 @@  class Task(models.Model):
             return "Executed"
         return "Not Executed"
 
+    def get_description(self):
+        variable = Variable.objects.filter(variable_name=self.task_name, build = self.build)
+        try:
+            return variable[0].description
+        except IndexError:
+            return ''
+
     build = models.ForeignKey(Build, related_name='task_build')
     order = models.IntegerField(null=True)
     task_executed = models.BooleanField(default=False) # True means Executed, False means Not/Executed
diff --git a/lib/toaster/toastergui/templates/recipe.html b/lib/toaster/toastergui/templates/recipe.html
index e367077..b8898d2 100644
--- a/lib/toaster/toastergui/templates/recipe.html
+++ b/lib/toaster/toastergui/templates/recipe.html
@@ -112,7 +112,7 @@ 
                     <td><a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">{{task.order}}</a></td>
                     <td>
                         <a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">{{task.task_name}}</a>
-                        <i class="icon-question-sign get-help hover-help" title="This task fetches the source code"></i>
+                        {% if task.get_description %}<i class="icon-question-sign get-help hover-help" title="" data-original-title="{{task.get_description}}"></i> {% endif %}
                     </td>
 
                     <td><a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">{{task.get_executed_display}}</a></td>
diff --git a/lib/toaster/toastergui/templates/tasks.html b/lib/toaster/toastergui/templates/tasks.html
index ca7e187..d68a31a 100644
--- a/lib/toaster/toastergui/templates/tasks.html
+++ b/lib/toaster/toastergui/templates/tasks.html
@@ -86,7 +86,7 @@ 
                 <a href="{% url "recipe" build.pk task.recipe.pk %}">{{task.recipe.version}}</a>
             </td>
             <td class="task_name">
-                <a href="{%url "task" build.pk task.pk%} ">{{task.task_name}}</a>
+                <a href="{%url "task" build.pk task.pk%} ">{{task.task_name}}</a> {% if task.get_description %}<i class="icon-question-sign get-help hover-help" title="" data-original-title="{{task.get_description}}"></i> {% endif %}
             </td>
             <td class="executed">
                 <a href="{%url "task" build.pk task.pk%} ">{{task.get_executed_display}}</a>