scope icons now show up everywhere
parent
d0fdf8140e
commit
62b931ee0d
|
@ -80,7 +80,7 @@
|
||||||
this.template = _.template($('#tmpl-list-widget').html());
|
this.template = _.template($('#tmpl-list-widget').html());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$el.addClass("table table-condensed table-hover span4");
|
this.$el.addClass("table table-condensed table-hover table-striped span4");
|
||||||
this.collection.bind('add', this.render, this);
|
this.collection.bind('add', this.render, this);
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -221,7 +221,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
getByValue: function(value) {
|
getByValue: function(value) {
|
||||||
var scopes = this.where({value: scope});
|
var scopes = this.where({value: value});
|
||||||
if (scopes.length == 1) {
|
if (scopes.length == 1) {
|
||||||
return scopes[0];
|
return scopes[0];
|
||||||
} else {
|
} else {
|
||||||
|
@ -340,6 +340,10 @@
|
||||||
this.template = _.template($('#tmpl-client').html());
|
this.template = _.template($('#tmpl-client').html());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.scopeTemplate) {
|
||||||
|
this.scopeTemplate = _.template($('#tmpl-scope-list').html());
|
||||||
|
}
|
||||||
|
|
||||||
this.model.bind('change', this.render, this);
|
this.model.bind('change', this.render, this);
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -347,6 +351,8 @@
|
||||||
render:function (eventName) {
|
render:function (eventName) {
|
||||||
this.$el.html(this.template(this.model.toJSON()));
|
this.$el.html(this.template(this.model.toJSON()));
|
||||||
|
|
||||||
|
$('.scope-list', this.el).html(this.scopeTemplate({scopes: this.model.get('scope'), systemScopes: app.systemScopeList}));
|
||||||
|
|
||||||
this.$('.dynamically-registered').tooltip({title: 'This client was dynamically registered'});
|
this.$('.dynamically-registered').tooltip({title: 'This client was dynamically registered'});
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
@ -750,6 +756,10 @@
|
||||||
if (!this.template) {
|
if (!this.template) {
|
||||||
this.template = _.template($('#tmpl-grant').html());
|
this.template = _.template($('#tmpl-grant').html());
|
||||||
}
|
}
|
||||||
|
if (!this.scopeTemplate) {
|
||||||
|
this.scopeTemplate = _.template($('#tmpl-scope-list').html());
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
@ -757,6 +767,8 @@
|
||||||
|
|
||||||
this.$el.html(this.template(json));
|
this.$el.html(this.template(json));
|
||||||
|
|
||||||
|
$('.scope-list', this.el).html(this.scopeTemplate({scopes: this.options.client.get('scope'), systemScopes: app.systemScopeList}));
|
||||||
|
|
||||||
this.$('.dynamically-registered').tooltip({title: 'This client was dynamically registered'});
|
this.$('.dynamically-registered').tooltip({title: 'This client was dynamically registered'});
|
||||||
this.$('.whitelisted-site').tooltip({title: 'This site was whitelisted by an adminstrator'});
|
this.$('.whitelisted-site').tooltip({title: 'This site was whitelisted by an adminstrator'});
|
||||||
|
|
||||||
|
@ -840,6 +852,10 @@
|
||||||
this.template = _.template($('#tmpl-whitelist').html());
|
this.template = _.template($('#tmpl-whitelist').html());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.scopeTemplate) {
|
||||||
|
this.scopeTemplate = _.template($('#tmpl-scope-list').html());
|
||||||
|
}
|
||||||
|
|
||||||
this.model.bind('change', this.render, this);
|
this.model.bind('change', this.render, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -849,6 +865,8 @@
|
||||||
|
|
||||||
this.$el.html(this.template(json));
|
this.$el.html(this.template(json));
|
||||||
|
|
||||||
|
$('.scope-list', this.el).html(this.scopeTemplate({scopes: this.model.get('allowedScopes'), systemScopes: app.systemScopeList}));
|
||||||
|
|
||||||
this.$('.dynamically-registered').tooltip({title: 'This client was dynamically registered'});
|
this.$('.dynamically-registered').tooltip({title: 'This client was dynamically registered'});
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<%=clientId%>
|
<%=clientId%>
|
||||||
<!-- scopes and stuff -->
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
|
@ -17,6 +16,7 @@
|
||||||
<% if (clientDescription) { %>
|
<% if (clientDescription) { %>
|
||||||
<blockquote><small><%=clientDescription%></small></blockquote>
|
<blockquote><small><%=clientDescription%></small></blockquote>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
<div class="scope-list"></div>
|
||||||
<!--expandable future information-->
|
<!--expandable future information-->
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
@ -345,7 +345,10 @@
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<%=whiteList.clientId%>
|
<%=whiteList.clientId%>
|
||||||
|
<% if (client.clientDescription) { %>
|
||||||
<blockquote><small><%=client.clientDescription%></small></blockquote>
|
<blockquote><small><%=client.clientDescription%></small></blockquote>
|
||||||
|
<% } %>
|
||||||
|
<div class="scope-list"></div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
|
@ -449,7 +452,7 @@
|
||||||
|
|
||||||
<div class="well">
|
<div class="well">
|
||||||
|
|
||||||
<h3>Sites that have been whitelisted by an administrator<h3>
|
<h3>Sites that have been whitelisted by an administrator</h3>
|
||||||
<p>If you revoke them here, they will automatically be re-approved on your next visit.</p>
|
<p>If you revoke them here, they will automatically be re-approved on your next visit.</p>
|
||||||
|
|
||||||
<table id="grant-whitelist-table" class="table table-hover table-striped">
|
<table id="grant-whitelist-table" class="table table-hover table-striped">
|
||||||
|
@ -484,8 +487,10 @@
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<%= client.clientName != null ? client.clientName : client.clientId %>
|
<%= client.clientName != null ? client.clientName : client.clientId %>
|
||||||
|
<% if (client.clientDescription) { %>
|
||||||
<blockquote><small><%=client.clientDescription%></small></blockquote>
|
<blockquote><small><%=client.clientDescription%></small></blockquote>
|
||||||
<!-- put scopes and other info here -->
|
<% } %>
|
||||||
|
<div class="scope-list"></div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
@ -682,3 +687,25 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script type="text/html" id="tmpl-scope-list">
|
||||||
|
|
||||||
|
<%
|
||||||
|
_.each(scopes, function(s) {
|
||||||
|
%>
|
||||||
|
<span class="badge badge-info">
|
||||||
|
<%
|
||||||
|
var ss = systemScopes.getByValue(s);
|
||||||
|
if (ss && ss.get('icon')) {
|
||||||
|
%>
|
||||||
|
<i class="icon-<%=ss.get('icon')%> icon-white"></i>
|
||||||
|
<%
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
<%=s%>
|
||||||
|
</span>
|
||||||
|
<%
|
||||||
|
});
|
||||||
|
%>
|
||||||
|
|
||||||
|
</script>
|
Loading…
Reference in New Issue