chore: alphabetize entries in resources page. Add margin under frontpage banner
This commit is contained in:
parent
f50dff818a
commit
8c1bbbf318
|
@ -1,6 +1,6 @@
|
|||
.home-rows {
|
||||
// NOTE (ericjim): if a banner is placed on the homescreen, add this margin.
|
||||
//margin-top: 112px;
|
||||
margin-top: 112px;
|
||||
}
|
||||
|
||||
.home-row {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<h3 class="text-uppercase subcategory-title">{{subCategory}}</h3>
|
||||
|
||||
<div ng-repeat="(section, sectionObj) in subcategoryObj">
|
||||
<div ng-repeat="resource in sectionObj">
|
||||
<div ng-repeat="resource in sectionObj | orderObjectByOfTypeString:'title':false">
|
||||
<div class="c-resource" ng-if="resource.rev">
|
||||
<a class="l-flex--column resource-row-link" target="_blank" href="{{resource.url}}">
|
||||
<div>
|
||||
|
|
|
@ -38,4 +38,19 @@ angularIO.controller('ResourcesCtrl', ['$scope', '$element', '$window', '$fireba
|
|||
vm.selectedCategory = category;
|
||||
};
|
||||
|
||||
}]);
|
||||
}]);
|
||||
|
||||
angularIO.filter('orderObjectByOfTypeString', function() {
|
||||
return function(items, field, reverse) {
|
||||
var filtered = [];
|
||||
angular.forEach(items, function(item) {
|
||||
filtered.push(item);
|
||||
});
|
||||
filtered.sort(function (a, b) {
|
||||
// normalize sort by uppercasing values.
|
||||
return (a[field].toUpperCase() > b[field].toUpperCase() ? 1 : -1);
|
||||
});
|
||||
if(reverse) filtered.reverse();
|
||||
return filtered;
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue