diff options
author | Belen Barros Pena <belen.barros.pena@linux.intel.com> | 2016-05-05 15:51:09 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-15 08:35:03 +0100 |
commit | 0bd6095d92de6e9a041e7b179c1925bbcada393d (patch) | |
tree | 75b8e51a058706ce4c227b14b2b89e318cc94bc0 /bitbake/lib/toaster | |
parent | 443f7b39158c891015a791814b9b1fe2324edc41 (diff) | |
download | poky-0bd6095d92de6e9a041e7b179c1925bbcada393d.tar.gz |
bitbake: toaster: toaster tables Enable complex empty states
Make sure we can create empty states for toaster tables that include
actions for users to get out of the empty state. Allows a template to be
used as an empty state.
(Bitbake rev: 9f21a1781345a2d2757616a9ab6f34ec48e9e93d)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster')
-rw-r--r-- | bitbake/lib/toaster/toastergui/tables.py | 9 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/toastertable.html | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py index a0eb69591b..0cf96a0ef3 100644 --- a/bitbake/lib/toaster/toastergui/tables.py +++ b/bitbake/lib/toaster/toastergui/tables.py | |||
@@ -477,7 +477,16 @@ class CustomImagesTable(ToasterTable): | |||
477 | 477 | ||
478 | def get_context_data(self, **kwargs): | 478 | def get_context_data(self, **kwargs): |
479 | context = super(CustomImagesTable, self).get_context_data(**kwargs) | 479 | context = super(CustomImagesTable, self).get_context_data(**kwargs) |
480 | |||
481 | empty_state_template = ''' | ||
482 | You have not created any custom images yet. | ||
483 | <a href="{% url 'newcustomimage' data.pid %}"> | ||
484 | Create your first custom image</a> | ||
485 | ''' | ||
486 | context['empty_state'] = self.render_static_data(empty_state_template, | ||
487 | kwargs) | ||
480 | project = Project.objects.get(pk=kwargs['pid']) | 488 | project = Project.objects.get(pk=kwargs['pid']) |
489 | |||
481 | # TODO put project into the ToasterTable base class | 490 | # TODO put project into the ToasterTable base class |
482 | context['project'] = project | 491 | context['project'] = project |
483 | return context | 492 | return context |
diff --git a/bitbake/lib/toaster/toastergui/templates/toastertable.html b/bitbake/lib/toaster/toastergui/templates/toastertable.html index d85d01f157..aa148955e4 100644 --- a/bitbake/lib/toaster/toastergui/templates/toastertable.html +++ b/bitbake/lib/toaster/toastergui/templates/toastertable.html | |||
@@ -26,7 +26,7 @@ | |||
26 | {% include 'toastertable-filter.html' %} | 26 | {% include 'toastertable-filter.html' %} |
27 | 27 | ||
28 | <div class="row-fluid" id="empty-state-{{table_name}}" style="display:none"> | 28 | <div class="row-fluid" id="empty-state-{{table_name}}" style="display:none"> |
29 | <div class="alert alert-info">{{empty_state}}</div> | 29 | <div class="alert alert-info">{{empty_state|safe}}</div> |
30 | </div> | 30 | </div> |
31 | 31 | ||
32 | <div id="no-results-{{table_name}}" style="display:none"> | 32 | <div id="no-results-{{table_name}}" style="display:none"> |