2021-05-14 14:29:36 +02:00
|
|
|
'use strict';
|
|
|
|
|
2022-03-18 19:44:30 +01:00
|
|
|
Application.Controllers.controller('HeaderController', ['$scope', '$transitions', '$state', 'settingsPromise', 'ProofOfIdentityType', 'AuthService',
|
|
|
|
function ($scope, $transitions, $state, settingsPromise, ProofOfIdentityType, AuthService) {
|
2021-05-14 14:29:36 +02:00
|
|
|
$scope.aboutPage = ($state.current.name === 'app.public.about');
|
|
|
|
|
2022-03-15 17:10:33 +01:00
|
|
|
$transitions.onStart({}, function (trans) {
|
|
|
|
$scope.aboutPage = (trans.$to().name === 'app.public.about');
|
2021-05-14 14:29:36 +02:00
|
|
|
});
|
2022-01-04 15:27:58 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the current state of the public registration setting (allowed/blocked).
|
|
|
|
*/
|
|
|
|
$scope.registrationEnabled = function () {
|
|
|
|
return settingsPromise.public_registrations === 'true';
|
|
|
|
};
|
2022-03-18 19:44:30 +01:00
|
|
|
|
|
|
|
$scope.dropdownOnToggled = function (open) {
|
|
|
|
if (open) {
|
|
|
|
ProofOfIdentityType.query({ group_id: $scope.currentUser.group_id }, function (proofOfIdentityTypes) {
|
|
|
|
$scope.hasProofOfIdentityTypes = proofOfIdentityTypes.length > 0;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
2021-05-14 14:29:36 +02:00
|
|
|
}
|
|
|
|
]);
|