client display improvements

pull/576/head
Justin Richer 2014-03-02 01:03:15 +00:00
parent 5da3e85f4f
commit f8e82037fe
8 changed files with 163 additions and 48 deletions

View File

@ -148,7 +148,8 @@ var ClientView = Backbone.View.extend({
events:{ events:{
"click .btn-edit":"editClient", "click .btn-edit":"editClient",
"click .btn-delete":"deleteClient", "click .btn-delete":"deleteClient",
"click .btn-whitelist":"whiteListClient" "click .btn-whitelist":"whiteListClient",
'click .toggleMoreInformation': 'toggleMoreInformation'
}, },
editClient:function () { editClient:function () {
@ -203,7 +204,20 @@ var ClientView = Backbone.View.extend({
return false; 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).unbind();
$(this.el).empty(); $(this.el).empty();
} }

View File

@ -167,7 +167,8 @@ var ApprovedSiteView = Backbone.View.extend({
}, },
events: { events: {
'click .btn-delete': 'deleteApprovedSite' 'click .btn-delete': 'deleteApprovedSite',
'click .toggleMoreInformation': 'toggleMoreInformation'
}, },
deleteApprovedSite:function() { deleteApprovedSite:function() {
@ -206,6 +207,20 @@ var ApprovedSiteView = Backbone.View.extend({
return false; return false;
}, },
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() { close:function() {
$(this.el).unbind(); $(this.el).unbind();
$(this.el).empty(); $(this.el).empty();

View File

@ -124,7 +124,8 @@ var WhiteListView = Backbone.View.extend({
events:{ events:{
'click .btn-edit': 'editWhitelist', 'click .btn-edit': 'editWhitelist',
'click .btn-delete': 'deleteWhitelist' 'click .btn-delete': 'deleteWhitelist',
'click .toggleMoreInformation': 'toggleMoreInformation'
}, },
editWhitelist:function() { editWhitelist:function() {
@ -169,6 +170,19 @@ var WhiteListView = Backbone.View.extend({
return false; return false;
}, },
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() { close:function() {
$(this.el).unbind(); $(this.el).unbind();
$(this.el).empty(); $(this.el).empty();

View File

@ -29,16 +29,37 @@
</td> </td>
<td> <td>
<%=client.clientId%> <span title="<%= client.clientId %>"><%= client.clientName != null ? client.clientName : ( client.clientId.substr(0,8) + '...' ) %></span>
</td> </td>
<td> <td>
<%=client.clientName%> <% if (client.clientDescription || client.clientUri || client.policyUri || client.tosUri || client.contacts) { %>
<% if (client.clientDescription) { %> <div class="alert alert-info">
<blockquote><small><%=client.clientDescription%></small></blockquote> <%=client.clientDescription%>
<% } %> <% if (client.clientUri || client.policyUri || client.tosUri || client.contacts) { %>
<div class="toggleMoreInformation" style="cursor: pointer;">
<i class="icon-chevron-right"></i> more information
</div>
<div class="moreInformation hide">
<ul>
<% if (client.clientUri) { %>
<li>Home page: <a href="<%= client.clientUri %>"><%= client.clientUri %></a></li>
<% } %>
<% if (client.policyUri) { %>
<li>Policy: <a href="<%= client.policyUri %>"><%= client.policyUri %></a></li>
<% } %>
<% if (client.tosUri) { %>
<li>Terms of Service: <a href="<%= client.tosUri %>"><%= client.tosUri %></a></li>
<% } %>
<% if (client.contacts) { %>
<li>Administrative Contacts: <%= client.contacts.join(', ') %></li>
<% } %>
</ul>
</div>
<% } %>
</div>
<% } %>
<div class="scope-list"></div> <div class="scope-list"></div>
<!--expandable future information-->
</td> </td>
<td> <td>
@ -63,8 +84,8 @@
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<th>ID</th> <th>Client</th>
<th>Name</th> <th>Information</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>

View File

@ -35,9 +35,7 @@
<tr> <tr>
<th></th> <th></th>
<th>Application</th> <th>Application</th>
<th>Created</th> <th></th>
<th>Last Accessed</th>
<th>Expires</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -59,9 +57,7 @@
<tr> <tr>
<th></th> <th></th>
<th>Application</th> <th>Application</th>
<th>Created</th> <th></th>
<th>Last Accessed</th>
<th>Expires</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -85,10 +81,35 @@
</td> </td>
<td> <td>
<%= client.clientName != null ? client.clientName : client.clientId %>
<% if (client.clientDescription) { %> <span title="<%= client.clientId %>"><%= client.clientName != null ? client.clientName : ( client.clientId.substr(0,8) + '...' ) %></span>
<blockquote><small><%=client.clientDescription%></small></blockquote>
<% } %> <% if (client.clientDescription || client.clientUri || client.policyUri || client.tosUri || client.contacts) { %>
<div class="alert alert-info">
<%=client.clientDescription%>
<% if (client.clientUri || client.policyUri || client.tosUri || client.contacts) { %>
<div class="toggleMoreInformation" style="cursor: pointer;">
<i class="icon-chevron-right"></i> more information
</div>
<div class="moreInformation hide">
<ul>
<% if (client.clientUri) { %>
<li>Home page: <a href="<%= client.clientUri %>"><%= client.clientUri %></a></li>
<% } %>
<% if (client.policyUri) { %>
<li>Policy: <a href="<%= client.policyUri %>"><%= client.policyUri %></a></li>
<% } %>
<% if (client.tosUri) { %>
<li>Terms of Service: <a href="<%= client.tosUri %>"><%= client.tosUri %></a></li>
<% } %>
<% if (client.contacts) { %>
<li>Administrative Contacts: <%= client.contacts.join(', ') %></li>
<% } %>
</ul>
</div>
<% } %>
</div>
<% } %>
<div class="scope-list"></div> <div class="scope-list"></div>
</td> </td>
@ -96,15 +117,17 @@
<!-- TODO: make these dates collapsable/expandable --> <!-- TODO: make these dates collapsable/expandable -->
<td> <td>
<%= formattedDate.creationDate %> <div>
</td> <i>Authorized:</i> <%= formattedDate.creationDate %>
</div>
<td> <div>
<%= formattedDate.accessDate %> <i>Last accessed:</i> <%= formattedDate.accessDate %>
</td> </div>
<td> <div>
<%= formattedDate.timeoutDate %> <i>Expires:</i> <%= formattedDate.timeoutDate %>
</div>
</td> </td>
<td> <td>

View File

@ -191,18 +191,27 @@
<% <%
_.each(scopes, function(s) { _.each(scopes, function(s) {
var ss = systemScopes.getByValue(s); var ss = systemScopes.getByValue(s);
if (ss) {
%> %>
<span class="badge<%= (ss) ? ' badge-info' : '' %>" <span class="badge badge-info"
<% if (ss && ss.get('description')) { %> <% if (ss.get('description')) { %>
title="<%= ss.get('description') %>" title="<%= ss.get('description') %>"
<% } %> <% } %>
>
<% if (ss && ss.get('icon')) { %> style="cursor: default;" >
<% if (ss.get('icon')) { %>
<i class="icon-<%=ss.get('icon')%> icon-white"></i> <i class="icon-<%=ss.get('icon')%> icon-white"></i>
<% } %> <% } %>
<%=s%> <%=s%>
</span> </span>
<% <%
} else {
%>
<span class="badge" style="cursor: default;"><%=s%></span>
<%
}
}); });
%> %>

View File

@ -69,7 +69,7 @@
<script type="text/html" id="tmpl-access-token"> <script type="text/html" id="tmpl-access-token">
<td> <td>
<span title="<%= client.clientId %>"><%= client.clientName != null ? client.clientName : ( client.clientId.substr(0,15) + '...' ) %></span> <span title="<%= client.clientId %>"><%= client.clientName != null ? client.clientName : ( client.clientId.substr(0,8) + '...' ) %></span>
<% if (token.refreshTokenId != null) { %> <% if (token.refreshTokenId != null) { %>
<br /> <br />
<span class="label label-important" title="This access token was issued with an associated refresh token.">+ <i class="icon-time icon-white"></i> Refresh</span> <span class="label label-important" title="This access token was issued with an associated refresh token.">+ <i class="icon-time icon-white"></i> Refresh</span>
@ -87,7 +87,6 @@
<input type="text" readonly style="cursor: text" class="token-full input-xxlarge" value="<%= token.value %>" /> <input type="text" readonly style="cursor: text" class="token-full input-xxlarge" value="<%= token.value %>" />
</div> </div>
<div class="scope-list"></div> <div class="scope-list"></div>
<!--expandable future information-->
</td> </td>
<td> <td>
@ -102,7 +101,7 @@
<script type="text/html" id="tmpl-refresh-token"> <script type="text/html" id="tmpl-refresh-token">
<td> <td>
<span title="<%= client.clientId %>"><%= client.clientName != null ? client.clientName : ( client.clientId.substr(0,15) + '...' ) %></span> <span title="<%= client.clientId %>"><%= client.clientName != null ? client.clientName : ( client.clientId.substr(0,8) + '...' ) %></span>
</td> </td>
@ -112,7 +111,6 @@
<input type="text" readonly style="cursor: text" class="token-full input-xxlarge" value="<%= token.value %>" /> <input type="text" readonly style="cursor: text" class="token-full input-xxlarge" value="<%= token.value %>" />
</div> </div>
<div class="scope-list"></div> <div class="scope-list"></div>
<!--expandable future information-->
</td> </td>
<td> <td>

View File

@ -24,16 +24,37 @@
</td> </td>
<td> <td>
<%=whiteList.clientId%> <span title="<%= client.clientId %>"><%= client.clientName != null ? client.clientName : ( client.clientId.substr(0,8) + '...' ) %></span>
<% if (client.clientDescription) { %> <% if (client.clientDescription || client.clientUri || client.policyUri || client.tosUri || client.contacts) { %>
<blockquote><small><%=client.clientDescription%></small></blockquote> <div class="alert alert-info">
<% } %> <%=client.clientDescription%>
<div class="scope-list"></div> <% if (client.clientUri || client.policyUri || client.tosUri || client.contacts) { %>
</td> <div class="toggleMoreInformation" style="cursor: pointer;">
<i class="icon-chevron-right"></i> more information
</div>
<div class="moreInformation hide">
<ul>
<% if (client.clientUri) { %>
<li>Home page: <a href="<%= client.clientUri %>"><%= client.clientUri %></a></li>
<% } %>
<% if (client.policyUri) { %>
<li>Policy: <a href="<%= client.policyUri %>"><%= client.policyUri %></a></li>
<% } %>
<% if (client.tosUri) { %>
<li>Terms of Service: <a href="<%= client.tosUri %>"><%= client.tosUri %></a></li>
<% } %>
<% if (client.contacts) { %>
<li>Administrative Contacts: <%= client.contacts.join(', ') %></li>
<% } %>
</ul>
</div>
<% } %>
</div>
<% } %>
</td>
<td> <td>
<%=client.clientName%> <div class="scope-list"></div>
<!--expandable future information-->
</td> </td>
<td> <td>
@ -56,8 +77,8 @@
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<th>ID</th> <th>Client</th>
<th>Name</th> <th>Scopes</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -87,7 +108,7 @@
<label class="control-label">Client</label> <label class="control-label">Client</label>
<div class="controls"> <div class="controls">
<input type="hidden" name="clientId" value="<%= client.clientId %>" /> <input type="hidden" name="clientId" value="<%= client.clientId %>" />
<%= client.clientName != null ? client.clientName : client.clientId %> <span title="<%= client.clientId %>"><%= client.clientName != null ? client.clientName : ( client.clientId.substr(0,8) + '...' ) %></span>
</div> </div>
</div> </div>