Update feature flag for affiliations; use it in the router; minor style adjustments.

This commit is contained in:
Paulo Reis 2018-07-06 12:03:26 +01:00 committed by James Allen
parent 85cf518457
commit a759828ece
5 changed files with 10 additions and 7 deletions

View file

@ -21,6 +21,6 @@ module.exports = Features =
when 'templates'
return !Settings.overleaf?
when 'affiliations'
return !(Settings.ldap? or Settings.saml?)
return settings?.apis?.v1?.url?
else
throw new Error("unknown feature: #{feature}")

View file

@ -116,7 +116,7 @@ module.exports = class Router
webRouter.post '/user/emails/confirm',
UserEmailsController.confirm
unless Features.externalAuthenticationSystemUsed()
if Features.hasFeature 'affiliations'
webRouter.post '/user/emails',
AuthenticationController.requireLogin(),
UserEmailsController.add

View file

@ -36,7 +36,7 @@ form.row(
a(
href
ng-click="changeAffiliation(userEmail);"
) #{translate("change")}
) #{translate("change")}
| )
.affiliation-change-container(
ng-if="isChangingAffiliation(userEmail.email)"
@ -51,19 +51,19 @@ form.row(
href
ng-click="saveAffiliationChange();"
) #{translate("save_or_cancel-save")}
| #{translate("save_or_cancel-or" )}
|  #{translate("save_or_cancel-or" )} 
a(
href
ng-click="cancelAffiliationChange();"
) #{translate("save_or_cancel-cancel")}
td
a(
a.affiliations-table-inline-action(
href
ng-if="!userEmail.default"
ng-click="setDefaultUserEmail(userEmail)"
) #{translate("make_default")}
br
a(
a.affiliations-table-inline-action(
href
ng-if="!userEmail.default"
ng-click="removeUserEmail(userEmail)"

View file

@ -81,7 +81,7 @@ define [
}
addRoleAndDepartment = (email, role, department) ->
$http.post "/endorse", {
$http.post "/user/emails/endorse", {
email,
role,
department,

View file

@ -26,6 +26,9 @@
.affiliations-table-inline-actions {
width: 20%;
}
.affiliations-table-inline-action {
text-transform: capitalize;
}
.affiliations-table-highlighted-row {
background-color: tint(@content-alt-bg-color, 6%);
}