<commit_before>angular.module("hyloControllers").controller('OnboardingCtrl', ['$scope', '$rootScope', '$modalInstance', 'User', 'Post', '$log', '$analytics',
  function($scope, $rootScope, $modalInstance, User, Post, $log, $analytics) {

    $scope.wizard = {};

    $scope.$watch('currentUser', function(user) {
      user.$promise.then(function(user) {
        $scope.wizard.skills = user.skills;
        $scope.wizard.organizations = user.organizations;
      });
    });

    $scope.saveSkills = function() {
      $rootScope.currentUser.$save(function(u, putRespHeaders) {
        $analytics.eventTrack("Saved User Skills Onboarding");
      });
    }

    $scope.saveOrgs = function() {
      $rootScope.currentUser.$save(function(u, putRespHeaders) {
        $analytics.eventTrack("Saved User Organizations Onboarding");
      });
    }

    var createPost = function(name, type, callback) {
      if (name && name.trim().length > 0) {
        var newPost = new Post();
        newPost.name = name;
        newPost.description = "";
        newPost.postType = type;
        newPost.communityId = $rootScope.community.id;

        newPost.$save(callback);
      } else {
        if (_.isFunction(callback)) {
          callback();
        }
      }
    }

    $scope.finishedWizard = function() {

      $analytics.eventTrack("Finished Wizard");

      createPost($scope.wizard.offer, "offer");
      createPost($scope.wizard.request, "request");
      createPost($scope.wizard.intention, "intention", function() {
        $modalInstance.close("success");
      });
    }

  }
]);
<commit_msg>fix for prefixes on onboarding modal<commit_after>angular.module("hyloControllers").controller('OnboardingCtrl', ['$scope', '$rootScope', '$modalInstance', 'User', 'Post', '$log', '$analytics',
  function($scope, $rootScope, $modalInstance, User, Post, $log, $analytics) {

    $scope.wizard = {};
    $scope.wizard.offer = "I'd like to share ";
    $scope.wizard.request = "I'm looking for ";
    $scope.wizard.intention = "I'd like to create ";

    $scope.$watch('currentUser', function(user) {
      user.$promise.then(function(user) {
        $scope.wizard.skills = user.skills;
        $scope.wizard.organizations = user.organizations;
      });
    });

    $scope.saveSkills = function() {
      $rootScope.currentUser.$save(function(u, putRespHeaders) {
        $analytics.eventTrack("Saved User Skills Onboarding");
      });
    }

    $scope.skip = function skip(seedType) {
      switch(seedType) {
        case 'offer':
          $scope.wizard.offer = "";
          break;
        case 'request':
          $scope.wizard.request = "";
          break;
        case 'intention':
          $scope.wizard.intention = "";
          break;
        default:
      }
    }

    $scope.saveOrgs = function() {
      $rootScope.currentUser.$save(function(u, putRespHeaders) {
        $analytics.eventTrack("Saved User Organizations Onboarding");
      });
    }

    var createPost = function(name, type, callback) {
      if (name && name.trim().length > 0
          && name != "I'd like to create "
          && name != "I'd like to share "
          && name != "I'm looking for ") {
        var newPost = new Post();
        newPost.name = name;
        newPost.description = "";
        newPost.postType = type;
        newPost.communityId = $rootScope.community.id;

        newPost.$save(callback);
      } else {
        if (_.isFunction(callback)) {
          callback();
        }
      }
    }

    $scope.finishedWizard = function() {

      $analytics.eventTrack("Finished Wizard");

      createPost($scope.wizard.offer, "offer");
      createPost($scope.wizard.request, "request");
      createPost($scope.wizard.intention, "intention", function() {
        $modalInstance.close("success");
      });
    }

  }
]);

{'fraction_non_alphanumeric': 0.1590612777053455, 'fraction_numerical': 0.0005215123859191656, 'mean_word_length': 2.5750232991612303, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3194742', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1145, 'n_words': 202}