<commit_before>'use strict';

angular.module('civis.youpower.cooperatives', ['highcharts-ng'])

.controller('CooperativeCtrl', function($scope,$timeout,$state,$q,$stateParams,$translate,$ionicPopup,Cooperatives,currentUser) {

  $scope.actionTypes = Cooperatives.getActionTypes();

  $scope.$on("$ionicView.enter",function(){
    var id = $stateParams.id || currentUser.cooperativeId;
    // Get the cooperative, currently hardcoded
    Cooperatives.get({id:id},function(data){
      $scope.cooperative = data;
      $scope.cooperative.actions = _.sortBy($scope.cooperative.actions,function(a){ return new Date(a.date)}).reverse();
      $scope.$broadcast('civisEnergyGraph.init');
      mixpanel.track('Cooperative viewed',{name: data.name, own: id == currentUser.cooperativeId});
    });
  })

  $scope.energyGraphSettings = {
    granularity: "monthly",
    compareTo: "",
    type: "electricity",
    unit: "kWh/m<sup>2</sup>",<commit_msg>Making heating default tab in cooperatives graph<commit_after>'use strict';

angular.module('civis.youpower.cooperatives', ['highcharts-ng'])

.controller('CooperativeCtrl', function($scope,$timeout,$state,$q,$stateParams,$translate,$ionicPopup,Cooperatives,currentUser) {

  $scope.actionTypes = Cooperatives.getActionTypes();

  $scope.$on("$ionicView.enter",function(){
    var id = $stateParams.id || currentUser.cooperativeId;
    // Get the cooperative, currently hardcoded
    Cooperatives.get({id:id},function(data){
      $scope.cooperative = data;
      $scope.cooperative.actions = _.sortBy($scope.cooperative.actions,function(a){ return new Date(a.date)}).reverse();
      $scope.$broadcast('civisEnergyGraph.init');
      mixpanel.track('Cooperative viewed',{name: data.name, own: id == currentUser.cooperativeId});
    });
  })

  $scope.energyGraphSettings = {
    granularity: "monthly",
    compareTo: "",
    type: "heating",
    unit: "kWh/m<sup>2</sup>",
{'fraction_non_alphanumeric': 0.16901408450704225, 'fraction_numerical': 0.0010432968179447052, 'mean_word_length': 5.167202572347267, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1073639', 'n_tokens_mistral': 620, 'n_tokens_neox': 590, 'n_words': 87}