diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates/projects-toastertable.html')
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/projects-toastertable.html | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/projects-toastertable.html b/bitbake/lib/toaster/toastergui/templates/projects-toastertable.html index 5814f32d06..d8020a97f2 100644 --- a/bitbake/lib/toaster/toastergui/templates/projects-toastertable.html +++ b/bitbake/lib/toaster/toastergui/templates/projects-toastertable.html | |||
@@ -4,33 +4,39 @@ | |||
4 | 4 | ||
5 | {% block pagecontent %} | 5 | {% block pagecontent %} |
6 | 6 | ||
7 | <div class="page-header top-air"> | 7 | <div class="row"> |
8 | <h1 data-role="page-title"></h1> | 8 | <div class="col-md-12"> |
9 | </div> | 9 | |
10 | 10 | <div class="page-header"> | |
11 | {% url 'projects' as xhr_table_url %} | 11 | <h1 data-role="page-title"></h1> |
12 | {% include 'toastertable.html' %} | 12 | </div> |
13 | 13 | ||
14 | <script> | 14 | {% url 'projects' as xhr_table_url %} |
15 | $(document).ready(function () { | 15 | {% include 'toastertable.html' %} |
16 | var tableElt = $("#{{table_name}}"); | 16 | |
17 | var titleElt = $("[data-role='page-title']"); | 17 | <script> |
18 | 18 | $(document).ready(function () { | |
19 | tableElt.on("table-done", function (e, total, tableParams) { | 19 | var tableElt = $("#{{table_name}}"); |
20 | var title = "All projects"; | 20 | var titleElt = $("[data-role='page-title']"); |
21 | 21 | ||
22 | if (tableParams.search || tableParams.filter) { | 22 | tableElt.on("table-done", function (e, total, tableParams) { |
23 | if (total === 0) { | 23 | var title = "All projects"; |
24 | title = "No projects found"; | 24 | |
25 | } | 25 | if (tableParams.search || tableParams.filter) { |
26 | else if (total > 0) { | 26 | if (total === 0) { |
27 | title = total + " project" + (total > 1 ? 's' : '') + " found"; | 27 | title = "No projects found"; |
28 | } | 28 | } |
29 | } | 29 | else if (total > 0) { |
30 | 30 | title = total + " project" + (total > 1 ? 's' : '') + " found"; | |
31 | titleElt.text(title); | 31 | } |
32 | } | ||
33 | |||
34 | titleElt.text(title); | ||
32 | }); | 35 | }); |
33 | }); | 36 | }); |
34 | </script> | 37 | </script> |
38 | |||
39 | </div> | ||
40 | </div> | ||
35 | 41 | ||
36 | {% endblock %} | 42 | {% endblock %} |