hide singup form invitation page if publicRegisterEnabled is false

stable
Juanfran 2016-07-06 12:12:20 +02:00
parent 945979a19b
commit e488fac8d1
4 changed files with 12 additions and 5 deletions

View File

@ -472,13 +472,14 @@ module.directive("tgChangePasswordFromRecovery", ["$tgAuth", "$tgConfirm", "$tgL
## Invitation ## Invitation
############################################################################# #############################################################################
InvitationDirective = ($auth, $confirm, $location, $params, $navUrls, $analytics, $translate) -> InvitationDirective = ($auth, $confirm, $location, $params, $navUrls, $analytics, $translate, config) ->
link = ($scope, $el, $attrs) -> link = ($scope, $el, $attrs) ->
token = $params.token token = $params.token
promise = $auth.getInvitation(token) promise = $auth.getInvitation(token)
promise.then (invitation) -> promise.then (invitation) ->
$scope.invitation = invitation $scope.invitation = invitation
$scope.publicRegisterEnabled = config.get("publicRegisterEnabled")
promise.then null, (response) -> promise.then null, (response) ->
$location.path($navUrls.resolve("login")) $location.path($navUrls.resolve("login"))
@ -549,7 +550,7 @@ InvitationDirective = ($auth, $confirm, $location, $params, $navUrls, $analytics
return {link:link} return {link:link}
module.directive("tgInvitation", ["$tgAuth", "$tgConfirm", "$tgLocation", "$routeParams", module.directive("tgInvitation", ["$tgAuth", "$tgConfirm", "$tgLocation", "$routeParams",
"$tgNavUrls", "$tgAnalytics", "$translate", InvitationDirective]) "$tgNavUrls", "$tgAnalytics", "$translate", "$tgConfig", InvitationDirective])
############################################################################# #############################################################################

View File

@ -10,6 +10,6 @@ div.wrapper
p(translate="AUTH.INVITED_YOU") p(translate="AUTH.INVITED_YOU")
p.project-name(tg-bo-bind="invitation.project_name") p.project-name(tg-bo-bind="invitation.project_name")
div.invitation-form div.invitation-form(ng-class="{'public-register-disabled': !publicRegisterEnabled}")
include ../includes/modules/invitation-login-form include ../includes/modules/invitation-login-form
include ../includes/modules/invitation-register-form include ../includes/modules/invitation-register-form

View File

@ -1,9 +1,9 @@
form.register-form form.register-form(ng-if="publicRegisterEnabled")
p.form-header(translate="REGISTER_FORM.TITLE") p.form-header(translate="REGISTER_FORM.TITLE")
fieldset fieldset
input( input(
type="text" type="text"
autocorrect="off" autocorrect="off"
autocapitalize="none" autocapitalize="none"
name="username" name="username"
ng-model="dataRegister.username" ng-model="dataRegister.username"

View File

@ -101,4 +101,10 @@
.login-form { .login-form {
border-right: 1px solid rgba($white, .3); border-right: 1px solid rgba($white, .3);
} }
.public-register-disabled {
width: 400px;
.login-form {
border-right: 0;
}
}
} }