diff --git a/services/web/app/views/user/settings.pug b/services/web/app/views/user/settings.pug index 69401b9569..5efcee86e6 100644 --- a/services/web/app/views/user/settings.pug +++ b/services/web/app/views/user/settings.pug @@ -21,7 +21,6 @@ block content .col-md-12 h3 Emails and Affiliations p.small Add additional email addresses to your account to access any upgrades your university or institution has, to make it easier for collaborators to find you, and to make sure you can recover your account. - table.table.affiliations-table thead tr @@ -33,7 +32,11 @@ block content ng-repeat="userEmail in userEmails" ) td {{ userEmail.email + (userEmail.default ? ' (default)' : '') }} - td {{ userEmail.institution }} + td + div(ng-if="userEmail.affiliation.institution") {{ userEmail.affiliation.institution.name }} + div(ng-if="userEmail.affiliation.role || userEmail.affiliation.department") + span(ng-if="userEmail.affiliation.role") {{ userEmail.affiliation.role + ", " }} + span(ng-if="userEmail.affiliation.department") {{ userEmail.affiliation.department }} td a( href @@ -53,7 +56,7 @@ block content i.fa.fa-fw.fa-spin.fa-refresh |  Loading... - tr( + tr.affiliations-table-highlighted-row( ng-if="!ui.showAddEmailUI && !ui.isLoadingEmails" ) td(colspan="3") @@ -100,72 +103,73 @@ block content href ng-click="selectUniversityManually();" ) Let us know - div( + .affiliations-form-group( ng-if="ui.showManualUniversitySelectionUI" ) - .affiliations-form-group - ui-select( - ng-model="newAffiliation.country" - ) - ui-select-match( - placeholder="Country" - ) {{ $select.selected.name }} - ui-select-choices( - repeat="country in countries | filter: $select.search" - ) - span( - ng-bind="country.name" - s) - .affiliations-form-group - ui-select( - ng-model="newAffiliation.university" - ng-disabled="!newAffiliation.country" - tagging="addUniversityToSelection" - tagging-label="false" - ) - ui-select-match( - placeholder="Institution" - ) {{ $select.selected.name }} - ui-select-choices( - repeat="university in universities | filter: $select.search" - ) - span( - ng-bind="university.name" - ) - .affiliations-form-group( - ng-if="ui.isValidEmail && newAffiliation.university" + ui-select( + ng-model="newAffiliation.country" ) - input.form-control( - type="text" - id="affiliations-role" - placeholder="Role" - ng-model="newAffiliation.role" - s) - .affiliations-form-group( - ng-if="ui.isValidEmail && newAffiliation.university" + ui-select-match( + placeholder="Country" + ) {{ $select.selected.name }} + ui-select-choices( + repeat="country in countries | filter: $select.search" + ) + span( + ng-bind="country.name" + s) + .affiliations-form-group( + ng-if="ui.showManualUniversitySelectionUI" + ) + ui-select( + ng-model="newAffiliation.university" + ng-disabled="!newAffiliation.country" + tagging="addUniversityToSelection" + tagging-label="false" ) - input.form-control( - type="text" - id="affiliations-department" + ui-select-match( + placeholder="Institution" + ) {{ $select.selected.name }} + ui-select-choices( + repeat="university in universities | filter: $select.search" + ) + span( + ng-bind="university.name" + ) + .affiliations-form-group( + ng-if="ui.isValidEmail && newAffiliation.university" + ) + input.form-control( + type="text" + id="affiliations-role" + placeholder="Role" + ng-model="newAffiliation.role" + ) + .affiliations-form-group( + ng-if="ui.isValidEmail && newAffiliation.university" + ) + input.form-control( + type="text" + id="affiliations-department" + placeholder="Department" + ng-model="newAffiliation.department" + ng-if="!newAffiliation.university.departments || newAffiliation.university.departments.length === 0" + ) + ui-select( + ng-model="newAffiliation.department" + ng-if="newAffiliation.university.departments.length > 0" + tagging + tagging-label="false" + ) + ui-select-match( placeholder="Department" - ng-model="newAffiliation.department" - ng-if="!newAffiliation.university.departments || newAffiliation.university.departments.length === 0" + ) {{ $select.selected }} + ui-select-choices( + repeat="department in getUniqueUniversityDepartments() | filter: $select.search" ) - ui-select( - ng-model="newAffiliation.department" - ng-if="newAffiliation.university.departments.length > 0" - tagging - tagging-label="false" - ) - ui-select-match( - placeholder="Department" - ) {{ $select.selected }} - ui-select-choices( - repeat="department in getUniqueUniversityDepartments() | filter: $select.search" + span( + ng-bind="department" ) - span( - ng-bind="department" - ) td button.btn.btn-primary( ng-disabled="affiliationsForm.$invalid || ui.isAddingNewEmail" diff --git a/services/web/public/coffee/components/inputSuggestions.coffee b/services/web/public/coffee/components/inputSuggestions.coffee index c9907fe26e..b48df8391c 100644 --- a/services/web/public/coffee/components/inputSuggestions.coffee +++ b/services/web/public/coffee/components/inputSuggestions.coffee @@ -45,8 +45,8 @@ define [ controller: inputSuggestionsController template: """
-
- +
+
diff --git a/services/web/public/coffee/main/affiliations/controllers/UserAffiliationsController.coffee b/services/web/public/coffee/main/affiliations/controllers/UserAffiliationsController.coffee index b8b867d411..d212a44bdf 100644 --- a/services/web/public/coffee/main/affiliations/controllers/UserAffiliationsController.coffee +++ b/services/web/public/coffee/main/affiliations/controllers/UserAffiliationsController.coffee @@ -28,7 +28,7 @@ define [ $scope.ui.isBlacklistedEmail = UserAffiliationsDataService.isDomainBlacklisted userInputLocalAndDomain.domain UserAffiliationsDataService.getUniversityDomainFromPartialDomainInput(userInputLocalAndDomain.domain) - .then (universityDomain) -> + .then (universityDomain) -> if userInputLocalAndDomain.domain == universityDomain.hostname $scope.newAffiliation.university = universityDomain.university $scope.newAffiliation.department = universityDomain.department diff --git a/services/web/public/coffee/main/affiliations/factories/UserAffiliationsDataService.coffee b/services/web/public/coffee/main/affiliations/factories/UserAffiliationsDataService.coffee index 7ee1323f4e..e51eaed703 100644 --- a/services/web/public/coffee/main/affiliations/factories/UserAffiliationsDataService.coffee +++ b/services/web/public/coffee/main/affiliations/factories/UserAffiliationsDataService.coffee @@ -28,7 +28,7 @@ define [ universitiesFromCountry = universities[country.code] else universitiesFromCountry = $http - .get "http://www.overleaf.test:5000/universities/list.json" , { params: { country_code: country.code } } + .get "/institutions/list" , { params: { country_code: country.code } } .then (response) -> universities[country.code] = response.data $q.resolve(universitiesFromCountry) @@ -36,7 +36,7 @@ define [ if universitiesByDomain[partialDomainInput]? $q.resolve universitiesByDomain[partialDomainInput] else - $http.get "http://www.overleaf.test:5000/university/domains.json" , { params: { hostname: partialDomainInput, limit: 1 } } + $http.get "/institutions/domains" , { params: { hostname: partialDomainInput, limit: 1 } } .then (response) -> university = response.data[0] if university? diff --git a/services/web/public/stylesheets/app/account-settings.less b/services/web/public/stylesheets/app/account-settings.less index 424ab84995..bf399b316c 100644 --- a/services/web/public/stylesheets/app/account-settings.less +++ b/services/web/public/stylesheets/app/account-settings.less @@ -28,9 +28,9 @@ } .affiliations-form-group { - margin-bottom: @table-cell-padding; - &:last-of-type { - margin-bottom: 0; + margin-top: @table-cell-padding; + &:first-child { + margin-top: 0; } } .affiliations-table-label { diff --git a/services/web/public/stylesheets/components/input-suggestions.less b/services/web/public/stylesheets/components/input-suggestions.less index 93afe4cfa4..bf2fd4a253 100644 --- a/services/web/public/stylesheets/components/input-suggestions.less +++ b/services/web/public/stylesheets/components/input-suggestions.less @@ -5,7 +5,7 @@ .input-suggestions-main { position: absolute; top: 0; - // background-color: transparent; + background-color: transparent; } .input-suggestions-shadow {