Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | {% extends "base.html" %} |
| 2 | {% load projecttags %} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 3 | {% load project_url_tag %} |
| 4 | {% load objects_to_dictionaries_filter %} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 5 | {% load humanize %} |
| 6 | {% block pagecontent %} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 7 | <!-- breadcrumbs --> |
| 8 | <div class="section"> |
| 9 | <ul class="breadcrumb" id="breadcrumb"> |
| 10 | <li><a href="{% project_url build.project %}">{{build.project.name}}</a></li> |
| 11 | {% if not build.project.is_default %} |
| 12 | <li><a href="{% url 'projectbuilds' build.project.id %}">Builds</a></li> |
| 13 | {% endif %} |
| 14 | <li> |
| 15 | {% block parentbreadcrumb %} |
| 16 | <a href="{%url 'builddashboard' build.pk%}"> |
| 17 | {{build.get_sorted_target_list.0.target}} {% if build.target_set.all.count > 1 %}(+{{build.target_set.all.count|add:"-1"}}){% endif %} {{build.machine}} ({{build.completed_on|date:"d/m/y H:i"}}) |
| 18 | </a> |
| 19 | {% endblock %} |
| 20 | </li> |
| 21 | {% block localbreadcrumb %}{% endblock %} |
| 22 | </ul> |
| 23 | <script> |
| 24 | $( function () { |
| 25 | $('#breadcrumb > li').append('<span class="divider">→</span>'); |
| 26 | $('#breadcrumb > li:last').addClass("active"); |
| 27 | $('#breadcrumb > li:last > span').remove(); |
| 28 | }); |
| 29 | </script> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 30 | </div> |
| 31 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 32 | <div class="row-fluid"> |
| 33 | <!-- begin left sidebar container --> |
| 34 | <div id="nav" class="span2"> |
| 35 | <ul class="nav nav-list well"> |
| 36 | <li |
| 37 | {% if request.resolver_match.url_name == 'builddashboard' %} |
| 38 | class="active" |
| 39 | {% endif %} > |
| 40 | <a class="nav-parent" href="{% url 'builddashboard' build.pk %}">Build summary</a> |
| 41 | </li> |
| 42 | {% if build.target_set.all.0.is_image and build.outcome == 0 %} |
| 43 | <li class="nav-header">Images</li> |
| 44 | {% block nav-target %} |
| 45 | {% for t in build.get_sorted_target_list %} |
| 46 | <li><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li> |
| 47 | {% endfor %} |
| 48 | {% endblock %} |
| 49 | {% endif %} |
| 50 | <li class="nav-header">Build</li> |
| 51 | {% block nav-configuration %} |
| 52 | <li><a href="{% url 'configuration' build.pk %}">Configuration</a></li> |
| 53 | {% endblock %} |
| 54 | {% block nav-tasks %} |
| 55 | <li><a href="{% url 'tasks' build.pk %}">Tasks</a></li> |
| 56 | {% endblock %} |
| 57 | {% block nav-recipes %} |
| 58 | <li><a href="{% url 'recipes' build.pk %}">Recipes</a></li> |
| 59 | {% endblock %} |
| 60 | {% block nav-packages %} |
| 61 | <li><a href="{% url 'packages' build.pk %}">Packages</a></li> |
| 62 | {% endblock %} |
| 63 | <li class="nav-header">Performance</li> |
| 64 | {% block nav-buildtime %} |
| 65 | <li><a href="{% url 'buildtime' build.pk %}">Time</a></li> |
| 66 | {% endblock %} |
| 67 | {% block nav-cputime %} |
| 68 | <li><a href="{% url 'cputime' build.pk %}">CPU usage</a></li> |
| 69 | {% endblock %} |
| 70 | {% block nav-diskio %} |
| 71 | <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li> |
| 72 | {% endblock %} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 73 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 74 | <li class="divider"></li> |
| 75 | |
| 76 | <li> |
| 77 | <p class="navbar-btn"> |
| 78 | <a class="btn btn-block" href="{% url 'build_artifact' build.id 'cookerlog' build.id %}"> |
| 79 | Download build log |
| 80 | </a> |
| 81 | </p> |
| 82 | </li> |
| 83 | |
| 84 | {% with build.get_custom_image_recipes as custom_image_recipes %} |
| 85 | {% if custom_image_recipes.count > 0 %} |
| 86 | <!-- edit custom image built during this build --> |
| 87 | <li> |
| 88 | <p class="navbar-btn" data-role="edit-custom-image-trigger"> |
| 89 | <button class="btn btn-block">Edit custom image</button> |
| 90 | {% include 'editcustomimage_modal.html' %} |
| 91 | <script> |
| 92 | var editableCustomImageRecipes = {{ custom_image_recipes | objects_to_dictionaries:"id,name" | json }}; |
| 93 | |
| 94 | $(document).ready(function () { |
| 95 | var editCustomImageTrigger = $('[data-role="edit-custom-image-trigger"]'); |
| 96 | var editCustomImageModal = $('#edit-custom-image-modal'); |
| 97 | |
| 98 | // edit custom image which was built during this build |
| 99 | editCustomImageTrigger.click(function () { |
| 100 | // single editable custom image: redirect to the edit page |
| 101 | // for that image |
| 102 | if (editableCustomImageRecipes.length === 1) { |
| 103 | var url = '{% url "customrecipe" build.project.id custom_image_recipes.first.id %}'; |
| 104 | document.location.href = url; |
| 105 | } |
| 106 | // multiple editable custom images: show modal to select |
| 107 | // one of them for editing |
| 108 | else { |
| 109 | editCustomImageModal.modal('show'); |
| 110 | } |
| 111 | }); |
| 112 | }); |
| 113 | </script> |
| 114 | </p> |
| 115 | </li> |
| 116 | {% endif %} |
| 117 | {% endwith %} |
| 118 | |
| 119 | <li> |
| 120 | <!-- new custom image from image recipe in this build --> |
| 121 | <p class="navbar-btn" data-role="new-custom-image-trigger"> |
| 122 | <button class="btn btn-block">New custom image</button> |
| 123 | </p> |
| 124 | {% include 'newcustomimage_modal.html' %} |
| 125 | <script> |
| 126 | // imageRecipes includes both custom image recipes and built-in |
| 127 | // image recipes, any of which can be used as the basis for a |
| 128 | // new custom image |
| 129 | var imageRecipes = {{ build.get_image_recipes | objects_to_dictionaries:"id,name" | json }}; |
| 130 | |
| 131 | $(document).ready(function () { |
| 132 | var newCustomImageModal = $('#new-custom-image-modal'); |
| 133 | var newCustomImageTrigger = $('[data-role="new-custom-image-trigger"]'); |
| 134 | |
| 135 | // show create new custom image modal to select an image built |
| 136 | // during this build as the basis for the custom recipe |
| 137 | newCustomImageTrigger.click(function () { |
| 138 | if (!imageRecipes.length) { |
| 139 | return; |
| 140 | } |
| 141 | |
| 142 | newCustomImageModalSetRecipes(imageRecipes); |
| 143 | newCustomImageModal.modal('show'); |
| 144 | }); |
| 145 | }); |
| 146 | </script> |
| 147 | </li> |
| 148 | </ul> |
| 149 | |
| 150 | </div> |
| 151 | <!-- end left sidebar container --> |
| 152 | |
| 153 | <!-- begin right container --> |
| 154 | {% block buildinfomain %}{% endblock %} |
| 155 | <!-- end right container --> |
| 156 | </div> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 157 | {% endblock %} |