1{% extends "base.html" %}
2{% load projecttags %}
3{% load humanize %}
4{% load static %}
5{% block pagecontent %}
6
7<ul class="breadcrumb">
8  <li>
9    <a href="{% url 'project' project.id %}">{{project.name}}</a>
10    <span class="divider">&rarr;</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">&rarr;</span>
19  </li>
20  <li class="active">
21    {{recipe.name}} ({{recipe.layer_version.layer.name}})
22  </li>
23</ul>
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
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>
61</div>
62
63<div class="row">
64  <div class="col-md-8">
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 %}">
70      <button class="btn btn-default btn-lg build-recipe-btn" style="width: 50%">
71        Build {{recipe.name}}
72      </button>
73      {% if recipe.is_image %}
74      <button class="btn btn-default btn-lg customise-btn" data-recipe="{{recipe.pk}}" style="width: 50%">
75        Customise {{recipe.name}}
76      </button>
77      {% endif %}
78    </div>
79    <div class="button-place">
80      <button class="btn btn-default btn-block btn-lg" id="add-layer-btn"
81          style="width:100%;
82          {% if in_project %}
83          display:none;
84          {% endif %}">
85        <i class="glyphicon glyphicon-plus"></i>
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>
105        <button class="btn btn-info btn-lg build-recipe-btn" style="margin:20px 0 10px 0;">Build {{recipe.name}}</button>
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>
118  <div class="col-md-4">
119    <div class="well">
120      <h2>About {{recipe.name}}</h2>
121      <dl class="item-info">
122        <dt>
123        Approx. packages included
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>
128        Approx. package size
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>
136        <a href="{% url 'projectbuilds' project.id%}">{{last_build.completed_on|date:"d/m/y H:i"}}</a>
137        </dd>
138        {% endif %}
139        <dt>Recipe file</dt>
140        <dd>
141        <code>{{recipe.file_path|cut_path_prefix:recipe.layer_version.local_path}}</code>
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>
147        Summary
148        </dt>
149        <dd>
150        {{recipe.summary}}
151        </dd>
152        <dt>
153        Description
154        </dt>
155        <dd>
156        {{recipe.description}}
157        </dd>
158        <dt>Version</dt>
159        <dd>
160        {{recipe.version}}
161        </dd>
162        <dt>Section</dt>
163        <dd>
164        {{recipe.section}}
165        </dd>
166        <dt>License</dt>
167        <dd>
168        {{recipe.license}}
169        </dd>
170      </dl>
171    </div>
172  </div>
173</div>
174
175{% endblock %}
176