Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | {% extends 'base.html' %} |
| 2 | |
| 3 | {% load static %} |
| 4 | |
| 5 | {% block extraheadcontent %} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 6 | <link rel="stylesheet" href="{% static 'css/jquery-ui.min.css' %}" type='text/css'> |
| 7 | <link rel="stylesheet" href="{% static 'css/jquery-ui.structure.min.css' %}" type='text/css'> |
| 8 | <link rel="stylesheet" href="{% static 'css/jquery-ui.theme.min.css' %}" type='text/css'> |
| 9 | <script src="{% static 'js/jquery-ui.min.js' %}"> |
| 10 | </script> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 11 | {% endblock %} |
| 12 | |
| 13 | {% block title %} {{title}} - {{project.name}} - Toaster {% endblock %} |
| 14 | |
| 15 | {% block pagecontent %} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 16 | <div class="row"> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 17 | |
| 18 | {% include "projecttopbar.html" %} |
| 19 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 20 | <div class="col-md-12"> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 21 | {% with mru=mru mrb_type=mrb_type %} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 22 | {% include 'mrb_section.html' %} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 23 | {% endwith %} |
| 24 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 25 | <h2 class="top-air" data-role="page-title"></h2> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 26 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 27 | {% if not build_in_progress_none_completed %} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 28 | {% url 'projectbuilds' project.id as xhr_table_url %} |
| 29 | {% include 'toastertable.html' %} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 30 | {% endif %} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 31 | </div> |
| 32 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 33 | <script> |
| 34 | $(document).ready(function () { |
| 35 | // title |
| 36 | var tableElt = $("#{{table_name}}"); |
| 37 | var titleElt = $("[data-role='page-title']"); |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 38 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 39 | tableElt.on("table-done", function (e, total, tableParams) { |
| 40 | var title = "All project builds"; |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 41 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 42 | if (tableParams.search || tableParams.filter) { |
| 43 | if (total === 0) { |
| 44 | title = "No project builds found"; |
| 45 | } |
| 46 | else if (total > 0) { |
| 47 | title = total + " project build" + (total > 1 ? 's' : '') + " found"; |
| 48 | } |
| 49 | } |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 50 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 51 | if (total === 0) { |
| 52 | titleElt.hide(); |
| 53 | } else { |
| 54 | titleElt.show(); |
| 55 | titleElt.text(title); |
| 56 | } |
| 57 | }); |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 58 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 59 | // highlight builds tab |
| 60 | $("#topbar-builds-tab").addClass("active") |
| 61 | }); |
| 62 | </script> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 63 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 64 | </div> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 65 | {% endblock %} |