summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/templates/base.html
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2015-10-05 16:39:36 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-16 14:59:59 +0100
commit2517987f8db37d50df03e690be2501447b7eeeb8 (patch)
treea4f5001de4f7e30d77a86ce2bf8135a3789407a6 /bitbake/lib/toaster/toastergui/templates/base.html
parent56d4c84cec911a9cf44848b0de6e04617fe7d82d (diff)
downloadpoky-2517987f8db37d50df03e690be2501447b7eeeb8.tar.gz
bitbake: toaster: Modify "New build" button behaviour for cli builds project
The "New build" button should only be displayed if there are user-generated projects, not if there is only the command-line builds project. (Toaster can't run builds on behalf of the command-line builds project.) The "New build" form should also display as if no project has been set (i.e. show the project and recipe text entries). Add a variable which tracks the number of non-command-line projects, then use this to hide the button when appropriate. Also track whether the current project is the default one, and use this to add extra conditions to when the "New build" text entries are shown. [YOCTO #8231] (Bitbake rev: 07e7bc29a7d976941eeae997f78a25ed6edddfc8) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates/base.html')
-rw-r--r--bitbake/lib/toaster/toastergui/templates/base.html95
1 files changed, 49 insertions, 46 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/base.html b/bitbake/lib/toaster/toastergui/templates/base.html
index 3f277909d7..c1d0693066 100644
--- a/bitbake/lib/toaster/toastergui/templates/base.html
+++ b/bitbake/lib/toaster/toastergui/templates/base.html
@@ -38,6 +38,7 @@
38 projectId : {{project.id}}, 38 projectId : {{project.id}},
39 projectPageUrl : {% url 'project' project.id as purl %}{{purl|json}}, 39 projectPageUrl : {% url 'project' project.id as purl %}{{purl|json}},
40 projectName : {{project.name|json}}, 40 projectName : {{project.name|json}},
41 projectIsDefault: {% if project.is_default %}true{% else %}false{% endif %},
41 recipesTypeAheadUrl: {% url 'xhr_recipestypeahead' project.id as paturl%}{{paturl|json}}, 42 recipesTypeAheadUrl: {% url 'xhr_recipestypeahead' project.id as paturl%}{{paturl|json}},
42 layersTypeAheadUrl: {% url 'xhr_layerstypeahead' project.id as paturl%}{{paturl|json}}, 43 layersTypeAheadUrl: {% url 'xhr_layerstypeahead' project.id as paturl%}{{paturl|json}},
43 machinesTypeAheadUrl: {% url 'xhr_machinestypeahead' project.id as paturl%}{{paturl|json}}, 44 machinesTypeAheadUrl: {% url 'xhr_machinestypeahead' project.id as paturl%}{{paturl|json}},
@@ -48,7 +49,7 @@
48 projectId : undefined, 49 projectId : undefined,
49 projectPageUrl : undefined, 50 projectPageUrl : undefined,
50 projectName : undefined, 51 projectName : undefined,
51 projectId : undefined, 52 projectIsDefault: false,
52 {% endif %} 53 {% endif %}
53 }; 54 };
54 </script> 55 </script>
@@ -122,52 +123,54 @@
122 <div class="btn-group pull-right"> 123 <div class="btn-group pull-right">
123 <a class="btn" id="new-project-button" href="{% url 'newproject' %}">New project</a> 124 <a class="btn" id="new-project-button" href="{% url 'newproject' %}">New project</a>
124 </div> 125 </div>
125 <!-- New build popover --> 126 <!-- New build popover; only shown if there is at least one user-created project -->
126 <div class="btn-group pull-right" id="new-build-button" style="display:none"> 127 {% if non_cli_projects.count > 0 %}
127 <button class="btn dropdown-toggle" data-toggle="dropdown"> 128 <div class="btn-group pull-right" id="new-build-button" style="display:none">
128 New build 129 <button class="btn dropdown-toggle" data-toggle="dropdown">
129 <i class="icon-caret-down"></i> 130 New build
130 </button> 131 <i class="icon-caret-down"></i>
131 <ul class="dropdown-menu new-build multi-select"> 132 </button>
132 <li> 133 <ul class="dropdown-menu new-build multi-select">
133 <h3>New build</h3> 134 <li>
134 <h6>Project:</h6> 135 <h3>New build</h3>
135 <span id="project"> 136 <h6>
136 {% if project.id %} 137 Project:
137 <a class="lead" href="{% project_url project %}">{{project.name}}</a> 138 <span id="project">
138 {% else %} 139 {% if project.id and not project.is_default %}
139 <a class="lead" href="#"></a> 140 <a class="lead" href="{% project_url project %}">{{project.name}}</a>
140 {% endif %} 141 {% else %}
141 <i class="icon-pencil"></i> 142 <a class="lead" href="#"></a>
142 </span> 143 {% endif %}
143 <form id="change-project-form" style="display:none;"> 144 <i class="icon-pencil"></i>
144 <div class="input-append"> 145 </span>
145 <input type="text" class="input-medium" id="project-name-input" placeholder="Type a project name" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead"/> 146 </h6>
146 <button id="save-project-button" class="btn" type="button">Save</button> 147 <form id="change-project-form" style="display:none;">
147 <a href="#" id="cancel-change-project" class="btn btn-link" style="display: none">Cancel</a> 148 <div class="input-append">
148 </div> 149 <input type="text" class="input-medium" id="project-name-input" placeholder="Type a project name" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead"/>
149 <p><a id="view-all-projects" href="{% url 'all-projects' %}">View all projects</a></p> 150 <button id="save-project-button" class="btn" type="button">Save</button>
150 </form> 151 <a href="#" id="cancel-change-project" class="btn btn-link" style="display: none">Cancel</a>
151 </li> 152 </div>
152 <li> 153 <p><a id="view-all-projects" href="{% url 'all-projects' %}">View all projects</a></p>
153 <div class="alert" style="display:none;"> 154 </form>
154 <p>This project configuration is incomplete, so you cannot run builds.</p> 155 </li>
155 <p><a href="{% if project.id %}{% url 'project' project.id %}{% endif %}">View project configuration</a></p> 156 <li>
156 </div> 157 <div class="alert" style="display:none;">
157 </li> 158 <p>This project configuration is incomplete, so you cannot run builds.</p>
158 <li id="targets-form"> 159 <p><a href="{% if project.id %}{% url 'project' project.id %}{% endif %}">View project configuration</a></p>
159 <h6>Recipe(s):</h6>
160 <form>
161 <input type="text" class="input-xlarge build-target-input" placeholder="Type a recipe name" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead" disabled/>
162 <div class="row-fluid">
163 <button class="btn btn-primary build-button" disabled>Build</button>
164 </div> 160 </div>
165 </form> 161 </li>
166 </li> 162 <li id="targets-form">
167 </ul> 163 <h6>Recipe(s):</h6>
168 </div> 164 <form>
169 165 <input type="text" class="input-xlarge build-target-input" placeholder="Type a recipe name" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead" disabled/>
170 166 <div class="row-fluid">
167 <button class="btn btn-primary build-button" disabled>Build</button>
168 </div>
169 </form>
170 </li>
171 </ul>
172 </div>
173 {% endif %}
171 </div> 174 </div>
172 </div> 175 </div>
173</div> 176</div>