caption for SliceSelector
diff --git a/planetstack/core/xoslib/static/js/xoslib/xosHelper.js b/planetstack/core/xoslib/static/js/xoslib/xosHelper.js
index e8c1b10..07ae9a9 100644
--- a/planetstack/core/xoslib/static/js/xoslib/xosHelper.js
+++ b/planetstack/core/xoslib/static/js/xoslib/xosHelper.js
@@ -20,6 +20,7 @@
template: "#xos-sliceselector-select",
childViewContainer: "select",
childView: SliceSelectorOption,
+ caption: "Slice",
events: {"change select": "onSliceChanged"},
@@ -34,6 +35,8 @@
sliceChanged: function(id) {
console.log("sliceChanged " + id);
},
+
+ templateHelpers: function() { return {caption: this.options.caption || this.caption }; },
});
FilteredCompositeView = Marionette.CompositeView.extend( {
diff --git a/planetstack/core/xoslib/templates/xosAdmin.html b/planetstack/core/xoslib/templates/xosAdmin.html
index c155848..574684b 100644
--- a/planetstack/core/xoslib/templates/xosAdmin.html
+++ b/planetstack/core/xoslib/templates/xosAdmin.html
@@ -285,8 +285,11 @@
</script>
<script type="text/template" id="xos-sliceselector-select">
- <select>
- </select>
+ <% if (caption) { %>
+ <table><tr><td><%= caption %>: </td><td><select></select></td></tr></table>
+ <% } else { %>
+ <select></select>
+ <% } %>
</script>
<script>