notifications.pug 11 KB

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