<commit_before>/**
 * Primary Controller for the Vocabulary CMS
 * For adding / editing vocabulary metadata
 * @author <NAME> <<EMAIL>>
 */
(function () {
    'use strict';

    angular
        .module('app')
        .controller('addVocabsCtrl', addVocabsCtrl);

    function addVocabsCtrl($log, $scope, $location, $modal, vocabs_factory) {
        vocabs_factory.user().then(function (data) {
            $scope.user_orgs = data.message;
        });
        $scope.form = {};

        $scope.vocab = {top_concept: [], subjects: []};
        $scope.mode = 'add'; // [add|edit]
        $scope.langs = [
            {"value": "zh", "text": "Chinese"},
            {"value": "en", "text": "English"},
            {"value": "fr", "text": "French"},
            {"value": "de", "text": "German"},
            {"value": "it", "text": "Italian"},
            {"value": "ja", "text": "Japanese"},
            {"value": "mi", "text": "Māori"},
            {"value": "ru", "text": "Russian"},
            {"value": "es", "text": "Spanish"}
        ];
        $scope.licence = ["CC-BY", "CC-BY-SA", "CC-BY-ND", "CC-BY-NC", "CC-BY-NC-SA", "CC-BY-NC-ND", "GPL", "AusGoalRestrictive", "NoLicence", "Unknown/Other"];
        $scope.subject_sources = ['ANZSRC-FOR', 'local'];

        $scope.opened = false;
        $scope.decide = false;

        $scope.status = 'idle';

        $scope.open = function ($event) {
            $event.preventDefault();
            $event.stopPropagation();
            $scope.opened = !$scope.opened;
        };

        /**
         * If there is a slug available, this is an edit view for the CMS
         * Proceed to overwrite the vocab object with the one fetched from the vocabs_factory.get()
         * @author <NAME> <<EMAIL>>
         */
        if ($('#vocab_slug').val()) {
            vocabs_factory.get($('#vocab_id').val()).then(function (data) {
                $log.debug('Editing ', data.message);
                $scope.vocab = data.message;
                $scope.mode = 'edit';
                $scope.decide = true;
                $log.debug($scope.form.cms);
            });
        }

        if ($location.search().skip) {<commit_msg>Vocabs: add ODC-By license to CMS<commit_after>/**
 * Primary Controller for the Vocabulary CMS
 * For adding / editing vocabulary metadata
 * @author <NAME> <<EMAIL>>
 */
(function () {
    'use strict';

    angular
        .module('app')
        .controller('addVocabsCtrl', addVocabsCtrl);

    function addVocabsCtrl($log, $scope, $location, $modal, vocabs_factory) {
        vocabs_factory.user().then(function (data) {
            $scope.user_orgs = data.message;
        });
        $scope.form = {};

        $scope.vocab = {top_concept: [], subjects: []};
        $scope.mode = 'add'; // [add|edit]
        $scope.langs = [
            {"value": "zh", "text": "Chinese"},
            {"value": "en", "text": "English"},
            {"value": "fr", "text": "French"},
            {"value": "de", "text": "German"},
            {"value": "it", "text": "Italian"},
            {"value": "ja", "text": "Japanese"},
            {"value": "mi", "text": "Māori"},
            {"value": "ru", "text": "Russian"},
            {"value": "es", "text": "Spanish"}
        ];
        $scope.licence = ["CC-BY", "CC-BY-SA", "CC-BY-ND", "CC-BY-NC", "CC-BY-NC-SA", "CC-BY-NC-ND", "ODC-By", "GPL", "AusGoalRestrictive", "NoLicence", "Unknown/Other"];
        $scope.subject_sources = ['ANZSRC-FOR', 'local'];

        $scope.opened = false;
        $scope.decide = false;

        $scope.status = 'idle';

        $scope.open = function ($event) {
            $event.preventDefault();
            $event.stopPropagation();
            $scope.opened = !$scope.opened;
        };

        /**
         * If there is a slug available, this is an edit view for the CMS
         * Proceed to overwrite the vocab object with the one fetched from the vocabs_factory.get()
         * @author <NAME> <<EMAIL>>
         */
        if ($('#vocab_slug').val()) {
            vocabs_factory.get($('#vocab_id').val()).then(function (data) {
                $log.debug('Editing ', data.message);
                $scope.vocab = data.message;
                $scope.mode = 'edit';
                $scope.decide = true;
                $log.debug($scope.form.cms);
            });
        }

        if ($location.search().skip) {
{'fraction_non_alphanumeric': 0.19269406392694063, 'fraction_numerical': 0.0, 'mean_word_length': 1.9863667348329925, 'pattern_counts': {'":': 36, '<': 15, '<?xml version=': 0, '>': 15, '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': '523623', 'n_tokens_mistral': 1411, 'n_tokens_neox': 1355, 'n_words': 302}