1{% extends 'base.html' %}
2
3{% block title %} All projects - Toaster {% endblock %}
4
5{% block pagecontent %}
6
7<div class="row">
8  <div class="col-md-12">
9
10    <div class="page-header">
11      <h1 data-role="page-title"></h1>
12    </div>
13
14    {% url 'projects' as xhr_table_url %}
15    {% include 'toastertable.html' %}
16
17    <script>
18$(document).ready(function () {
19    var tableElt = $("#{{table_name}}");
20    var titleElt = $("[data-role='page-title']");
21
22    tableElt.on("table-done", function (e, total, tableParams) {
23      var title = "All projects";
24
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);
35      });
36    });
37    </script>
38
39  </div>
40</div>
41
42{% endblock %}
43