'use strict';

var EventDetailsController = angular.module('events.controllers.event', [
    'system'
])
    .controller('EventDetailsController', [
        '$scope',
        '$location',
        '$route',
        '$window',
        'System',
        'EventService',
        'OdjeljenjeService',
        'ClassificationService',
        function ($scope, $location, $route, $window, System, EventService, OdjeljenjeService, ClassificationService) {
            var id = $route.current.params["id"];
            $scope.user = { EventID: id };

            $(".tooltip").tooltip();

            $scope.refresh = function () {
                EventService.get(id).then(function (event) {
                    $scope.event = event;
                    System.Page.title($scope.event.Title);

                });
            };

            $scope.load = function() {
            
                ClassificationService.getByAlias("team").then(function(data) {
                    $scope.teams = data.Labels;
                });
            };

            
            $scope.back = function () {
                $location.url('/events');
            };
            
            $scope.refresh();
            $scope.load();
        }
    ]);