<commit_before>﻿(function () {
    'use strict';

    function RelatedLinksAppController($scope) {
        var vm = this;

        vm.relations = $scope.model.viewModel;     
        var currentVariant = _.find($scope.content.variants, function(v) { return v.active });
        vm.culture = currentVariant.language.culture;      
        vm.cultureRelations = _.filter(vm.relations, function (r) { return r.Culture.toLowerCase() === vm.culture.toLowerCase() });

        vm.ungrouped = [];

        for (var i = 0; i < vm.cultureRelations.length; i++) {
            var relation = vm.cultureRelations[i];
            
            for (var j = 0; j < relation.Properties.length; j++) {
                vm.ungrouped.push({
                    id: relation.Id,
                    name: relation.Name,
                    propertyname: relation.Properties[j].PropertyName,
                    tabname: relation.Properties[j].TabName
                });
            }
        }

    }

    angular.module('umbraco').controller('Our.Umbraco.Nexu.Controllers.RelatedLinksAppController',
        [
            '$scope',
            'editorState',
            'localizationService',
            RelatedLinksAppController
        ]);

})();<commit_msg>Make sure content app works when there are no variants<commit_after>﻿(function () {
    'use strict';

    function RelatedLinksAppController($scope) {
        var vm = this;

        vm.relations = $scope.model.viewModel;     
        var currentVariant = _.find($scope.content.variants, function (v) { return v.active });

        if (currentVariant.language) {
            vm.culture = currentVariant.language.culture;
            vm.cultureRelations = _.filter(vm.relations,
                function(r) { return r.Culture.toLowerCase() === vm.culture.toLowerCase() });
        } else {
            vm.cultureRelations = vm.relations;
        }
      
      

        vm.ungrouped = [];

        for (var i = 0; i < vm.cultureRelations.length; i++) {
            var relation = vm.cultureRelations[i];
            
            for (var j = 0; j < relation.Properties.length; j++) {
                vm.ungrouped.push({
                    id: relation.Id,
                    name: relation.Name,
                    propertyname: relation.Properties[j].PropertyName,
                    tabname: relation.Properties[j].TabName
                });
            }
        }

    }

    angular.module('umbraco').controller('Our.Umbraco.Nexu.Controllers.RelatedLinksAppController',
        [
            '$scope',
            'editorState',
            'localizationService',
            RelatedLinksAppController
        ]);

})();
{'fraction_non_alphanumeric': 0.12154076290201944, 'fraction_numerical': 0.0014958863126402393, 'mean_word_length': 1.7240325865580448, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1698760', 'n_tokens_mistral': 742, 'n_tokens_neox': 691, 'n_words': 128}