mno-enterprise-frontend 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +1 -0
- data/Rakefile +12 -0
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/images/mno_enterprise/impac/close-widget-pink.png +0 -0
- data/app/assets/images/mno_enterprise/impac/close-widget.png +0 -0
- data/app/assets/images/mno_enterprise/loader-32x32-bg-inverse.gif +0 -0
- data/app/assets/images/mno_enterprise/loader-32x32-bg-main.gif +0 -0
- data/app/assets/images/mno_enterprise/maestrano/logo-whitebg.png +0 -0
- data/app/assets/javascripts/mno_enterprise/angular/app.js.coffee.erb +173 -0
- data/app/assets/javascripts/mno_enterprise/angular/controllers/maestrano-controllers.js.coffee +4 -0
- data/app/assets/javascripts/mno_enterprise/angular/controllers/modals/modals-ctrl.js.coffee +62 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-account.js.coffee +157 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-app-deletion-request.js.coffee +62 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-apps-list.js.coffee +127 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-components.js.coffee +25 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-marketplace-app.js.coffee +77 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-marketplace.js.coffee +51 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-menu.js.coffee +174 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/arrears.js.coffee +70 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/billing.js.coffee +48 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/credit-card.js.coffee +142 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/index.js.coffee +61 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/invoices.js.coffee +42 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/members.js.coffee +280 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/settings.js.coffee +91 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/team-list.js.coffee +179 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/teams.js.coffee +268 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/file-model.js.coffee +33 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/maestrano-components.js.coffee +22 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-autostop-app.js.coffee +123 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-compile.js.coffee +18 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-currency-widget.js.coffee +43 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-current-currency.js.coffee +22 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-editable.js.coffee +68 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-flash-msg.js.coffee +40 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-helptext.js.coffee +38 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-loading-lounge.js.coffee +184 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-match.js.coffee +14 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-message-modal.js.coffee +56 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-notification-widget.js.coffee +192 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-partner-code-popup.js.coffee +74 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-partner-contact.js.coffee +59 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-password-strength.js.coffee +154 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-password.js.coffee +40 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-price-converter.js.coffee +49 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-scroll-to.js.coffee +14 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-typeahead.js.coffee +89 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/user-setup/components.js.coffee +7 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/user-setup/index.js.coffee +256 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-app-by-category.js.coffee +5 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-currency.js.coffee +30 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-filters.js.coffee +7 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-replace-underscore-with-space.js.coffee +4 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-titleize.js.coffee +7 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-truncate.js.coffee +24 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/maestrano-app-instance.js.coffee +15 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/maestrano-apps-document.js.coffee +83 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/maestrano-user.js.coffee +27 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/organization-svc.js.coffee +318 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/team-svc.js.coffee +180 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/tickets-svc.js.coffee +109 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/impac-config.svc.js.coffee +35 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-apps-list-helper.js.coffee +337 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-assets.js.coffee.erb +21 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-current-currency.js.coffee +7 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-current-user-svc.js.coffee +99 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-exchange-rates.js.coffee +102 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-message-svc.js.coffee +71 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-miscellaneous.js.coffee.erb +46 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-modal.js.coffee +67 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-msg-bus.js.coffee +50 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-services.js.coffee +21 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-shopping-cart.js.coffee +361 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-utilities.js.coffee +61 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/marketplace-svc.js.coffee +59 -0
- data/app/assets/javascripts/mno_enterprise/application.js +17 -0
- data/app/assets/javascripts/mno_enterprise/application_lib.js +14 -0
- data/app/assets/javascripts/mno_enterprise/lib/angular-really-click.js +17 -0
- data/app/assets/javascripts/mno_enterprise/lib/sortable.js +315 -0
- data/app/assets/javascripts/mno_enterprise/lib/ui-bootstrap-tpls-0.13.4.js +5836 -0
- data/app/assets/javascripts/mno_enterprise/lib/xeditable.js +1588 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap.js +12 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/affix.js +162 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/alert.js +94 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/button.js +116 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/carousel.js +237 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/collapse.js +211 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/dropdown.js +161 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/modal.js +324 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/popover.js +113 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/scrollspy.js +175 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/tab.js +153 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/tooltip.js +472 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/transition.js +59 -0
- data/app/assets/javascripts/ng-performance/ngPerformance.html +109 -0
- data/app/assets/javascripts/ng-performance/ngPerformance.js +211 -0
- data/app/assets/stylesheets/mno_enterprise/application.css +13 -0
- data/app/assets/stylesheets/mno_enterprise/custom/accordion.less +90 -0
- data/app/assets/stylesheets/mno_enterprise/custom/alert.less +30 -0
- data/app/assets/stylesheets/mno_enterprise/custom/angular-animate.less +42 -0
- data/app/assets/stylesheets/mno_enterprise/custom/angular-material.less +56 -0
- data/app/assets/stylesheets/mno_enterprise/custom/bootstrap-on-juice.less +22 -0
- data/app/assets/stylesheets/mno_enterprise/custom/button.less +84 -0
- data/app/assets/stylesheets/mno_enterprise/custom/footer.less +44 -0
- data/app/assets/stylesheets/mno_enterprise/custom/form.less +191 -0
- data/app/assets/stylesheets/mno_enterprise/custom/header.less +281 -0
- data/app/assets/stylesheets/mno_enterprise/custom/impac-variables-override.less +65 -0
- data/app/assets/stylesheets/mno_enterprise/custom/modal.less +183 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utilities.less +729 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/app-presentation.less +77 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/banners.less +145 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/carousel.less +68 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/helptext.less +40 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/miscellaneous.less +134 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/progress-bar.less +55 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/step.less +101 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/tabset.less +87 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/testimonial.less +118 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/text.less +23 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/apps.less +243 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/myspace.less +477 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/pages/confirmation_lounge.less +31 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/pages/home.less +57 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/pages/oauth-config-page.less +6 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/registration.less +84 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/star.less +18 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/bootstrap-wizard.less +63 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/dashboard-marketplace.less +187 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/dashboard-organization.less +149 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/dashboard-teams.less +119 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/support.less +42 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/tickets.less +80 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/mno-editable.less +60 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/notification-widget.less +49 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/password-strength.less +28 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/shopping-cart.less +333 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/star-wizard.less +49 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/user-setup.less +10 -0
- data/app/assets/stylesheets/mno_enterprise/custom/xeditable.less +40 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/font-awesome-regular.less +13 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/font-awesome-sprockets.less +13 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/font-awesome.less +16 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/FontAwesome.otf +0 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.svg +640 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/animated.less +34 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/bordered-pulled.less +25 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/core.less +12 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/extras.less +2 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/fixed-width.less +6 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/icons.less +677 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/larger.less +13 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/list.less +19 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/mixins.less +26 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/rotated-flipped.less +20 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/stacked.less +20 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/variables.less +687 -0
- data/app/assets/stylesheets/mno_enterprise/main.less +132 -0
- data/app/assets/stylesheets/mno_enterprise/mixins.less +75 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/alerts.less +73 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/badges.less +65 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/bootstrap.less +50 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/breadcrumbs.less +26 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/button-groups.less +243 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/buttons.less +160 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/carousel.less +269 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/close.less +34 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/code.less +69 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/component-animations.less +34 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/dropdowns.less +214 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/forms.less +566 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/glyphicons.less +301 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/grid.less +84 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/input-groups.less +166 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/jumbotron.less +50 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/labels.less +64 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/list-group.less +124 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/media.less +61 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins.less +39 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/alerts.less +14 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/background-variant.less +8 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/border-radius.less +18 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/buttons.less +52 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/center-block.less +7 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/clearfix.less +22 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/forms.less +85 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/gradients.less +59 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/grid-framework.less +91 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/grid.less +122 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/hide-text.less +21 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/image.less +33 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/labels.less +12 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/list-group.less +29 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/nav-divider.less +10 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/nav-vertical-align.less +9 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/opacity.less +8 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/pagination.less +23 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/panels.less +24 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/progress-bar.less +10 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/reset-filter.less +8 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/resize.less +6 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/responsive-visibility.less +15 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/size.less +10 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/tab-focus.less +9 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/table-row.less +28 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/text-emphasis.less +8 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/text-overflow.less +8 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/vendor-prefixes.less +227 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/modals.less +148 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/navbar.less +661 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/navs.less +244 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/normalize.less +427 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/pager.less +54 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/pagination.less +88 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/panels.less +265 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/popovers.less +135 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/print.less +107 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/progress-bars.less +87 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/responsive-embed.less +35 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/responsive-utilities.less +194 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/scaffolding.less +150 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/tables.less +234 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/theme.less +273 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/thumbnails.less +36 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/tooltip.less +103 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/type.less +302 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/utilities.less +56 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/variables.less +857 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/wells.less +29 -0
- data/app/assets/stylesheets/mno_enterprise/variables.less +226 -0
- data/app/assets/templates/mno_enterprise/dashboard/account.html +131 -0
- data/app/assets/templates/mno_enterprise/dashboard/app_deletion.html +36 -0
- data/app/assets/templates/mno_enterprise/dashboard/apps_list.html +103 -0
- data/app/assets/templates/mno_enterprise/dashboard/horizontal_menu.html +85 -0
- data/app/assets/templates/mno_enterprise/dashboard/marketplace/index.html +60 -0
- data/app/assets/templates/mno_enterprise/dashboard/marketplace/show.html +133 -0
- data/app/assets/templates/mno_enterprise/dashboard/menu.html +161 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/arrears.html +37 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/billing.html +37 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/credit-card.html +156 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/index.full.html +181 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/index.html +173 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/invoices.html +27 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/members.html +288 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/settings.html +55 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/index.html +175 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/member-add-modal.html +60 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/member-removal-modal.html +35 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/team-add-modal.html +35 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/team-delete-modal.html +35 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/team-list.html +107 -0
- data/app/assets/templates/mno_enterprise/default_template.html +20 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/autostop_app.html +42 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/currency_widget.html +1 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/editable.html +28 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/loading_lounge.html +63 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/modal-messages/congratulations.html +8 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/modal-messages/default.html +1 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/modal-messages/information.html +8 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/notification-widget.html +31 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/password.html +55 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/star_wizard.html +254 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/upload_spreadsheet.html +191 -0
- data/app/assets/templates/mno_enterprise/modals/new-organization-reseller-req.html +35 -0
- data/app/assets/templates/mno_enterprise/modals/new-organization.html +35 -0
- data/app/assets/templates/mno_enterprise/user-setup/index.html +312 -0
- data/app/controllers/mno_enterprise/invoices_controller.rb +22 -0
- data/app/controllers/mno_enterprise/pages_controller.rb +9 -0
- data/app/controllers/mno_enterprise/user_setup_controller.rb +11 -0
- data/app/views/layouts/mno_enterprise/_application_js.html.haml +17 -0
- data/app/views/layouts/mno_enterprise/_common_cdn_lib_js.html.haml +19 -0
- data/app/views/layouts/mno_enterprise/_footer_files.html.haml +5 -0
- data/app/views/layouts/mno_enterprise/_header_files.html.haml +31 -0
- data/app/views/layouts/mno_enterprise/_impersonate_header.html.haml +7 -0
- data/app/views/layouts/mno_enterprise/_public_page_header.html.haml +2 -0
- data/app/views/layouts/mno_enterprise/application.html.haml +18 -0
- data/app/views/layouts/mno_enterprise/application_dashboard.html.haml +22 -0
- data/app/views/layouts/mno_enterprise/third_party/_google_tag_container.html.haml +10 -0
- data/app/views/mno_enterprise/pages/app_access_unauthorized.html.haml +19 -0
- data/app/views/mno_enterprise/pages/app_logout.html.haml +18 -0
- data/app/views/mno_enterprise/pages/billing_details_required.html.haml +19 -0
- data/app/views/mno_enterprise/pages/loading.html.haml +3 -0
- data/app/views/mno_enterprise/pages/myspace.html.haml +6 -0
- data/app/views/mno_enterprise/provision/_provision_apps.html.haml +43 -0
- data/app/views/mno_enterprise/provision/_select_organization.html.haml +17 -0
- data/app/views/mno_enterprise/provision/new.html.haml +4 -0
- data/app/views/mno_enterprise/user_setup/index.html.haml +2 -0
- data/config/initializers/ng-annotate.rb +3 -0
- data/config/initializers/ng-performance.rb +3 -0
- data/config/routes.rb +19 -0
- data/lib/assets/javascripts/impac-angular.js +8719 -0
- data/lib/assets/stylesheets/impac-angular.less +2352 -0
- data/lib/mno-enterprise-frontend.rb +1 -0
- data/lib/mno_enterprise/frontend.rb +13 -0
- data/lib/mno_enterprise/frontend/assets_util.rb +47 -0
- data/lib/mno_enterprise/frontend/concerns/README.md +6 -0
- data/lib/mno_enterprise/frontend/concerns/controllers/pages_controller.rb +25 -0
- data/lib/mno_enterprise/frontend/engine.rb +13 -0
- data/spec/controllers/mno_enterprise/auth/confirmations_controller_spec.rb +84 -0
- data/spec/controllers/mno_enterprise/invoices_controller_spec.rb +34 -0
- data/spec/controllers/mno_enterprise/pages_controller_spec.rb +42 -0
- data/spec/controllers/mno_enterprise/user_setup_controller_spec.rb +33 -0
- data/spec/controllers/mno_enterprise/webhook/o_auth_controller_spec.rb +76 -0
- data/spec/rails_helper.rb +92 -0
- data/spec/routing/mno_enterprise/invoices_controller_routing_spec.rb +11 -0
- data/spec/routing/mno_enterprise/pages_controller_routing_spec.rb +18 -0
- data/spec/routing/mno_enterprise/user_setup_controller_routing_spec.rb +11 -0
- data/spec/spec_helper.rb +78 -0
- metadata +464 -0
@@ -0,0 +1,70 @@
|
|
1
|
+
module = angular.module('maestrano.dashboard.dashboard-organization-arrears',['maestrano.assets'])
|
2
|
+
|
3
|
+
#============================================
|
4
|
+
# Arrears Directive
|
5
|
+
#============================================
|
6
|
+
module.controller('DashboardOrganizationArrearsCtrl',[
|
7
|
+
'$scope','$window','DhbOrganizationSvc', 'Utilities','AssetPath'
|
8
|
+
($scope, $window, DhbOrganizationSvc, Utilities,AssetPath) ->
|
9
|
+
#====================================
|
10
|
+
# Pre-Initialization
|
11
|
+
#====================================
|
12
|
+
$scope.assetPath = AssetPath
|
13
|
+
$scope.isLoading = true
|
14
|
+
$scope.paymentFailedBox = paymentFailedBox = {}
|
15
|
+
$scope.situations = {}
|
16
|
+
|
17
|
+
DhbOrganizationSvc.load().then (organization)->
|
18
|
+
$scope.situations = organization.arrears_situations
|
19
|
+
$scope.isLoading = false
|
20
|
+
|
21
|
+
#==============================
|
22
|
+
# Payment failed/retry section
|
23
|
+
#==============================
|
24
|
+
paymentFailedBox.errors = []
|
25
|
+
paymentFailedBox.inProgress = false
|
26
|
+
|
27
|
+
paymentFailedBox.getSituation = () ->
|
28
|
+
_.find($scope.situations,
|
29
|
+
(situation) -> situation.category == 'payment_failed'
|
30
|
+
)
|
31
|
+
|
32
|
+
paymentFailedBox.show = ->
|
33
|
+
this.getSituation()?
|
34
|
+
|
35
|
+
paymentFailedBox.retryPayment = () ->
|
36
|
+
self = this
|
37
|
+
self.inProgress = true
|
38
|
+
DhbOrganizationSvc.charge().then (response) ->
|
39
|
+
success = response.status == 'success'
|
40
|
+
payment = response.data
|
41
|
+
if (payment)
|
42
|
+
if (success)
|
43
|
+
self.resolve()
|
44
|
+
else if (payment.full_return_message)
|
45
|
+
self.errors = Utilities.processRailsError(payment.full_return_message)
|
46
|
+
else
|
47
|
+
self.errors = Utilities.processRailsError("bug")
|
48
|
+
else
|
49
|
+
self.errors = Utilities.processRailsError("bug")
|
50
|
+
self.inProgress = false
|
51
|
+
|
52
|
+
paymentFailedBox.resolve = () ->
|
53
|
+
self = this
|
54
|
+
# Remove ArrearsSituation
|
55
|
+
index = $scope.situations.indexOf(self.getSituation())
|
56
|
+
$scope.situations.splice(index,1)
|
57
|
+
# Return success
|
58
|
+
self.success = "Thank you! The payment has been performed successfully!"
|
59
|
+
|
60
|
+
])
|
61
|
+
|
62
|
+
module.directive('dashboardOrganizationArrears', ['TemplatePath', (TemplatePath) ->
|
63
|
+
return {
|
64
|
+
restrict: 'A',
|
65
|
+
scope: {
|
66
|
+
},
|
67
|
+
templateUrl: TemplatePath['mno_enterprise/dashboard/organization/arrears.html'],
|
68
|
+
controller: 'DashboardOrganizationArrearsCtrl'
|
69
|
+
}
|
70
|
+
])
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module = angular.module('maestrano.dashboard.dashboard-organization-billing',['maestrano.assets'])
|
2
|
+
|
3
|
+
#============================================
|
4
|
+
# Current Billing Directive
|
5
|
+
#============================================
|
6
|
+
module.controller('DashboardOrganizationBillingCtrl',[
|
7
|
+
'$scope','$window','DhbOrganizationSvc', 'Utilities','AssetPath','Miscellaneous'
|
8
|
+
($scope, $window, DhbOrganizationSvc, Utilities,AssetPath,Miscellaneous) ->
|
9
|
+
#====================================
|
10
|
+
# Pre-Initialization
|
11
|
+
#====================================
|
12
|
+
$scope.assetPath = AssetPath
|
13
|
+
$scope.isLoading = true
|
14
|
+
$scope.billing = {}
|
15
|
+
|
16
|
+
#====================================
|
17
|
+
# Scope Management
|
18
|
+
#====================================
|
19
|
+
# Initialize the data used by the directive
|
20
|
+
$scope.initialize = (billing) ->
|
21
|
+
angular.copy(billing,$scope.billing)
|
22
|
+
$scope.isLoading = false
|
23
|
+
|
24
|
+
$scope.isCreditShown = () ->
|
25
|
+
b = $scope.billing
|
26
|
+
b &&
|
27
|
+
b.credit &&
|
28
|
+
b.credit.value > 0
|
29
|
+
|
30
|
+
#====================================
|
31
|
+
# Post-Initialization
|
32
|
+
#====================================
|
33
|
+
$scope.$watch DhbOrganizationSvc.getId, (val) ->
|
34
|
+
$scope.isLoading = true
|
35
|
+
if val?
|
36
|
+
DhbOrganizationSvc.load().then (organization)->
|
37
|
+
$scope.initialize(organization.billing)
|
38
|
+
])
|
39
|
+
|
40
|
+
module.directive('dashboardOrganizationBilling', ['TemplatePath', (TemplatePath) ->
|
41
|
+
return {
|
42
|
+
restrict: 'A',
|
43
|
+
scope: {
|
44
|
+
},
|
45
|
+
templateUrl: TemplatePath['mno_enterprise/dashboard/organization/billing.html'],
|
46
|
+
controller: 'DashboardOrganizationBillingCtrl'
|
47
|
+
}
|
48
|
+
])
|
@@ -0,0 +1,142 @@
|
|
1
|
+
module = angular.module('maestrano.dashboard.dashboard-organization-credit-card',['maestrano.assets'])
|
2
|
+
|
3
|
+
#============================================
|
4
|
+
#
|
5
|
+
#============================================
|
6
|
+
module.controller('DashboardOrganizationCreditCardCtrl',[
|
7
|
+
'$scope','$window','DhbOrganizationSvc', 'Miscellaneous', 'Utilities','AssetPath'
|
8
|
+
($scope, $window, DhbOrganizationSvc, Miscellaneous, Utilities,AssetPath) ->
|
9
|
+
|
10
|
+
#====================================
|
11
|
+
# Pre-Initialization
|
12
|
+
#====================================
|
13
|
+
$scope.assetPath = AssetPath
|
14
|
+
$scope.isLoading = true
|
15
|
+
$scope.forms = {}
|
16
|
+
$scope.model = {}
|
17
|
+
$scope.origModel = {}
|
18
|
+
$scope.config = {
|
19
|
+
validTitles: ['Mr.', 'Ms.', 'Mrs.', 'Miss', 'Dr.', 'Sir.', 'Prof.']
|
20
|
+
validMonths: [1..12]
|
21
|
+
validYears: [d = (new Date).getFullYear()..d+20]
|
22
|
+
validCountries: Miscellaneous.countries
|
23
|
+
}
|
24
|
+
|
25
|
+
#====================================
|
26
|
+
# Scope Management
|
27
|
+
#====================================
|
28
|
+
# Initialize the data used by the directive
|
29
|
+
$scope.initialize = (creditCard) ->
|
30
|
+
angular.copy(creditCard,$scope.model)
|
31
|
+
angular.copy(creditCard,$scope.origModel)
|
32
|
+
$scope.isLoading = false
|
33
|
+
|
34
|
+
# Save the current state of the credit card
|
35
|
+
$scope.save = ->
|
36
|
+
$scope.isLoading = true
|
37
|
+
DhbOrganizationSvc.billing.update($scope.model).then(
|
38
|
+
(creditCard) ->
|
39
|
+
$scope.errors = ''
|
40
|
+
angular.copy(creditCard,$scope.model)
|
41
|
+
angular.copy(creditCard,$scope.origModel)
|
42
|
+
if $scope.callback
|
43
|
+
$scope.callback()
|
44
|
+
, (errors) ->
|
45
|
+
$scope.errors = Utilities.processRailsError(errors)
|
46
|
+
).finally(-> $scope.isLoading = false)
|
47
|
+
|
48
|
+
# Cancel the temporary changes made by the
|
49
|
+
# user
|
50
|
+
$scope.cancel = ->
|
51
|
+
angular.copy($scope.origModel,$scope.model)
|
52
|
+
$scope.errors = ''
|
53
|
+
|
54
|
+
# Check if the user has started editing the
|
55
|
+
# CreditCard
|
56
|
+
$scope.isChanged = ->
|
57
|
+
!angular.equals($scope.model,$scope.origModel)
|
58
|
+
|
59
|
+
# Check whether we should display the cancel
|
60
|
+
# button or not
|
61
|
+
$scope.isCancelShown = ->
|
62
|
+
$scope.isChanged()
|
63
|
+
|
64
|
+
# Should we enable the save button
|
65
|
+
$scope.isSaveEnabled = ->
|
66
|
+
f = $scope.forms
|
67
|
+
$scope.isChanged() && f.billingAddress.$valid && f.creditCard.$valid
|
68
|
+
|
69
|
+
# Enable/Disable the credit card icons
|
70
|
+
$scope.classForIconType = (ccType) ->
|
71
|
+
self = $scope
|
72
|
+
cType = self.getType()
|
73
|
+
if ccType == self.getType() || cType == ""
|
74
|
+
return "enabled"
|
75
|
+
else
|
76
|
+
return "disabled"
|
77
|
+
|
78
|
+
# Return the credit card type (visa/mastercard/amex/jcb)
|
79
|
+
$scope.getType = () ->
|
80
|
+
self = $scope
|
81
|
+
number = self.model.number
|
82
|
+
if number != null && number != undefined
|
83
|
+
re = new RegExp("^X");
|
84
|
+
if (number.match(re) != null) then return ""
|
85
|
+
|
86
|
+
re = new RegExp("^4");
|
87
|
+
if (number.match(re) != null) then return "visa"
|
88
|
+
|
89
|
+
re = new RegExp("^(34|37)");
|
90
|
+
if (number.match(re) != null) then return "amex"
|
91
|
+
|
92
|
+
re = new RegExp("^5[1-5]");
|
93
|
+
if (number.match(re) != null) then return "mastercard"
|
94
|
+
|
95
|
+
re = new RegExp("^6(?:011|5[0-9]{2})");
|
96
|
+
if (number.match(re) != null) then return "discover"
|
97
|
+
|
98
|
+
re = new RegExp("(?:2131|1800|35[0-9]{3})")
|
99
|
+
if (number.match(re) != null) then return "jcb"
|
100
|
+
|
101
|
+
re = new RegExp("^3(?:0[0-5]|[68][0-9])")
|
102
|
+
if (number.match(re) != null) then return "dinersclub"
|
103
|
+
|
104
|
+
# Last resort we assume that it is a Mastercard if
|
105
|
+
# the number is long enough
|
106
|
+
# See:
|
107
|
+
#http://stackoverflow.com/questions/72768/how-do-you-detect-credit-card-type-based-on-number
|
108
|
+
if number.length > 4
|
109
|
+
return "mastercard"
|
110
|
+
else
|
111
|
+
return ""
|
112
|
+
|
113
|
+
return ""
|
114
|
+
|
115
|
+
# Open the godaddy site seal in a popup
|
116
|
+
$scope.openGodaddySslSeal = () ->
|
117
|
+
bgHeight = "779"
|
118
|
+
bgWidth = "593"
|
119
|
+
url = "https://seal.godaddy.com/verifySeal?sealID=RsNWG4eDd3ctNJWJfbeSBjJ6OWCtE3j0OwSXRDYF1WlMAGMqqmX5Kp"
|
120
|
+
options = "menubar=no,toolbar=no,personalbar=no,location=yes,status=no,resizable=yes,fullscreen=no,scrollbars=no,width=#{bgWidth},height=#{bgHeight}"
|
121
|
+
$window.open(url,'SealVerfication',options)
|
122
|
+
|
123
|
+
#====================================
|
124
|
+
# Post-Initialization
|
125
|
+
#====================================
|
126
|
+
$scope.$watch DhbOrganizationSvc.getId, (val) ->
|
127
|
+
$scope.isLoading = true
|
128
|
+
if val?
|
129
|
+
DhbOrganizationSvc.load().then (organization)->
|
130
|
+
$scope.initialize(organization.credit_card)
|
131
|
+
])
|
132
|
+
|
133
|
+
module.directive('dashboardOrganizationCreditCard', ['TemplatePath', (TemplatePath) ->
|
134
|
+
return {
|
135
|
+
restrict: 'A',
|
136
|
+
scope: {
|
137
|
+
callback:'&'
|
138
|
+
},
|
139
|
+
templateUrl: TemplatePath['mno_enterprise/dashboard/organization/credit-card.html'],
|
140
|
+
controller: 'DashboardOrganizationCreditCardCtrl'
|
141
|
+
}
|
142
|
+
])
|
data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/index.js.coffee
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
module = angular.module('maestrano.dashboard.dashboard-organization-index',['maestrano.assets'])
|
2
|
+
|
3
|
+
#============================================
|
4
|
+
#
|
5
|
+
#============================================
|
6
|
+
module.controller('DashboardOrganizationIndexCtrl',[
|
7
|
+
'$scope', 'DhbOrganizationSvc', 'AssetPath'
|
8
|
+
($scope, DhbOrganizationSvc, AssetPath) ->
|
9
|
+
|
10
|
+
#====================================
|
11
|
+
# Pre-Initialization
|
12
|
+
#====================================
|
13
|
+
$scope.assetPath = AssetPath
|
14
|
+
$scope.isLoading = true
|
15
|
+
$scope.tabs = {
|
16
|
+
billing: false,
|
17
|
+
members: false,
|
18
|
+
teams: false,
|
19
|
+
settings: false
|
20
|
+
}
|
21
|
+
|
22
|
+
#====================================
|
23
|
+
# Scope Management
|
24
|
+
#====================================
|
25
|
+
$scope.initialize = ->
|
26
|
+
$scope.isLoading = false
|
27
|
+
if $scope.isBillingShown()
|
28
|
+
$scope.tabs.billing = true
|
29
|
+
else
|
30
|
+
$scope.tabs.members = true
|
31
|
+
|
32
|
+
$scope.isTabSetShown = ->
|
33
|
+
!$scope.isLoading && (
|
34
|
+
DhbOrganizationSvc.user.isSuperAdmin() || DhbOrganizationSvc.user.isAdmin())
|
35
|
+
|
36
|
+
$scope.isBillingShown = ->
|
37
|
+
DhbOrganizationSvc.user.isSuperAdmin()
|
38
|
+
|
39
|
+
$scope.isSettingsShown = ->
|
40
|
+
DhbOrganizationSvc.user.isSuperAdmin()
|
41
|
+
|
42
|
+
#====================================
|
43
|
+
# Post-Initialization
|
44
|
+
#====================================
|
45
|
+
$scope.$watch DhbOrganizationSvc.getId, (val) ->
|
46
|
+
$scope.isLoading = true
|
47
|
+
if val?
|
48
|
+
DhbOrganizationSvc.load().then (organization)->
|
49
|
+
$scope.initialize()
|
50
|
+
|
51
|
+
])
|
52
|
+
|
53
|
+
module.directive('dashboardOrganizationIndex', ['TemplatePath', (TemplatePath) ->
|
54
|
+
return {
|
55
|
+
restrict: 'A',
|
56
|
+
scope: {
|
57
|
+
},
|
58
|
+
templateUrl: TemplatePath['mno_enterprise/dashboard/organization/index.html'],
|
59
|
+
controller: 'DashboardOrganizationIndexCtrl'
|
60
|
+
}
|
61
|
+
])
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module = angular.module('maestrano.dashboard.dashboard-organization-invoices',['maestrano.assets'])
|
2
|
+
|
3
|
+
#============================================
|
4
|
+
#
|
5
|
+
#============================================
|
6
|
+
module.controller('DashboardOrganizationInvoicesCtrl',[
|
7
|
+
'$scope','$window','DhbOrganizationSvc', 'Utilities','AssetPath', 'Miscellaneous',
|
8
|
+
($scope, $window, DhbOrganizationSvc, Utilities, AssetPath, Miscellaneous) ->
|
9
|
+
#====================================
|
10
|
+
# Pre-Initialization
|
11
|
+
#====================================
|
12
|
+
$scope.assetPath = AssetPath
|
13
|
+
$scope.isLoading = true
|
14
|
+
$scope.invoices = []
|
15
|
+
|
16
|
+
#====================================
|
17
|
+
# Scope Management
|
18
|
+
#====================================
|
19
|
+
# Initialize the data used by the directive
|
20
|
+
$scope.initialize = (invoices) ->
|
21
|
+
angular.copy(invoices,$scope.invoices)
|
22
|
+
$scope.isLoading = false
|
23
|
+
|
24
|
+
#====================================
|
25
|
+
# Post-Initialization
|
26
|
+
#====================================
|
27
|
+
$scope.$watch DhbOrganizationSvc.getId, (val) ->
|
28
|
+
$scope.isLoading = true
|
29
|
+
if val?
|
30
|
+
DhbOrganizationSvc.load().then (organization)->
|
31
|
+
$scope.initialize(organization.invoices)
|
32
|
+
])
|
33
|
+
|
34
|
+
module.directive('dashboardOrganizationInvoices', ['TemplatePath', (TemplatePath) ->
|
35
|
+
return {
|
36
|
+
restrict: 'A',
|
37
|
+
scope: {
|
38
|
+
},
|
39
|
+
templateUrl: TemplatePath['mno_enterprise/dashboard/organization/invoices.html'],
|
40
|
+
controller: 'DashboardOrganizationInvoicesCtrl'
|
41
|
+
}
|
42
|
+
])
|
@@ -0,0 +1,280 @@
|
|
1
|
+
module = angular.module('maestrano.dashboard.dashboard-organization-members',['maestrano.assets'])
|
2
|
+
|
3
|
+
#============================================
|
4
|
+
#
|
5
|
+
#============================================
|
6
|
+
module.controller('DashboardOrganizationMembersCtrl',[
|
7
|
+
'$scope','$window','DhbOrganizationSvc','DhbTeamSvc', 'Utilities','AssetPath','$modal', '$q',
|
8
|
+
($scope, $window, DhbOrganizationSvc, DhbTeamSvc, Utilities, AssetPath,$modal, $q) ->
|
9
|
+
#====================================
|
10
|
+
# Pre-Initialization
|
11
|
+
#====================================
|
12
|
+
$scope.assetPath = AssetPath
|
13
|
+
$scope.isLoading = true
|
14
|
+
$scope.members = []
|
15
|
+
$scope.teams = []
|
16
|
+
|
17
|
+
#====================================
|
18
|
+
# Scope Management
|
19
|
+
#====================================
|
20
|
+
# Initialize the data used by the directive
|
21
|
+
$scope.initialize = (members, teams = nil) ->
|
22
|
+
angular.copy(members,$scope.members)
|
23
|
+
angular.copy(teams,$scope.teams) if teams
|
24
|
+
$scope.isLoading = false
|
25
|
+
|
26
|
+
$scope.editMember = (member) ->
|
27
|
+
$scope.editionModal.open(member)
|
28
|
+
|
29
|
+
$scope.removeMember = (member) ->
|
30
|
+
$scope.deletionModal.open(member)
|
31
|
+
|
32
|
+
$scope.inviteMembers = ->
|
33
|
+
$scope.inviteModal.open()
|
34
|
+
|
35
|
+
$scope.isInviteShown = ->
|
36
|
+
DhbOrganizationSvc.can.create.member()
|
37
|
+
|
38
|
+
$scope.isEditShown = (member) ->
|
39
|
+
DhbOrganizationSvc.can.update.member(member)
|
40
|
+
|
41
|
+
$scope.isRemoveShown = (member) ->
|
42
|
+
DhbOrganizationSvc.can.destroy.member(member)
|
43
|
+
|
44
|
+
$scope.memberRoleLabel = (member) ->
|
45
|
+
if member.entity == 'User'
|
46
|
+
return member.role
|
47
|
+
else
|
48
|
+
return "Invited (#{member.role})"
|
49
|
+
|
50
|
+
#====================================
|
51
|
+
# User Edition Modal
|
52
|
+
#====================================
|
53
|
+
$scope.editionModal = editionModal = {}
|
54
|
+
editionModal.config = {
|
55
|
+
instance: {
|
56
|
+
backdrop: 'static'
|
57
|
+
templateUrl: 'dashboard/organization/members/edition-modal.html'
|
58
|
+
size: 'lg'
|
59
|
+
windowClass: 'inverse member-edit'
|
60
|
+
scope: $scope
|
61
|
+
}
|
62
|
+
roles: ['Member','Power User','Admin','Super Admin']
|
63
|
+
}
|
64
|
+
|
65
|
+
editionModal.open = (member) ->
|
66
|
+
self = editionModal
|
67
|
+
self.member = member
|
68
|
+
self.selectedRole = member.role
|
69
|
+
self.$instance = $modal.open(self.config.instance)
|
70
|
+
self.isLoading = false
|
71
|
+
editionModal.member = member
|
72
|
+
|
73
|
+
editionModal.title = ->
|
74
|
+
m = editionModal.member
|
75
|
+
if m.entity == 'User'
|
76
|
+
return "Edit Member: #{m.name} #{m.surname}"
|
77
|
+
else
|
78
|
+
return "Edit Member: #{m.email}"
|
79
|
+
|
80
|
+
editionModal.close = ->
|
81
|
+
self = editionModal
|
82
|
+
self.$instance.close()
|
83
|
+
|
84
|
+
editionModal.select = (role) ->
|
85
|
+
editionModal.selectedRole = role
|
86
|
+
|
87
|
+
editionModal.classForRole = (role) ->
|
88
|
+
self = editionModal
|
89
|
+
if role == self.member.role
|
90
|
+
return 'btn-info'
|
91
|
+
else if role == self.selectedRole
|
92
|
+
return 'btn-warning'
|
93
|
+
else
|
94
|
+
return ''
|
95
|
+
|
96
|
+
editionModal.isChangeDisabled = ->
|
97
|
+
editionModal.member.role == editionModal.selectedRole
|
98
|
+
|
99
|
+
editionModal.change = ->
|
100
|
+
self = editionModal
|
101
|
+
self.isLoading = true
|
102
|
+
obj = { email: self.member.email, role: self.selectedRole }
|
103
|
+
DhbOrganizationSvc.members.update(obj).then(
|
104
|
+
(members) ->
|
105
|
+
self.errors = ''
|
106
|
+
angular.copy(members,$scope.members)
|
107
|
+
self.close()
|
108
|
+
, (errors) ->
|
109
|
+
self.errors = Utilities.processRailsError(errors)
|
110
|
+
).finally(-> self.isLoading = false)
|
111
|
+
|
112
|
+
#====================================
|
113
|
+
# User Deletion Modal
|
114
|
+
#====================================
|
115
|
+
$scope.deletionModal = deletionModal = {}
|
116
|
+
deletionModal.config = {
|
117
|
+
instance: {
|
118
|
+
backdrop: 'static'
|
119
|
+
templateUrl: 'dashboard/organization/members/removal-modal.html'
|
120
|
+
size: 'lg'
|
121
|
+
windowClass: 'inverse member-edit'
|
122
|
+
scope: $scope
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
deletionModal.open = (member) ->
|
127
|
+
self = deletionModal
|
128
|
+
self.member = member
|
129
|
+
self.$instance = $modal.open(self.config.instance)
|
130
|
+
self.isLoading = false
|
131
|
+
self.member = member
|
132
|
+
|
133
|
+
deletionModal.close = ->
|
134
|
+
self = deletionModal
|
135
|
+
self.$instance.close()
|
136
|
+
|
137
|
+
deletionModal.confirmationText = ->
|
138
|
+
m = deletionModal.member
|
139
|
+
if m.entity == 'User' && m.name?
|
140
|
+
return "Do you really want to remove <strong>#{m.name} #{m.surname}</strong> from your company?"
|
141
|
+
else
|
142
|
+
return "Do you really want to remove <strong>#{m.email}</strong> from your company?"
|
143
|
+
|
144
|
+
deletionModal.remove = ->
|
145
|
+
self = deletionModal
|
146
|
+
self.isLoading = true
|
147
|
+
obj = { email: self.member.email }
|
148
|
+
DhbOrganizationSvc.members.remove(obj).then(
|
149
|
+
(members) ->
|
150
|
+
self.errors = ''
|
151
|
+
angular.copy(members,$scope.members)
|
152
|
+
self.close()
|
153
|
+
, (errors) ->
|
154
|
+
self.errors = Utilities.processRailsError(errors)
|
155
|
+
).finally(-> self.isLoading = false)
|
156
|
+
|
157
|
+
#====================================
|
158
|
+
# Invite Modal
|
159
|
+
#====================================
|
160
|
+
$scope.inviteModal = inviteModal = {}
|
161
|
+
inviteModal.config = {
|
162
|
+
instance: {
|
163
|
+
backdrop: 'static'
|
164
|
+
templateUrl: 'dashboard/organization/members/invite-modal.html'
|
165
|
+
size: 'lg'
|
166
|
+
windowClass: 'inverse member-edit'
|
167
|
+
scope: $scope
|
168
|
+
}
|
169
|
+
defaultRole: 'Member'
|
170
|
+
roles: ->
|
171
|
+
list = ['Member','Power User','Admin']
|
172
|
+
list.push('Super Admin') if DhbOrganizationSvc.user.isSuperAdmin()
|
173
|
+
return list
|
174
|
+
teams: ->
|
175
|
+
$scope.teams
|
176
|
+
}
|
177
|
+
|
178
|
+
inviteModal.open = () ->
|
179
|
+
self = inviteModal
|
180
|
+
self.$instance = $modal.open(self.config.instance)
|
181
|
+
self.isLoading = false
|
182
|
+
self.members = []
|
183
|
+
self.userEmails = ''
|
184
|
+
self.step = 'enterEmails'
|
185
|
+
self.roleList = self.config.roles()
|
186
|
+
self.teamList = self.config.teams()
|
187
|
+
self.invalidEmails = []
|
188
|
+
|
189
|
+
inviteModal.close = ->
|
190
|
+
self = inviteModal
|
191
|
+
self.$instance.close()
|
192
|
+
|
193
|
+
inviteModal.isTeamListShown = ->
|
194
|
+
inviteModal.teamList.length > 0
|
195
|
+
|
196
|
+
inviteModal.title = ->
|
197
|
+
self = inviteModal
|
198
|
+
if self.step == 'enterEmails'
|
199
|
+
"Enter email addresses"
|
200
|
+
else
|
201
|
+
"Select role for each new member"
|
202
|
+
|
203
|
+
inviteModal.labelForAction = ->
|
204
|
+
if inviteModal.step == 'enterEmails'
|
205
|
+
return "Next"
|
206
|
+
else
|
207
|
+
return "Invite"
|
208
|
+
|
209
|
+
inviteModal.next = ->
|
210
|
+
self = inviteModal
|
211
|
+
if self.step == 'enterEmails'
|
212
|
+
inviteModal.processEmails()
|
213
|
+
|
214
|
+
else
|
215
|
+
inviteModal.inviteMembers()
|
216
|
+
|
217
|
+
inviteModal.isNextEnabled = ->
|
218
|
+
self = inviteModal
|
219
|
+
self.step == 'defineRoles' || (self.step == 'enterEmails' && self.userEmails.length > 0)
|
220
|
+
|
221
|
+
inviteModal.oneValidEmail = ->
|
222
|
+
self = inviteModal
|
223
|
+
res = false
|
224
|
+
_.each self.userEmails.split("\n"), (email) ->
|
225
|
+
|
226
|
+
res = true if email.match(email_regexp)
|
227
|
+
return res
|
228
|
+
|
229
|
+
inviteModal.processEmails = ->
|
230
|
+
self = inviteModal
|
231
|
+
self.isLoading = true
|
232
|
+
self.members = []
|
233
|
+
self.invalidEmails = []
|
234
|
+
|
235
|
+
_.each self.userEmails.split("\n"), (email) ->
|
236
|
+
email_regexp = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i
|
237
|
+
if email.match(email_regexp)
|
238
|
+
self.members.push({email: email, role: self.config.defaultRole })
|
239
|
+
else
|
240
|
+
self.invalidEmails.push(email)
|
241
|
+
|
242
|
+
self.isLoading = false
|
243
|
+
if self.invalidEmails.length == 0
|
244
|
+
self.step = 'defineRoles'
|
245
|
+
|
246
|
+
inviteModal.inviteMembers = ->
|
247
|
+
self = inviteModal
|
248
|
+
self.isLoading = true
|
249
|
+
DhbOrganizationSvc.members.invite(self.members).then(
|
250
|
+
(members) ->
|
251
|
+
self.errors = ''
|
252
|
+
angular.copy(members,$scope.members)
|
253
|
+
self.close()
|
254
|
+
, (errors) ->
|
255
|
+
self.errors = Utilities.processRailsError(errors)
|
256
|
+
).finally(-> self.isLoading = false)
|
257
|
+
|
258
|
+
|
259
|
+
#====================================
|
260
|
+
# Post-Initialization
|
261
|
+
#====================================
|
262
|
+
refresh = ->
|
263
|
+
$q.all([DhbOrganizationSvc.load(),DhbTeamSvc.load()]).then (values)->
|
264
|
+
$scope.initialize(values[0].organization.members,values[1])
|
265
|
+
|
266
|
+
contextObj = ->
|
267
|
+
{ orgId: DhbOrganizationSvc.getId(), teams: DhbTeamSvc.data }
|
268
|
+
|
269
|
+
$scope.$watch contextObj, refresh, true
|
270
|
+
])
|
271
|
+
|
272
|
+
module.directive('dashboardOrganizationMembers', ['TemplatePath', (TemplatePath) ->
|
273
|
+
return {
|
274
|
+
restrict: 'A',
|
275
|
+
scope: {
|
276
|
+
},
|
277
|
+
templateUrl: TemplatePath['mno_enterprise/dashboard/organization/members.html'],
|
278
|
+
controller: 'DashboardOrganizationMembersCtrl'
|
279
|
+
}
|
280
|
+
])
|