From dc1f1965aff60ae4656ade718344c18cf97cb3f8 Mon Sep 17 00:00:00 2001 From: Michael Jett Date: Thu, 23 Aug 2012 18:07:22 -0400 Subject: [PATCH] Refactoring breadcrumbs. The breadcrumb bar will disappear momentarily. --- .../main/webapp/WEB-INF/tags/breadcrumbs.tag | 5 +--- .../src/main/webapp/resources/js/app.js | 23 +++++++++++++++++++ .../webapp/resources/template/client.html | 22 +++++++++++++----- 3 files changed, 40 insertions(+), 10 deletions(-) diff --git a/openid-connect-server/src/main/webapp/WEB-INF/tags/breadcrumbs.tag b/openid-connect-server/src/main/webapp/WEB-INF/tags/breadcrumbs.tag index 34d9222d7..833cca39f 100644 --- a/openid-connect-server/src/main/webapp/WEB-INF/tags/breadcrumbs.tag +++ b/openid-connect-server/src/main/webapp/WEB-INF/tags/breadcrumbs.tag @@ -1,5 +1,2 @@ <%@attribute name="crumb" required="false" %> - \ No newline at end of file + \ No newline at end of file diff --git a/openid-connect-server/src/main/webapp/resources/js/app.js b/openid-connect-server/src/main/webapp/resources/js/app.js index f9305a4c1..4ae09db1d 100644 --- a/openid-connect-server/src/main/webapp/resources/js/app.js +++ b/openid-connect-server/src/main/webapp/resources/js/app.js @@ -90,6 +90,27 @@ url:"api/clients" }); + var BreadCrumbView = Backbone.View.extend({ + + tagName: 'ul', + + initialize:function () { + + if (!this.template) { + this.template = _.template($('#tmpl-breadcrumbs').html()); + } + + this.$el.addClass('breadcrumb'); + + this.model.bind('change', this.render, this); + }, + + render:function (eventName) { + this.$el.html(this.template(this.model.toJSON())); + $('#breadcrumbs').html(this.el); + } + }); + var ClientView = Backbone.View.extend({ @@ -374,6 +395,8 @@ this.whiteListView = new URLListView(); this.blackListView = new URLListView(); + //this.clientBreadCrumbView = new BreadCrumbView(); + this.startAfter([this.clientList]); }, diff --git a/openid-connect-server/src/main/webapp/resources/template/client.html b/openid-connect-server/src/main/webapp/resources/template/client.html index a50a779ca..3b67f5f08 100644 --- a/openid-connect-server/src/main/webapp/resources/template/client.html +++ b/openid-connect-server/src/main/webapp/resources/template/client.html @@ -42,9 +42,15 @@

<%=(clientId == null ? 'New' : 'Edit')%> Client

+
Details + +
+ +
+
@@ -200,14 +206,18 @@
+
+ +
+
+ - - -
- -
- + \ No newline at end of file