notifications.pug 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. include ../../_mixins/saml
  2. .user-notifications(ng-controller="NotificationsController")
  3. ul.list-unstyled(
  4. ng-if="notifications.length > 0 && projects.length > 0",
  5. ng-cloak
  6. )
  7. li.notification-entry(
  8. ng-repeat="notification in notifications"
  9. )
  10. div(ng-switch="notification.templateKey" ng-hide="notification.hide")
  11. .alert.alert-info(
  12. ng-switch-when="notification_project_invite",
  13. ng-controller="ProjectInviteNotificationController"
  14. )
  15. .notification-body
  16. span(ng-show="!notification.accepted") !{translate("notification_project_invite_message", { userName: "{{ userName }}", projectName: "{{ projectName }}" })}
  17. span(ng-show="notification.accepted") !{translate("notification_project_invite_accepted_message", { projectName: "{{ projectName }}" })}
  18. .notification-action
  19. a.pull-right.btn.btn-sm.btn-info(
  20. ng-show="notification.accepted",
  21. href="/project/{{ notification.messageOpts.projectId }}"
  22. ) #{translate("open_project")}
  23. a.pull-right.btn.btn-sm.btn-info(
  24. href,
  25. ng-click="accept()",
  26. ng-disabled="notification.inflight",
  27. ng-show="!notification.accepted"
  28. )
  29. span(ng-show="!notification.inflight") #{translate("join_project")}
  30. span(ng-show="notification.inflight")
  31. i.fa.fa-fw.fa-spinner.fa-spin(aria-hidden="true")
  32. |  
  33. | #{translate("joining")}…
  34. .notification-close
  35. button(ng-click="dismiss(notification)").close.pull-right
  36. span(aria-hidden="true") ×
  37. span.sr-only #{translate("close")}
  38. .alert.alert-info(
  39. ng-switch-when="wfh_2020_upgrade_offer"
  40. )
  41. .notification-body
  42. span Important notice: Your free WFH2020 upgrade came to an end on June 30th 2020. We're providing specially discounted annual plans to help you continue collaborating throughout 2020.
  43. .notification-action
  44. a.pull-right.btn.btn-sm.btn-info(href="https://www.overleaf.com/events/wfh2020") Upgrade
  45. .notification-close
  46. button(ng-click="dismiss(notification)").close.pull-right
  47. span(aria-hidden="true") ×
  48. span.sr-only #{translate("close")}
  49. .alert.alert-info(
  50. ng-switch-when="notification_ip_matched_affiliation"
  51. )
  52. .notification-body
  53. | It looks like you're at 
  54. strong {{ notification.messageOpts.university_name }}! <br/>
  55. | Did you know that {{notification.messageOpts.university_name}} is providing
  56. strong free Overleaf Professional accounts
  57. | to everyone at {{notification.messageOpts.university_name}}? <br/>
  58. | Add an institutional email address to claim your account.
  59. .notification-action
  60. a.pull-right.btn.btn-sm.btn-info(href="/user/settings")
  61. | Add Affiliation
  62. .notification-close
  63. button.btn-sm(ng-click="dismiss(notification)").close.pull-right
  64. span(aria-hidden="true") &times;
  65. span.sr-only #{translate("close")}
  66. .alert.alert-danger(
  67. ng-switch-when="notification_tpds_file_limit"
  68. )
  69. .notification-body
  70. | Error: Your project
  71. strong {{ notification.messageOpts.projectName }}
  72. | has gone over the 2000 file limit using an integration (e.g. Dropbox or Github) <br/>
  73. | Please decrease the size of your project to prevent further errors.
  74. .notification-action
  75. a.pull-right.btn.btn-sm.btn-info(href="/user/settings")
  76. | Account Settings
  77. .notification-close
  78. button.btn-sm(ng-click="dismiss(notification)").close.pull-right
  79. span(aria-hidden="true") &times;
  80. span.sr-only #{translate("close")}
  81. .alert.alert-info(
  82. ng-switch-default
  83. )
  84. span(ng-bind-html="notification.html").notification-body
  85. .notification-close
  86. button(ng-click="dismiss(notification)").close.pull-right
  87. span(aria-hidden="true") &times;
  88. span.sr-only #{translate("close")}
  89. ul.list-unstyled(
  90. ng-if="notificationsInstitution.length > 0",
  91. ng-cloak
  92. )
  93. li.notification-entry(
  94. ng-repeat="notification in notificationsInstitution"
  95. )
  96. div(ng-switch="notification.templateKey" ng-hide="notification.hide")
  97. .alert.alert-info(
  98. ng-switch-when="notification_institution_sso_available"
  99. )
  100. .notification-body
  101. p !{translate("can_link_institution_email_acct_to_institution_acct", {appName: settings.appName, email: "{{notification.email}}", institutionName: "{{notification.institutionName}}"})}
  102. div !{translate("doing_this_allow_log_in_through_institution", {appName: settings.appName})}
  103. .notification-action
  104. a.btn.btn-sm.btn-info(href="{{samlInitPath}}?university_id={{notification.institutionId}}&auto=/project&email={{notification.email}}")
  105. | #{translate('link_account')}
  106. .alert.alert-info(
  107. ng-switch-when="notification_institution_sso_linked"
  108. )
  109. .notification-body
  110. div !{translate("account_has_been_link_to_institution_account", {appName: settings.appName, email: "{{notification.email}}", institutionName: "{{notification.institutionName}}"})}
  111. .notification-close
  112. button(ng-click="dismiss(notification)").close.pull-right
  113. span(aria-hidden="true") &times;
  114. span.sr-only #{translate("close")}
  115. .alert.alert-warning(
  116. ng-switch-when="notification_institution_sso_non_canonical"
  117. )
  118. .notification-body
  119. div
  120. i.fa.fa-fw.fa-exclamation-triangle(aria-hidden="true")
  121. | !{translate("tried_to_log_in_with_email", {email: "{{notification.requestedEmail}}"})} !{translate("in_order_to_match_institutional_metadata_associated", {email: "{{notification.institutionEmail}}"})}
  122. .notification-close
  123. button(ng-click="dismiss(notification)").close.pull-right
  124. span(aria-hidden="true") &times;
  125. span.sr-only #{translate("close")}
  126. .alert.alert-info(
  127. ng-switch-when="notification_institution_sso_already_registered"
  128. )
  129. .notification-body
  130. | !{translate("tried_to_register_with_email", {appName: settings.appName, email: "{{notification.email}}"})}
  131. | #{translate("we_logged_you_in")}
  132. .notification-action
  133. a.btn.btn-sm.btn-info(href="/learn/how-to/Institutional_Login")
  134. | #{translate("find_out_more")}
  135. .notification-close
  136. button(ng-click="dismiss(notification)").close.pull-right
  137. span(aria-hidden="true") &times;
  138. span.sr-only #{translate("close")}
  139. .alert.alert-danger(
  140. ng-switch-when="notification_institution_sso_linked_by_another"
  141. )
  142. .notification-body
  143. div
  144. i.fa.fa-fw.fa-exclamation-triangle(aria-hidden="true")
  145. | !{translate("institution_account_tried_to_add_already_registered")}
  146. .notification-close
  147. button(ng-click="dismiss(notification)").close.pull-right
  148. span(aria-hidden="true") &times;
  149. span.sr-only #{translate("close")}
  150. if institutionLinkingError
  151. .alert.alert-danger(ng-switch-when="notification_institution_sso_error")
  152. .notification-body
  153. div
  154. +samlErrorLoggedIn(institutionLinkingError)
  155. .notification-close
  156. button(ng-click="dismiss(notification)").close.pull-right
  157. span(aria-hidden="true") &times;
  158. span.sr-only #{translate("close")}
  159. ul.list-unstyled(
  160. ng-controller="EmailNotificationController",
  161. ng-cloak
  162. )
  163. li.notification-entry(
  164. ng-repeat="userEmail in userEmails",
  165. ng-if="showConfirmEmail(userEmail) && projects.length > 0"
  166. )
  167. .alert.alert-warning(ng-if="!userEmail.confirmationInflight")
  168. .notification-body
  169. | #{translate("please_confirm_email", {emailAddress: "{{ userEmail.email }}"})}
  170. |
  171. a(
  172. href
  173. ng-click="resendConfirmationEmail(userEmail)"
  174. ) (#{translate('resend_confirmation_email')})
  175. .alert.alert-warning(ng-if="userEmail.confirmationInflight")
  176. .notification-body
  177. i.fa.fa-spinner.fa-spin(aria-hidden="true")
  178. |
  179. | #{translate('resending_confirmation_email')}&hellip;
  180. - var hasPaidAffiliation = userAffiliations.some(affiliation => affiliation.licence && affiliation.licence !== 'free')
  181. if settings.enableSubscriptions && !hasSubscription && !hasPaidAffiliation
  182. ul.list-unstyled(
  183. ng-controller="DismissableNotificationsController",
  184. ng-cloak
  185. )
  186. li.notification-entry(
  187. ng-if="shouldShowNotification && projects.length > 0"
  188. )
  189. .alert.alert-info
  190. .notification-body
  191. span To help you work from home throughout 2020 and beyond, we're providing specially discounted annual plans.
  192. .notification-action
  193. a.pull-right.btn.btn-sm.btn-info(href="https://www.overleaf.com/events/wfh2020") Upgrade
  194. .notification-close
  195. button(ng-click="dismiss()").close.pull-right
  196. span(aria-hidden="true") &times;
  197. span.sr-only #{translate("close")}