Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -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 | <ul class="breadcrumb"> |
| 8 | <li> |
| 9 | <a href="{% url 'project' project.id %}">{{project.name}}</a> |
| 10 | <span class="divider">→</span> |
| 11 | </li> |
| 12 | <li> |
| 13 | {% if recipe.is_image %} |
| 14 | <a href="{% url 'projectimagerecipes' project.id %}">Image recipes</a> |
| 15 | {% else %} |
| 16 | <a href="{% url 'projectsoftwarerecipes' project.id %}">Software recipes</a> |
| 17 | {% endif %} |
| 18 | <span class="divider">→</span> |
| 19 | </li> |
| 20 | <li class="active"> |
| 21 | {{recipe.name}} ({{recipe.layer_version.layer.name}}) |
| 22 | </li> |
| 23 | </ul> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 24 | |
| 25 | <script src="{% static 'js/recipedetails.js' %}"></script> |
| 26 | <script> |
| 27 | $(document).ready(function (){ |
| 28 | var ctx = { |
| 29 | recipe : { |
| 30 | id: {{recipe.pk}}, |
| 31 | name: "{{recipe.name}}", |
| 32 | totalPackages: {{packages.count}}, |
| 33 | layer_version : { |
| 34 | id: {{recipe.layer_version.pk}}, |
| 35 | name: "{{recipe.layer_version.layer.name}}", |
| 36 | layerdetailurl: "{% url 'layerdetails' project.pk recipe.layer_version.pk %}" |
| 37 | } |
| 38 | } |
| 39 | }; |
| 40 | |
| 41 | try { |
| 42 | recipeDetailsPageInit(ctx); |
| 43 | } catch (e) { |
| 44 | document.write("Sorry, An error has occurred loading this page"); |
| 45 | console.warn(e); |
| 46 | } |
| 47 | }); |
| 48 | </script> |
| 49 | |
| 50 | {% include 'newcustomimage_modal.html' %} |
| 51 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 52 | <div class="alert alert-success lead" id="image-created-notification" style="margin-top: 15px; display: none"> |
| 53 | <button type="button" data-dismiss="alert" class="close">x</button> |
| 54 | Your custom image <strong>{{recipe.name}}</strong> has been created. You can now add or remove packages as needed. |
| 55 | </div> |
| 56 | <div class="page-header"> |
| 57 | <h1> |
| 58 | {{recipe.name}} |
| 59 | <small>({{recipe.layer_version.layer.name}})</small> |
| 60 | </h1> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 61 | </div> |
| 62 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 63 | <div class="row"> |
| 64 | <div class="col-md-8"> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 65 | <div class="button-place btn-group" id="customise-build-btns" |
| 66 | style="width: 100%; |
| 67 | {% if not in_project %} |
| 68 | display:none; |
| 69 | {% endif %}"> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 70 | <button class="btn btn-default btn-lg build-recipe-btn" style="width: 50%"> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 71 | Build {{recipe.name}} |
| 72 | </button> |
| 73 | {% if recipe.is_image %} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 74 | <button class="btn btn-default btn-lg customise-btn" data-recipe="{{recipe.pk}}" style="width: 50%"> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 75 | Customise {{recipe.name}} |
| 76 | </button> |
| 77 | {% endif %} |
| 78 | </div> |
| 79 | <div class="button-place"> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 80 | <button class="btn btn-default btn-block btn-lg" id="add-layer-btn" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 81 | style="width:100%; |
| 82 | {% if in_project %} |
| 83 | display:none; |
| 84 | {% endif %}"> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 85 | <i class="glyphicon glyphicon-plus"></i> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 86 | Add the {{recipe.layer_version.layer.name}} layer to your project to build or customise this image recipe |
| 87 | </button> |
| 88 | </div> |
| 89 | |
| 90 | <div id="packages-table"> |
| 91 | {% if packages.count %} |
| 92 | {% url 'recipepackages' project.id recipe.id as xhr_table_url %} |
| 93 | <h2>{{title}} (<span class="table-count-{{table_name}}">0</span>) </h2> |
| 94 | {% include "toastertable.html" %} |
| 95 | {% else %} |
| 96 | <h2>{{title}}</h2> |
| 97 | {% endif %} |
| 98 | |
| 99 | <div class="alert alert-info air" id="build-to-get-packages-msg" |
| 100 | {# if there are packages and it's in the project don't show this msg #} |
| 101 | {% if packages.count or not packages.count and not in_project %} |
| 102 | style="display:none" |
| 103 | {% endif %} > |
| 104 | <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] | 105 | <button class="btn btn-info btn-lg build-recipe-btn" style="margin:20px 0 10px 0;">Build {{recipe.name}}</button> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 106 | </div> |
| 107 | |
| 108 | <div class="alert alert-info air" id="packages-alert" |
| 109 | {% if packages.count or in_project %} |
| 110 | style="display:none" |
| 111 | {% endif %} |
| 112 | > |
| 113 | <p class="lead">Toaster has no package information for {{recipe.name}} |
| 114 | </p> |
| 115 | </div> |
| 116 | </div> |
| 117 | </div> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 118 | <div class="col-md-4"> |
| 119 | <div class="well"> |
| 120 | <h2>About {{recipe.name}}</h2> |
| 121 | <dl class="item-info"> |
| 122 | <dt> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 123 | Approx. packages included |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 124 | <span class="glyphicon glyphicon-question-sign get-help" 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> |
| 125 | </dt> |
| 126 | <dd class="no-packages">{{packages.count}}</dd> |
| 127 | <dt> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 128 | Approx. package size |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 129 | <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> |
| 130 | </dt> |
| 131 | <dd>{{approx_pkg_size.size__sum|filtered_filesizeformat}}</dd> |
| 132 | {% if last_build %} |
| 133 | <dt>Last build</dt> |
| 134 | <dd> |
| 135 | <span class="glyphicon glyphicon-ok-circle"></span> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 136 | <a href="{% url 'projectbuilds' project.id%}">{{last_build.completed_on|date:"d/m/y H:i"}}</a> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 137 | </dd> |
| 138 | {% endif %} |
| 139 | <dt>Recipe file</dt> |
| 140 | <dd> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 141 | <code>{{recipe.file_path|cut_path_prefix:recipe.layer_version.local_path}}</code> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 142 | <a href="{{recipe.get_vcs_recipe_file_link_url}}"><span class="glyphicon glyphicon-new-window" title="View recipe file" data-toggle="tooltip"></span></a> |
| 143 | </dd> |
| 144 | <dt>Layer</dt> |
| 145 | <dd><a href="{% url 'layerdetails' project.id recipe.layer_version.pk %}">{{recipe.layer_version.layer.name}}</a></dd> |
| 146 | <dt> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 147 | Summary |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 148 | </dt> |
| 149 | <dd> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 150 | {{recipe.summary}} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 151 | </dd> |
| 152 | <dt> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 153 | Description |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 154 | </dt> |
| 155 | <dd> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 156 | {{recipe.description}} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 157 | </dd> |
| 158 | <dt>Version</dt> |
| 159 | <dd> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 160 | {{recipe.version}} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 161 | </dd> |
| 162 | <dt>Section</dt> |
| 163 | <dd> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 164 | {{recipe.section}} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 165 | </dd> |
| 166 | <dt>License</dt> |
| 167 | <dd> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 168 | {{recipe.license}} |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 169 | </dd> |
| 170 | </dl> |
| 171 | </div> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 172 | </div> |
| 173 | </div> |
| 174 | |
| 175 | {% endblock %} |