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 {
|
.home-rows {
|
||||||
// NOTE (ericjim): if a banner is placed on the homescreen, add this margin.
|
// NOTE (ericjim): if a banner is placed on the homescreen, add this margin.
|
||||||
//margin-top: 112px;
|
margin-top: 112px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.home-row {
|
.home-row {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<h3 class="text-uppercase subcategory-title">{{subCategory}}</h3>
|
<h3 class="text-uppercase subcategory-title">{{subCategory}}</h3>
|
||||||
|
|
||||||
<div ng-repeat="(section, sectionObj) in subcategoryObj">
|
<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">
|
<div class="c-resource" ng-if="resource.rev">
|
||||||
<a class="l-flex--column resource-row-link" target="_blank" href="{{resource.url}}">
|
<a class="l-flex--column resource-row-link" target="_blank" href="{{resource.url}}">
|
||||||
<div>
|
<div>
|
||||||
|
@ -39,3 +39,18 @@ angularIO.controller('ResourcesCtrl', ['$scope', '$element', '$window', '$fireba
|
|||||||
};
|
};
|
||||||
|
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
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…
x
Reference in New Issue
Block a user