Use existing notification styling

This commit is contained in:
hugh-obrien 2018-09-18 10:54:13 +01:00
parent f76ff55b6f
commit 2d40c3d21a
5 changed files with 31 additions and 33 deletions

View file

@ -22,25 +22,6 @@ if hasFeature('v2-banner')
span(aria-hidden="true") × span(aria-hidden="true") ×
span.sr-only #{translate("close")} span.sr-only #{translate("close")}
.userNotifications
ul.list-unstyled.notifications-list(
ng-controller="UserAffiliationsController",
ng-cloak
)
li.notification_entry(
ng-repeat="userEmail in userEmails",
ng-if="!userEmail.confirmedAt"
)
.row
.col-xs-12
.alert.alert-email
.notification_inner
| Please confirm your email {{userEmail.email}} by clicking on the link in the confirmation email
a(
href,
ng-click="resendConfirmationEmail(userEmail)"
) (#{translate('resend_confirmation_email')})
span(ng-controller="NotificationsController").userNotifications span(ng-controller="NotificationsController").userNotifications
ul.list-unstyled.notifications-list( ul.list-unstyled.notifications-list(
ng-if="notifications.length > 0", ng-if="notifications.length > 0",
@ -101,3 +82,21 @@ span(ng-controller="NotificationsController").userNotifications
button(ng-click="dismiss(notification)").close.pull-right button(ng-click="dismiss(notification)").close.pull-right
span(aria-hidden="true") × span(aria-hidden="true") ×
span.sr-only #{translate("close")} span.sr-only #{translate("close")}
ul.list-unstyled.notifications-list(
ng-controller="EmailNotificationController",
ng-cloak
)
li.notification_entry(
ng-repeat="userEmail in userEmails",
ng-if="!userEmail.confirmedAt"
)
.row
.col-xs-12
.alert.alert-warning
.notification_inner
| Please confirm your email {{userEmail.email}} by clicking on the link in the confirmation email
a(
href,
ng-click="resendConfirmationEmail(userEmail)"
) (#{translate('resend_confirmation_email')})

View file

@ -53,3 +53,16 @@ define [
localStorage('overleaf_v1_notification_hidden_at', Date.now()) localStorage('overleaf_v1_notification_hidden_at', Date.now())
else else
localStorage('overleaf_v1_notification_hidden_at', null) localStorage('overleaf_v1_notification_hidden_at', null)
App.controller "EmailNotificationController", ($scope, $http, UserAffiliationsDataService) ->
$scope.userEmails = []
_getUserEmails = () ->
UserAffiliationsDataService
.getUserEmails().then (emails) ->
$scope.userEmails = emails
_getUserEmails()
$scope.resendConfirmationEmail = (userEmail) ->
UserAffiliationsDataService
.resendConfirmationEmail userEmail.email

View file

@ -75,11 +75,3 @@
text-decoration: none; text-decoration: none;
} }
} }
.alert-email {
.alert-variant(@alert-email-bg; @alert-email-border; @alert-email-text);
a {
color: @link-color;
}
}

View file

@ -586,9 +586,6 @@
@alert-danger-text: @state-danger-text; @alert-danger-text: @state-danger-text;
@alert-danger-border: @state-danger-border; @alert-danger-border: @state-danger-border;
@alert-email-bg : white;
@alert-email-text : #FFF;
@alert-email-border : @red;
//== Progress bars //== Progress bars
// //

View file

@ -108,9 +108,6 @@
@alert-danger-text : #FFF; @alert-danger-text : #FFF;
@alert-danger-border : transparent; @alert-danger-border : transparent;
@alert-email-bg : #FFF;
@alert-email-text : @ol-type-color;
@alert-email-border : @ol-green;
// Tags // Tags
@tag-border-radius : 9999px; @tag-border-radius : 9999px;