diff options
3 files changed, 25 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/filtersnippet.html b/bitbake/lib/toaster/toastergui/templates/filtersnippet.html index 90ffd3de6c..fe70e7143e 100644 --- a/bitbake/lib/toaster/toastergui/templates/filtersnippet.html +++ b/bitbake/lib/toaster/toastergui/templates/filtersnippet.html | |||
@@ -18,10 +18,10 @@ | |||
18 | {% for option in f.options %} | 18 | {% for option in f.options %} |
19 | {% if option.2 %} | 19 | {% if option.2 %} |
20 | <label class="radio"> | 20 | <label class="radio"> |
21 | <input type="radio" name="filter" {%if request.GET.filter == option.1 %}checked{%endif%} value="{{option.1}}"> {{option.0}} ({{option.2}}) | 21 | <input type="radio" name="filter" {%if request.GET.filter == option.1 %}checked{%endif%} value="{{option.1}}"> {{option.0}} (<span id="{{option.1}}_count">{{option.2}}</span>) |
22 | {% else %} | 22 | {% else %} |
23 | <label class="radio muted"> | 23 | <label class="radio muted"> |
24 | <input type="radio" name="filter" disabled {%if request.GET.filter == option.1 %}checked{%endif%} value="{{option.1}}"> {{option.0}} ({{option.2}}) | 24 | <input type="radio" name="filter" disabled {%if request.GET.filter == option.1 %}checked{%endif%} value="{{option.1}}"> {{option.0}} (<span id="{{option.1}}_count">{{option.2}}</span>) |
25 | {% endif %} | 25 | {% endif %} |
26 | {% if option.3 %}<i class="icon-question-sign get-help" data-placement="right" title="{{option.3}}"></i>{% endif %} | 26 | {% if option.3 %}<i class="icon-question-sign get-help" data-placement="right" title="{{option.3}}"></i>{% endif %} |
27 | </label> | 27 | </label> |
diff --git a/bitbake/lib/toaster/toastergui/templates/layers.html b/bitbake/lib/toaster/toastergui/templates/layers.html index db34fe4818..8cb079d0a3 100644 --- a/bitbake/lib/toaster/toastergui/templates/layers.html +++ b/bitbake/lib/toaster/toastergui/templates/layers.html | |||
@@ -120,10 +120,21 @@ function _makeXHREditCall(data, onsuccess, onfail) { | |||
120 | }); | 120 | }); |
121 | } | 121 | } |
122 | 122 | ||
123 | function updateLayerCountLabels (amount) { | ||
124 | /* Update the filter labels */ | ||
125 | var countLabel = $("#projectlayer__project\\:{{project.id}}_count"); | ||
126 | countLabel.text(Number(countLabel.text())+amount); | ||
127 | |||
128 | var countLabelRemaining = $("#projectlayer__project\\:NOT{{project.id}}_count"); | ||
129 | countLabelRemaining.text(Number(countLabelRemaining.text())-amount); | ||
130 | } | ||
131 | |||
123 | 132 | ||
124 | function layerDel(layerId, layerName, layerURL) { | 133 | function layerDel(layerId, layerName, layerURL) { |
125 | tooltipUpdateText = "1 layer deleted"; | 134 | tooltipUpdateText = "1 layer deleted"; |
126 | _makeXHREditCall({ 'layerDel': layerId }, function () { | 135 | _makeXHREditCall({ 'layerDel': layerId }, function () { |
136 | updateLayerCountLabels(-1); | ||
137 | |||
127 | show_alert("You have deleted <strong>1</strong> layer from <a href=\"{% url 'project' project.id%}\">{{project.name}}</a>: <a href=\""+layerURL+"\">" + layerName +"</a>"); | 138 | show_alert("You have deleted <strong>1</strong> layer from <a href=\"{% url 'project' project.id%}\">{{project.name}}</a>: <a href=\""+layerURL+"\">" + layerName +"</a>"); |
128 | }); | 139 | }); |
129 | } | 140 | } |
@@ -187,6 +198,8 @@ function layerAdd(layerId, layerName, layerURL) { | |||
187 | if (_data.error != "ok") { | 198 | if (_data.error != "ok") { |
188 | alert(_data.error); | 199 | alert(_data.error); |
189 | } else { | 200 | } else { |
201 | updateLayerCountLabels(_data.list.length+1); | ||
202 | |||
190 | if (_data.list.length > 0) { | 203 | if (_data.list.length > 0) { |
191 | show_dependencies_modal(layerId, layerName, layerURL, _data.list); | 204 | show_dependencies_modal(layerId, layerName, layerURL, _data.list); |
192 | } | 205 | } |
diff --git a/bitbake/lib/toaster/toastergui/templates/targets.html b/bitbake/lib/toaster/toastergui/templates/targets.html index 32a644a743..8776a5d548 100644 --- a/bitbake/lib/toaster/toastergui/templates/targets.html +++ b/bitbake/lib/toaster/toastergui/templates/targets.html | |||
@@ -182,6 +182,14 @@ function show_dependencies_modal(layerId, layerName, layerURL, dependencies) { | |||
182 | $('#dependencies_modal').modal('show'); | 182 | $('#dependencies_modal').modal('show'); |
183 | } | 183 | } |
184 | 184 | ||
185 | function updateLayerCountLabels (amount) { | ||
186 | /* Update the filter labels */ | ||
187 | var countLabel = $("#layer_version__projectlayer__project\\:{{project.id}}_count"); | ||
188 | countLabel.text(Number(countLabel.text())+amount); | ||
189 | |||
190 | var countLabelRemaining = $("#layer_version__projectlayer__project\\:NOT{{project.id}}_count"); | ||
191 | countLabelRemaining.text(Number(countLabelRemaining.text())-amount); | ||
192 | } | ||
185 | 193 | ||
186 | var pressedButton = undefined; | 194 | var pressedButton = undefined; |
187 | 195 | ||
@@ -194,6 +202,8 @@ function layerAdd(layerId, layerName, layerURL, pressedButtonId) { | |||
194 | if (_data.error != "ok") { | 202 | if (_data.error != "ok") { |
195 | alert(_data.error); | 203 | alert(_data.error); |
196 | } else { | 204 | } else { |
205 | updateLayerCountLabels(_data.list.length+1); | ||
206 | |||
197 | if (_data.list.length > 0) { | 207 | if (_data.list.length > 0) { |
198 | show_dependencies_modal(layerId, layerName, layerURL, _data.list); | 208 | show_dependencies_modal(layerId, layerName, layerURL, _data.list); |
199 | } | 209 | } |