diff --git a/js/apps/system/aardvark/frontend/js/models/foxx.js b/js/apps/system/aardvark/frontend/js/models/foxx.js index 9279212363..e325c0f65b 100644 --- a/js/apps/system/aardvark/frontend/js/models/foxx.js +++ b/js/apps/system/aardvark/frontend/js/models/foxx.js @@ -3,6 +3,8 @@ "use strict"; window.Foxx = Backbone.Model.extend({ + idAttribute: '_key', + defaults: { "title": "", "version": "", @@ -23,6 +25,5 @@ isNew: function() { return false; } - }); }()); diff --git a/js/apps/system/aardvark/frontend/js/routers/router.js b/js/apps/system/aardvark/frontend/js/routers/router.js index 92fe915bd9..86cfa0e668 100644 --- a/js/apps/system/aardvark/frontend/js/routers/router.js +++ b/js/apps/system/aardvark/frontend/js/routers/router.js @@ -19,6 +19,7 @@ "api": "api", "databases": "databases", "applications": "applications", + "applications/:key": "applicationDetail", "application/documentation/:key": "appDocumentation", "graph": "graphManagement", "userManagement": "userManagement", @@ -107,6 +108,16 @@ return true; }, + applicationDetail: function (key) { + if (this.foxxList.length === 0) { + this.foxxList.fetch({ async: false }); + } + var applicationDetailView = new window.ApplicationDetailView({ + model: this.foxxList.get(key) + }); + applicationDetailView.render(); + }, + login: function () { if (!this.loginView) { this.loginView = new window.loginView({ diff --git a/js/apps/system/aardvark/frontend/js/templates/applicationDetailView.ejs b/js/apps/system/aardvark/frontend/js/templates/applicationDetailView.ejs new file mode 100644 index 0000000000..3e747837ec --- /dev/null +++ b/js/apps/system/aardvark/frontend/js/templates/applicationDetailView.ejs @@ -0,0 +1,3 @@ + diff --git a/js/apps/system/aardvark/frontend/js/views/applicationDetailView.js b/js/apps/system/aardvark/frontend/js/views/applicationDetailView.js new file mode 100644 index 0000000000..9c60ce411a --- /dev/null +++ b/js/apps/system/aardvark/frontend/js/views/applicationDetailView.js @@ -0,0 +1,18 @@ +/*jshint browser: true */ +/*jshint strict: false, unused: false */ +/*global Backbone, $, window, arangoHelper, templateEngine, Joi, _*/ + +window.ApplicationDetailView = Backbone.View.extend({ + el: '#content', + + template: templateEngine.createTemplate('applicationDetailView.ejs'), + + events: { + }, + + render: function() { + console.log(this.model); + $(this.el).html(this.template.render(this.model)); + return $(this.el); + } +}); diff --git a/js/apps/system/aardvark/frontend/js/views/foxxActiveView.js b/js/apps/system/aardvark/frontend/js/views/foxxActiveView.js index a3c156d0cb..231f63234e 100644 --- a/js/apps/system/aardvark/frontend/js/views/foxxActiveView.js +++ b/js/apps/system/aardvark/frontend/js/views/foxxActiveView.js @@ -15,11 +15,7 @@ }, openAppDetailView: function() { - // var url = window.location.origin + "/_db/" + - // encodeURIComponent(arangoHelper.currentDatabase()) + - // this.model.get("mount"); - // var windowRef = window.open(url, this.model.get("title")); - alert('Michael will insert something here for ' + this.model.get('mount') + '. Stay tuned.'); + window.App.navigate('applications/' + encodeURIComponent(this.model.get('_key')), { trigger: true }); }, render: function(){ diff --git a/js/apps/system/aardvark/manifest.json b/js/apps/system/aardvark/manifest.json index e67a2ebb27..91b7fa3790 100644 --- a/js/apps/system/aardvark/manifest.json +++ b/js/apps/system/aardvark/manifest.json @@ -26,6 +26,7 @@ "frontend/js/templates/apiView.ejs", "frontend/js/templates/appDocumentationView.ejs", "frontend/js/templates/applicationsView.ejs", + "frontend/js/templates/applicationDetailView.ejs", "frontend/js/templates/arangoTabbar.ejs", "frontend/js/templates/arangoTable.ejs", "frontend/js/templates/collectionsItemView.ejs", @@ -143,6 +144,7 @@ "frontend/js/views/apiView.js", "frontend/js/views/appDocumentationView.js", "frontend/js/views/applicationsView.js", + "frontend/js/views/applicationDetailView.js", "frontend/js/views/collectionsItemView.js", "frontend/js/views/collectionsView.js", "frontend/js/views/databaseView.js",