add button plumbed through to router
diff --git a/planetstack/core/xoslib/static/js/xosAdminSite.js b/planetstack/core/xoslib/static/js/xosAdminSite.js
index 6fb46a0..99cf851 100644
--- a/planetstack/core/xoslib/static/js/xosAdminSite.js
+++ b/planetstack/core/xoslib/static/js/xosAdminSite.js
@@ -95,7 +95,7 @@
         name = OBJS[index];

         collection_name = name + "s";

         nav_url = collection_name;

-        api_command = "list" + collection_name.charAt(0).toUpperCase() + collection_name.slice(1);

+        api_command = "list" + firstCharUpper(collection_name);

         listViewName = collection_name + "ListView";

         detailViewName = collection_name + "DetailView";

 

@@ -103,10 +103,15 @@
         routes[nav_url] = api_command;

 

         nav_url = collection_name + "/:id";

-        api_command = "detail" + collection_name.charAt(0).toUpperCase() + collection_name.slice(1);

+        api_command = "detail" + firstCharUpper(collection_name);

 

         api[api_command] = XOSAdminApp.detailShower(detailViewName, collection_name, "detail", name);

         routes[nav_url] = api_command;

+

+        nav_url = "add" + firstCharUpper(name);

+        api_command = "add" + firstCharUpper(name);

+        api[api_command] = XOSAdminApp.addShower(detailViewName, collection_name, "detail", name);

+        routes[nav_url] = api_command;

     };

 

     XOSAdminApp.Router = new router({ appRoutes: routes, controller: api });

diff --git a/planetstack/core/xoslib/static/js/xoslib/xosHelper.js b/planetstack/core/xoslib/static/js/xoslib/xosHelper.js
index 4a408e1..11d97d6 100644
--- a/planetstack/core/xoslib/static/js/xoslib/xosHelper.js
+++ b/planetstack/core/xoslib/static/js/xoslib/xosHelper.js
@@ -8,6 +8,10 @@
     return _.template($(id).html());
 }
 
+function firstCharUpper(s) {
+    return s.charAt(0).toUpperCase() + s.slice(1);
+}
+
 HTMLView = Marionette.ItemView.extend({
   render: function() {
       this.$el.append(this.options.html);
@@ -119,6 +123,15 @@
         }

     },

 

+    addShower: function(detailName, collection_name, regionName, title) {

+        var app=this;

+        return function() {

+            detailViewClass = app[detailName];

+            detailView = new detailViewClass();

+            app[regionName].show(detailView);

+        }

+    },

+

     detailShower: function(detailName, collection_name, regionName, title) {

         var app=this;

         showModelId = function(model_id) {

@@ -322,6 +335,15 @@
 XOSListView = Marionette.CompositeView.extend({
              childViewContainer: 'tbody',

 

+             events: {"click button.btn-xos-add": "addClicked",

+                     },
+
+             addClicked: function(e) {
+                console.log("add");
+                e.preventDefault();
+                this.app.Router.navigate("add" + firstCharUpper(this.collection.modelName));
+             },
+

              initialize: function() {

                  this.listenTo(this.collection, 'change', this._renderChildren)