Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | {% extends 'base.html' %} |
| 2 | |
| 3 | {% block title %} All projects - Toaster {% endblock %} |
| 4 | |
| 5 | {% block pagecontent %} |
| 6 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 7 | <div class="row"> |
| 8 | <div class="col-md-12"> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 9 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 10 | <div class="page-header"> |
| 11 | <h1 data-role="page-title"></h1> |
| 12 | </div> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 13 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 14 | {% url 'projects' as xhr_table_url %} |
| 15 | {% include 'toastertable.html' %} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 16 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 17 | <script> |
| 18 | $(document).ready(function () { |
| 19 | var tableElt = $("#{{table_name}}"); |
| 20 | var titleElt = $("[data-role='page-title']"); |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 21 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 22 | tableElt.on("table-done", function (e, total, tableParams) { |
| 23 | var title = "All projects"; |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 24 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 25 | if (tableParams.search || tableParams.filter) { |
| 26 | if (total === 0) { |
| 27 | title = "No projects found"; |
| 28 | } |
| 29 | else if (total > 0) { |
| 30 | title = total + " project" + (total > 1 ? 's' : '') + " found"; |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | titleElt.text(title); |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 35 | }); |
| 36 | }); |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 37 | </script> |
| 38 | |
| 39 | </div> |
| 40 | </div> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 41 | |
| 42 | {% endblock %} |