<option value="advanced">[% l('Advanced (default)') %]</option>
<option value="numeric" >[% l('Numeric') %]</option>
<option value="expert" >[% l('MARC Expert') %]</option>
+ <option value="browse" >[% l('Browse') %]</option>
+ </select>
+ </div>
+ </div>
+
+ <div class="row new-entry">
+ <div class="col-md-8">
+ <label for="results_sort_selector">[% l('Browse Results Default Sort') %]</label>
+ <p>[% l('You can set the default of how items are sorted in the Browse field.') %]</p>
+ </div>
+ <div class="col-md-4">
+ <select id="results_sort_selector" ng-model="results_sort">
+ <option value="pubdate">[% l('Date: Newest to Oldest') %]</option>
+ <option value="pubdate.descending">[% l('Date: Oldest to Newest') %]</option>
+ <option value="titlesort">[% l('Title: A to Z') %]</option>
+ <option value="titlesort.descending">[% l('Title: Z to A') %]</option>
+ <option value="authorsort">[% l('Author: A to Z') %]</option>
+ <option value="authorsort.descending">[% l('Author: Z to A') %]</option>
</select>
</div>
</div>
}
});
+ $scope.$watch('results_sort', function(newVal, oldVal) {
+ if (typeof newVal != 'undefined' && newVal != oldVal) {
+ egCore.hatch.setItem('eg.search.browse_sort_default', newVal);
+ }
+ });
+
$scope.apply_sound = function() {
if ($scope.disable_sound) {
egCore.hatch.setItem('eg.audio.disable', true);
});
} else {
$scope.catalog_url = url;
- }
-
+ }
+
+ // if we're displaying the browse search form,
+ // select whatever browse sort default the user
+ // has chosen via workstation preference
+ if (url.match(/\?pane=browse/)) {
+ var browse_sort_default = egCore.hatch.getLocalItem('eg.search.browse_sort_default');
+ if (browse_sort_default) {
+ url += '&sort=' + encodeURIComponent(browse_sort_default);
+ }
+ }
}
function init_parts_url() {