Sha256: 982005d88217a6532995ee8e0473608331909d715387f6b42d258508fa0d1b3c

Contents?: true

Size: 1.58 KB

Versions: 10

Compression:

Stored size: 1.58 KB

Contents

module = angular.module('maestrano.dashboard.dashboard-organization-billing',['maestrano.assets'])

#============================================
# Current Billing Directive
#============================================
module.controller('DashboardOrganizationBillingCtrl',[
  '$scope','$window','DhbOrganizationSvc', 'Utilities','AssetPath','Miscellaneous'
  ($scope, $window, DhbOrganizationSvc, Utilities,AssetPath,Miscellaneous) ->
    #====================================
    # Pre-Initialization
    #====================================
    $scope.assetPath = AssetPath
    $scope.isLoading = true
    $scope.billing = {}

    #====================================
    # Scope Management
    #====================================
    # Initialize the data used by the directive
    $scope.initialize = (billing) ->
      angular.copy(billing,$scope.billing)
      $scope.isLoading = false

    $scope.isCreditShown = () ->
      b = $scope.billing
      b &&
      b.credit &&
      b.credit.value > 0

    #====================================
    # Post-Initialization
    #====================================
    $scope.$watch DhbOrganizationSvc.getId, (val) ->
      $scope.isLoading = true
      if val?
        DhbOrganizationSvc.load().then (organization)->
          $scope.initialize(organization.billing)
])

module.directive('dashboardOrganizationBilling', ['TemplatePath', (TemplatePath) ->
  return {
      restrict: 'A',
      scope: {
      },
      templateUrl: TemplatePath['mno_enterprise/dashboard/organization/billing.html'],
      controller: 'DashboardOrganizationBillingCtrl'
    }
])

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mno-enterprise-frontend-2.0.9 app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/billing.js.coffee
mno-enterprise-frontend-2.0.8 app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/billing.js.coffee
mno-enterprise-frontend-2.0.7 app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/billing.js.coffee
mno-enterprise-frontend-2.0.6 app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/billing.js.coffee
mno-enterprise-frontend-2.0.5 app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/billing.js.coffee
mno-enterprise-frontend-2.0.4 app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/billing.js.coffee
mno-enterprise-frontend-2.0.3 app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/billing.js.coffee
mno-enterprise-frontend-2.0.2 app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/billing.js.coffee
mno-enterprise-frontend-2.0.1 app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/billing.js.coffee
mno-enterprise-frontend-2.0.0 app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/billing.js.coffee