Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

va-property2 - hidden languages #186

Merged
merged 3 commits into from
Dec 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions VirtoCommerce.CatalogModule.Web/Scripts/directives/property2.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ angular.module('virtoCommerce.catalogModule')
templateUrl: 'Modules/$(VirtoCommerce.Catalog)/Scripts/directives/property2.tpl.html',
scope: {
languages: "=",
hiddenLanguages: "=",
defaultLanguage: "=",
getPropValues: "&",
pageSize: "@?"
Expand Down Expand Up @@ -130,6 +131,16 @@ angular.module('virtoCommerce.catalogModule')
}
};

scope.isLanguageVisible = function (language) {
Tilesto marked this conversation as resolved.
Show resolved Hide resolved
if(scope.hiddenLanguages){
if (_.contains(scope.hiddenLanguages, language)) {
return false;
}
}

return true;
}

scope.loadDictionaryValues = function ($select) {
$select.page = 0;
scope.context.allDictionaryValues = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@


<script type="text/ng-template" id="ShortText-multilang.html">
<div class="form-group" ng-repeat="(language, langValuesGroup) in context.langValuesMap">
<div class="form-group" ng-repeat="(language, langValuesGroup) in context.langValuesMap" ng-if="isLanguageVisible(language)">
<div class="form-input __langs">
<span ng-if="language.length>2" class="flag flag-{{language.substr(3).toLowerCase()}}"></span>
<span ng-if="language.length<=2" class="langCode">{{language.toUpperCase()}}</span>
Expand All @@ -197,7 +197,7 @@
</script>

<script type="text/ng-template" id="LongText-multilang.html">
<div class="form-group" ng-repeat="(language, langValuesGroup) in context.langValuesMap">
<div class="form-group" ng-repeat="(language, langValuesGroup) in context.langValuesMap" ng-if="isLanguageVisible(language)">
<div class="form-input __langs">
<span ng-if="language.length>2" class="flag flag-{{language.substr(3).toLowerCase()}}"></span>
<span ng-if="language.length<=2" class="langCode">{{language.toUpperCase()}}</span>
Expand All @@ -213,7 +213,7 @@
</div>
</script>
<script type="text/ng-template" id="Number-multilang.html">
<div class="form-group" ng-repeat="(language, langValuesGroup) in context.langValuesMap">
<div class="form-group" ng-repeat="(language, langValuesGroup) in context.langValuesMap" ng-if="isLanguageVisible(language)">
<div class="form-input __number">
<input ng-disabled="currentEntity.isReadOnly"
ng-required="currentEntity.required && !currentEntity.isReadOnly"
Expand All @@ -225,7 +225,7 @@
</div>
</script>
<script type="text/ng-template" id="DateTime-multilang.html">
<div class="form-group" ng-repeat="(language, langValuesGroup) in context.langValuesMap">
<div class="form-group" ng-repeat="(language, langValuesGroup) in context.langValuesMap" ng-if="isLanguageVisible(language)">
<div class="form-input __langs __calendar">
<span ng-if="language.length>2" class="flag flag-{{language.substr(3).toLowerCase()}}"></span>
<span ng-if="language.length<=2" class="langCode">{{language.toUpperCase()}}</span>
Expand All @@ -243,7 +243,7 @@


<script type="text/ng-template" id="ShortText-multivalue-multilang.html">
<div class="form-group" ng-repeat="(language, langValuesGroup) in context.langValuesMap">
<div class="form-group" ng-repeat="(language, langValuesGroup) in context.langValuesMap" ng-if="isLanguageVisible(language)">
<div class="form-input __langs">
<span ng-if="language.length>2" class="flag flag-{{language.substr(3).toLowerCase()}}"></span>
<span ng-if="language.length<=2" class="langCode">{{language.toUpperCase()}}</span>
Expand All @@ -265,7 +265,7 @@
</div>
</script>
<script type="text/ng-template" id="LongText-multivalue-multilang.html">
<div class="form-group" ng-repeat="(language, langValuesGroup) in context.langValuesMap">
<div class="form-group" ng-repeat="(language, langValuesGroup) in context.langValuesMap" ng-if="isLanguageVisible(language)">
<div class="form-input __langs" ng-repeat="val in langValuesGroup.currentPropValues track by $index">
<span ng-if="language.length>2" class="flag flag-{{language.substr(3).toLowerCase()}}"></span>
<span ng-if="language.length<=2" class="langCode">{{language.toUpperCase()}}</span>
Expand All @@ -283,7 +283,7 @@
</div>
</script>
<script type="text/ng-template" id="Number-multivalue-multilang.html">
<div class="form-group" ng-repeat="(language, langValuesGroup) in context.langValuesMap">
<div class="form-group" ng-repeat="(language, langValuesGroup) in context.langValuesMap" ng-if="isLanguageVisible(language)">
<div class="form-input __langs">
<span ng-if="language.length>2" class="flag flag-{{language.substr(3).toLowerCase()}}"></span>
<span ng-if="language.length<=2" class="langCode">{{language.toUpperCase()}}</span>
Expand Down