blob: 945fc9797787432c4c528812b172edc6769570f4 [file] [log] [blame]
Patrick Williamsf1e5d692016-03-30 15:21:19 -05001{% extends "base.html" %}
2{% load projecttags %}
3{% load humanize %}
4{% load static %}
5{% block pagecontent %}
6
Patrick Williamsc0f7c042017-02-23 20:41:17 -06007{% with recipe.get_base_recipe_file as base_recipe_file %}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05008 <ul class="breadcrumb">
9 <li>
10 <a href="{% url 'project' project.id %}">{{project.name}}</a>
11 <span class="divider">&rarr;</span>
12 </li>
13 <li><a href="{% url 'projectcustomimages' project.id %}">Custom images</a>
14 <span class="divider">&rarr;</span>
15 </li>
16 <li class="active">
17 {{recipe.name}} ({{recipe.layer_version.layer.name}})
18 </li>
19 </ul>
Patrick Williamsf1e5d692016-03-30 15:21:19 -050020
21<script src="{% static 'js/customrecipe.js' %}"></script>
22<script>
23 $(document).ready(function (){
24 var ctx = {
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050025 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 Williamsc0f7c042017-02-23 20:41:17 -060031 xhrCustomRecipeUrl: "{% url 'xhr_customrecipe_id' recipe.pk %}",
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050032 }
Patrick Williamsf1e5d692016-03-30 15:21:19 -050033 };
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 Williamsc0f7c042017-02-23 20:41:17 -060043
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 &nbsp;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 Williamsd8c66bc2016-06-20 12:57:21 -050069<!-- package dependencies modal -->
Patrick Williamsc0f7c042017-02-23 20:41:17 -060070<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 Williamsd8c66bc2016-06-20 12:57:21 -050091<!-- end package dependencies modal -->
92
93<!-- package reverse dependencies modal -->
Patrick Williamsc0f7c042017-02-23 20:41:17 -060094<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 Williamsd8c66bc2016-06-20 12:57:21 -0500115<!-- end package dependencies modal -->
116
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600117<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">&times;</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 Williamsf1e5d692016-03-30 15:21:19 -0500126</div>
127
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600128<div class="row">
129 <div class="col-md-8">
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500130 <div class="button-place btn-group" style="width: 100%">
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600131 <a class="btn btn-default btn-lg build-custom-image" href="#" style="width: 50%">
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500132 Build {{recipe.name}}
133 </a>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600134 <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 Williamsd8c66bc2016-06-20 12:57:21 -0500138 Download recipe file
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600139 {% 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 Williamsd8c66bc2016-06-20 12:57:21 -0500143 </a>
144 </div>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600145 <div id="no-results-special-{{table_name}}" class="top-air" style="display:none;">
146 <div class="alert alert-warning">
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500147 <h3>No packages found</h3>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600148 <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 Williamsd8c66bc2016-06-20 12:57:21 -0500150 <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 Williamsc0f7c042017-02-23 20:41:17 -0600155 <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 Williamsd8c66bc2016-06-20 12:57:21 -0500163 <button class="btn btn-link" id="no-results-show-all-packages">Show all packages</button>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500164 </form>
165 </div>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600166 </div>
167 <div id="results-found-{{table_name}}">
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500168 <div id="packages-table">
169 {% if recipe.get_all_packages.count == 0 and last_build == None %}
170 <h2> Add | Remove packages </h2>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600171 <div class="alert alert-info">
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500172 <p class="lead">Toaster has no package information for {{recipe.name}}. To generate package information, build {{recipe.name}}</p>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600173 <button class="btn btn-info btn-lg build-custom-image" style="margin:20px 0 10px 0;">Build {{recipe.name}}</button>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500174 </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 Williamsf1e5d692016-03-30 15:21:19 -0500182 </div>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600183 </div>
184 <div class="col-md-4">
185 <div class="well">
186 <h2>About {{recipe.name}}</h2>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500187
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600188 <dl class="item-info">
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500189 <dt>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600190 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 Williamsf1e5d692016-03-30 15:21:19 -0500192 </dt>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500193 <dd id="total-num-packages">{{recipe.get_all_packages.count}}</dd>
194 <dt>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600195 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 Williamsf1e5d692016-03-30 15:21:19 -0500197 </dt>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500198 <dd id="total-size-packages">{{approx_pkg_size.size__sum|filtered_filesizeformat}}</dd>
199 {% if last_build %}
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500200 <dt>Last build</dt>
201 <dd>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600202 <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 Williamsf1e5d692016-03-30 15:21:19 -0500204 </dd>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500205 {% endif %}
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500206 <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 Williamsc0f7c042017-02-23 20:41:17 -0600212 <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 Williamsd8c66bc2016-06-20 12:57:21 -0500215 </dd>
216 {% endwith %}
217 {% endif %}
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600218 {% if base_recipe_file %}
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500219 <dt>Recipe file</dt>
220 <dd>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600221 <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 Williamsd8c66bc2016-06-20 12:57:21 -0500223 </dd>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600224 {% endif %}
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500225 <dt>Layer</dt>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500226 <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 Williamsc0f7c042017-02-23 20:41:17 -0600229 Summary
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500230 </dt>
231 <dd>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600232 {{recipe.summary}}
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500233 </dd>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500234 {% endif %}
235 {% if recipe.description %}
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500236 <dt>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600237 Description
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500238 </dt>
239 <dd>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600240 {{recipe.description}}
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500241 </dd>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500242 {% endif %}
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500243 <dt>Version</dt>
244 <dd>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600245 {{recipe.version}}
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500246 </dd>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500247 {% if recipe.section %}
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500248 <dt>Section</dt>
249 <dd>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600250 {{recipe.section}}
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500251 </dd>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500252 {% endif %}
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500253 <dt>License</dt>
254 <dd>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600255 {{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 Williamsf1e5d692016-03-30 15:21:19 -0500258 </dl>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600259 <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 Williamsf1e5d692016-03-30 15:21:19 -0500263 </div>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500264 </div>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600265</div>
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500266
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600267{% endwith %}{# end base_recipe_file #}
268{% endblock %}