client id and (sometimes) secret shown on save, addresses #517
parent
d12751a5b6
commit
b9d684fe1a
|
@ -5,14 +5,14 @@
|
||||||
<o:topbar pageName="Home" />
|
<o:topbar pageName="Home" />
|
||||||
|
|
||||||
<!-- Modal dialogue for management UI -->
|
<!-- Modal dialogue for management UI -->
|
||||||
<div id="modalAlert" class="modal hide fade" role="dialog">
|
<div id="modalAlert" class="modal hide fade" tabindex="-1" role="dialog">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modalAlert">×</button>
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
<h3 id="myModalLabel">Modal header</h3>
|
<h3 id="modalAlertLabel"></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body"></div>
|
<div class="modal-body"></div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button class="btn btn-primary" data-dismiss="modalAlert">OK</button>
|
<button class="btn btn-primary" data-dismiss="modal">OK</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -279,6 +279,10 @@ var ClientFormView = Backbone.View.extend({
|
||||||
this.template = _.template($('#tmpl-client-form').html());
|
this.template = _.template($('#tmpl-client-form').html());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.clientSavedTemplate) {
|
||||||
|
this.clientSavedTemplate = _.template($('#tmpl-client-saved').html());
|
||||||
|
}
|
||||||
|
|
||||||
this.redirectUrisCollection = new Backbone.Collection();
|
this.redirectUrisCollection = new Backbone.Collection();
|
||||||
this.scopeCollection = new Backbone.Collection();
|
this.scopeCollection = new Backbone.Collection();
|
||||||
this.contactsCollection = new Backbone.Collection();
|
this.contactsCollection = new Backbone.Collection();
|
||||||
|
@ -556,7 +560,9 @@ var ClientFormView = Backbone.View.extend({
|
||||||
this.model.save(attrs, {
|
this.model.save(attrs, {
|
||||||
success:function () {
|
success:function () {
|
||||||
|
|
||||||
$('#modalAlert div.modal-body').html('Client Saved');
|
$('#modalAlertLabel').html('Client Saved');
|
||||||
|
|
||||||
|
$('#modalAlert .modal-body').html(_self.clientSavedTemplate(_self.model.toJSON()));
|
||||||
|
|
||||||
$('#modalAlert').modal({
|
$('#modalAlert').modal({
|
||||||
'backdrop': 'static',
|
'backdrop': 'static',
|
||||||
|
|
|
@ -78,7 +78,6 @@
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<script type="text/html" id="tmpl-client-form">
|
<script type="text/html" id="tmpl-client-form">
|
||||||
|
|
||||||
<h1><%=(id == null ? 'New' : 'Edit')%> Client</h1>
|
<h1><%=(id == null ? 'New' : 'Edit')%> Client</h1>
|
||||||
|
@ -648,3 +647,21 @@
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script type="text/html" id="tmpl-client-saved">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<strong>ID:</strong> <code><%= clientId %></code>
|
||||||
|
</div>
|
||||||
|
<% if (generateClientSecret && clientSecret != null && clientSecret != '') { %>
|
||||||
|
<div>
|
||||||
|
<strong>Secret:</strong> <code><%= clientSecret %></code>
|
||||||
|
</div>
|
||||||
|
<% } else { %>
|
||||||
|
<div>
|
||||||
|
<strong>Secret:</strong> <i>unchanged</i>
|
||||||
|
</div>
|
||||||
|
<% } %>
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue