- sliceSelector = new XOSTenantApp.tenantSliceSelectorView({collection: xos.slicesPlus,\r
- selectedID: model.id,\r
- } );\r
- XOSTenantApp.sliceSelector = sliceSelector;\r
- XOSTenantApp.tenantSliceSelector.show(sliceSelector);\r
-\r
- tenantSummary = new XOSTenantApp.tenantSummaryView({model: model,\r
- choices: {mount_data_sets: make_choices(xos.tenant().public_volume_names, null),\r
- serviceClass: make_choices(xos.tenant().blessed_service_class_names, xos.tenant().blessed_service_classes),\r
- default_image: make_choices(xos.tenant().blessed_image_names, xos.tenant().blessed_images),\r
- default_flavor: make_choices(xos.tenant().blessed_flavor_names, xos.tenant().blessed_flavors),},\r
- });\r
- XOSTenantApp.tenantSummary.show(tenantSummary);\r
-\r
- tenantSites = new XOSTenantSiteCollection();\r
- tenantSites.getFromSlice(model);\r
- model.tenantSiteCollection = tenantSites;\r
- XOSTenantApp.tenantSites = tenantSites;\r
-\r
- tenantSiteList = new XOSTenantApp.tenantSiteListView({collection: tenantSites });\r
- XOSTenantApp.tenantSiteList.show(tenantSiteList);\r
- // on xos.slicePlus.sort, need to update xostenantapp.tenantSites\r
-\r
- XOSTenantApp.tenantButtons.show( new XOSTenantButtonView( { app: XOSTenantApp,\r
- linkedView: tenantSummary } ) );\r
+ if (model) {\r
+ sliceSelector = new XOSTenantApp.tenantSliceSelectorView({collection: xos.slicesPlus,\r
+ selectedID: model ? model.id : null,\r
+ } );\r
+ XOSTenantApp.sliceSelector = sliceSelector;\r
+ XOSTenantApp.tenantSliceSelector.show(sliceSelector);\r
+\r
+ tenantSummary = new XOSTenantApp.tenantSummaryView({model: model,\r
+ choices: {mount_data_sets: make_choices(xos.tenant().public_volume_names, null),\r
+ serviceClass: make_choices(xos.tenant().blessed_service_class_names, xos.tenant().blessed_service_classes),\r
+ default_image: make_choices(xos.tenant().blessed_image_names, xos.tenant().blessed_images),\r
+ default_flavor: make_choices(xos.tenant().blessed_flavor_names, xos.tenant().blessed_flavors),},\r
+ });\r
+ XOSTenantApp.tenantSummary.show(tenantSummary);\r
+\r
+ tenantSites = new XOSTenantSiteCollection();\r
+ tenantSites.getFromSlice(model);\r
+ model.usersBuffer = model.attributes.users; /* save a copy of 'users' that we can edit. This prevents another view (developer) from overwriting our copy with a fetch from the server */\r
+ model.usersOrig = model.attributes.users; /* save an immutable copy that we'll use for username lookups */\r
+ model.user_namesOrig = model.attributes.user_names;\r
+ model.tenantSiteCollection = tenantSites;\r
+ XOSTenantApp.tenantSites = tenantSites;\r
+\r
+ tenantSiteList = new XOSTenantApp.tenantSiteListView({collection: tenantSites });\r
+ XOSTenantApp.tenantSiteList.show(tenantSiteList);\r
+ // on xos.slicePlus.sort, need to update xostenantapp.tenantSites\r
+\r
+ XOSTenantApp.tenantButtons.show( new XOSTenantButtonView( { app: XOSTenantApp,\r
+ linkedView: tenantSummary } ) );\r
+\r
+ XOSTenantApp.currentSlice = model;\r
+ } else {\r
+ XOSTenantApp.tenantSliceSelector.show(new HTMLView({html: ""}));\r
+ XOSTenantApp.tenantSummary.show(new HTMLView({html: "You have no slices"}));\r
+ XOSTenantApp.tenantSiteList.show(new HTMLView({html: ""}));\r
+ XOSTenantApp.tenantButtons.show( new XOSTenantButtonView( { template: "#xos-tenant-buttons-noslice-template",\r
+ app: XOSTenantApp,\r
+ linkedView: tenantSummary } ) );\r
+ }\r