1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 13:29:49 +00:00

bitbake: toastergui: fix task executed status display

The proper way to get a display-able value
in Django is to use a model method instead of clutter
the template with if/else.

	[YOCTO #5641]

(Bitbake rev: bb21b71dab70db163b804c7ebf27b85c59a39112)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexandru DAMIAN
2014-02-13 13:36:54 +00:00
committed by Richard Purdie
parent 4ae598195b
commit 7008a24792
3 changed files with 7 additions and 12 deletions
+5
View File
@@ -116,6 +116,11 @@ class Task(models.Model):
def get_related_setscene(self): def get_related_setscene(self):
return Task.objects.related_setscene(self) return Task.objects.related_setscene(self)
def get_executed_display(self):
if self.task_executed:
return "Executed"
return "Not Executed"
build = models.ForeignKey(Build, related_name='task_build') build = models.ForeignKey(Build, related_name='task_build')
order = models.IntegerField(null=True) order = models.IntegerField(null=True)
task_executed = models.BooleanField(default=False) # True means Executed, False means Not/Executed task_executed = models.BooleanField(default=False) # True means Executed, False means Not/Executed
@@ -115,11 +115,7 @@
<i class="icon-question-sign get-help hover-help" title="This task fetches the source code"></i> <i class="icon-question-sign get-help hover-help" title="This task fetches the source code"></i>
</td> </td>
{% if task.task_executed %} <td><a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">{{task.get_executed_display}}</a></td>
<td><a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">Executed</a></td>
{% else %}
<td><a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">Prebuilt</a></td>
{% endif %}
<td><a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">{{task.get_outcome_display}}</a></td> <td><a {{ task|task_color }} href="{% url "task" build.pk task.pk %}">{{task.get_outcome_display}}</a></td>
<td> <td>
@@ -30,13 +30,7 @@
<a href="{%url "task" build.pk task.pk%} ">{{task.task_name}}</a> <a href="{%url "task" build.pk task.pk%} ">{{task.task_name}}</a>
</td> </td>
<td class="executed"> <td class="executed">
<a href="{%url "task" build.pk task.pk%} "> <a href="{%url "task" build.pk task.pk%} ">{{task.get_executed_display}}</a>
{% if task.task_executed %}
Executed
{% else %}
Not executed
{% endif %}
</a>
</td> </td>
<td class="outcome"> <td class="outcome">
<a href="{%url "task" build.pk task.pk%} ">{{task.get_outcome_display}}</a> <a href="{%url "task" build.pk task.pk%} ">{{task.get_outcome_display}}</a>