<commit_before>/******************************************
* Place Modal View
*/
app.Views.TeamMembersAndServices = Backbone.View.extend({


	templateHTML : 'teamMembersAndServices',



	// The DOM events //
	events: function(){
		return _.defaults({
			'change #searchMembers, #searchServices' : 'change',
		}, 
			app.Views.GenericModalView.prototype.events
		);
	},



	/** View Initialization
	*/
	initialize : function() {
		var self = this;


		// Check if the model is loaded
		if(_.isObject(this.model)){
			this.render();
		}
		else{
			var id = this.model;
			this.model = new app.Models.Team();
			this.model.setId(id);
			
			this.model.fetch().done(function(){
				self.render();
			}).fail(function(){
				console.error('Unable to load the team');
			})
		}
	},



	/** Display the view
	*/
	render : function() {
		var self = this;



		// Retrieve the template // 
		$.get("templates/" + this.templateHTML + ".html", function(templateData){

			var template = _.template(templateData, {
				lang  : app.lang,
				team : self.model
			});

			$(self.el).html(template);

			
			self.off(self.events());
			self.delegateEvents(self.events());
			
			// Advance Select List View //
			app.views.advancedSelectBoxTeamMembersView = new app.Views.AdvancedSelectBoxView({el: $("#searchMembers"), collection: app.Collections.Officers.prototype })
			app.Views.advancedSelectBoxTeamMembersView.setSearchParam({field:'service_ids', operator:'!=', value:'false'}, true);
			app.views.advancedSelectBoxTeamMembersView.render();

			app.views.advancedSelectBoxPlaceParentView = new app.Views.AdvancedSelectBoxView({el: $("#searchServices"), collection: app.Collections.ClaimersServices.prototype })<commit_msg>Fix Bug team Views<commit_after>/******************************************
* Place Modal View
*/
app.Views.TeamMembersAndServices = Backbone.View.extend({


	templateHTML : 'teamMembersAndServices',



	// The DOM events //
	events: function(){
		return _.defaults({
			'change #searchMembers, #searchServices' : 'change',
		}, 
			app.Views.GenericModalView.prototype.events
		);
	},



	/** View Initialization
	*/
	initialize : function() {
		var self = this;


		// Check if the model is loaded
		if(_.isObject(this.model)){
			this.render();
		}
		else{
			var id = this.model;
			this.model = new app.Models.Team();
			this.model.setId(id);
			
			this.model.fetch().done(function(){
				self.render();
			}).fail(function(){
				console.error('Unable to load the team');
			})
		}
	},



	/** Display the view
	*/
	render : function() {
		var self = this;



		// Retrieve the template // 
		$.get("templates/" + this.templateHTML + ".html", function(templateData){

			var template = _.template(templateData, {
				lang  : app.lang,
				team : self.model
			});

			$(self.el).html(template);

			
			self.off(self.events());
			self.delegateEvents(self.events());
			
			// Advance Select List View //
			app.views.advancedSelectBoxTeamMembersView = new app.Views.AdvancedSelectBoxView({el: $("#searchMembers"), collection: app.Collections.Officers.prototype });
			app.views.advancedSelectBoxTeamMembersView.setSearchParam({field:'service_ids', operator:'!=', value:'false'}, true);
			app.views.advancedSelectBoxTeamMembersView.render();

			app.views.advancedSelectBoxPlaceParentView = new app.Views.AdvancedSelectBoxView({el: $("#searchServices"), collection: app.Collections.ClaimersServices.prototype })
{'fraction_non_alphanumeric': 0.1762820512820513, 'fraction_numerical': 0.0, 'mean_word_length': 3.7680555555555557, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '964317', 'n_tokens_mistral': 1199, 'n_tokens_neox': 999, 'n_words': 197}