Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #794 from GeotrekCE/no_picto_label_default_picto
Browse files Browse the repository at this point in the history
Change behaviour, no picto, default picto
  • Loading branch information
LePetitTim authored Oct 26, 2020
2 parents ceb065d + 36590da commit 12accd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/app/categories/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,6 @@ function CategoriesListeController($scope, $rootScope, $location, $timeout, util
return !el.filter_rando
};

$scope.checkPictogram = function checkPictogram (el) {
return !el.pictogram
};

function initCatFilters() {
initDatePickers();
initRangeFilters();
Expand Down
9 changes: 5 additions & 4 deletions src/app/categories/templates/categories-liste.html
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
</div>
</div>
<!-- Other filter selector -->
<div ng-if="category.labels && category.labels.values.length > 0 && !category.labels.values.every(checkFilterRando) && !category.labels.values.every(checkPictogram)" class="category-filter selector labels" ng-class="{empty: category.labels.values.length === 0}">
<div ng-if="category.labels && category.labels.values.length > 0 && !category.labels.values.every(checkFilterRando)" class="category-filter selector labels" ng-class="{empty: category.labels.values.length === 0}">
<div class="filter-title">
<span>{{'OTHERS' | translate}}</span>
</div>
Expand All @@ -283,14 +283,15 @@
<input type="checkbox" id="label-{{::label.id}}" ng-click="toogleCategoryFilter(category.id, 'labels', label.id)"
ng-checked="activeFilters[category.id + '_labels'].indexOf(label.id.toString()) > -1" />
<label for="label-{{label.id}}">
<span ng-if="label.pictogram">
<span>
<div class="choice-tick">
<img ng-if="activeFilters[category.id + '_labels'].indexOf(label.id.toString()) > -1"
src="/images/icons/filter-check.svg" />
</div>
<span class="category-filters-theme-icon choice-icon">
<ng-include ng-if="label.pictogram | isSVG" src="label.pictogram"></ng-include>
<img ng-if="!(label.pictogram | isSVG)" ng-src="{{label.pictogram}}" ng-alt="{{label.name}}">
<ng-include ng-if="label.pictogram && label.pictogram | isSVG" src="label.pictogram"></ng-include>
<img ng-if="label.pictogram && !(label.pictogram | isSVG)" ng-src="{{label.pictogram}}" ng-alt="{{label.name}}">
<ng-include ng-if="!label.pictogram" src="'/images/icons/warning.svg'"></ng-include>
</span>
</span>
</label>
Expand Down

0 comments on commit 12accd5

Please sign in to comment.