Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 1 | {% extends "base.html" %} |
| 2 | {% load projecttags %} |
| 3 | {% load humanize %} |
| 4 | {% load static %} |
| 5 | {% block pagecontent %} |
| 6 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 7 | {% with recipe.get_base_recipe_file as base_recipe_file %} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 8 | <ul class="breadcrumb"> |
| 9 | <li> |
| 10 | <a href="{% url 'project' project.id %}">{{project.name}}</a> |
| 11 | <span class="divider">→</span> |
| 12 | </li> |
| 13 | <li><a href="{% url 'projectcustomimages' project.id %}">Custom images</a> |
| 14 | <span class="divider">→</span> |
| 15 | </li> |
| 16 | <li class="active"> |
| 17 | {{recipe.name}} ({{recipe.layer_version.layer.name}}) |
| 18 | </li> |
| 19 | </ul> |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 20 | |
| 21 | <script src="{% static 'js/customrecipe.js' %}"></script> |
| 22 | <script> |
| 23 | $(document).ready(function (){ |
| 24 | var ctx = { |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 25 | recipe : { |
| 26 | id: {{recipe.pk}}, |
| 27 | name: "{{recipe.name}}", |
| 28 | includedPackagesCount: {{recipe.includes_set.count}}, |
| 29 | baseRecipeId: {{recipe.base_recipe.pk}}, |
| 30 | xhrPackageListUrl: "{% url 'xhr_customrecipe_packages' recipe.pk %}", |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 31 | xhrCustomRecipeUrl: "{% url 'xhr_customrecipe_id' recipe.pk %}", |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 32 | } |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 33 | }; |
| 34 | |
| 35 | try { |
| 36 | customRecipePageInit(ctx); |
| 37 | } catch (e) { |
| 38 | document.write("Sorry, An error has occurred loading this page"); |
| 39 | console.warn(e); |
| 40 | } |
| 41 | }); |
| 42 | </script> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 43 | |
| 44 | <!-- Delete recipe modal --> |
| 45 | <div id="delete-recipe-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false"> |
| 46 | <div class="modal-dialog"> |
| 47 | <div class="modal-content"> |
| 48 | <div class="modal-body"> |
| 49 | <p>Are you sure you want to delete the <strong>{{recipe.name}}</strong> |
| 50 | custom image?</p> |
| 51 | </div> |
| 52 | <div class="modal-footer"> |
| 53 | <button type="button" class="btn btn-primary" id="delete-custom-recipe-confirmed"> |
| 54 | <span data-role="submit-state">Delete custom image</span> |
| 55 | <span data-role="loading-state" style="display:none"> |
| 56 | <span class="fa-pulse"> |
| 57 | <i class="fa-pulse icon-spinner"></i> |
| 58 | </span> |
| 59 | Deleting custom image... |
| 60 | </span> |
| 61 | </button> |
| 62 | <button type="button" class="btn btn-link" data-dismiss="modal">Cancel</button> |
| 63 | </div> |
| 64 | </div><!-- /.modal-content --> |
| 65 | </div><!-- /.modal-dialog --> |
| 66 | </div><!-- /.modal --> |
| 67 | <!-- end delete recipe modal --> |
| 68 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 69 | <!-- package dependencies modal --> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 70 | <div id="package-deps-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false"> |
| 71 | <div class="modal-dialog"> |
| 72 | <div class="modal-content"> |
| 73 | <div class="modal-header"> |
| 74 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button> |
| 75 | <h3><span class="package-to-add-name"></span> dependencies</h3> |
| 76 | </div> |
| 77 | <div class="modal-body"> |
| 78 | <p>Based on information from a previous build it is likely that adding <strong class="package-to-add-name"></strong> will also add the following packages to your custom image: |
| 79 | </p> |
| 80 | <ul id="package-add-dep-list"> |
| 81 | </ul> |
| 82 | </div> |
| 83 | <div class="modal-footer"> |
| 84 | <p class="help-block text-left">Total package size: <strong id="package-deps-total-size"></strong></p> |
| 85 | <button id="add-package-deps-modal-btn" type="submit" class="btn btn-primary" data-dismiss="modal">Add packages</button> |
| 86 | <button class="btn btn-link" data-dismiss="modal">Cancel</button> |
| 87 | </div> |
| 88 | </div><!-- /.modal-content --> |
| 89 | </div><!-- /.modal-dialog --> |
| 90 | </div><!-- /.modal --> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 91 | <!-- end package dependencies modal --> |
| 92 | |
| 93 | <!-- package reverse dependencies modal --> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 94 | <div style="display:none" id="package-reverse-deps-modal" class="modal fade in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false"> |
| 95 | <div class="modal-dialog"> |
| 96 | <div class="modal-content"> |
| 97 | <div class="modal-header"> |
| 98 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button> |
| 99 | <h3><span class="package-to-rm-name"></span> reverse dependencies</h3> |
| 100 | </div> |
| 101 | <div class="modal-body"> |
| 102 | <p> <strong class="reverse-deps-count"></strong> <span class="reverse-deps-package"></span> in your image <span class="reverse-deps-depends"></span> on <strong class="package-to-rm-name"></strong>:</p> |
| 103 | <ul id="package-reverse-dep-list"> |
| 104 | </ul> |
| 105 | <p>In order to remove <strong class="package-to-rm-name"></strong>, you must remove <span class="reverse-deps-this"></span> <strong class="reverse-deps-count"></strong> <span class="reverse-deps-package"></span> as well.</p> |
| 106 | </div> |
| 107 | <div class="modal-footer"> |
| 108 | <p class="help-block text-left">Total package size: <strong id="package-reverse-deps-total-size"></strong></p> |
| 109 | <button id="rm-package-reverse-deps-modal-btn" type="submit" class="btn btn-primary" data-dismiss="modal">Remove all <span class="reverse-deps-count-plus1"></button> |
| 110 | <button class="btn btn-link" data-dismiss="modal">Cancel</button> |
| 111 | </div> |
| 112 | </div><!-- /.modal-content --> |
| 113 | </div><!-- /.modal-dialog --> |
| 114 | </div><!-- /.modal --> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 115 | <!-- end package dependencies modal --> |
| 116 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 117 | <div class="alert alert-success alert-dismissible change-notification" id="image-created-notification" style="display: none"> |
| 118 | <button type="button" data-dismiss="alert" class="close">×</button> |
| 119 | <p>Your custom image <strong>{{recipe.name}}</strong> has been created. You can now add or remove packages as needed.</p> |
| 120 | </div> |
| 121 | <div class="page-header"> |
| 122 | <h1> |
| 123 | {{recipe.name}} |
| 124 | <small>({{recipe.layer_version.layer.name}})</small> |
| 125 | </h1> |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 126 | </div> |
| 127 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 128 | <div class="row"> |
| 129 | <div class="col-md-8"> |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 130 | <div class="button-place btn-group" style="width: 100%"> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 131 | <a class="btn btn-default btn-lg build-custom-image" href="#" style="width: 50%"> |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 132 | Build {{recipe.name}} |
| 133 | </a> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 134 | <a href="{% url 'customrecipedownload' project.id recipe.id %}" class="btn btn-default btn-lg" style="width: 50%" |
| 135 | {% if not base_recipe_file %} |
| 136 | disabled="disabled" |
| 137 | {% endif %}> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 138 | Download recipe file |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 139 | {% if not base_recipe_file %} |
| 140 | <i class="icon-question-sign get-help" |
| 141 | data-original-title="The recipe file doesn't exist yet, so you cannot download it. You need to build your custom image first"></i> |
| 142 | {% endif %} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 143 | </a> |
| 144 | </div> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 145 | <div id="no-results-special-{{table_name}}" class="top-air" style="display:none;"> |
| 146 | <div class="alert alert-warning"> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 147 | <h3>No packages found</h3> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 148 | <p>You might consider <a href={% url 'projectsoftwarerecipes' project.id %}>searching the list of recipes</a> instead.</p> |
| 149 | <p>If you find a recipe that matches the name of the package you want:</p> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 150 | <ol> |
| 151 | <li>Add the layer providing the recipe to your project</li> |
| 152 | <li>Build the recipe</li> |
| 153 | <li>Once the build completes, come back to this page and search for the package</li> |
| 154 | </ol> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 155 | <form class="form-inline no-results"> |
| 156 | <div class="form-group"> |
| 157 | <div class="btn-group"> |
| 158 | <input type="text" class="form-control no-results-search-input" id="no-results-search-input-{{table_name}}" name="search" placeholder="Search {{title|lower}}" /> |
| 159 | <span class="remove-search-btn-{{table_name}} glyphicon glyphicon-remove-circle" id="no-results-remove-search-btn" tabindex="-1"></span> |
| 160 | </div> |
| 161 | </div> |
| 162 | <button class="btn btn-default search-submit-{{table_name}}">Search</button> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 163 | <button class="btn btn-link" id="no-results-show-all-packages">Show all packages</button> |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 164 | </form> |
| 165 | </div> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 166 | </div> |
| 167 | <div id="results-found-{{table_name}}"> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 168 | <div id="packages-table"> |
| 169 | {% if recipe.get_all_packages.count == 0 and last_build == None %} |
| 170 | <h2> Add | Remove packages </h2> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 171 | <div class="alert alert-info"> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 172 | <p class="lead">Toaster has no package information for {{recipe.name}}. To generate package information, build {{recipe.name}}</p> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 173 | <button class="btn btn-info btn-lg build-custom-image" style="margin:20px 0 10px 0;">Build {{recipe.name}}</button> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 174 | </div> |
| 175 | {% else %} |
| 176 | {# ToasterTable for Adding remove packages #} |
| 177 | {% url 'recipeselectpackages' project.id recipe.id as xhr_table_url %} |
| 178 | <h2>{{title}} (<span class="table-count-{{table_name}}">0</span>) </h2> |
| 179 | {% include "toastertable.html" %} |
| 180 | {% endif %} |
| 181 | </div> |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 182 | </div> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 183 | </div> |
| 184 | <div class="col-md-4"> |
| 185 | <div class="well"> |
| 186 | <h2>About {{recipe.name}}</h2> |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 187 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 188 | <dl class="item-info"> |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 189 | <dt> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 190 | Approx. packages included |
| 191 | <span class="glyphicon glyphicon-question-sign get-help" title="" data-original-title="The number of packages included is based on information from previous builds and from parsing layers, so we can never be sure it is 100% accurate"></span> |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 192 | </dt> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 193 | <dd id="total-num-packages">{{recipe.get_all_packages.count}}</dd> |
| 194 | <dt> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 195 | Approx. package size |
| 196 | <span class="glyphicon glyphicon-question-sign get-help" title="Package size is based on information from previous builds, so we can never be sure it is 100% accurate"></span> |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 197 | </dt> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 198 | <dd id="total-size-packages">{{approx_pkg_size.size__sum|filtered_filesizeformat}}</dd> |
| 199 | {% if last_build %} |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 200 | <dt>Last build</dt> |
| 201 | <dd> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 202 | <span class="glyphicon glyphicon-ok-circle"></span> |
| 203 | <a href="{% url 'projectbuilds' project.id%}">{{last_build.completed_on|date:"d/m/y H:i"}}</a> |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 204 | </dd> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 205 | {% endif %} |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 206 | <dt>Based on</dt> |
| 207 | <dd><a href="{% url 'recipedetails' project.id recipe.base_recipe.pk %}">{{recipe.base_recipe.name}}</a></dd> |
| 208 | {% if recipe.get_last_successful_built_target %} |
| 209 | {% with recipe.get_last_successful_built_target as last_build_target %} |
| 210 | <dt>Last build</dt> |
| 211 | <dd> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 212 | <span class="glyphicon glyphicon-ok-circle"></span> |
| 213 | <a href="{% url 'builddashboard' last_build_target.build.pk %}"> |
| 214 | {{last_build_target.build.completed_on|date:"d/m/y H:i"}}</a> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 215 | </dd> |
| 216 | {% endwith %} |
| 217 | {% endif %} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 218 | {% if base_recipe_file %} |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 219 | <dt>Recipe file</dt> |
| 220 | <dd> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 221 | <code>{{recipe.name}}_{{recipe.version}}.bb</code> |
| 222 | <a href="{% url 'customrecipedownload' project.pk recipe.pk %}"><span class="glyphicon glyphicon-download-alt" data-toggle="tooltip" title="Download recipe file"></span></a> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 223 | </dd> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 224 | {% endif %} |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 225 | <dt>Layer</dt> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 226 | <dd><a href="{% url 'layerdetails' project.id recipe.layer_version.pk %}">{{recipe.layer_version.layer.name}}</a></dd> |
| 227 | {% if recipe.summary %} |
| 228 | <dt> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 229 | Summary |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 230 | </dt> |
| 231 | <dd> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 232 | {{recipe.summary}} |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 233 | </dd> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 234 | {% endif %} |
| 235 | {% if recipe.description %} |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 236 | <dt> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 237 | Description |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 238 | </dt> |
| 239 | <dd> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 240 | {{recipe.description}} |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 241 | </dd> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 242 | {% endif %} |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 243 | <dt>Version</dt> |
| 244 | <dd> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 245 | {{recipe.version}} |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 246 | </dd> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 247 | {% if recipe.section %} |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 248 | <dt>Section</dt> |
| 249 | <dd> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 250 | {{recipe.section}} |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 251 | </dd> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 252 | {% endif %} |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 253 | <dt>License</dt> |
| 254 | <dd> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 255 | {{recipe.license}} |
| 256 | <span class="glyphicon glyphicon-question-sign get-help" title="All custom images have their license set to MIT. This is because the license applies only to the recipe (.bb) file, and not to the image itself. To see which licenses apply to the image you must check the license manifest generated with each build"></i> |
| 257 | </dd> |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 258 | </dl> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 259 | <i class="icon-trash text-danger"></i> |
| 260 | <a href="#delete-recipe-modal" data-target="#delete-recipe-modal" data-toggle="modal" class="text-danger" id="delete-recipe"> |
| 261 | Delete custom image |
| 262 | </a> |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 263 | </div> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 264 | </div> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 265 | </div> |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 266 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 267 | {% endwith %}{# end base_recipe_file #} |
| 268 | {% endblock %} |