blob: d8020a97f230911dff99fc04e9014a9c23d85794 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001{% extends 'base.html' %}
2
3{% block title %} All projects - Toaster {% endblock %}
4
5{% block pagecontent %}
6
Patrick Williamsc0f7c042017-02-23 20:41:17 -06007<div class="row">
8 <div class="col-md-12">
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05009
Patrick Williamsc0f7c042017-02-23 20:41:17 -060010 <div class="page-header">
11 <h1 data-role="page-title"></h1>
12 </div>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050013
Patrick Williamsc0f7c042017-02-23 20:41:17 -060014 {% url 'projects' as xhr_table_url %}
15 {% include 'toastertable.html' %}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050016
Patrick Williamsc0f7c042017-02-23 20:41:17 -060017 <script>
18$(document).ready(function () {
19 var tableElt = $("#{{table_name}}");
20 var titleElt = $("[data-role='page-title']");
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050021
Patrick Williamsc0f7c042017-02-23 20:41:17 -060022 tableElt.on("table-done", function (e, total, tableParams) {
23 var title = "All projects";
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050024
Patrick Williamsc0f7c042017-02-23 20:41:17 -060025 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 Williamsd8c66bc2016-06-20 12:57:21 -050035 });
36 });
Patrick Williamsc0f7c042017-02-23 20:41:17 -060037 </script>
38
39 </div>
40</div>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050041
42{% endblock %}