Explorar o código

Make sure we infer the university when the user finishes typing his email.

Paulo Reis %!s(int64=8) %!d(string=hai) anos
pai
achega
76d8ab11e5

+ 1 - 1
services/web/public/coffee/components/inputSuggestions.coffee

@@ -45,7 +45,7 @@ define [
 		controller: inputSuggestionsController
 		controller: inputSuggestionsController
 		template: """
 		template: """
 			<div class="input-suggestions">
 			<div class="input-suggestions">
-				<div type="text" class="form-control input-suggestions-shadow">
+				<div class="form-control input-suggestions-shadow">
 					<span ng-bind="$ctrl.localNgModel" class="input-suggestions-shadow-existing" ng-show="$ctrl.showHint"></span><span ng-bind="$ctrl.suggestion" class="input-suggestions-shadow-suggested" ng-show="$ctrl.showHint"></span>
 					<span ng-bind="$ctrl.localNgModel" class="input-suggestions-shadow-existing" ng-show="$ctrl.showHint"></span><span ng-bind="$ctrl.suggestion" class="input-suggestions-shadow-suggested" ng-show="$ctrl.showHint"></span>
 				</div>
 				</div>
 				<input type="text" ng-focus="$ctrl.handleFocus()" ng-keyDown="$ctrl.handleKeyDown($event)" ng-blur="$ctrl.handleBlur()" ng-model="$ctrl.localNgModel" ng-model-options="$ctrl.localNgModelOptions" ng-model-options="{ debounce: 50 }" class="form-control input-suggestions-main" ng-attr-id="{{ ::$ctrl.inputId }}" ng-attr-placeholder="{{ ::$ctrl.inputPlaceholder }}" ng-attr-type="{{ ::$ctrl.inputType }}" ng-attr-name="{{ ::$ctrl.inputName }}" ng-required="::$ctrl.inputRequired">
 				<input type="text" ng-focus="$ctrl.handleFocus()" ng-keyDown="$ctrl.handleKeyDown($event)" ng-blur="$ctrl.handleBlur()" ng-model="$ctrl.localNgModel" ng-model-options="$ctrl.localNgModelOptions" ng-model-options="{ debounce: 50 }" class="form-control input-suggestions-main" ng-attr-id="{{ ::$ctrl.inputId }}" ng-attr-placeholder="{{ ::$ctrl.inputPlaceholder }}" ng-attr-type="{{ ::$ctrl.inputType }}" ng-attr-name="{{ ::$ctrl.inputName }}" ng-required="::$ctrl.inputRequired">

+ 2 - 1
services/web/public/coffee/main/affiliations/controllers/UserAffiliationsController.coffee

@@ -29,7 +29,8 @@ define [
 
 
 				UserAffiliationsDataService.getUniversityDomainFromPartialDomainInput(userInputLocalAndDomain.domain)
 				UserAffiliationsDataService.getUniversityDomainFromPartialDomainInput(userInputLocalAndDomain.domain)
 					.then (universityDomain) ->
 					.then (universityDomain) ->
-						if userInputLocalAndDomain.domain == universityDomain.hostname
+						currentUserInputLocalAndDomain = _matchLocalAndDomain $scope.newAffiliation.email
+						if currentUserInputLocalAndDomain.domain == universityDomain.hostname
 							$scope.newAffiliation.university = universityDomain.university
 							$scope.newAffiliation.university = universityDomain.university
 							$scope.newAffiliation.department = universityDomain.department
 							$scope.newAffiliation.department = universityDomain.department
 						else 
 						else