git://git.onelab.eu
/
plstackapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update slice prefix in slice name field when site is changed slice create page
[plstackapi.git]
/
planetstack
/
templates
/
admin
/
core
/
slice
/
change_form.html
diff --git
a/planetstack/templates/admin/core/slice/change_form.html
b/planetstack/templates/admin/core/slice/change_form.html
index
c94b580
..
e97364b
100644
(file)
--- a/
planetstack/templates/admin/core/slice/change_form.html
+++ b/
planetstack/templates/admin/core/slice/change_form.html
@@
-8,6
+8,13
@@
deployment_nodes = [
{% endfor %}
];
{% endfor %}
];
+sites = [
+{% for s in sites %}
+ [{{ s.0 }}, {{ s.1 }}],
+{% endfor %}
+];
+
+
function update_nodes(deployment_select, node_select_id) {
deployment_id = $(deployment_select).val();
html = "<option value=''>---------</option>\n";
function update_nodes(deployment_select, node_select_id) {
deployment_id = $(deployment_select).val();
html = "<option value=''>---------</option>\n";
@@
-20,6
+27,15
@@
function update_nodes(deployment_select, node_select_id) {
//console.log(html);
$("#"+node_select_id).empty().append(html);
}
//console.log(html);
$("#"+node_select_id).empty().append(html);
}
+
+function update_slice_prefix(site_select, slice_name_id) {
+ site_id = $(site_select).val();
+ slice_prefix="";
+ if (site_id in sites) {
+ slice_prefix=sites[site_id]+"_";
+ }
+ $("#"+slice_name_id).val(slice_prefix);
+}
</script>
{% endblock %}
</script>
{% endblock %}