<commit_before>require([ "app/models/Product" , 
          "app/collections/Products", 
          "app/views/ProductListView",
          "app/views/ProductCreateUpdateView",
          "app/views/HomeView", ],

function(Product, Products, ProductListView, ProductCreateUpdateView, HomeView) {

	var AppRouter = Backbone.Router.extend({
		routes : {
			"" : "home", // index page
			"products" : "listProducts", // list of products
			"products/new" : "createProduct", // create product
			"products/:id" : "editProduct", // create product
			"axis" : "listAxis", // list of axis
			"products/:id/versions" : "listProductVersions", // list of product versions
		},

		listProductVersions : function(pid) {
			var productVersions = new ProductVersions({
				urlRoot : "rest/products/"+pid+"versions/"
			}); 
			
			var view = new ProductVersionListView({
				el : $("#page_loader"),
				model : productVersions
			});
			
			productVersions.fetch();
		},
		
		editProduct : function(product_id) {
			var product = new Product({id : product_id}); 
			
			var view = new ProductCreateUpdateView({
				el : $("#page_loader"),
				model : product
			});
			
			product.fetch();
		},
		
		createProduct : function() {
			
			var view = new ProductCreateUpdateView({
				el : $("#page_loader"),
				model : new Product()
			});
			
			view.render();
		},
		
		listProducts : function() {
			var products = new Products(); 
			
			var view = new ProductListView({<commit_msg>Routes completed<commit_after>require([ "app/models/Product" , 
          "app/collections/Products", 
          "app/views/ProductListView",
          "app/views/ProductCreateUpdateView",
          "app/views/HomeView", ],

function(Product, Products, ProductListView, ProductCreateUpdateView, HomeView) {

	var AppRouter = Backbone.Router.extend({
		routes : {
			// Application routing: 
			"" : "home", // index page
			// Products
			"products" : "listProducts", // list of products
			"products/new" : "createProduct", // create product
			"products/:id" : "editProduct", // edit product
			// Product version
			"products/:pid/versions" : "listProductVersions", // list of product versions
			"products/:pid/versions/new" : "createProductVersion", // create product version
			"products/:pid/versions/:id" : "editProductVersion", // edit product version
			// Product build
			"products/:pid/versions/:vid/builds" : "listProductVersions", // list of product build
			"products/:pid/versions/:vid/builds/new" : "createProductVersion", // create product build
			"products/:pid/versions/:vid/builds/:id" : "editProductVersion", // edit product build
			// Axis
			"axis" : "listAxis", // list of axis
			"axis/new" : "createAxis", // create axis
			"axis/:id" : "editAxis", // edit axis
			// Axis value
			"axis/:aid/values" : "listAxisValues", // list of axis values
			"axis/:aid/values/new" : "createAxisValue", // create axis value
			"axis/:aid/values/:id" : "editAxisValue", // edit axis value
			// Axis configuration
			"axis/:aid/configurations" : "listAxisConfigs", // list of axis configurations
			"axis/:aid/configurations/new" : "createAxisConfig", // create axis configuration
			"axis/:aid/configurations/:id" : "editAxisConfig", // edit axis configuration
			// Test plan
			"products/:pid/versions/:vid/testplans" : "listTestPlan", // list of test plans
			"products/:pid/versions/:vid/testplans/new" : "createTestPlan", // create test plan
			"products/:pid/versions/:vid/testplans/:id" : "editTestPlan", // edit test plan
			// Test case
			"products/:pid/versions/:vid/testplans/:tid/cases" : "listTestCases", // list of test cases
			"products/:pid/versions/:vid/testplans/:tid/cases/new" : "createTestCase", // create test case
			"products/:pid/versions/:vid/testplans/:tid/cases/:id" : "editTestCase", // edit test case
			// Test run
			"products/:pid/versions/:vid/testplans/:tid/runs" : "listTestRuns", // list of test runs
			"products/:pid/versions/:vid/testplans/:tid/runs/new" : "createTestRun", // create test run
			"products/:pid/versions/:vid/testplans/:tid/runs/:id" : "editTestRun", // edit test run 
			// Test run case
			"products/:pid/versions/:vid/testplans/:tid/runs/:rid/cases" : "listTestRunCases", // list of test run cases
			"products/:pid/versions/:vid/testplans/:tid/runs/:rid/cases/:id" : "editTestRunCase", // edit test run case
		},

		editProductVersion : function(product_id) {
			var product = new Product({id : product_id}); 
			
			var view = new ProductCreateUpdateView({
				el : $("#page_loader"),
				model : product
			});
			
			product.fetch();
		},
		
		createProductVersion : function() {
			var view = new ProductCreateUpdateView({
				el : $("#page_loader"),
				model : new ProductVersion()
			});
			
			view.render();
		},
		
		listProductVersions : function(pid) {
			var productVersions = new ProductVersions({
				urlRoot : "rest/products/"+pid+"versions/"
			}); 
			
			var view = new ProductVersionListView({
				el : $("#page_loader"),
				model : productVersions
			});
			
			productVersions.fetch();
		},
		
		editProduct : function(product_id) {
			var product = new Product({id : product_id}); 
			
			var view = new ProductCreateUpdateView({
				el : $("#page_loader"),
				model : product
			});
			
			product.fetch();
		},
		
		createProduct : function() {
			var view = new ProductCreateUpdateView({
				el : $("#page_loader"),
				model : new Product()
			});
			
			view.render();
		},
		
		listProducts : function() {
			var products = new Products(); 
			
			var view = new ProductListView({
{'fraction_non_alphanumeric': 0.15547957531041928, 'fraction_numerical': 0.0, 'mean_word_length': 3.132342007434944, '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': '5607593', 'n_tokens_mistral': 1971, 'n_tokens_neox': 1696, 'n_words': 370}