added support for help blocks on list widget views

pull/779/head
Justin Richer 2015-02-16 16:43:58 -05:00
parent cc02f8fbe8
commit da9c8bdee5
4 changed files with 22 additions and 12 deletions

View File

@ -132,7 +132,7 @@ var ListWidgetChildView = Backbone.View.extend({
var ListWidgetView = Backbone.View.extend({
tagName: "table",
tagName: "div",
childView:ListWidgetChildView,
@ -155,7 +155,6 @@ var ListWidgetView = Backbone.View.extend({
this.template = _.template($('#tmpl-list-widget').html());
}
this.$el.addClass("table table-condensed table-hover table-striped span4");
this.collection.bind('add', this.render, this);
this.collection.bind('remove', this.render, this);
},
@ -193,7 +192,8 @@ var ListWidgetView = Backbone.View.extend({
render:function (eventName) {
this.$el.html(this.template({placeholder:this.options.placeholder}));
this.$el.html(this.template({placeholder:this.options.placeholder,
helpBlockText:this.options.helpBlockText}));
// bind autocomplete options
if (this.options.autocomplete) {

View File

@ -1036,6 +1036,7 @@ var ClientFormView = Backbone.View.extend({
var contactsView = new ListWidgetView({
placeholder: $.t("client.client-form.contacts-placeholder"),
helpBlockText: $.t("client.client-form.contacts-help"),
collection: this.contactsCollection});
$("#contacts .controls", this.el).html(contactsView.render().el);
this.listWidgetViews.push(contactsView);
@ -1061,6 +1062,7 @@ var ClientFormView = Backbone.View.extend({
var requestUriView = new ListWidgetView({
type: 'uri',
placeholder: 'https://',
helpBlockText: $.t('client.client-form.request-uri-help'),
collection: this.requestUrisCollection});
$('#requestUris .controls', this.el).html(requestUriView.render().el);
this.listWidgetViews.push(requestUriView);

View File

@ -110,6 +110,7 @@
"registration-token-error": "There was a problem loading the registration access token for this client.",
"request-object-signing-algorithm": "Request Object Signing Algorithm",
"request-uri": "Request URIs",
"request-uri-help": "URIs containing request objects used by this client",
"require-auth-time": "Require Authentication Time",
"require-auth-time-label": "Always require that the auth_time claim be sent in the id token",
"response-types": "Response Types",

View File

@ -39,15 +39,22 @@
</script>
<script type="text/html" id="tmpl-list-widget">
<thead>
<tr>
<th class="control-group">
<input type="text" value="" placeholder="<%-(placeholder) ? placeholder : ''%>"></th>
<th><a class="btn btn-small btn-add-list-item" href="#"><i class="icon-plus-sign"></i></a></th>
</tr>
</thead>
<tbody>
</tbody>
<div class="control-group">
<table class="table table-condensed table-hover table-striped span4">
<thead>
<tr>
<th>
<input type="text" value="" placeholder="<%-(placeholder) ? placeholder : ''%>"></th>
<th><a class="btn btn-small btn-add-list-item" href="#"><i class="icon-plus-sign"></i></a></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<% if (typeof(helpBlockText) !== 'undefined') { %>
<p class="help-block"><%-helpBlockText%></p>
<% } %>
</script>