OBJS = ['deployment', 'image', 'networkTemplate', 'network', 'networkSliver', 'networkDeployment', 'node', 'service', 'site', 'slice', 'sliceDeployment', 'slicePrivilege', 'sliver', 'user', 'sliceRole', 'userDeployment'];
NAV_OBJS = ['deployment', 'site', 'slice', 'user'];

XOSAdminApp = new XOSApplication({logTableId: "#logTable", hideTabsByDefault: true});

XOSAdminApp.addRegions({
    navigation: "#navigationPanel",

    detail: "#detail",
    linkedObjs1: "#linkedObjs1",
    linkedObjs2: "#linkedObjs2",
    linkedObjs3: "#linkedObjs3",
    linkedObjs4: "#linkedObjs4"
});

XOSAdminApp.navigateToModel = function(app, detailClass, detailNavLink, model) {
     XOSAdminApp.Router.navigate(detailNavLink + "/" + model.id, {trigger: true});
};

ICON_CLASSES = {home: "icon-home", deployments: "icon-deployment", sites: "icon-site", slices: "icon-slice", users: "icon-user"};

XOSAdminApp.updateNavigationPanel = function() {
    buttonTemplate=$("#xos-navbutton").html();
    assert(buttonTemplate != undefined, "buttonTemplate is undefined");
    html="<div class='left-nav'><ul>";
    for (var index in NAV_OBJS) {
        name = NAV_OBJS[index];
        collection_name = name+"s";
        nav_url = "#" + collection_name;
        id = "nav-"+name;
        icon_class = ICON_CLASSES[collection_name] || "icon-cog";

        html = html + _.template(buttonTemplate, {name: collection_name, router: "XOSAdminApp.Router", routeUrl: nav_url, iconClass: icon_class});
    }

    html = html + "</ul>";

    $("#navigationPanel").html(html);
};

XOSAdminApp.buildViews = function() {
     for (var index in OBJS) {
         name = OBJS[index];
         tr_template = '#xosAdmin-' + name + '-listitem-template';
         table_template = '#xosAdmin-' + name + '-list-template';
         detail_template = '#xosAdmin-' + name + '-detail-template';
         collection_name = name + "s";
         region_name = name + "List";
         detailNavLink = collection_name;

         detailClass = XOSDetailView.extend({
            template: detail_template,
            app: XOSAdminApp,
         });
         XOSAdminApp[collection_name + "DetailView"] = detailClass;

         itemViewClass = XOSItemView.extend({
             detailClass: detailClass,
             template: tr_template,
             app: XOSAdminApp,
             detailNavLink: detailNavLink,
         });

         listViewClass = XOSListView.extend({
             childView: itemViewClass,
             template: table_template,
             collection: xos[collection_name],
             title: name + "s",
             app: XOSAdminApp,
         });

         XOSAdminApp[collection_name + "ListView"] = listViewClass;

         xos[collection_name].fetch(); //startPolling();
     }
};

XOSAdminApp.initRouter = function() {
    router = Marionette.AppRouter.extend({
    });

    var api = {};
    var routes = {};

    for (var index in OBJS) {
        name = OBJS[index];
        collection_name = name + "s";
        nav_url = collection_name;
        api_command = "list" + collection_name.charAt(0).toUpperCase() + collection_name.slice(1);
        listViewName = collection_name + "ListView";
        detailViewName = collection_name + "DetailView";

        api[api_command] = XOSAdminApp.listViewShower(listViewName, collection_name, "detail", collection_name);
        routes[nav_url] = api_command;

        nav_url = collection_name + "/:id";
        api_command = "detail" + collection_name.charAt(0).toUpperCase() + collection_name.slice(1);

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

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

XOSAdminApp.on("start", function() {
     XOSAdminApp.buildViews();

     XOSAdminApp.initRouter();

     XOSAdminApp.updateNavigationPanel();

     if (Backbone.history) {
         console.log("history start");
         Backbone.history.start();
     }
});

$(document).ready(function(){
    XOSAdminApp.start();
});


@@ -268,16 +268,207 @@
 ser'%5D;%0A%0A
+REWRITES = %7B%22/admin/core/deployment/%22: %22#deployments%22,%0A            %22/admin/core/site/%22 : %22#sites%22,%0A            %22/admin/core/slice/%22 : %22#slices%22,%0A            %22/admin/core/user/%22 : %22#users%22%7D;%0A%0A
 XOSAdmin
@@ -493,16 +493,21 @@
 cation(%7B
+%0A    
 logTable
@@ -522,16 +522,51 @@
 gTable%22,
+%0A    statusMsgId: %22#statusMsg%22,%0A   
  hideTab
@@ -577,24 +577,25 @@
 efault: true
+%0A
 %7D);%0A%0AXOSAdmi
@@ -4040,16 +4040,500 @@
 i %7D);%0D%0A%7D
+;%0D%0A%0D%0A/* rewriteLinks%0D%0A%0D%0A   Rewrite the links in the suit navbar from django-links to marionette%0D%0A   links. This let's us intercept the navbar and make it function within%0D%0A   this view rather than jumping back out to a django view.%0D%0A*/%0D%0A%0D%0AXOSAdminApp.rewriteLinks = function () %7B%0D%0A    $(%22a%22).each(function() %7B%0D%0A        href=$(this).attr(%22href%22);%0D%0A        rewrite_href=REWRITES%5Bhref%5D;%0D%0A        if (rewrite_href) %7B%0D%0A            $(this).attr(%22href%22, rewrite_href);%0D%0A        %7D%0D%0A    %7D);%0D%0A%7D;
 %0D%0A%0D%0AXOSA
@@ -4669,24 +4669,58 @@
 onPanel();%0A%0A
+     XOSAdminApp.rewriteLinks();%0A%0A
      if (Bac

add suit navbar link rewriting