Sha256: 4fdf4156326b06d55b47ebf8e2b979070842bcf3a609097bb802c38ddf3c7391

Contents?: true

Size: 1011 Bytes

Versions: 2

Compression:

Stored size: 1011 Bytes

Contents

angular.module("SWAT").controller "ConsoleCtrl", ($rootScope, $scope, $state, $stateParams,
    ConfirmationDialog, ConsoleService) ->

  $scope.init = ->
    $scope.clean =
      branch: { name: '' }
      user: { name: '' }
      period: { name: '' }
      revision: { name: '' }

    $scope.loadConsoleData()
    $rootScope.globalControl.setReloader($scope.loadConsoleData)


  $scope.loadConsoleData = ->
    $scope.consoleDataPromise = ConsoleService.data()
    $scope.consoleDataPromise.$promise.then((resp)->
      $scope.consoleData = resp
    )

  $scope.sum = (data)->
   _.sum(_.values(data))

  $scope.remove = (attribute)->
    message = 'Are you sure you want to remove revisions of ' + attribute + ' <strong>' + $scope.clean[attribute].name + '<strong>?'
    action =  ->
      promise = ConsoleService.clean(attribute: attribute, value: $scope.clean[attribute].name)
      promise.$promise.then($scope.loadConsoleData)
      promise

    new ConfirmationDialog(message, action)

  $scope.init()

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sw2at-ui-0.0.15 app/assets/javascripts/swat/app/controllers/management/console.coffee
sw2at-ui-0.0.14 app/assets/javascripts/swat/app/controllers/management/console.coffee