From 2d40c3d21aa9226b14ff7dadbf9e387cff00987e Mon Sep 17 00:00:00 2001 From: hugh-obrien Date: Tue, 18 Sep 2018 10:54:13 +0100 Subject: [PATCH] Use existing notification styling --- .../app/views/project/list/notifications.pug | 37 +++++++++---------- .../notifications-controller.coffee | 13 +++++++ .../public/stylesheets/components/alerts.less | 8 ---- .../stylesheets/core/_common-variables.less | 3 -- .../public/stylesheets/core/ol-variables.less | 3 -- 5 files changed, 31 insertions(+), 33 deletions(-) diff --git a/services/web/app/views/project/list/notifications.pug b/services/web/app/views/project/list/notifications.pug index 1593d00309..7b991c40a9 100644 --- a/services/web/app/views/project/list/notifications.pug +++ b/services/web/app/views/project/list/notifications.pug @@ -22,25 +22,6 @@ if hasFeature('v2-banner') span(aria-hidden="true") × 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 ul.list-unstyled.notifications-list( ng-if="notifications.length > 0", @@ -101,3 +82,21 @@ span(ng-controller="NotificationsController").userNotifications button(ng-click="dismiss(notification)").close.pull-right span(aria-hidden="true") × 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')}) diff --git a/services/web/public/coffee/main/project-list/notifications-controller.coffee b/services/web/public/coffee/main/project-list/notifications-controller.coffee index 647ffd8c88..8e9e49677c 100644 --- a/services/web/public/coffee/main/project-list/notifications-controller.coffee +++ b/services/web/public/coffee/main/project-list/notifications-controller.coffee @@ -53,3 +53,16 @@ define [ localStorage('overleaf_v1_notification_hidden_at', Date.now()) else 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 diff --git a/services/web/public/stylesheets/components/alerts.less b/services/web/public/stylesheets/components/alerts.less index a68c73929f..049aa6652b 100755 --- a/services/web/public/stylesheets/components/alerts.less +++ b/services/web/public/stylesheets/components/alerts.less @@ -74,12 +74,4 @@ .btn { text-decoration: none; } -} - -.alert-email { - .alert-variant(@alert-email-bg; @alert-email-border; @alert-email-text); - - a { - color: @link-color; - } } \ No newline at end of file diff --git a/services/web/public/stylesheets/core/_common-variables.less b/services/web/public/stylesheets/core/_common-variables.less index b23f8a7211..9d7eab3493 100644 --- a/services/web/public/stylesheets/core/_common-variables.less +++ b/services/web/public/stylesheets/core/_common-variables.less @@ -586,9 +586,6 @@ @alert-danger-text: @state-danger-text; @alert-danger-border: @state-danger-border; -@alert-email-bg : white; -@alert-email-text : #FFF; -@alert-email-border : @red; //== Progress bars // diff --git a/services/web/public/stylesheets/core/ol-variables.less b/services/web/public/stylesheets/core/ol-variables.less index 7999a54067..fb242e831a 100644 --- a/services/web/public/stylesheets/core/ol-variables.less +++ b/services/web/public/stylesheets/core/ol-variables.less @@ -108,9 +108,6 @@ @alert-danger-text : #FFF; @alert-danger-border : transparent; -@alert-email-bg : #FFF; -@alert-email-text : @ol-type-color; -@alert-email-border : @ol-green; // Tags @tag-border-radius : 9999px;