Hide register page link if public registration is disabled

stable
David Barragán Merino 2014-07-14 20:48:00 +02:00
parent 5a2cc5c627
commit 7bd03e221c
3 changed files with 6 additions and 3 deletions

View File

@ -31,6 +31,7 @@ class ConfigService extends taiga.Service
"es": "Spanish" "es": "Spanish"
"en": "English" "en": "English"
} }
allowPublicRegistration: false
} }
initialize: (localconfig) -> initialize: (localconfig) ->

View File

@ -152,8 +152,10 @@ module.service("$tgAuth", AuthService)
## Login Directive ## Login Directive
################### ###################
LoginDirective = ($auth, $confirm, $location) -> LoginDirective = ($auth, $confirm, $location, $config) ->
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
$scope.allowPublicRegistration = $config.get("allowPublicRegistration")
$scope.data = {} $scope.data = {}
form = $el.find("form").checksley() form = $el.find("form").checksley()
@ -381,7 +383,7 @@ InvitationDirective = ($auth, $confirm, $location, $params) ->
module.directive("tgRegister", ["$tgAuth", "$tgConfirm", RegisterDirective]) 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("tgForgotPassword", ["$tgAuth", "$tgConfirm", "$location", ForgotPasswordDirective])
module.directive("tgChangePasswordFromRecovery", ["$tgAuth", "$tgConfirm", "$location", "$routeParams", module.directive("tgChangePasswordFromRecovery", ["$tgAuth", "$tgConfirm", "$location", "$routeParams",
ChangePasswordFromRecoveryDirective]) ChangePasswordFromRecoveryDirective])

View File

@ -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 a.button.button-login.button-gray(href="", ng-click="ctrl.submit()", title="Sign in") Sign in
input(type="submit", style="display:none") input(type="submit", style="display:none")
p.login-text p.login-text(ng-if="allowPublicRegistration")
span Not registered yet? span Not registered yet?
a(href="", tg-nav="register", title="Register") create your free account here a(href="", tg-nav="register", title="Register") create your free account here