Hide register page link if public registration is disabled
parent
5a2cc5c627
commit
7bd03e221c
|
@ -31,6 +31,7 @@ class ConfigService extends taiga.Service
|
|||
"es": "Spanish"
|
||||
"en": "English"
|
||||
}
|
||||
allowPublicRegistration: false
|
||||
}
|
||||
|
||||
initialize: (localconfig) ->
|
||||
|
|
|
@ -152,8 +152,10 @@ module.service("$tgAuth", AuthService)
|
|||
## Login Directive
|
||||
###################
|
||||
|
||||
LoginDirective = ($auth, $confirm, $location) ->
|
||||
LoginDirective = ($auth, $confirm, $location, $config) ->
|
||||
link = ($scope, $el, $attrs) ->
|
||||
$scope.allowPublicRegistration = $config.get("allowPublicRegistration")
|
||||
|
||||
$scope.data = {}
|
||||
form = $el.find("form").checksley()
|
||||
|
||||
|
@ -381,7 +383,7 @@ InvitationDirective = ($auth, $confirm, $location, $params) ->
|
|||
|
||||
|
||||
module.directive("tgRegister", ["$tgAuth", "$tgConfirm", RegisterDirective])
|
||||
module.directive("tgLogin", ["$tgAuth", "$tgConfirm", "$location", LoginDirective])
|
||||
module.directive("tgLogin", ["$tgAuth", "$tgConfirm", "$location", "$tgConfig", LoginDirective])
|
||||
module.directive("tgForgotPassword", ["$tgAuth", "$tgConfirm", "$location", ForgotPasswordDirective])
|
||||
module.directive("tgChangePasswordFromRecovery", ["$tgAuth", "$tgConfirm", "$location", "$routeParams",
|
||||
ChangePasswordFromRecoveryDirective])
|
||||
|
|
|
@ -13,6 +13,6 @@ div.login-form-container(tg-login)
|
|||
a.button.button-login.button-gray(href="", ng-click="ctrl.submit()", title="Sign in") Sign in
|
||||
input(type="submit", style="display:none")
|
||||
|
||||
p.login-text
|
||||
p.login-text(ng-if="allowPublicRegistration")
|
||||
span Not registered yet?
|
||||
a(href="", tg-nav="register", title="Register") create your free account here
|
||||
|
|
Loading…
Reference in New Issue