<commit_before>'use strict';

var app = angular.module('blinky', ['ui.router']);

app.config(function($stateProvider, $urlRouterProvider) {
  // default route
  $urlRouterProvider.otherwise('/');

  $stateProvider.state('home', {
    url: '/',
    templateUrl: getTemplateUrl('home')
  });

  $stateProvider.state('paste', {
    url: '/paste',
    templateUrl: getTemplateUrl('paste'),
    controller: 'NewPasteCtrl'
  });

  $stateProvider.state('paste-view', {
    url: '/:id',
    templateUrl: getTemplateUrl('paste-view'),
    controller: 'ViewPasteCtrl'
  });
});

app.controller('NewPasteCtrl', function($scope, $state, $http) {
  $scope.submit = function() {
    $http.post('/api/pastes', $scope.paste).success(function(data, status, headers, config) {
      $state.go('paste-view', data, {});
    });
  }
});

app.controller('ViewPasteCtrl', function($scope, $stateParams, $http) {
  $http.get('/api/pastes/' + $stateParams.id).success(function(data) {
    $scope.paste = data;
  });
});

function getTemplateUrl(name) {
  return 'assets/template/' + name + '.html';
}
<commit_msg>Fix state urls<commit_after>'use strict';

var app = angular.module('blinky', ['ui.router']);

app.config(function($stateProvider, $urlRouterProvider) {
  // default route
  $urlRouterProvider.otherwise('/');

  $stateProvider.state('home', {
    url: '/',
    templateUrl: getTemplateUrl('home')
  });

  $stateProvider.state('paste', {
    url: '/pastes/new',
    templateUrl: getTemplateUrl('paste'),
    controller: 'NewPasteCtrl'
  });

  $stateProvider.state('paste-view', {
    url: '/pastes/:id',
    templateUrl: getTemplateUrl('paste-view'),
    controller: 'ViewPasteCtrl'
  });
});

app.controller('NewPasteCtrl', function($scope, $state, $http) {
  $scope.submit = function() {
    $http.post('/api/pastes', $scope.paste).success(function(data, status, headers, config) {
      $state.go('paste-view', data, {});
    });
  }
});

app.controller('ViewPasteCtrl', function($scope, $stateParams, $http) {
  $http.get('/api/pastes/' + $stateParams.id).success(function(data) {
    $scope.paste = data;
  });
});

function getTemplateUrl(name) {
  return 'assets/template/' + name + '.html';
}

{'fraction_non_alphanumeric': 0.20356001825650388, 'fraction_numerical': 0.0, 'mean_word_length': 4.3075060532687655, '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': '3257035', 'n_tokens_mistral': 754, 'n_tokens_neox': 723, 'n_words': 114}