--- /dev/null
+<div class="col-md-6">
+ <div ng-if="no_last" class="alert alert-warning">
+ [% l('No patrons recently accessed.') %]
+ <span class="pad-horiz">
+ <a href='./circ/patron/search'>[% l('Try Patron Search') %]</a>
+ </span>
+ </div>
+ <br/>
+</div>
[% l('Check In') %]
</a>
</li>
+ <li>
+ <a href="./circ/patron/last" target="_self">
+ <span class="glyphicon glyphicon-share-alt"></span>
+ [% l('Retrieve Last Patron') %]
+ </a>
+ </li>
<li class="divider"></li>
<li>
<a href="./circ/patron/credentials" target="_self">
resolve : resolver
});
+ $routeProvider.when('/circ/patron/last', {
+ templateUrl: './circ/patron/t_last_patron',
+ controller: 'PatronFetchLastCtrl',
+ resolve : resolver
+ });
+
// the following require a patron ID
$routeProvider.when('/circ/patron/:id/alerts', {
var user_id = id ? id : (user ? user.id() : null);
console.debug('setting primary user to: ' + user_id);
+ egCore.hatch.setLocalItem('eg.circ.last_patron', user_id);
// avoid running multiple retrievals for the same patron, which
// can happen during dbl-click by maintaining a single running
});
}])
+.controller('PatronFetchLastCtrl',
+ ['$scope','$location','egCore',
+function($scope , $location , egCore) {
+
+ var id = egCore.hatch.getLocalItem('eg.circ.last_patron');
+ if (id) return $location.path('/circ/patron/' + id + '/checkout');
+
+ $scope.no_last = true;
+}])
+