From: Scott Baker Date: Wed, 12 Nov 2014 02:02:35 +0000 (-0800) Subject: add button now mostly working for deployments X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=853be0d1647c484641cda19b00b34ed4d626f8dc;p=plstackapi.git add button now mostly working for deployments --- diff --git a/planetstack/core/xoslib/static/js/xoslib/xosHelper.js b/planetstack/core/xoslib/static/js/xoslib/xosHelper.js index 11d97d6..0fc9496 100644 --- a/planetstack/core/xoslib/static/js/xoslib/xosHelper.js +++ b/planetstack/core/xoslib/static/js/xoslib/xosHelper.js @@ -126,9 +126,12 @@ XOSApplication = Marionette.Application.extend({ addShower: function(detailName, collection_name, regionName, title) { var app=this; return function() { + model = new xos[collection_name].model(); detailViewClass = app[detailName]; - detailView = new detailViewClass(); + detailView = new detailViewClass({model: model}); app[regionName].show(detailView); + $("#xos-detail-button-box").show(); + $("#xos-listview-button-box").hide(); } }, @@ -341,7 +344,7 @@ XOSListView = Marionette.CompositeView.extend({ addClicked: function(e) { console.log("add"); e.preventDefault(); - this.app.Router.navigate("add" + firstCharUpper(this.collection.modelName)); + this.app.Router.navigate("add" + firstCharUpper(this.collection.modelName), {trigger: true}); }, initialize: function() { diff --git a/planetstack/core/xoslib/tools/make_defaults.py b/planetstack/core/xoslib/tools/make_defaults.py index 5a6a48f..ad5377c 100644 --- a/planetstack/core/xoslib/tools/make_defaults.py +++ b/planetstack/core/xoslib/tools/make_defaults.py @@ -12,7 +12,7 @@ import inspect from django.core import serializers import json -print "function xosdefault() {" +print "function xos_get_defaults() {" for c in dir(core.models): c = getattr(core.models,c) @@ -37,4 +37,5 @@ for c in dir(core.models): print " this." + classname + " = " + fields_json + ";" print "};" +print "xosdefaults = new xos_get_defaults();"