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