notifications.pug 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. include ../../_mixins/saml
  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}}`
  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-info(
  106. ng-switch-default
  107. )
  108. span(ng-bind-html="notification.html").notification-body
  109. .notification-close
  110. button(ng-click="dismiss(notification)").close.pull-right
  111. span(aria-hidden="true") &times;
  112. span.sr-only #{translate("close")}
  113. ul.list-unstyled(
  114. ng-if="notificationsInstitution.length > 0",
  115. ng-cloak
  116. )
  117. li.notification-entry(
  118. ng-repeat="notification in notificationsInstitution"
  119. )
  120. div(ng-switch="notification.templateKey" ng-hide="notification.hide")
  121. .alert.alert-info(
  122. ng-switch-when="notification_institution_sso_available"
  123. )
  124. .notification-body
  125. p !{translate("can_link_institution_email_acct_to_institution_acct", {appName: settings.appName, email: "{{notification.email}}", institutionName: "{{notification.institutionName}}"})}
  126. div !{translate("doing_this_allow_log_in_through_institution", {appName: settings.appName})}
  127. .notification-action
  128. a.btn.btn-sm.btn-info(href="{{samlInitPath}}?university_id={{notification.institutionId}}&auto=/project&email={{notification.email}}")
  129. | #{translate('link_account')}
  130. .alert.alert-info(
  131. ng-switch-when="notification_institution_sso_linked"
  132. )
  133. .notification-body
  134. div !{translate("account_has_been_link_to_institution_account", {appName: settings.appName, email: "{{notification.email}}", institutionName: "{{notification.institutionName}}"})}
  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-warning(
  140. ng-switch-when="notification_institution_sso_non_canonical"
  141. )
  142. .notification-body
  143. div
  144. i.fa.fa-fw.fa-exclamation-triangle(aria-hidden="true")
  145. | !{translate("tried_to_log_in_with_email", {email: "{{notification.requestedEmail}}"})} !{translate("in_order_to_match_institutional_metadata_associated", {email: "{{notification.institutionEmail}}"})}
  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. .alert.alert-info(
  151. ng-switch-when="notification_institution_sso_already_registered"
  152. )
  153. .notification-body
  154. | !{translate("tried_to_register_with_email", {appName: settings.appName, email: "{{notification.email}}"})}
  155. | #{translate("we_logged_you_in")}
  156. .notification-action
  157. a.btn.btn-sm.btn-info(href="/learn/how-to/Institutional_Login")
  158. | #{translate("find_out_more")}
  159. .notification-close
  160. button(ng-click="dismiss(notification)").close.pull-right
  161. span(aria-hidden="true") &times;
  162. span.sr-only #{translate("close")}
  163. .alert.alert-danger(
  164. ng-switch-when="notification_institution_sso_linked_by_another"
  165. )
  166. .notification-body
  167. div
  168. i.fa.fa-fw.fa-exclamation-triangle(aria-hidden="true")
  169. | !{translate("institution_account_tried_to_add_already_registered")}
  170. .notification-close
  171. button(ng-click="dismiss(notification)").close.pull-right
  172. span(aria-hidden="true") &times;
  173. span.sr-only #{translate("close")}
  174. if institutionLinkingError
  175. .alert.alert-danger(ng-switch-when="notification_institution_sso_error")
  176. .notification-body
  177. div
  178. +samlErrorLoggedIn(institutionLinkingError)
  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. | #{translate('generic_something_went_wrong')}
  206. - var hasPaidAffiliation = userAffiliations.some(affiliation => affiliation.licence && affiliation.licence !== 'free')
  207. if settings.enableSubscriptions && !hasSubscription && !hasPaidAffiliation
  208. ul.list-unstyled(
  209. ng-controller="DismissableNotificationsController",
  210. ng-cloak
  211. )
  212. li.notification-entry(
  213. ng-if="shouldShowNotification && projects.length > 0"
  214. )
  215. .alert.alert-info
  216. .notification-body
  217. span To help you work from home throughout 2020 and beyond, we're providing a number of special initiatives.
  218. .notification-action
  219. a.pull-right.btn.btn-sm.btn-info(href="https://www.overleaf.com/events/wfh2020") View
  220. .notification-close
  221. button(ng-click="dismiss()").close.pull-right
  222. span(aria-hidden="true") &times;
  223. span.sr-only #{translate("close")}