2018-06-27 12:08:25 -04:00
|
|
|
form.row(
|
|
|
|
ng-controller="UserAffiliationsController"
|
|
|
|
name="affiliationsForm"
|
|
|
|
)
|
|
|
|
.col-md-12
|
2018-07-05 10:31:34 -04:00
|
|
|
h3 #{translate("emails_and_affiliations_title")}
|
|
|
|
p.small #{translate("emails_and_affiliations_explanation")}
|
2018-06-27 12:08:25 -04:00
|
|
|
table.table.affiliations-table
|
|
|
|
thead
|
|
|
|
tr
|
2018-07-05 10:31:34 -04:00
|
|
|
th.affiliations-table-email #{translate("email")}
|
|
|
|
th.affiliations-table-institution #{translate("institution_and_role")}
|
2018-06-27 12:08:25 -04:00
|
|
|
th.affiliations-table-inline-actions
|
2018-07-17 06:12:47 -04:00
|
|
|
tbody
|
2018-06-27 12:08:25 -04:00
|
|
|
tr(
|
|
|
|
ng-repeat="userEmail in userEmails"
|
|
|
|
)
|
2018-07-12 12:13:26 -04:00
|
|
|
td
|
|
|
|
| {{ userEmail.email + (userEmail.default ? ' (default)' : '') }}
|
2018-07-13 06:17:05 -04:00
|
|
|
div(ng-if="!userEmail.confirmedAt").small
|
2018-07-12 12:13:26 -04:00
|
|
|
strong #{translate('unconfirmed')}.
|
|
|
|
|
|
|
|
|
| #{translate('please_check_your_inbox')}.
|
|
|
|
br
|
|
|
|
a(
|
|
|
|
href,
|
|
|
|
ng-click="resendConfirmationEmail(userEmail)"
|
|
|
|
) #{translate('resend_confirmation_email')}
|
2018-08-27 05:26:13 -04:00
|
|
|
div(ng-if="userEmail.confirmedAt && userEmail.affiliation.institution && userEmail.affiliation.institution.confirmed && userEmail.affiliation.institution.licence != 'free'").small
|
|
|
|
span.label.label-primary #{translate("professional")}
|
2018-06-27 12:08:25 -04:00
|
|
|
td
|
2018-07-04 11:37:40 -04:00
|
|
|
div(ng-if="userEmail.affiliation.institution")
|
|
|
|
div {{ userEmail.affiliation.institution.name }}
|
2018-07-12 12:13:26 -04:00
|
|
|
span.small
|
|
|
|
a(
|
|
|
|
href
|
|
|
|
ng-if="!isChangingAffiliation(userEmail.email) && !userEmail.affiliation.role && !userEmail.affiliation.department"
|
|
|
|
ng-click="changeAffiliation(userEmail);"
|
|
|
|
) #{translate("add_role_and_department")}
|
|
|
|
div.small(
|
2018-07-04 11:37:40 -04:00
|
|
|
ng-if="!isChangingAffiliation(userEmail.email) && (userEmail.affiliation.role || userEmail.affiliation.department)"
|
|
|
|
)
|
|
|
|
span(ng-if="userEmail.affiliation.role") {{ userEmail.affiliation.role }}
|
|
|
|
span(ng-if="userEmail.affiliation.role && userEmail.affiliation.department") ,
|
|
|
|
span(ng-if="userEmail.affiliation.department") {{ userEmail.affiliation.department }}
|
2018-07-12 12:13:26 -04:00
|
|
|
br
|
2018-07-04 11:37:40 -04:00
|
|
|
a(
|
|
|
|
href
|
|
|
|
ng-click="changeAffiliation(userEmail);"
|
2018-07-06 07:03:26 -04:00
|
|
|
) #{translate("change")}
|
2018-07-05 10:31:34 -04:00
|
|
|
.affiliation-change-container(
|
2018-07-04 11:37:40 -04:00
|
|
|
ng-if="isChangingAffiliation(userEmail.email)"
|
|
|
|
)
|
|
|
|
affiliation-form(
|
|
|
|
affiliation-data="affiliationToChange"
|
|
|
|
show-university-and-country="false"
|
|
|
|
show-role-and-department="true"
|
|
|
|
)
|
2018-07-12 12:13:26 -04:00
|
|
|
.affiliation-change-actions.small
|
2018-08-27 05:32:24 -04:00
|
|
|
button.btn.btn-sm.btn-success(
|
2018-07-17 06:12:47 -04:00
|
|
|
ng-click="saveAffiliationChange(userEmail);"
|
2018-08-27 05:32:24 -04:00
|
|
|
ng-disabled="!(affiliationToChange.role && affiliationToChange.department)"
|
2018-07-05 10:31:34 -04:00
|
|
|
) #{translate("save_or_cancel-save")}
|
2018-08-28 11:34:49 -04:00
|
|
|
|  #{translate("save_or_cancel-or" )} 
|
2018-07-04 11:37:40 -04:00
|
|
|
a(
|
|
|
|
href
|
|
|
|
ng-click="cancelAffiliationChange();"
|
2018-07-05 10:31:34 -04:00
|
|
|
) #{translate("save_or_cancel-cancel")}
|
2018-07-12 12:13:26 -04:00
|
|
|
td.affiliations-table-inline-actions
|
|
|
|
// Disabled buttons don't work with tooltips, due to pointer-events: none,
|
|
|
|
// so create a wrapper for the tooltip
|
2018-07-13 06:19:49 -04:00
|
|
|
div.affiliations-table-inline-action-disabled-wrapper(
|
2018-07-12 12:13:26 -04:00
|
|
|
tooltip=translate("please_confirm_your_email_before_making_it_default")
|
2018-07-17 06:12:47 -04:00
|
|
|
tooltip-enable="!ui.isMakingRequest"
|
|
|
|
ng-if="!userEmail.default && (!userEmail.confirmedAt || ui.isMakingRequest)"
|
2018-07-12 12:13:26 -04:00
|
|
|
)
|
|
|
|
button.btn.btn-sm.btn-success.affiliations-table-inline-action(
|
|
|
|
disabled
|
|
|
|
) #{translate("make_default")}
|
|
|
|
button.btn.btn-sm.btn-success.affiliations-table-inline-action(
|
2018-07-17 06:12:47 -04:00
|
|
|
ng-if="!userEmail.default && (userEmail.confirmedAt && !ui.isMakingRequest)"
|
2018-07-04 11:54:04 -04:00
|
|
|
ng-click="setDefaultUserEmail(userEmail)"
|
2018-07-12 12:13:26 -04:00
|
|
|
) #{translate("make_default")}
|
|
|
|
|
|
|
|
|
button.btn.btn-sm.btn-danger.affiliations-table-inline-action(
|
2018-06-27 12:08:25 -04:00
|
|
|
ng-if="!userEmail.default"
|
2018-07-04 11:54:04 -04:00
|
|
|
ng-click="removeUserEmail(userEmail)"
|
2018-07-17 06:12:47 -04:00
|
|
|
ng-disabled="ui.isMakingRequest"
|
2018-07-12 12:13:26 -04:00
|
|
|
tooltip=translate("remove")
|
|
|
|
)
|
2018-11-19 04:41:34 -05:00
|
|
|
i.fa.fa-fw.fa-trash(aria-hidden="true")
|
2018-11-15 12:21:45 -05:00
|
|
|
span.sr-only #{translate("remove")}
|
2018-06-27 12:08:25 -04:00
|
|
|
tr.affiliations-table-highlighted-row(
|
2018-07-17 06:12:47 -04:00
|
|
|
ng-if="!ui.showAddEmailUI && !ui.isMakingRequest"
|
2018-06-27 12:08:25 -04:00
|
|
|
)
|
|
|
|
td(colspan="3")
|
|
|
|
a(
|
|
|
|
href
|
|
|
|
ng-click="showAddEmailForm()"
|
2018-07-05 10:31:34 -04:00
|
|
|
) #{translate("add_another_email")}
|
2018-06-27 12:08:25 -04:00
|
|
|
|
|
|
|
tr.affiliations-table-highlighted-row(
|
2018-07-17 06:12:47 -04:00
|
|
|
ng-if="ui.showAddEmailUI && !ui.isLoadingEmails"
|
2018-06-27 12:08:25 -04:00
|
|
|
)
|
|
|
|
td
|
|
|
|
.affiliations-form-group
|
|
|
|
input-suggestions(
|
|
|
|
ng-model="newAffiliation.email"
|
|
|
|
ng-model-options="{ allowInvalid: true }"
|
|
|
|
get-suggestion="getEmailSuggestion(userInput)"
|
|
|
|
on-blur="handleEmailInputBlur()"
|
|
|
|
input-id="affilitations-email"
|
|
|
|
input-name="affilitationsEmail"
|
|
|
|
input-placeholder="e.g. johndoe@mit.edu"
|
|
|
|
input-type="email"
|
|
|
|
input-required="true"
|
|
|
|
)
|
|
|
|
td
|
2018-07-12 12:13:26 -04:00
|
|
|
p.affiliations-table-label(
|
2018-06-27 12:08:25 -04:00
|
|
|
ng-if="newAffiliation.university && !ui.showManualUniversitySelectionUI"
|
|
|
|
)
|
2018-07-12 12:13:26 -04:00
|
|
|
| {{ newAffiliation.university.name }}
|
|
|
|
span.small
|
|
|
|
| (
|
|
|
|
a(
|
|
|
|
href
|
|
|
|
ng-click="selectUniversityManually();"
|
|
|
|
) #{translate("change")}
|
|
|
|
| )
|
2018-06-27 12:08:25 -04:00
|
|
|
.affiliations-table-label(
|
|
|
|
ng-if="!newAffiliation.university && !ui.isValidEmail && !ui.showManualUniversitySelectionUI"
|
2018-07-05 10:31:34 -04:00
|
|
|
) #{translate("start_by_adding_your_email")}
|
2018-06-27 12:08:25 -04:00
|
|
|
.affiliations-table-label(
|
|
|
|
ng-if="!newAffiliation.university && ui.isValidEmail && !ui.isBlacklistedEmail && !ui.showManualUniversitySelectionUI"
|
|
|
|
)
|
2018-07-05 10:31:34 -04:00
|
|
|
| #{translate("is_email_affiliated")}
|
2018-06-27 12:08:25 -04:00
|
|
|
br
|
|
|
|
a(
|
|
|
|
href
|
|
|
|
ng-click="selectUniversityManually();"
|
2018-07-05 10:31:34 -04:00
|
|
|
) #{translate("let_us_know")}
|
2018-07-03 11:47:02 -04:00
|
|
|
affiliation-form(
|
|
|
|
affiliation-data="newAffiliation"
|
|
|
|
show-university-and-country="ui.showManualUniversitySelectionUI"
|
|
|
|
show-role-and-department="ui.isValidEmail && newAffiliation.university"
|
2018-06-27 12:08:25 -04:00
|
|
|
)
|
|
|
|
td
|
2018-07-12 12:13:26 -04:00
|
|
|
button.btn.btn-sm.btn-primary(
|
2018-07-17 06:12:47 -04:00
|
|
|
ng-disabled="affiliationsForm.$invalid || ui.isMakingRequest"
|
2018-06-27 12:08:25 -04:00
|
|
|
ng-click="addNewEmail()"
|
|
|
|
)
|
2018-07-17 06:12:47 -04:00
|
|
|
| #{translate("add_new_email")}
|
|
|
|
tr.affiliations-table-highlighted-row(
|
|
|
|
ng-if="ui.isMakingRequest"
|
|
|
|
)
|
|
|
|
td.text-center(colspan="3", ng-if="ui.isLoadingEmails")
|
2018-11-19 04:41:34 -05:00
|
|
|
i.fa.fa-fw.fa-spin.fa-refresh(aria-hidden="true")
|
2018-07-17 06:12:47 -04:00
|
|
|
| #{translate("loading")}...
|
|
|
|
td.text-center(colspan="3", ng-if="ui.isResendingConfirmation")
|
2018-11-19 04:41:34 -05:00
|
|
|
i.fa.fa-fw.fa-spin.fa-refresh(aria-hidden="true")
|
2018-07-17 06:12:47 -04:00
|
|
|
| #{translate("sending")}...
|
|
|
|
td.text-center(colspan="3", ng-if="!ui.isLoadingEmails && !ui.isResendingConfirmation")
|
2018-11-19 04:41:34 -05:00
|
|
|
i.fa.fa-fw.fa-spin.fa-refresh(aria-hidden="true")
|
2018-07-17 06:12:47 -04:00
|
|
|
| #{translate("saving")}...
|
2018-07-05 06:36:02 -04:00
|
|
|
tr.affiliations-table-error-row(
|
2018-07-17 06:12:47 -04:00
|
|
|
ng-if="ui.hasError"
|
2018-07-05 06:36:02 -04:00
|
|
|
)
|
|
|
|
td.text-center(colspan="3")
|
|
|
|
div
|
2018-11-19 04:41:34 -05:00
|
|
|
i.fa.fa-fw.fa-exclamation-triangle(aria-hidden="true")
|
2018-07-17 06:12:47 -04:00
|
|
|
span(ng-if="!ui.errorMessage") #{translate("error_performing_request")}
|
|
|
|
span(ng-if="ui.errorMessage") {{ui.errorMessage}}
|
2018-07-05 06:36:02 -04:00
|
|
|
|
2018-07-03 11:47:02 -04:00
|
|
|
hr
|
|
|
|
|
|
|
|
script(type="text/ng-template", id="affiliationFormTpl")
|
|
|
|
.affiliations-form-group(
|
|
|
|
ng-if="$ctrl.showUniversityAndCountry"
|
|
|
|
)
|
|
|
|
ui-select(
|
|
|
|
ng-model="$ctrl.affiliationData.country"
|
|
|
|
)
|
|
|
|
ui-select-match(
|
|
|
|
placeholder="Country"
|
|
|
|
) {{ $select.selected.name }}
|
|
|
|
ui-select-choices(
|
|
|
|
repeat="country in $ctrl.countries | filter: $select.search"
|
|
|
|
)
|
|
|
|
span(
|
|
|
|
ng-bind="country.name"
|
|
|
|
)
|
|
|
|
.affiliations-form-group(
|
|
|
|
ng-if="$ctrl.showUniversityAndCountry"
|
|
|
|
)
|
|
|
|
ui-select(
|
|
|
|
ng-model="$ctrl.affiliationData.university"
|
|
|
|
ng-disabled="!$ctrl.affiliationData.country"
|
2018-08-24 10:29:48 -04:00
|
|
|
tagging="$ctrl.addUniversityToSelection"
|
2018-07-03 11:47:02 -04:00
|
|
|
tagging-label="false"
|
|
|
|
)
|
|
|
|
ui-select-match(
|
|
|
|
placeholder="Institution"
|
|
|
|
) {{ $select.selected.name }}
|
|
|
|
ui-select-choices(
|
|
|
|
repeat="university in $ctrl.universities | filter: $select.search"
|
2018-08-29 12:31:47 -04:00
|
|
|
refresh="$ctrl.handleFreeformInputChange($select, 'name');"
|
|
|
|
refresh-delay="10"
|
2018-07-03 11:47:02 -04:00
|
|
|
)
|
|
|
|
span(
|
|
|
|
ng-bind="university.name"
|
|
|
|
)
|
|
|
|
.affiliations-form-group(
|
|
|
|
ng-if="$ctrl.showRoleAndDepartment"
|
|
|
|
)
|
|
|
|
ui-select(
|
|
|
|
ng-model="$ctrl.affiliationData.role"
|
|
|
|
tagging
|
|
|
|
tagging-label="false"
|
|
|
|
)
|
|
|
|
ui-select-match(
|
|
|
|
placeholder="Role"
|
|
|
|
) {{ $select.selected }}
|
|
|
|
ui-select-choices(
|
|
|
|
repeat="role in $ctrl.roles | filter: $select.search"
|
2018-08-29 12:31:47 -04:00
|
|
|
refresh="$ctrl.handleFreeformInputChange($select);"
|
|
|
|
refresh-delay="10"
|
2018-07-03 11:47:02 -04:00
|
|
|
)
|
|
|
|
span(
|
|
|
|
ng-bind="role"
|
|
|
|
)
|
|
|
|
|
|
|
|
.affiliations-form-group(
|
|
|
|
ng-if="$ctrl.showRoleAndDepartment"
|
|
|
|
)
|
|
|
|
ui-select(
|
|
|
|
ng-model="$ctrl.affiliationData.department"
|
|
|
|
tagging
|
|
|
|
tagging-label="false"
|
|
|
|
)
|
|
|
|
ui-select-match(
|
|
|
|
placeholder="Department"
|
|
|
|
) {{ $select.selected }}
|
|
|
|
ui-select-choices(
|
|
|
|
repeat="department in $ctrl.departments | filter: $select.search"
|
2018-08-29 12:31:47 -04:00
|
|
|
refresh="$ctrl.handleFreeformInputChange($select);"
|
|
|
|
refresh-delay="10"
|
2018-07-03 11:47:02 -04:00
|
|
|
)
|
|
|
|
span(
|
|
|
|
ng-bind="department"
|
|
|
|
)
|