notifications.pug 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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. ng-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. p()
  109. | !{translate("dropbox_duplicate_project_names", { projectName: '{{notification.messageOpts.projectName}}'}, ['strong'])}
  110. p()
  111. | !{translate("dropbox_duplicate_project_names_suggestion", {}, ['strong'])}
  112. | &nbsp;
  113. a(href="/learn/how-to/Dropbox_Synchronization#Troubleshooting") #{translate("learn_more")}
  114. |.
  115. .notification-close
  116. button.btn-sm(ng-click="dismiss(notification)").close.pull-right
  117. span(aria-hidden="true") &times;
  118. span.sr-only #{translate("close")}
  119. .alert.alert-info(
  120. ng-switch-when="notification_dropbox_unlinked_due_to_lapsed_reconfirmation"
  121. )
  122. .notification-body
  123. if user.features.dropbox
  124. | !{translate("dropbox_unlinked_premium_feature", {}, ['strong'])}
  125. | !{translate("can_now_relink_dropbox", {}, [{name: 'a', attrs: {href: '/user/settings#project-sync' }}])}
  126. else
  127. | !{translate("dropbox_unlinked_premium_feature", {}, ['strong'])}
  128. | !{translate("confirm_affiliation_to_relink_dropbox")}
  129. | &nbsp;
  130. a(href="/learn/how-to/Institutional_Email_Reconfirmation") #{translate("learn_more")}
  131. .notification-close
  132. button.btn-sm(ng-click="dismiss(notification)").close.pull-right
  133. span(aria-hidden="true") &times;
  134. span.sr-only #{translate("close")}
  135. .alert.alert-info(
  136. ng-switch-default
  137. )
  138. span(ng-bind-html="notification.html").notification-body
  139. .notification-close
  140. button(ng-click="dismiss(notification)").close.pull-right
  141. span(aria-hidden="true") &times;
  142. span.sr-only #{translate("close")}
  143. ul.list-unstyled(
  144. ng-if="notificationsInstitution.length > 0",
  145. ng-cloak
  146. )
  147. li.notification-entry(
  148. ng-repeat="notification in notificationsInstitution"
  149. )
  150. div(ng-switch="notification.templateKey" ng-hide="notification.hide")
  151. .alert.alert-info(
  152. ng-switch-when="notification_institution_sso_available"
  153. )
  154. .notification-body
  155. p !{translate("can_link_institution_email_acct_to_institution_acct", {appName: settings.appName, email: "{{notification.email}}", institutionName: "{{notification.institutionName}}"})}
  156. div !{translate("doing_this_allow_log_in_through_institution", {appName: settings.appName})}&nbsp;
  157. a(href="/learn/how-to/Institutional_Login") #{translate("learn_more")}
  158. .notification-action
  159. a.btn.btn-sm.btn-info(ng-href="{{samlInitPath}}?university_id={{notification.institutionId}}&auto=/project&email={{notification.email}}")
  160. | #{translate('link_account')}
  161. .alert.alert-info(
  162. ng-switch-when="notification_institution_sso_linked"
  163. )
  164. .notification-body
  165. div !{translate("account_has_been_link_to_institution_account", {appName: settings.appName, email: "{{notification.email}}", institutionName: "{{notification.institutionName}}"})}
  166. .notification-close
  167. button(ng-click="dismiss(notification)").close.pull-right
  168. span(aria-hidden="true") &times;
  169. span.sr-only #{translate("close")}
  170. .alert.alert-warning(
  171. ng-switch-when="notification_institution_sso_non_canonical"
  172. )
  173. .notification-body
  174. div
  175. i.fa.fa-fw.fa-exclamation-triangle(aria-hidden="true")
  176. | !{translate("tried_to_log_in_with_email", {email: "{{notification.requestedEmail}}"})} !{translate("in_order_to_match_institutional_metadata_associated", {email: "{{notification.institutionEmail}}"})}
  177. .notification-close
  178. button(ng-click="dismiss(notification)").close.pull-right
  179. span(aria-hidden="true") &times;
  180. span.sr-only #{translate("close")}
  181. .alert.alert-info(
  182. ng-switch-when="notification_institution_sso_already_registered"
  183. )
  184. .notification-body
  185. | !{translate("tried_to_register_with_email", {appName: settings.appName, email: "{{notification.email}}"})}
  186. | #{translate("we_logged_you_in")}
  187. .notification-action
  188. a.btn.btn-sm.btn-info(href="/learn/how-to/Institutional_Login")
  189. | #{translate("find_out_more")}
  190. .notification-close
  191. button(ng-click="dismiss(notification)").close.pull-right
  192. span(aria-hidden="true") &times;
  193. span.sr-only #{translate("close")}
  194. .alert.alert-danger(ng-switch-when="notification_institution_sso_error")
  195. .notification-body
  196. div
  197. i.fa.fa-fw.fa-exclamation-triangle(aria-hidden="true")
  198. | &nbsp;#{translate("generic_something_went_wrong")}.
  199. div(ng-if="notification.error.translatedMessage" ng-bind-html="notification.error.translatedMessage")
  200. div(ng-else="notification.error.message") {{ notification.error.message}}
  201. div(ng-if="notification.error.tryAgain") #{translate("try_again")}.
  202. .notification-close
  203. button(ng-click="dismiss(notification)").close.pull-right
  204. span(aria-hidden="true") &times;
  205. span.sr-only #{translate("close")}
  206. ul.list-unstyled(
  207. ng-controller="EmailNotificationController",
  208. ng-cloak
  209. )
  210. li.notification-entry(
  211. ng-repeat="userEmail in userEmails",
  212. ng-if="showConfirmEmail(userEmail) && projects.length > 0"
  213. )
  214. .alert.alert-warning
  215. .notification-body
  216. div(ng-if="!userEmail.confirmationInflight")
  217. | #{translate("please_confirm_email", {emailAddress: "{{ userEmail.email }}"})}
  218. |
  219. a(
  220. href
  221. ng-click="resendConfirmationEmail(userEmail)"
  222. ) (#{translate('resend_confirmation_email')})
  223. div(ng-if="userEmail.confirmationInflight")
  224. i.fa.fa-spinner.fa-spin(aria-hidden="true")
  225. |
  226. | #{translate('resending_confirmation_email')}&hellip;
  227. div(ng-if="!userEmail.confirmationInflight && userEmail.error" aria-live="polite")
  228. span(ng-if="userEmail.errorMessage") {{ userEmail.errorMessage }}
  229. span(ng-if="!userEmail.errorMessage") #{translate('generic_something_went_wrong')}
  230. ui.list-unstyled(ng-controller="UserAffiliationsReconfirmController")
  231. li.notification-entry(
  232. ng-repeat="userEmail in allInReconfirmNotificationPeriods"
  233. )
  234. .alert.alert-info()
  235. +reconfirmAffiliationNotification('/project')
  236. li.notification-entry(
  237. ng-repeat="userEmail in userEmails"
  238. ng-if="userEmail.samlIdentifier && userEmail.samlIdentifier.providerId === reconfirmedViaSAML"
  239. )
  240. +reconfirmedAffiliationNotification()