the big xoslib test, WIP
diff --git a/planetstack/core/xoslib/static/css/test.css b/planetstack/core/xoslib/static/css/test.css
new file mode 100644
index 0000000..3444fdb
--- /dev/null
+++ b/planetstack/core/xoslib/static/css/test.css
@@ -0,0 +1,4 @@
+.test-table td, th {
+ border: 1px solid black;
+}
+
diff --git a/planetstack/core/xoslib/static/js/test.js b/planetstack/core/xoslib/static/js/test.js
new file mode 100644
index 0000000..bc7f955
--- /dev/null
+++ b/planetstack/core/xoslib/static/js/test.js
@@ -0,0 +1,71 @@
+TestApp = new Marionette.Application();
+
+TestApp.addRegions({
+ deploymentList: "#deploymentList",
+ imageList: "#imageList",
+ networkTemplateList: "#networkTemplateList",
+ networkList: "#networkList",
+ nodeList: "#nodeList",
+ serviceList: "#serviceList",
+ siteList: "#siteList",
+ sliceList: "#sliceList",
+ sliverList: "#sliverList",
+ userList: "#userList"
+});
+
+// ---- Deployment ----
+
+TestApp.DeploymentListItemView = Marionette.ItemView.extend({
+ template: '#test-deployment-listitem-template',
+ tagName: 'tr',
+ className: 'test-tablerow',
+});
+
+TestApp.DeploymentListView = Marionette.CompositeView.extend({
+ childView: TestApp.DeploymentListItemView,
+ childViewContainer: 'tbody',
+ template: '#test-deployment-list-template',
+
+ initialize: function() {
+ this.listenTo(this.collection, 'change', this._renderChildren)
+ },
+});
+
+TestApp.on("start", function() {
+ var objs = ['deployment', 'image', 'networkTemplate', 'network', 'node', 'service', 'site', 'slice', 'sliver'];
+
+ for (var index in objs) {
+ name = objs[index];
+ tr_template = '#test-' + name + '-listitem-template';
+ table_template = '#test-' + name + '-list-template';
+ collection_name = name + "s";
+ region_name = name + "List";
+
+ itemViewClass = Marionette.ItemView.extend({
+ template: tr_template,
+ tagName: 'tr',
+ className: 'test-tablerow',
+ });
+
+ listViewClass = Marionette.CompositeView.extend({
+ childView: itemViewClass,
+ childViewContainer: 'tbody',
+ template: table_template,
+ collection: xos[collection_name],
+
+ initialize: function() {
+ this.listenTo(this.collection, 'change', this._renderChildren)
+ },
+ });
+
+ var listView = new listViewClass();
+
+ TestApp[region_name].show(listView);
+ xos[collection_name].startPolling();
+ }
+});
+
+$(document).ready(function(){
+ TestApp.start();
+});
+