mirror of
https://github.com/overleaf/overleaf.git
synced 2024-09-16 02:52:31 -04:00
recomend roles and still show form when complete
This commit is contained in:
parent
a1055b226c
commit
7355a912b6
4 changed files with 25 additions and 13 deletions
|
@ -101,7 +101,7 @@ block content
|
||||||
ul#projectList
|
ul#projectList
|
||||||
mixin projectList(projects)
|
mixin projectList(projects)
|
||||||
|
|
||||||
.span3#userProfileInformation()
|
.span3#userProfileInformation(ng-cloak)
|
||||||
div(ng-controller="UpdateForm").userProfileInformationArea
|
div(ng-controller="UpdateForm").userProfileInformationArea
|
||||||
div(ng-hide="hidePersonalInfoSection").alert.alert-info
|
div(ng-hide="hidePersonalInfoSection").alert.alert-info
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ block content
|
||||||
.progress
|
.progress
|
||||||
.bar.bar-success(ng-style="{'width' : (percentComplete+'%')}")
|
.bar.bar-success(ng-style="{'width' : (percentComplete+'%')}")
|
||||||
|
|
||||||
button#completeUserProfileInformation.btn.btn-primary(ng-hide="formVisable", ng-click="formVisable = true") Complete now
|
button#completeUserProfileInformation.btn.btn-primary(ng-hide="formVisable", ng-click="showForm()") Complete now
|
||||||
|
|
||||||
div(ng-show="formVisable")
|
div(ng-show="formVisable")
|
||||||
form(enctype='multipart/form-data', method='post')
|
form(enctype='multipart/form-data', method='post')
|
||||||
|
@ -124,9 +124,11 @@ block content
|
||||||
.input
|
.input
|
||||||
input(type='text', name='last_name', ng-model="userInfoForm.last_name", ng-blur="sendUpdate()", placeholder='Last Name')
|
input(type='text', name='last_name', ng-model="userInfoForm.last_name", ng-blur="sendUpdate()", placeholder='Last Name')
|
||||||
.input#institution_auto_complete
|
.input#institution_auto_complete
|
||||||
autocomplete(ng-model="userInfoForm.institution", data="institutions", on-type="updateInstitutionsList", attr-placeholder="Institution")
|
autocomplete(ng-model="userInfoForm.institution", data="institutions", ng-blur="sendUpdate()", on-type="updateInstitutionsList", attr-placeholder="Institution")
|
||||||
.input
|
.input
|
||||||
input(type='text', name='role', ng-model="userInfoForm.role", placeholder='Role', ng-blur="sendUpdate()")
|
input(type='text', name='role', ng-model="userInfoForm.role", placeholder='Role', ng-blur="sendUpdate()", list="_roles")
|
||||||
|
datalist#_roles
|
||||||
|
option(ng-repeat='role in roles') {{role}}
|
||||||
.span3
|
.span3
|
||||||
.tag-list
|
.tag-list
|
||||||
h2 Tags
|
h2 Tags
|
||||||
|
|
|
@ -7,7 +7,9 @@ define ["libs/algolia", "libs/angular", "libs/angular-autocomplete/angular-autoc
|
||||||
|
|
||||||
app.controller "UpdateForm", ($scope, $http, Institutions)->
|
app.controller "UpdateForm", ($scope, $http, Institutions)->
|
||||||
$scope.institutions = []
|
$scope.institutions = []
|
||||||
|
$scope.formVisable = false
|
||||||
$scope.hidePersonalInfoSection = true
|
$scope.hidePersonalInfoSection = true
|
||||||
|
$scope.roles = ["Student", "Post-graduate student", "Post-doctoral researcher", "Lecturer", "Proffessor"]
|
||||||
|
|
||||||
$http.get("/user/personal_info").success (data)->
|
$http.get("/user/personal_info").success (data)->
|
||||||
$scope.userInfoForm =
|
$scope.userInfoForm =
|
||||||
|
@ -21,10 +23,12 @@ define ["libs/algolia", "libs/angular", "libs/angular-autocomplete/angular-autoc
|
||||||
$scope.percentComplete = getPercentComplete()
|
$scope.percentComplete = getPercentComplete()
|
||||||
$scope.hidePersonalInfoSection = false
|
$scope.hidePersonalInfoSection = false
|
||||||
|
|
||||||
|
$scope.showForm = ->
|
||||||
|
$scope.formVisable = true
|
||||||
|
|
||||||
$scope.sendUpdate = ->
|
$scope.sendUpdate = ->
|
||||||
request = $http.post "/user/personal_info", $scope.userInfoForm
|
request = $http.post "/user/personal_info", $scope.userInfoForm
|
||||||
request.success (data, status)->
|
request.success (data, status)->
|
||||||
console.log "the post worked"
|
|
||||||
request.error (data, status)->
|
request.error (data, status)->
|
||||||
console.log "the request failed"
|
console.log "the request failed"
|
||||||
$scope.percentComplete = getPercentComplete()
|
$scope.percentComplete = getPercentComplete()
|
||||||
|
@ -37,5 +41,7 @@ define ["libs/algolia", "libs/angular", "libs/angular-autocomplete/angular-autoc
|
||||||
Institutions.search $scope.userInfoForm.institution, (err, response)->
|
Institutions.search $scope.userInfoForm.institution, (err, response)->
|
||||||
$scope.institutions = _.pluck response.hits, "name"
|
$scope.institutions = _.pluck response.hits, "name"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
angular.bootstrap(document.getElementById("userProfileInformation"), ['userProfileInformationApp'])
|
angular.bootstrap(document.getElementById("userProfileInformation"), ['userProfileInformationApp'])
|
||||||
|
|
||||||
|
|
|
@ -297,7 +297,7 @@ a.archived-projects {
|
||||||
}
|
}
|
||||||
|
|
||||||
.autocomplete li.active{
|
.autocomplete li.active{
|
||||||
background-color: #BDE1F6;
|
background-color: #b5d4fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.autocomplete .highlight {
|
.autocomplete .highlight {
|
||||||
|
|
|
@ -80,3 +80,7 @@ input.large{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue