projectbuilds-toastertable.html 1.6 KB

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