summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-11-04 15:44:00 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-10 13:29:17 +0000
commit5f52614a878269fe7837b7198e653377b25b91d8 (patch)
treecccfa1e509182a2a219f7cb8474200ecff22816f
parent2a3dd32d669f4d114fe9c978c9fc1269c2566b8a (diff)
downloadopenembedded-core-contrib-5f52614a878269fe7837b7198e653377b25b91d8.tar.gz
bitbake: toaster: newcustomimage Move modal dialog out of newcustomimage template
Move the modal template and JS out of the newcustomimage page so that it can also be used by the image details page. (Bitbake rev: c310bc6bab1a33124906dd57b3c63462a773ff25) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js (renamed from bitbake/lib/toaster/toastergui/static/js/newcustomimage.js)5
-rw-r--r--bitbake/lib/toaster/toastergui/templates/newcustomimage.html44
-rw-r--r--bitbake/lib/toaster/toastergui/templates/newcustomimage_modal.html33
3 files changed, 37 insertions, 45 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/newcustomimage.js b/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js
index 935b21ede8..71a28f7b2a 100644
--- a/bitbake/lib/toaster/toastergui/static/js/newcustomimage.js
+++ b/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js
@@ -1,6 +1,7 @@
"use strict";
-function newCustomImagePageInit(ctx){
+/* Used for the newcustomimage_modal actions */
+function newCustomImageModalInit(ctx){
var newCustomImgBtn = $("#create-new-custom-image-btn");
var imgCustomModal = $("#new-custom-image-modal");
@@ -44,6 +45,4 @@ function newCustomImagePageInit(ctx){
}
});
}
-
-
}
diff --git a/bitbake/lib/toaster/toastergui/templates/newcustomimage.html b/bitbake/lib/toaster/toastergui/templates/newcustomimage.html
index 4487b3ea08..46aed901f1 100644
--- a/bitbake/lib/toaster/toastergui/templates/newcustomimage.html
+++ b/bitbake/lib/toaster/toastergui/templates/newcustomimage.html
@@ -4,51 +4,11 @@
{% load static %}
{% block pagecontent %}
-<script src="{% static 'js/newcustomimage.js' %}"></script>
-<script>
- $(document).ready(function (){
- var ctx = {
- xhrCustomRecipeUrl : "{% url 'xhr_customrecipe' %}",
- };
-
- try {
- newCustomImagePageInit(ctx);
- } catch (e) {
- document.write("Sorry, An error has occurred loading this page");
- console.warn(e);
- }
- });
-</script>
-
-</script>
-<div class="modal hide fade in" id="new-custom-image-modal" aria-hidden="false">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h3>Name your custom image</h3>
- </div>
- <div class="modal-body">
- <div class="row-fluid">
- <span class="help-block span8">Image names must be unique. They should not contain spaces or capital letters, and the only allowed special character is dash (-).<p></p>
- </span></div>
- <div class="control-group controls">
- <input type="text" class="huge span5" placeholder="Type the name, something like 'core-image-myimage'">
- <span class="help-block" style="display:none">Image names cannot contain spaces or capital letters. The only allowed special character is dash (-)</span>
- <span class="help-block" style="display: none">An image with this name already exists. Image names must be unique: try a different one.</span>
- </div>
- </div>
- <div class="modal-footer">
- <a href="#" id="create-new-custom-image-btn" class="btn btn-primary btn-large" data-original-title="" title="">Create custom image</a>
- </div>
-</div>
-
+{% include "newcustomimage_modal.html" %}
{% include "projecttopbar.html" %}
-
{% url table_name project.id as xhr_table_url %}
+<h2>{{title}} (<span class="table-count-{{table_name}}">0</span>)</h2>
{% include "toastertable.html" %}
-
-
{% endblock %}
-
-
diff --git a/bitbake/lib/toaster/toastergui/templates/newcustomimage_modal.html b/bitbake/lib/toaster/toastergui/templates/newcustomimage_modal.html
new file mode 100644
index 0000000000..93cf9d7e02
--- /dev/null
+++ b/bitbake/lib/toaster/toastergui/templates/newcustomimage_modal.html
@@ -0,0 +1,33 @@
+{% load static %}
+
+<script src="{% static 'js/newcustomimage_modal.js' %}"></script>
+<script>
+ $(document).ready(function (){
+ try {
+ newCustomImageModalInit();
+ } catch (e) {
+ document.write("Sorry, An error has occurred loading this page");
+ console.warn(e);
+ }
+ });
+</script>
+
+<div class="modal hide fade in" id="new-custom-image-modal" aria-hidden="false">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+ <h3>Name your custom image</h3>
+ </div>
+ <div class="modal-body">
+ <div class="row-fluid">
+ <span class="help-block span8">Image names must be unique. They should not contain spaces or capital letters, and the only allowed special character is dash (-).<p></p>
+ </span></div>
+ <div class="control-group controls">
+ <input type="text" class="huge span5" placeholder="Type the name, something like 'core-image-myimage'">
+ <span class="help-block" style="display:none">Image names cannot contain spaces or capital letters. The only allowed special character is dash (-)</span>
+ <span class="help-block" style="display: none">An image with this name already exists. Image names must be unique: try a different one.</span>
+ </div>
+ </div>
+ <div class="modal-footer">
+ <a href="#" id="create-new-custom-image-btn" class="btn btn-primary btn-large" data-original-title="" title="">Create custom image</a>
+ </div>
+</div>