<commit_before>'use strict';

angular.module('visualDiffViewerApp')
  .controller('RunCtrl', function ($scope, $routeParams, RunResource) {
    $scope.runId = $routeParams.runId;

    function updateTotals() {
      $scope.totalUndecided = 0;
      $scope.totalRejected = 0;
      $scope.totalAccepted = 0;

      angular.forEach($scope.diffs, function (result) {
        switch (result.status) {
          case "PENDING" :
            $scope.totalUndecided++;
            break;

          case "REJECTED" :
            $scope.totalRejected++;
            break;

          case "ACCEPTED" :
            $scope.totalAccepted++;
        }
      });
    }

    function saveState() {
      var diffId = $scope.diffs[$scope.selectedDiffIndex].id;
      var runId = $scope.analysis.runId;
      var status = $scope.diffs[$scope.selectedDiffIndex].status.toLowerCase();

      RunResource.updateStatus({runId: runId, diffId: diffId}, {status: status});
    }

    function toggleAccepted() {
      var currResult = $scope.diffs[$scope.selectedDiffIndex];
      currResult.status == "ACCEPTED" ? currResult.status = "PENDING" : currResult.status = "ACCEPTED";
      saveState();
    }

    function toggleRejected() {
      var currResult = $scope.diffs[$scope.selectedDiffIndex];
      currResult.status == "REJECTED" ? currResult.status = "PENDING" : currResult.status = "REJECTED";
      saveState();<commit_msg>wip-new-design: fixed casing of screenshot statusses<commit_after>'use strict';

angular.module('visualDiffViewerApp')
  .controller('RunCtrl', function ($scope, $routeParams, RunResource) {
    $scope.runId = $routeParams.runId;

    function updateTotals() {
      $scope.totalUndecided = 0;
      $scope.totalRejected = 0;
      $scope.totalAccepted = 0;

      angular.forEach($scope.diffs, function (result) {
        switch (result.status) {
          case "pending" :
            $scope.totalUndecided++;
            break;

          case "rejected" :
            $scope.totalRejected++;
            break;

          case "accepted" :
            $scope.totalAccepted++;
        }
      });
    }

    function saveState() {
      var diffId = $scope.diffs[$scope.selectedDiffIndex].id;
      var runId = $scope.analysis.runId;
      var status = $scope.diffs[$scope.selectedDiffIndex].status.toLowerCase();

      RunResource.updateStatus({runId: runId, diffId: diffId}, {status: status});
    }

    function toggleAccepted() {
      var currResult = $scope.diffs[$scope.selectedDiffIndex];
      currResult.status == "accepted" ? currResult.status = "pending" : currResult.status = "accepted";
      saveState();
    }

    function toggleRejected() {
      var currResult = $scope.diffs[$scope.selectedDiffIndex];
      currResult.status == "rejected" ? currResult.status = "pending" : currResult.status = "rejected";
      saveState();
{'fraction_non_alphanumeric': 0.13466246939489332, 'fraction_numerical': 0.002098635886673662, 'mean_word_length': 2.7239583333333335, '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': '6948461', 'n_tokens_mistral': 873, 'n_tokens_neox': 849, 'n_words': 154}