{% block search_identity_widget %}
{% spaceless %}
	{{ block('choice_widget') }}

	<script type="text/javascript">
	(function($, window, document) {
		$(function() {
			$('.select2-entity-ajax').each(function(){
				$(this).select2({
					ajax: {
						url: Routing.generate($(this).attr('data-route')),
						dataType: 'json',
						delay: 250,
						data: function(params) {
							return {
								q: params.term,
								page: params.page
							};
						},
						processResults: function(data, params) {
							params.page = params.page || 1;
							return {
								results: data.items,
								pagination: {
									more: (params.page * 30) > data.total_count
								}
							};
						},
						cache: true
					},
					escapeMarkup: function(markup){ return markup; },
					minimumInputLength: 3,
					templateResult: function(repo) {
						if (repo.loading) return repo.text;
						
						 var markup = "<div class='select2-result-repository clearfix'>" +
						 	"<div class='select2-result-repository__title'>" + repo.name + "</div>" +
						 	"</div>";
						 
						 return markup;
					},
					templateSelection: function(repo) {
						return repo.text;
					}
				});
			});
		});
	}(window.jQuery, window, document));
	</script>
{% endspaceless %}
{% endblock %}
Add fields template for forms in the bundle
Add fields template for forms in the bundle
