forked from SAP-archive/yaas-storefront
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbd4fdc
commit 6555af8
Showing
31 changed files
with
306 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
public/js/app/shared/filters/show-number-of-items-filter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* [y] hybris Platform | ||
* | ||
* Copyright (c) 2000-2015 hybris AG | ||
* All rights reserved. | ||
* | ||
* This software is the confidential and proprietary information of hybris | ||
* ("Confidential Information"). You shall not disclose such Confidential | ||
* Information and shall use it only in accordance with the terms of the | ||
* license agreement you entered into with hybris. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
angular.module('ds.shared') | ||
.filter('showNoOfItems', ['$translate', function ($translate) { | ||
return function (data) { | ||
if (typeof (data) === 'undefined') { | ||
return $translate.instant('ORDER_ITEM_COUNT', { number: 0 }); | ||
} | ||
|
||
if (data > 1) { | ||
return $translate.instant('ORDER_ITEMS_COUNT', { number: data }); | ||
} else { | ||
return $translate.instant('ORDER_ITEM_COUNT', { number: data }); | ||
} | ||
}; | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* [y] hybris Platform | ||
* | ||
* Copyright (c) 2000-2015 hybris AG | ||
* All rights reserved. | ||
* | ||
* This software is the confidential and proprietary information of hybris | ||
* ("Confidential Information"). You shall not disclose such Confidential | ||
* Information and shall use it only in accordance with the terms of the | ||
* license agreement you entered into with hybris. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
angular.module('ds.shared') | ||
.filter('sumByKey', function () { | ||
return function (data, key) { | ||
if (typeof (data) === 'undefined' || typeof (key) === 'undefined') { | ||
return 0; | ||
} | ||
|
||
var sum = 0; | ||
for (var i = data.length - 1; i >= 0; i--) { | ||
if (!!data[i][key] && !isNaN(data[i][key])) { | ||
sum += parseInt(data[i][key]); | ||
} | ||
} | ||
|
||
return sum; | ||
}; | ||
}); |
Oops, something went wrong.