notifications.pug 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. include ../../_mixins/reconfirm_affiliation
  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 still providing a number of special initiatives 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") View
  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. ng-if="notification.messageOpts.ssoEnabled"
  52. )
  53. .notification-body
  54. | !{translate("looks_like_youre_at", {institutionName: '{{notification.messageOpts.university_name}}'}, ['strong'])}
  55. br
  56. | !{translate("you_can_now_log_in_sso", {}, ['strong'])}
  57. br
  58. | #{translate("link_institutional_email_get_started", {}, ['strong'])} 
  59. a(
  60. ng-href="{{notification.messageOpts.portalPath || 'https://www.overleaf.com/learn/how-to/Institutional_Login'}}"
  61. ) #{translate("find_out_more_nt")}
  62. .notification-action
  63. a.pull-right.btn.btn-sm.btn-info(
  64. href=`{{samlInitPath}}?university_id={{notification.messageOpts.institutionId}}&auto=/project`
  65. )
  66. | #{translate("link_account")}
  67. .notification-close
  68. button.btn-sm(ng-click="dismiss(notification)").close.pull-right
  69. span(aria-hidden="true") ×
  70. span.sr-only #{translate("close")}
  71. .alert.alert-info(
  72. ng-switch-when="notification_ip_matched_affiliation"
  73. ng-if="!notification.messageOpts.ssoEnabled"
  74. )
  75. .notification-body
  76. | !{translate("looks_like_youre_at", {institutionName: '{{notification.messageOpts.university_name}}'}, ['strong'])}
  77. br
  78. | !{translate("did_you_know_institution_providing_professional", {institutionName: '{{notification.messageOpts.university_name}}'}, ['strong'])}
  79. br
  80. | #{translate("add_email_to_claim_features")}
  81. .notification-action
  82. a.pull-right.btn.btn-sm.btn-info(
  83. href="/user/settings"
  84. ) #{translate("add_affiliation")}
  85. .notification-close
  86. button.btn-sm(ng-click="dismiss(notification)").close.pull-right
  87. span(aria-hidden="true") ×
  88. span.sr-only #{translate("close")}
  89. .alert.alert-danger(
  90. ng-switch-when="notification_tpds_file_limit"
  91. )
  92. .notification-body
  93. | Error: Your project
  94. strong {{ notification.messageOpts.projectName }}
  95. | has gone over the 2000 file limit using an integration (e.g. Dropbox or Github) <br/>
  96. | Please decrease the size of your project to prevent further errors.
  97. .notification-action
  98. a.pull-right.btn.btn-sm.btn-info(href="/user/settings")
  99. | Account Settings
  100. .notification-close
  101. button.btn-sm(ng-click="dismiss(notification)").close.pull-right
  102. span(aria-hidden="true") &times;
  103. span.sr-only #{translate("close")}
  104. .alert.alert-warning(
  105. ng-switch-when="notification_dropbox_duplicate_project_names"
  106. )
  107. .notification-body
  108. | !{translate("dropbox_duplicate_project_names", {projectName: '{{notification.messageOpts.projectName}}'}, ['strong'])}
  109. .notification-close
  110. button.btn-sm(ng-click="dismiss(notification)").close.pull-right
  111. span(aria-hidden="true") &times;
  112. span.sr-only #{translate("close")}
  113. .alert.alert-info(
  114. ng-switch-default
  115. )
  116. span(ng-bind-html="notification.html").notification-body
  117. .notification-close
  118. button(ng-click="dismiss(notification)").close.pull-right
  119. span(aria-hidden="true") &times;
  120. span.sr-only #{translate("close")}
  121. ul.list-unstyled(
  122. ng-if="notificationsInstitution.length > 0",
  123. ng-cloak
  124. )
  125. li.notification-entry(
  126. ng-repeat="notification in notificationsInstitution"
  127. )
  128. div(ng-switch="notification.templateKey" ng-hide="notification.hide")
  129. .alert.alert-info(
  130. ng-switch-when="notification_institution_sso_available"
  131. )
  132. .notification-body
  133. p !{translate("can_link_institution_email_acct_to_institution_acct", {appName: settings.appName, email: "{{notification.email}}", institutionName: "{{notification.institutionName}}"})}
  134. div !{translate("doing_this_allow_log_in_through_institution", {appName: settings.appName})}
  135. .notification-action
  136. a.btn.btn-sm.btn-info(href="{{samlInitPath}}?university_id={{notification.institutionId}}&auto=/project&email={{notification.email}}")
  137. | #{translate('link_account')}
  138. .alert.alert-info(
  139. ng-switch-when="notification_institution_sso_linked"
  140. )
  141. .notification-body
  142. div !{translate("account_has_been_link_to_institution_account", {appName: settings.appName, email: "{{notification.email}}", institutionName: "{{notification.institutionName}}"})}
  143. .notification-close
  144. button(ng-click="dismiss(notification)").close.pull-right
  145. span(aria-hidden="true") &times;
  146. span.sr-only #{translate("close")}
  147. .alert.alert-warning(
  148. ng-switch-when="notification_institution_sso_non_canonical"
  149. )
  150. .notification-body
  151. div
  152. i.fa.fa-fw.fa-exclamation-triangle(aria-hidden="true")
  153. | !{translate("tried_to_log_in_with_email", {email: "{{notification.requestedEmail}}"})} !{translate("in_order_to_match_institutional_metadata_associated", {email: "{{notification.institutionEmail}}"})}
  154. .notification-close
  155. button(ng-click="dismiss(notification)").close.pull-right
  156. span(aria-hidden="true") &times;
  157. span.sr-only #{translate("close")}
  158. .alert.alert-info(
  159. ng-switch-when="notification_institution_sso_already_registered"
  160. )
  161. .notification-body
  162. | !{translate("tried_to_register_with_email", {appName: settings.appName, email: "{{notification.email}}"})}
  163. | #{translate("we_logged_you_in")}
  164. .notification-action
  165. a.btn.btn-sm.btn-info(href="/learn/how-to/Institutional_Login")
  166. | #{translate("find_out_more")}
  167. .notification-close
  168. button(ng-click="dismiss(notification)").close.pull-right
  169. span(aria-hidden="true") &times;
  170. span.sr-only #{translate("close")}
  171. .alert.alert-danger(ng-switch-when="notification_institution_sso_error")
  172. .notification-body
  173. div
  174. i.fa.fa-fw.fa-exclamation-triangle(aria-hidden="true")
  175. | &nbsp;#{translate("generic_something_went_wrong")}.
  176. div(ng-if="notification.error.translatedMessage" ng-bind-html="notification.error.translatedMessage")
  177. div(ng-else="notification.error.message") {{ notification.error.message}}
  178. div(ng-if="notification.error.tryAgain") #{translate("try_again")}.
  179. .notification-close
  180. button(ng-click="dismiss(notification)").close.pull-right
  181. span(aria-hidden="true") &times;
  182. span.sr-only #{translate("close")}
  183. ul.list-unstyled(
  184. ng-controller="EmailNotificationController",
  185. ng-cloak
  186. )
  187. li.notification-entry(
  188. ng-repeat="userEmail in userEmails",
  189. ng-if="showConfirmEmail(userEmail) && projects.length > 0"
  190. )
  191. .alert.alert-warning
  192. .notification-body
  193. div(ng-if="!userEmail.confirmationInflight")
  194. | #{translate("please_confirm_email", {emailAddress: "{{ userEmail.email }}"})}
  195. |
  196. a(
  197. href
  198. ng-click="resendConfirmationEmail(userEmail)"
  199. ) (#{translate('resend_confirmation_email')})
  200. div(ng-if="userEmail.confirmationInflight")
  201. i.fa.fa-spinner.fa-spin(aria-hidden="true")
  202. |
  203. | #{translate('resending_confirmation_email')}&hellip;
  204. div(ng-if="!userEmail.confirmationInflight && userEmail.error" aria-live="polite")
  205. span(ng-if="userEmail.errorMessage") {{ userEmail.errorMessage }}
  206. span(ng-if="!userEmail.errorMessage") #{translate('generic_something_went_wrong')}
  207. ui.list-unstyled(ng-controller="UserAffiliationsReconfirmController")
  208. li.notification-entry(
  209. ng-repeat="userEmail in allInReconfirmNotificationPeriods"
  210. )
  211. .alert.alert-info()
  212. +reconfirmAffiliationNotification('/project')
  213. li.notification-entry(
  214. ng-repeat="userEmail in userEmails"
  215. ng-if="userEmail.samlIdentifier && userEmail.samlIdentifier.providerId === reconfirmedViaSAML"
  216. )
  217. +reconfirmedAffiliationNotification()
  218. - var hasPaidAffiliation = userAffiliations.some(affiliation => affiliation.licence && affiliation.licence !== 'free')
  219. if settings.enableSubscriptions && !hasSubscription && !hasPaidAffiliation
  220. ul.list-unstyled(
  221. ng-controller="DismissableNotificationsController",
  222. ng-cloak
  223. )
  224. li.notification-entry(
  225. ng-if="shouldShowNotification && projects.length > 0"
  226. )
  227. .alert.alert-info
  228. .notification-body
  229. span To help you work from home throughout 2021, we're providing discounted plans and special initiatives.
  230. .notification-action
  231. a.pull-right.btn.btn-sm.btn-info(href="https://www.overleaf.com/events/wfh2021" event-tracking="Event-Pages" event-tracking-trigger="click" event-tracking-ga="WFH-Offer-Click" event-tracking-label="Dash-Banner") Upgrade
  232. .notification-close
  233. button(ng-click="dismiss()").close.pull-right
  234. span(aria-hidden="true") &times;
  235. span.sr-only #{translate("close")}