<commit_before>﻿angular
.module('peregrineUi.controllers')
.controller('tournamentDashboardController', [
	'$scope', '$routeParams', '$location', 'tournamentResource', 'roundResource', 'standingsResource', 'playerResource',
	function($scope, $routeParams, $location, tournamentResource, roundResource, standingsResource, playerResource) {

		$scope.location = $location;

		var tournamentEventSource;
		var roundEventSource;

		$scope.tournament = tournamentResource.get({
				tournamentKey: $routeParams.tournamentKey
			})
			.$promise
			.then(function(tournament) {
				var url = '/api/tournaments/' + $routeParams.tournamentKey + '/updates';
				console.log('listening for tournament updates', url);

				tournamentEventSource = new EventSource(url);
				tournamentEventSource.addEventListener(
					'updated',
					function(event) {
						console.log('tournament update', event);
						$scope.$apply(function() {
							$scope.tournament = JSON.parse(event.data);
						})
					},
					false);
			});

		$scope.round = roundResource.get({
				tournamentKey: $routeParams.tournamentKey,
				roundNumber: 'current'
			}).$promise
			.then(function(round) {
				var url = '/api/tournaments/' + $routeParams.tournamentKey + '/rounds/' + round.number + '/updates';<commit_msg>- Fixing an issue where the round pairings don't show on initial page load. Fixes #23<commit_after>﻿angular
.module('peregrineUi.controllers')
.controller('tournamentDashboardController', [
	'$scope', '$routeParams', '$location', 'tournamentResource', 'roundResource', 'standingsResource', 'playerResource',
	function($scope, $routeParams, $location, tournamentResource, roundResource, standingsResource, playerResource) {

		$scope.location = $location;

		var tournamentEventSource;
		var roundEventSource;

		$scope.tournament = tournamentResource.get({
			tournamentKey: $routeParams.tournamentKey
		});

		$scope.tournament.$promise
			.then(function(tournament) {
				var url = '/api/tournaments/' + $routeParams.tournamentKey + '/updates';
				console.log('listening for tournament updates', url);

				tournamentEventSource = new EventSource(url);
				tournamentEventSource.addEventListener(
					'updated',
					function(event) {
						console.log('tournament update', event);
						$scope.$apply(function() {
							$scope.tournament = JSON.parse(event.data);
						})
					},
					false);
			});

		$scope.round = roundResource.get({
			tournamentKey: $routeParams.tournamentKey,
			roundNumber: 'current'
		});

		$scope.round.$promise
			.then(function(round) {
				var url = '/api/tournaments/' + $routeParams.tournamentKey + '/rounds/' + round.number + '/updates';
{'fraction_non_alphanumeric': 0.14231927710843373, 'fraction_numerical': 0.0007530120481927711, 'mean_word_length': 4.433537832310838, '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': '3021624', 'n_tokens_mistral': 963, 'n_tokens_neox': 761, 'n_words': 148}