diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/client.js b/openid-connect-server-webapp/src/main/webapp/resources/js/client.js index 04d819a46..5f488ffea 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/client.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/client.js @@ -130,6 +130,10 @@ var ClientView = Backbone.View.extend({ this.scopeTemplate = _.template($('#tmpl-scope-list').html()); } + if (!this.moreInfoTemplate) { + this.moreInfoTemplate = _.template($('#tmpl-client-more-info-block').html()); + } + this.model.bind('change', this.render, this); }, @@ -140,6 +144,8 @@ var ClientView = Backbone.View.extend({ $('.scope-list', this.el).html(this.scopeTemplate({scopes: this.model.get('scope'), systemScopes: this.options.systemScopeList})); + $('.client-more-info-block', this.el).html(this.moreInfoTemplate({client: this.model.toJSON()})); + this.$('.dynamically-registered').tooltip({title: 'This client was dynamically registered'}); return this; @@ -581,6 +587,8 @@ var ClientFormView = Backbone.View.extend({ $('#modalAlert .modal-body').html(_self.clientSavedTemplate(_self.model.toJSON())); + $('#modalAlert .modal-body #savedClientSecret').hide(); + $('#modalAlert').on('click', '#clientSaveShow', function(event) { event.preventDefault(); $('#clientSaveShow').hide(); diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/grant.js b/openid-connect-server-webapp/src/main/webapp/resources/js/grant.js index 03ceba782..2187b83ea 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/grant.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/grant.js @@ -114,6 +114,10 @@ var ApprovedSiteView = Backbone.View.extend({ this.scopeTemplate = _.template($('#tmpl-scope-list').html()); } + if (!this.moreInfoTemplate) { + this.moreInfoTemplate = _.template($('#tmpl-client-more-info-block').html()); + } + }, render: function() { @@ -160,6 +164,8 @@ var ApprovedSiteView = Backbone.View.extend({ $('.scope-list', this.el).html(this.scopeTemplate({scopes: this.model.get('allowedScopes'), systemScopes: this.options.systemScopeList})); + $('.client-more-info-block', this.el).html(this.moreInfoTemplate({client: this.options.client.toJSON()})); + this.$('.dynamically-registered').tooltip({title: 'This client was dynamically registered'}); this.$('.whitelisted-site').tooltip({title: 'This site was whitelisted by an adminstrator'}); diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/token.js b/openid-connect-server-webapp/src/main/webapp/resources/js/token.js index c381dfdd9..532e74853 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/token.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/token.js @@ -55,13 +55,18 @@ var AccessTokenView = Backbone.View.extend({ this.scopeTemplate = _.template($('#tmpl-scope-list').html()); } + if (!this.moreInfoTemplate) { + this.moreInfoTemplate = _.template($('#tmpl-client-more-info-block').html()); + } + this.model.bind('change', this.render, this); }, events: { 'click .btn-delete':'deleteToken', - 'click .token-substring':'showTokenValue' + 'click .token-substring':'showTokenValue', + 'click .toggleMoreInformation': 'toggleMoreInformation' }, render:function (eventName) { @@ -86,6 +91,8 @@ var AccessTokenView = Backbone.View.extend({ // show scopes $('.scope-list', this.el).html(this.scopeTemplate({scopes: this.model.get('scopes'), systemScopes: this.options.systemScopeList})); + $('.client-more-info-block', this.el).html(this.moreInfoTemplate({client: this.options.client.toJSON()})); + return this; }, @@ -128,7 +135,21 @@ var AccessTokenView = Backbone.View.extend({ return false; }, - close:function () { + toggleMoreInformation:function(event) { + event.preventDefault(); + if ($('.moreInformation', this.el).is(':visible')) { + // hide it + $('.moreInformation', this.el).hide('fast'); + $('.toggleMoreInformation i', this.el).attr('class', 'icon-chevron-right'); + } else { + // show it + $('.moreInformation', this.el).show('fast'); + $('.toggleMoreInformation i', this.el).attr('class', 'icon-chevron-down'); + } + + }, + + close:function () { $(this.el).unbind(); $(this.el).empty(); }, @@ -177,13 +198,18 @@ var RefreshTokenView = Backbone.View.extend({ this.scopeTemplate = _.template($('#tmpl-scope-list').html()); } + if (!this.moreInfoTemplate) { + this.moreInfoTemplate = _.template($('#tmpl-client-more-info-block').html()); + } + this.model.bind('change', this.render, this); }, events: { 'click .btn-delete':'deleteToken', - 'click .token-substring':'showTokenValue' + 'click .token-substring':'showTokenValue', + 'click .toggleMoreInformation': 'toggleMoreInformation' }, render:function (eventName) { @@ -208,6 +234,8 @@ var RefreshTokenView = Backbone.View.extend({ // show scopes $('.scope-list', this.el).html(this.scopeTemplate({scopes: this.model.get('scopes'), systemScopes: this.options.systemScopeList})); + $('.client-more-info-block', this.el).html(this.moreInfoTemplate({client: this.options.client.toJSON()})); + return this; }, @@ -251,7 +279,21 @@ var RefreshTokenView = Backbone.View.extend({ return false; }, - close:function () { + toggleMoreInformation:function(event) { + event.preventDefault(); + if ($('.moreInformation', this.el).is(':visible')) { + // hide it + $('.moreInformation', this.el).hide('fast'); + $('.toggleMoreInformation i', this.el).attr('class', 'icon-chevron-right'); + } else { + // show it + $('.moreInformation', this.el).show('fast'); + $('.toggleMoreInformation i', this.el).attr('class', 'icon-chevron-down'); + } + + }, + + close:function () { $(this.el).unbind(); $(this.el).empty(); }, diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js b/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js index 22a9b5089..d6506ee05 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/whitelist.js @@ -106,6 +106,10 @@ var WhiteListView = Backbone.View.extend({ this.scopeTemplate = _.template($('#tmpl-scope-list').html()); } + if (!this.moreInfoTemplate) { + this.moreInfoTemplate = _.template($('#tmpl-client-more-info-block').html()); + } + this.model.bind('change', this.render, this); }, @@ -117,6 +121,8 @@ var WhiteListView = Backbone.View.extend({ $('.scope-list', this.el).html(this.scopeTemplate({scopes: this.model.get('allowedScopes'), systemScopes: this.options.systemScopeList})); + $('.client-more-info-block', this.el).html(this.moreInfoTemplate({client: this.options.client.toJSON()})); + this.$('.dynamically-registered').tooltip({title: 'This client was dynamically registered'}); return this; diff --git a/openid-connect-server-webapp/src/main/webapp/resources/template/client.html b/openid-connect-server-webapp/src/main/webapp/resources/template/client.html index 63efa5f0e..8cc41ef6f 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/template/client.html +++ b/openid-connect-server-webapp/src/main/webapp/resources/template/client.html @@ -35,12 +35,29 @@ +
+
+ + + +   + <% if (whiteList != null) { %> +   + <% } else { %> +   + <% } %> + + + + + +