\n\n
\n\n
\n
\n
\n
\n\n
\n\n
{{getSelectedProduct().name}}
\n
{{getCurrentValue() | mnoCurrency : getSelectedProduct().currency}}
\n
{{getCurrentValue()}}
\n\n
\n\n
\n
\n\n
");
$templateCache.put("widgets/sales-leads-list.tmpl.html","
\n\n
\n
Widget settings \n\n
\n\n
\n Cancel \n Save \n
\n
\n\n
\n\n
");
$templateCache.put("widgets/sales-list.tmpl.html","
\n\n
\n
Widget settings \n\n
\n\n
\n Cancel \n Save \n
\n
\n\n
\n\n
\n\n
\n See: for this \n ({{widget.content.hist_parameters.from | date : \"d MMM\"}} to {{widget.content.hist_parameters.to | date : \"d MMM\"}})\n
\n\n
\n\n
\n\n
\n
\n\n
");
$templateCache.put("widgets/sales-margin.tmpl.html","
\n\n
\n
Widget settings \n\n
\n
\n\n
\n Cancel \n Save \n
\n
\n\n
\n
\n
\n\n
\n
\n {{ getTotalMargin() | mnoCurrency : getCurrency()}}\n
\n
\n Total sold - Total purchased\n \n {{getTimeSpan()}}\n \n
\n
\n
\n\n
\n
\n
Total sold - Total purchased
\n
\n
\n\n
\n
\n\n
\n");
-$templateCache.put("widgets/sales-number-of-leads.tmpl.html","
\n\n
\n
Widget settings \n\n
\n\n
\n Cancel \n Save \n
\n
\n\n
\n\n
\n
\n Leads for this \n
\n\n
\n
\n
{{carac | titleize}}
\n
\n {{formatNumberOfLeads(carac).variation}} \n {{formatNumberOfLeads(carac).nominal}} \n
\n
\n
\n\n
\n {{widget.content.number_of_leads.total[1]}} leads in total\n
\n
\n\n
\n
\n\n
");
$templateCache.put("widgets/sales-opportunities-funnel.tmpl.html","
\n\n
\n
Widget settings \n\n
\n
\n\n
\n Cancel \n Save \n
\n
\n\n
\n\n
\n\n
\n
\n\n
Your opportunities, sorted by sales stage
\n\n
\n
\n
{{elem.number}}
\n
{{elem.status | titleize}}
\n
\n
\n
\n\n
\n\n
\n Select a sales stage to display a list of the corresponding opportunities\n
\n\n
\n
\n\n
\n\n
\n
\n\n
");
+$templateCache.put("widgets/sales-number-of-leads.tmpl.html","
\n\n
\n
Widget settings \n\n
\n\n
\n Cancel \n Save \n
\n
\n\n
\n\n
\n
\n Leads for this \n
\n\n
\n
\n
{{carac | titleize}}
\n
\n {{formatNumberOfLeads(carac).variation}} \n {{formatNumberOfLeads(carac).nominal}} \n
\n
\n
\n\n
\n {{widget.content.number_of_leads.total[1]}} leads in total\n
\n
\n\n
\n
\n\n
");
$templateCache.put("widgets/sales-performance.tmpl.html","
\n\n
\n
Widget settings \n\n
\n\n
\n Cancel \n Save \n
\n
\n\n
\n\n\n
\n
\n\n
\n\n
\n
{{selectedElement.name | titleize}} \n\n
\n
\n
Total won (last 12 months): {{selectedElement.total_won | mnoCurrency}}
\n
\n \n
\n
\n\n
\n Select an employee or team to display the corresponding opportunities won/lost.\n
\n
\n\n
\n\n
\n
\n\n
");
$templateCache.put("widgets/sales-segmented-turnover.tmpl.html","
\n\n
\n
Widget settings \n\n
\n
\n\n
\n Cancel \n Save \n
\n
\n\n
\n\n
\n
\n\n
\n
\n
{{getMaxRange().percentage.toFixed()}}% of your revenue comes from products sold at an average price between {{getMaxRange().label.split(\'-\')[0] | mnoCurrency : widget.content.currency}} and {{getMaxRange().label.split(\'-\')[1] | mnoCurrency : widget.content.currency}}. \n
{{getAnalysis()}}
\n
\n
\n\n
\n
\n\n
");
$templateCache.put("widgets/sales-summary.tmpl.html","
\n\n
\n
Widget settings \n\n
\n
\n\n
\n Cancel \n Save \n
\n
\n\n
\n\n
\n See: \n for this \n ({{widget.content.hist_parameters.from | date : \'d MMM\'}} to {{widget.content.hist_parameters.to | date : \'d MMM\'}})\n
\n\n
\n\n
\n
No data found for this period Please select another one
\n
\n\n
\n
\n\n
");
-$templateCache.put("widgets/sales-top-opportunities.tmpl.html","
\n\n
\n
Widget settings \n\n
\n\n
\n Cancel \n Save \n
\n
\n\n
\n\n
\n\n
\n Total potential: {{widget.content.total_potential | mnoCurrency : widget.content.currency || \"AUD\"}} - {{widget.content.eligible_opportunities}} eligible opportunities\n
\n\n
\n
\n
{{$index +1 }}
\n
\n {{opp.name | titleize}}\n \n {{getOppDetails(opp)}} \n
\n
\n
\n\n
\n\n
\n
\n \n
");
$templateCache.put("widgets-common/data-not-found.tmpl.html","
\n \n
\n
\n
\n");
+$templateCache.put("widgets/sales-top-opportunities.tmpl.html","
\n\n
\n
Widget settings \n\n
\n\n
\n Cancel \n Save \n
\n
\n\n
\n\n
\n\n
\n Total potential: {{widget.content.total_potential | mnoCurrency : widget.content.currency || \"AUD\"}} - {{widget.content.eligible_opportunities}} eligible opportunities\n
\n\n
\n
\n
{{$index +1 }}
\n
\n {{opp.name | titleize}}\n \n {{getOppDetails(opp)}} \n
\n
\n
\n\n
\n\n
\n
\n \n
");
$templateCache.put("widgets-common/editable-title.tmpl.html","
= 3 && parentWidget.width < 6\">\n
\n {{parentWidget.name | truncate:19:\".\"}}\n
\n\n
\n {{parentWidget.name | truncate:19:\".\"}}\n
\n
\n\n
= 6\">\n
\n {{parentWidget.name | truncate:80:\".\"}}\n
\n\n
\n {{parentWidget.name | truncate:80:\".\"}}\n
\n
\n\n
\n
\n {{parentWidget.name | truncate:13:\".\"}}\n
\n\n
\n {{parentWidget.name | truncate:13:\".\"}}\n
\n
\n\n
= 6\">\n
\n {{parentWidget.name | truncate:60:\".\"}}\n
\n\n
\n {{parentWidget.name | truncate:60:\".\"}}\n
\n
\n\n
\n \n
\n {{parentWidget.name | truncate:25:\".\"}}\n
\n
");
$templateCache.put("widgets-common/top-buttons.tmpl.html","
\n\n");
$templateCache.put("widgets-settings/account.tmpl.html","
{{label}} \n
\n \n
\n");
$templateCache.put("widgets-settings/chart-filters.tmpl.html","
\n");
$templateCache.put("widgets-settings/hist-mode.tmpl.html","
");
$templateCache.put("widgets-settings/limit-entries.tmpl.html","
\n {{ entriesLabel ? \'Top\' : \'Display\' }}\n\n
\n {{ $index!=0 ? \' |\' : \'\' }} \n {{ option }} \n \n\n
\n | \n {{ max }} \n \n\n {{entriesLabel || \'entries\'}}\n
");
-$templateCache.put("widgets-settings/organizations.tmpl.html","
\n
Select Companies \n\n
\n
");
$templateCache.put("widgets-settings/param-selector.tmpl.html","
\n {{selected.label | titleize | truncate : getTruncateValue() : \"...\" : false}} \n \n
\n {{option.label | titleize}}\n
\n
\n ");
+$templateCache.put("widgets-settings/organizations.tmpl.html","
\n
Select Companies \n\n
\n
");
$templateCache.put("widgets-settings/params-checkboxes.tmpl.html","
\n \n \n {{parameter.label}} \n \n
\n");
$templateCache.put("widgets-settings/params-picker.tmpl.html","
{{formattedParam | titleize}} \n
\n
\n The selected criteria will be displayed in this order (drag/drop to modify):\n
\n
\n \n {{$index + 1}} \n {{parameter.label | titleize}}\n \n \n
\n
");
$templateCache.put("widgets-settings/time-range.tmpl.html","
Time range \n
\n
\n
\n Show last {{numberOfPeriods}} {{periodToUnit()}}\n
\n
\n
\n
");
@@ -331,7 +331,7 @@ angular.module('impac.services.assets', []).provider('ImpacAssets', function() {
}).call(this);
(function () {
'use strict';
-angular.module('impac.components.chart', []).directive('impacChart', ["$log", function($log) {
+angular.module('impac.components.chart', []).directive('impacChart', ["$log", "$window", function($log, $window) {
return {
restrict: 'A',
scope: {
@@ -1785,52 +1785,6 @@ angular.module('impac.services.kpis', []).service('ImpacKpisSvc', ["$log", "$htt
}).call(this);
(function () {
'use strict';
-angular.module('impac.services.linking', []).provider('ImpacLinking', function() {
- var _$get, links, provider;
- provider = this;
- links = {
- user: null,
- organizations: null
- };
- provider.linkData = function(configData) {
- return _.forIn(links, function(value, key) {
- var link;
- link = configData[key];
- if (link == null) {
- throw new Error("impac-angular linking.svc: Missing core data (" + key + ") to run impac-angular.");
- }
- if (typeof link !== 'function') {
- throw new TypeError("impac-angular linking.svc: " + key + " should be a Function.");
- }
- return links[key] = link;
- });
- };
- _$get = function($q) {
- var service;
- service = this;
- service.getUserData = function() {
- return links.user().then(function(success) {
- return success;
- }, function(err) {
- return $q.reject(err);
- });
- };
- service.getOrganizations = function() {
- return links.organizations().then(function(success) {
- return success;
- }, function(err) {
- return $q.reject(err);
- });
- };
- return service;
- };
- _$get.$inject = ['$q'];
- provider.$get = _$get;
- return provider;
-});
-}).call(this);
-(function () {
-'use strict';
angular.module('impac.components.kpis-bar', []).directive('kpisBar', ["$templateCache", "ImpacKpisSvc", function($templateCache, ImpacKpisSvc) {
return {
restrict: 'E',
@@ -1882,6 +1836,52 @@ angular.module('impac.components.kpis-bar', []).directive('kpisBar', ["$template
}).call(this);
(function () {
'use strict';
+angular.module('impac.services.linking', []).provider('ImpacLinking', function() {
+ var _$get, links, provider;
+ provider = this;
+ links = {
+ user: null,
+ organizations: null
+ };
+ provider.linkData = function(configData) {
+ return _.forIn(links, function(value, key) {
+ var link;
+ link = configData[key];
+ if (link == null) {
+ throw new Error("impac-angular linking.svc: Missing core data (" + key + ") to run impac-angular.");
+ }
+ if (typeof link !== 'function') {
+ throw new TypeError("impac-angular linking.svc: " + key + " should be a Function.");
+ }
+ return links[key] = link;
+ });
+ };
+ _$get = function($q) {
+ var service;
+ service = this;
+ service.getUserData = function() {
+ return links.user().then(function(success) {
+ return success;
+ }, function(err) {
+ return $q.reject(err);
+ });
+ };
+ service.getOrganizations = function() {
+ return links.organizations().then(function(success) {
+ return success;
+ }, function(err) {
+ return $q.reject(err);
+ });
+ };
+ return service;
+ };
+ _$get.$inject = ['$q'];
+ provider.$get = _$get;
+ return provider;
+});
+}).call(this);
+(function () {
+'use strict';
angular.module('impac.services.main', []).service('ImpacMainSvc', ["$q", "$log", "ImpacLinking", "ImpacRoutes", function($q, $log, ImpacLinking, ImpacRoutes) {
var _self, isConfigurationLoaded, setDefaultCurrentOrganization;
_self = this;
@@ -2577,6 +2577,126 @@ angular.module('impac.services.widgets', []).service('ImpacWidgetsSvc', ["$q", "
'use strict';
var module;
+module = angular.module('impac.components.widgets-common.data-not-found', []);
+
+module.directive('commonDataNotFound', ["$templateCache", "$log", "$http", "ImpacAssets", "ImpacTheming", "ImpacMainSvc", function($templateCache, $log, $http, ImpacAssets, ImpacTheming, ImpacMainSvc) {
+ return {
+ restrict: 'A',
+ scope: {
+ widgetEngine: '=',
+ onDisplayAlerts: '&'
+ },
+ link: function(scope) {
+ var assetPath, baseDir, dir, hasMyobEssentialsOnly;
+ scope.bgImage = '';
+ scope.content = ImpacTheming.get().dataNotFoundConfig;
+ baseDir = ImpacAssets.get('dataNotFound');
+ if (scope.widgetEngine && baseDir.length > 0) {
+ dir = baseDir.split('');
+ dir = dir[dir.length - 1] !== '/' ? dir.concat('/').join('') : dir.join('');
+ assetPath = dir + scope.widgetEngine + '.png';
+ $http.get(assetPath).then(function(success) {
+ return scope.bgImage = assetPath;
+ }, function(error) {
+ return $log.warn("Missing data-not-found image for " + scope.widgetEngine);
+ });
+ }
+ hasMyobEssentialsOnly = ImpacMainSvc.config.currentOrganization.has_myob_essentials_only;
+ return scope.showAlertsTrigger = hasMyobEssentialsOnly && scope.widgetEngine.match(/.*accounts\/.*/);
+ },
+ template: $templateCache.get('widgets-common/data-not-found.tmpl.html')
+ };
+}]);
+}).call(this);
+(function () {
+'use strict';
+var module;
+
+module = angular.module('impac.components.widgets-common.editable-title', []);
+
+module.controller('CommonEditableTitleCtrl', ["$scope", "ImpacWidgetsSvc", function($scope, ImpacWidgetsSvc) {
+ var w;
+ w = $scope.parentWidget;
+ return $scope.updateName = function() {
+ var data;
+ if (w.name.length === 0) {
+ w.name = w.originalName;
+ return "Incorrect name";
+ } else {
+ data = {
+ name: w.name
+ };
+ return ImpacWidgetsSvc.update(w, data).then(function(success) {
+ return true;
+ }, function(error) {
+ return w.name = w.originalName;
+ });
+ }
+ };
+}]);
+
+module.directive('commonEditableTitle', ["$templateCache", function($templateCache) {
+ return {
+ restrict: 'A',
+ scope: {
+ parentWidget: '='
+ },
+ template: $templateCache.get('widgets-common/editable-title.tmpl.html'),
+ controller: 'CommonEditableTitleCtrl'
+ };
+}]);
+}).call(this);
+(function () {
+'use strict';
+var module;
+
+module = angular.module('impac.components.widgets-common.top-buttons', []);
+
+module.controller('CommonTopButtonsCtrl', ["$scope", "$rootScope", "$log", "ImpacWidgetsSvc", "ImpacAssets", "ImpacUtilities", function($scope, $rootScope, $log, ImpacWidgetsSvc, ImpacAssets, ImpacUtilities) {
+ var w;
+ w = $scope.parentWidget;
+ $scope.showCloseActive = false;
+ $scope.showConfirmDelete = false;
+ $scope.isDeletePopoverLoading = false;
+ w.isEditMode = false;
+ $scope.deleteWidget = function() {
+ $scope.isDeletePopoverLoading = true;
+ return ImpacWidgetsSvc["delete"](w).then(function(success) {
+ return true;
+ }, function(errors) {
+ return w.errors = ImpacUtilities.processRailsError(errors);
+ })["finally"](function() {
+ return $scope.isDeletePopoverLoading = false;
+ });
+ };
+ return $scope.toggleEditMode = function() {
+ if (!w.isLoading) {
+ if (w.isEditMode) {
+ w.isEditMode = false;
+ return ImpacWidgetsSvc.initWidgetSettings(w);
+ } else {
+ return w.isEditMode = true;
+ }
+ }
+ };
+}]);
+
+module.directive('commonTopButtons', ["$templateCache", function($templateCache) {
+ return {
+ restrict: 'A',
+ scope: {
+ parentWidget: '=',
+ onRefresh: '='
+ },
+ template: $templateCache.get('widgets-common/top-buttons.tmpl.html'),
+ controller: 'CommonTopButtonsCtrl'
+ };
+}]);
+}).call(this);
+(function () {
+'use strict';
+var module;
+
module = angular.module('impac.components.widgets.accounts-accounting-values', []);
module.controller('WidgetAccountsAccountingValuesCtrl', ["$scope", "$q", "ChartFormatterSvc", function($scope, $q, ChartFormatterSvc) {
@@ -2890,39 +3010,129 @@ module.controller('WidgetAccountsBalanceCtrl', ["$scope", "$q", "ChartFormatterS
return w.selectedAccount.currency;
}
};
- $scope.displayAccount = function() {
- $scope.updateSettings(false);
- return w.format();
+ $scope.displayAccount = function() {
+ $scope.updateSettings(false);
+ return w.format();
+ };
+ $scope.drawTrigger = $q.defer();
+ w.format = function() {
+ var all_values_are_positive, chartData, data, inputData, options;
+ if ($scope.isDataFound && (w.selectedAccount != null)) {
+ data = angular.copy(w.selectedAccount);
+ inputData = {
+ title: data.name,
+ labels: w.content.dates,
+ values: data.balances
+ };
+ all_values_are_positive = true;
+ angular.forEach(data.balances, function(value) {
+ return all_values_are_positive && (all_values_are_positive = value >= 0);
+ });
+ options = {
+ scaleBeginAtZero: all_values_are_positive,
+ showXLabels: false
+ };
+ chartData = ChartFormatterSvc.lineChart([inputData], options);
+ return $scope.drawTrigger.notify(chartData);
+ }
+ };
+ return $scope.widgetDeferred.resolve(settingsPromises);
+}]);
+
+module.directive('widgetAccountsBalance', function() {
+ return {
+ restrict: 'A',
+ controller: 'WidgetAccountsBalanceCtrl'
+ };
+});
+}).call(this);
+(function () {
+'use strict';
+var module;
+
+module = angular.module('impac.components.widgets.accounts-balance-sheet', []);
+
+module.controller('WidgetAccountsBalanceSheetCtrl', ["$scope", "$q", "ImpacWidgetsSvc", function($scope, $q, ImpacWidgetsSvc) {
+ var settingsPromises, unCollapsedSetting, w;
+ w = $scope.widget;
+ $scope.orgDeferred = $q.defer();
+ $scope.paramSelectorFrontDeferred = $q.defer();
+ $scope.paramSelectorBackDeferred = $q.defer();
+ settingsPromises = [$scope.orgDeferred.promise, $scope.paramSelectorFrontDeferred.promise, $scope.paramSelectorBackDeferred.promise];
+ $scope.periodOptions = [
+ {
+ label: "Year",
+ value: "YEARLY"
+ }, {
+ label: "Quarter",
+ value: "QUARTERLY"
+ }, {
+ label: "Month",
+ value: "MONTHLY"
+ }, {
+ label: "Week",
+ value: "WEEKLY"
+ }, {
+ label: "Day",
+ value: "DAILY"
+ }
+ ];
+ $scope.period = angular.copy($scope.periodOptions[2]);
+ w.initContext = function() {
+ if ((w.content != null) && (w.content.period != null) && _.contains(_.pluck($scope.periodOptions, 'value'), w.content.period)) {
+ $scope.period = angular.copy(_.find($scope.periodOptions, (function(o) {
+ return o.value === w.content.period;
+ })));
+ }
+ if ($scope.isDataFound = angular.isDefined(w.content) && !_.isEmpty(w.content.summary) && !_.isEmpty(w.content.dates)) {
+ $scope.dates = w.content.dates;
+ $scope.unCollapsed = w.metadata.unCollapsed || [];
+ return $scope.categories = Object.keys(w.content.summary);
+ }
+ };
+ $scope.toggleCollapsed = function(categoryName) {
+ if (categoryName != null) {
+ if (_.find($scope.unCollapsed, (function(name) {
+ return categoryName === name;
+ }))) {
+ $scope.unCollapsed = _.reject($scope.unCollapsed, function(name) {
+ return name === categoryName;
+ });
+ } else {
+ $scope.unCollapsed.push(categoryName);
+ }
+ return ImpacWidgetsSvc.updateWidgetSettings(w, false);
+ }
+ };
+ $scope.isCollapsed = function(categoryName) {
+ if (categoryName != null) {
+ if (_.find($scope.unCollapsed, (function(name) {
+ return categoryName === name;
+ }))) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ };
+ unCollapsedSetting = {};
+ unCollapsedSetting.initialized = false;
+ unCollapsedSetting.initialize = function() {
+ return unCollapsedSetting.initialized = true;
};
- $scope.drawTrigger = $q.defer();
- w.format = function() {
- var all_values_are_positive, chartData, data, inputData, options;
- if ($scope.isDataFound && (w.selectedAccount != null)) {
- data = angular.copy(w.selectedAccount);
- inputData = {
- title: data.name,
- labels: w.content.dates,
- values: data.balances
- };
- all_values_are_positive = true;
- angular.forEach(data.balances, function(value) {
- return all_values_are_positive && (all_values_are_positive = value >= 0);
- });
- options = {
- scaleBeginAtZero: all_values_are_positive,
- showXLabels: false
- };
- chartData = ChartFormatterSvc.lineChart([inputData], options);
- return $scope.drawTrigger.notify(chartData);
- }
+ unCollapsedSetting.toMetadata = function() {
+ return {
+ unCollapsed: $scope.unCollapsed
+ };
};
+ w.settings.push(unCollapsedSetting);
return $scope.widgetDeferred.resolve(settingsPromises);
}]);
-module.directive('widgetAccountsBalance', function() {
+module.directive('widgetAccountsBalanceSheet', function() {
return {
restrict: 'A',
- controller: 'WidgetAccountsBalanceCtrl'
+ controller: 'WidgetAccountsBalanceSheetCtrl'
};
});
}).call(this);
@@ -3128,96 +3338,6 @@ module.directive('widgetAccountsCashSummary', function() {
'use strict';
var module;
-module = angular.module('impac.components.widgets.accounts-balance-sheet', []);
-
-module.controller('WidgetAccountsBalanceSheetCtrl', ["$scope", "$q", "ImpacWidgetsSvc", function($scope, $q, ImpacWidgetsSvc) {
- var settingsPromises, unCollapsedSetting, w;
- w = $scope.widget;
- $scope.orgDeferred = $q.defer();
- $scope.paramSelectorFrontDeferred = $q.defer();
- $scope.paramSelectorBackDeferred = $q.defer();
- settingsPromises = [$scope.orgDeferred.promise, $scope.paramSelectorFrontDeferred.promise, $scope.paramSelectorBackDeferred.promise];
- $scope.periodOptions = [
- {
- label: "Year",
- value: "YEARLY"
- }, {
- label: "Quarter",
- value: "QUARTERLY"
- }, {
- label: "Month",
- value: "MONTHLY"
- }, {
- label: "Week",
- value: "WEEKLY"
- }, {
- label: "Day",
- value: "DAILY"
- }
- ];
- $scope.period = angular.copy($scope.periodOptions[2]);
- w.initContext = function() {
- if ((w.content != null) && (w.content.period != null) && _.contains(_.pluck($scope.periodOptions, 'value'), w.content.period)) {
- $scope.period = angular.copy(_.find($scope.periodOptions, (function(o) {
- return o.value === w.content.period;
- })));
- }
- if ($scope.isDataFound = angular.isDefined(w.content) && !_.isEmpty(w.content.summary) && !_.isEmpty(w.content.dates)) {
- $scope.dates = w.content.dates;
- $scope.unCollapsed = w.metadata.unCollapsed || [];
- return $scope.categories = Object.keys(w.content.summary);
- }
- };
- $scope.toggleCollapsed = function(categoryName) {
- if (categoryName != null) {
- if (_.find($scope.unCollapsed, (function(name) {
- return categoryName === name;
- }))) {
- $scope.unCollapsed = _.reject($scope.unCollapsed, function(name) {
- return name === categoryName;
- });
- } else {
- $scope.unCollapsed.push(categoryName);
- }
- return ImpacWidgetsSvc.updateWidgetSettings(w, false);
- }
- };
- $scope.isCollapsed = function(categoryName) {
- if (categoryName != null) {
- if (_.find($scope.unCollapsed, (function(name) {
- return categoryName === name;
- }))) {
- return false;
- } else {
- return true;
- }
- }
- };
- unCollapsedSetting = {};
- unCollapsedSetting.initialized = false;
- unCollapsedSetting.initialize = function() {
- return unCollapsedSetting.initialized = true;
- };
- unCollapsedSetting.toMetadata = function() {
- return {
- unCollapsed: $scope.unCollapsed
- };
- };
- w.settings.push(unCollapsedSetting);
- return $scope.widgetDeferred.resolve(settingsPromises);
-}]);
-
-module.directive('widgetAccountsBalanceSheet', function() {
- return {
- restrict: 'A',
- controller: 'WidgetAccountsBalanceSheetCtrl'
- };
-});
-}).call(this);
-(function () {
-'use strict';
-var module;
-
module = angular.module('impac.components.widgets.accounts-class-comparison', []);
module.controller('WidgetAccountsClassComparisonCtrl', ["$scope", "$q", "$filter", "ChartFormatterSvc", function($scope, $q, $filter, ChartFormatterSvc) {
@@ -7294,126 +7414,6 @@ module.directive('widgetSalesTopOpportunities', function() {
'use strict';
var module;
-module = angular.module('impac.components.widgets-common.data-not-found', []);
-
-module.directive('commonDataNotFound', ["$templateCache", "$log", "$http", "ImpacAssets", "ImpacTheming", "ImpacMainSvc", function($templateCache, $log, $http, ImpacAssets, ImpacTheming, ImpacMainSvc) {
- return {
- restrict: 'A',
- scope: {
- widgetEngine: '=',
- onDisplayAlerts: '&'
- },
- link: function(scope) {
- var assetPath, baseDir, dir, hasMyobEssentialsOnly;
- scope.bgImage = '';
- scope.content = ImpacTheming.get().dataNotFoundConfig;
- baseDir = ImpacAssets.get('dataNotFound');
- if (scope.widgetEngine && baseDir.length > 0) {
- dir = baseDir.split('');
- dir = dir[dir.length - 1] !== '/' ? dir.concat('/').join('') : dir.join('');
- assetPath = dir + scope.widgetEngine + '.png';
- $http.get(assetPath).then(function(success) {
- return scope.bgImage = assetPath;
- }, function(error) {
- return $log.warn("Missing data-not-found image for " + scope.widgetEngine);
- });
- }
- hasMyobEssentialsOnly = ImpacMainSvc.config.currentOrganization.has_myob_essentials_only;
- return scope.showAlertsTrigger = hasMyobEssentialsOnly && scope.widgetEngine.match(/.*accounts\/.*/);
- },
- template: $templateCache.get('widgets-common/data-not-found.tmpl.html')
- };
-}]);
-}).call(this);
-(function () {
-'use strict';
-var module;
-
-module = angular.module('impac.components.widgets-common.editable-title', []);
-
-module.controller('CommonEditableTitleCtrl', ["$scope", "ImpacWidgetsSvc", function($scope, ImpacWidgetsSvc) {
- var w;
- w = $scope.parentWidget;
- return $scope.updateName = function() {
- var data;
- if (w.name.length === 0) {
- w.name = w.originalName;
- return "Incorrect name";
- } else {
- data = {
- name: w.name
- };
- return ImpacWidgetsSvc.update(w, data).then(function(success) {
- return true;
- }, function(error) {
- return w.name = w.originalName;
- });
- }
- };
-}]);
-
-module.directive('commonEditableTitle', ["$templateCache", function($templateCache) {
- return {
- restrict: 'A',
- scope: {
- parentWidget: '='
- },
- template: $templateCache.get('widgets-common/editable-title.tmpl.html'),
- controller: 'CommonEditableTitleCtrl'
- };
-}]);
-}).call(this);
-(function () {
-'use strict';
-var module;
-
-module = angular.module('impac.components.widgets-common.top-buttons', []);
-
-module.controller('CommonTopButtonsCtrl', ["$scope", "$rootScope", "$log", "ImpacWidgetsSvc", "ImpacAssets", "ImpacUtilities", function($scope, $rootScope, $log, ImpacWidgetsSvc, ImpacAssets, ImpacUtilities) {
- var w;
- w = $scope.parentWidget;
- $scope.showCloseActive = false;
- $scope.showConfirmDelete = false;
- $scope.isDeletePopoverLoading = false;
- w.isEditMode = false;
- $scope.deleteWidget = function() {
- $scope.isDeletePopoverLoading = true;
- return ImpacWidgetsSvc["delete"](w).then(function(success) {
- return true;
- }, function(errors) {
- return w.errors = ImpacUtilities.processRailsError(errors);
- })["finally"](function() {
- return $scope.isDeletePopoverLoading = false;
- });
- };
- return $scope.toggleEditMode = function() {
- if (!w.isLoading) {
- if (w.isEditMode) {
- w.isEditMode = false;
- return ImpacWidgetsSvc.initWidgetSettings(w);
- } else {
- return w.isEditMode = true;
- }
- }
- };
-}]);
-
-module.directive('commonTopButtons', ["$templateCache", function($templateCache) {
- return {
- restrict: 'A',
- scope: {
- parentWidget: '=',
- onRefresh: '='
- },
- template: $templateCache.get('widgets-common/top-buttons.tmpl.html'),
- controller: 'CommonTopButtonsCtrl'
- };
-}]);
-}).call(this);
-(function () {
-'use strict';
-var module;
-
module = angular.module('impac.components.widgets-settings.account', []);
module.controller('SettingAccountCtrl', ["$scope", "$filter", function($scope, $filter) {
diff --git a/dist/impac-angular.less b/dist/impac-angular.less
index c1291dbe..e1e8c7e0 100644
--- a/dist/impac-angular.less
+++ b/dist/impac-angular.less
@@ -886,107 +886,6 @@ body {
.loader-style(@impac-dashboard-loading-spinner)
}
-.analytics kpis-bar .kpi {
-
- text-align: center;
- min-height: 125px;
- white-space: normal;
- padding: 10px 3px;
- border-radius: 3px;
- background-color: white;
- box-shadow: 0px 4px 12px -7px #17262d;
-
- &.static {
- .kpi-value {
- display: block;
- font-size: 14px;
- font-weight: 700;
- }
- }
-
- &.edit {
- .scrollable();
-
- input.form-control.input-sm {
- height: 30px;
- background-color: white;
- border: solid 1px @impac-widget-borders-color;
- margin-top: 5px;
- }
-
- .btn.btn-sm {
- margin-top: 8px;
- }
-
- .param-name {
- margin-top: 5px;
- }
- }
-
-
- .kpi-title {
- .text-uppercase();
- font-size: 12px;
- font-weight: 600;
- color: @impac-widget-text-color-medium;
- border-bottom-color: @impac-widget-text-color-medium;
-
- &:hover {
- color: @impac-widget-text-color;
- border-bottom-color: @impac-widget-text-color;
- }
- }
-
- .kpi-value {
- display: block;
- font-size: 20px;
- font-weight: 700;
- }
-
- .kpi-alert {
- .text-uppercase();
- font-size: 11px;
- font-weight: 700;
- background-color: white;
- border: 1px solid @brand-danger;
- border-radius: 4px;
- color: @brand-danger;
- padding: 2px 5px;
-
- position: absolute;
- bottom: 15px;
- left: 15%;
- width: 70%;
-
- &.kpi-close {
- bottom: auto;
- right: 20px;
- top: 5px;
- border-radius: 10px;
- width: 21px;
- left: auto;
- }
-
- &:hover {
- color: darken(@brand-danger, 10%);
- border-color: darken(@brand-danger, 10%);
- }
-
- &.static {
- position: static;
- margin: 5px 20px;
- }
- }
-
- .kpi-watch {
- font-size: 11px;
- }
-}
-
-.analytics kpis-bar > .key-stats .kpi {
- min-height: 80px;
-}
-
#module__dashboard-selector {
a {
font-weight: normal;
@@ -1175,49 +1074,107 @@ body {
////////
}
-.widget-item .top-line {
- cursor: move;
- background-color: @impac-widget-title-bg;
- padding: 9px 9px 0px 9px;
- border-radius: @impac-widget-title-border-radius;
- border: @impac-widget-border;
- border-bottom: none;
- min-height: 41px;
- .box-shadow(0px 1px 8px -4px);
-}
+.analytics kpis-bar .kpi {
-.widget-item .content {
- padding: 9px;
- border-radius: @impac-widget-content-border-radius;
- border: @impac-widget-border;
- border-top: none;
- background-color: @impac-widget-background-color;
+ text-align: center;
+ min-height: 125px;
+ white-space: normal;
+ padding: 10px 3px;
+ border-radius: 3px;
+ background-color: white;
+ box-shadow: 0px 4px 12px -7px #17262d;
- vertical-align: top;
- .box-shadow(0px 1px 8px -4px);
- .short-widget();
+ &.static {
+ .kpi-value {
+ display: block;
+ font-size: 14px;
+ font-weight: 700;
+ }
+ }
- .loader {
- .loader-centered();
- i {
- .loader-style();
+ &.edit {
+ .scrollable();
+
+ input.form-control.input-sm {
+ height: 30px;
+ background-color: white;
+ border: solid 1px @impac-widget-borders-color;
+ margin-top: 5px;
}
- p {
- margin-top: 10px;
+
+ .btn.btn-sm {
+ margin-top: 8px;
+ }
+
+ .param-name {
+ margin-top: 5px;
}
}
- .edit {
- .edit-panel-style();
+
+ .kpi-title {
+ .text-uppercase();
+ font-size: 12px;
+ font-weight: 600;
+ color: @impac-widget-text-color-medium;
+ border-bottom-color: @impac-widget-text-color-medium;
+
+ &:hover {
+ color: @impac-widget-text-color;
+ border-bottom-color: @impac-widget-text-color;
+ }
}
- &.accessible {
- height: auto !important;
- min-height: 250px !important;
- max-height: auto !important;
+ .kpi-value {
+ display: block;
+ font-size: 20px;
+ font-weight: 700;
+ }
+
+ .kpi-alert {
+ .text-uppercase();
+ font-size: 11px;
+ font-weight: 700;
+ background-color: white;
+ border: 1px solid @brand-danger;
+ border-radius: 4px;
+ color: @brand-danger;
+ padding: 2px 5px;
+
+ position: absolute;
+ bottom: 15px;
+ left: 15%;
+ width: 70%;
+
+ &.kpi-close {
+ bottom: auto;
+ right: 20px;
+ top: 5px;
+ border-radius: 10px;
+ width: 21px;
+ left: auto;
+ }
+
+ &:hover {
+ color: darken(@brand-danger, 10%);
+ border-color: darken(@brand-danger, 10%);
+ }
+
+ &.static {
+ position: static;
+ margin: 5px 20px;
+ }
+ }
+
+ .kpi-watch {
+ font-size: 11px;
}
}
+.analytics kpis-bar > .key-stats .kpi {
+ min-height: 80px;
+}
+
.analytics kpis-bar > .kpis {
// color: @light-black;
@@ -1280,6 +1237,49 @@ body {
// color: @light-black;
padding: 5px 0px;
}
+.widget-item .top-line {
+ cursor: move;
+ background-color: @impac-widget-title-bg;
+ padding: 9px 9px 0px 9px;
+ border-radius: @impac-widget-title-border-radius;
+ border: @impac-widget-border;
+ border-bottom: none;
+ min-height: 41px;
+ .box-shadow(0px 1px 8px -4px);
+}
+
+.widget-item .content {
+ padding: 9px;
+ border-radius: @impac-widget-content-border-radius;
+ border: @impac-widget-border;
+ border-top: none;
+ background-color: @impac-widget-background-color;
+
+ vertical-align: top;
+ .box-shadow(0px 1px 8px -4px);
+ .short-widget();
+
+ .loader {
+ .loader-centered();
+ i {
+ .loader-style();
+ }
+ p {
+ margin-top: 10px;
+ }
+ }
+
+ .edit {
+ .edit-panel-style();
+ }
+
+ &.accessible {
+ height: auto !important;
+ min-height: 250px !important;
+ max-height: auto !important;
+ }
+}
+
.analytics .widget-item .content.accounts-accounting-values {
// Nothing particular yet for this template...
}
@@ -1639,6 +1639,12 @@ body {
max-height: 260px;
}
}
+.analytics .widget-item .content.sales-comparison {
+ .drill-down-widget();
+ .right-panel .widget-lines-container {
+ max-height: 270px;
+ }
+}
.analytics .widget-item .content.sales-break-even {
.price {
.center-bold(0px);
@@ -1683,12 +1689,6 @@ body {
}
}
}
-.analytics .widget-item .content.sales-comparison {
- .drill-down-widget();
- .right-panel .widget-lines-container {
- max-height: 270px;
- }
-}
.analytics .widget-item .content.sales-customer-details {
.loader {
font-size: 14px;
@@ -1723,6 +1723,10 @@ body {
.selectable();
}
}
+.analytics .widget-item .content.sales-leads-funnel {
+ .funnel-widget();
+}
+
.analytics .widget-item .content.sales-growth {
.price {
.center-bold(0px);
@@ -1732,10 +1736,6 @@ body {
font-size: 14px;
}
}
-.analytics .widget-item .content.sales-leads-funnel {
- .funnel-widget();
-}
-
.analytics .widget-item .content.sales-leads-list {
.simple-list-widget();
.widget-lines-container {
@@ -1755,6 +1755,10 @@ body {
.analytics .widget-item .content.sales-margin {
// Nothing special yet for this template
}
+.analytics .widget-item .content.sales-opportunities-funnel {
+ .funnel-widget();
+}
+
.analytics .widget-item .content.sales-number-of-leads {
.stats {
margin-top: 35px;
@@ -1782,10 +1786,6 @@ body {
}
}
}
-.analytics .widget-item .content.sales-opportunities-funnel {
- .funnel-widget();
-}
-
.analytics .widget-item .content.sales-performance {
.drill-down-widget();
.right-panel > .widget-lines-container {
@@ -1827,6 +1827,37 @@ body {
margin-bottom: 5px;
}
}
+.analytics .widget-item .content .data-not-found {
+ text-align: center;
+ font-size: 18px;
+ color: @impac-widget-text-color;
+ img {
+ opacity: 0.8;
+ -webkit-filter: blur(2px);
+ -moz-filter: blur(2px);
+ -o-filter: blur(2px);
+ -ms-filter: blur(2px);
+ filter: blur(2px);
+ // fix for mobile, prevents images from extended the width of the widget.
+ max-width: 100%;
+ }
+ .message {
+ position: absolute;
+ top: 90px;
+ width: 70%;
+ left: 15%;
+ background-color: rgb(244, 248, 249);
+ padding: 10px 0px;
+ border-radius: 4px;
+ border: solid 1px @impac-widget-borders-color;
+ a {
+ color: @impac-widget-link-color;
+ display: block;
+ font-size: 16px;
+ font-weight: normal;
+ }
+ }
+}
.analytics .widget-item .content.sales-top-opportunities {
.opps-container {
max-height: 195px;
@@ -1875,37 +1906,6 @@ body {
}
}
}
-.analytics .widget-item .content .data-not-found {
- text-align: center;
- font-size: 18px;
- color: @impac-widget-text-color;
- img {
- opacity: 0.8;
- -webkit-filter: blur(2px);
- -moz-filter: blur(2px);
- -o-filter: blur(2px);
- -ms-filter: blur(2px);
- filter: blur(2px);
- // fix for mobile, prevents images from extended the width of the widget.
- max-width: 100%;
- }
- .message {
- position: absolute;
- top: 90px;
- width: 70%;
- left: 15%;
- background-color: rgb(244, 248, 249);
- padding: 10px 0px;
- border-radius: 4px;
- border: solid 1px @impac-widget-borders-color;
- a {
- color: @impac-widget-link-color;
- display: block;
- font-size: 16px;
- font-weight: normal;
- }
- }
-}
.analytics .widget-item {
.title-wrapper {
width: 100%;
@@ -2088,25 +2088,6 @@ body {
}
-.analytics .settings.organizations {
- .widget-lines-container {
- .widget-line {
- padding: 5px 10px 5px 18px;
- .alternate-bg(#f3f4f4);
- .fa {
- float: right;
- font-size: 20px;
- cursor: pointer;
- &.fa-toggle-on {
- color: @impac-widget-link-color;
- }
- &.fa-toggle-off {
- color: @impac-widget-text-color-medium;
- }
- }
- }
- }
-}
.analytics .widget-item .content .settings.param-selector {
display: inline-block;
a {
@@ -2147,6 +2128,25 @@ body {
}
}
}
+.analytics .settings.organizations {
+ .widget-lines-container {
+ .widget-line {
+ padding: 5px 10px 5px 18px;
+ .alternate-bg(#f3f4f4);
+ .fa {
+ float: right;
+ font-size: 20px;
+ cursor: pointer;
+ &.fa-toggle-on {
+ color: @impac-widget-link-color;
+ }
+ &.fa-toggle-off {
+ color: @impac-widget-text-color-medium;
+ }
+ }
+ }
+ }
+}
.analytics .settings.params-checkboxes {
padding: 2px 0px;
input {
diff --git a/src/impac-angular.less b/src/impac-angular.less
index 9755889f..ea5affff 100644
--- a/src/impac-angular.less
+++ b/src/impac-angular.less
@@ -11,10 +11,10 @@
/* DO NOT MODIFY - AUTOMATICALLY GENERATED BY GULP INJECT*/
/* inject:imports */
@import "components/dashboard/dashboard.less";
-@import "components/kpi/kpi.less";
@import "components/dashboard-selector/dashboard-selector.less";
-@import "components/widget/widget.less";
+@import "components/kpi/kpi.less";
@import "components/kpis-bar/kpis-bar.less";
+@import "components/widget/widget.less";
@import "components/widgets/accounts-accounting-values/accounts-accounting-values.less";
@import "components/widgets/accounts-assets-liability-summary/accounts-assets-liability-summary.less";
@import "components/widgets/accounts-assets-summary/accounts-assets-summary.less";
@@ -44,31 +44,31 @@
@import "components/widgets/invoices-list/invoices-list.less";
@import "components/widgets/invoices-summary/invoices-summary.less";
@import "components/widgets/sales-aged/sales-aged.less";
-@import "components/widgets/sales-break-even/sales-break-even.less";
@import "components/widgets/sales-comparison/sales-comparison.less";
+@import "components/widgets/sales-break-even/sales-break-even.less";
@import "components/widgets/sales-customer-details/sales-customer-details.less";
@import "components/widgets/sales-cycle/sales-cycle.less";
@import "components/widgets/sales-forecast/sales-forecast.less";
-@import "components/widgets/sales-growth/sales-growth.less";
@import "components/widgets/sales-leads-funnel/sales-leads-funnel.less";
+@import "components/widgets/sales-growth/sales-growth.less";
@import "components/widgets/sales-leads-list/sales-leads-list.less";
@import "components/widgets/sales-list/sales-list.less";
@import "components/widgets/sales-margin/sales-margin.less";
-@import "components/widgets/sales-number-of-leads/sales-number-of-leads.less";
@import "components/widgets/sales-opportunities-funnel/sales-opportunities-funnel.less";
+@import "components/widgets/sales-number-of-leads/sales-number-of-leads.less";
@import "components/widgets/sales-performance/sales-performance.less";
@import "components/widgets/sales-segmented-turnover/sales-segmented-turnover.less";
@import "components/widgets/sales-summary/sales-summary.less";
-@import "components/widgets/sales-top-opportunities/sales-top-opportunities.less";
@import "components/widgets-common/data-not-found/data-not-found.less";
+@import "components/widgets/sales-top-opportunities/sales-top-opportunities.less";
@import "components/widgets-common/editable-title/editable-title.less";
@import "components/widgets-common/top-buttons/top-buttons.less";
@import "components/widgets-settings/account/account.less";
@import "components/widgets-settings/chart-filters/chart-filters.less";
@import "components/widgets-settings/hist-mode/hist-mode.less";
@import "components/widgets-settings/limit-entries/limit-entries.less";
-@import "components/widgets-settings/organizations/organizations.less";
@import "components/widgets-settings/param-selector/param-selector.less";
+@import "components/widgets-settings/organizations/organizations.less";
@import "components/widgets-settings/params-checkboxes/params-checkboxes.less";
@import "components/widgets-settings/params-picker/params-picker.less";
@import "components/widgets-settings/time-range/time-range.less";