notifications.pug 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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#dropboxSettings' }}])}
  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})}
  157. .notification-action
  158. a.btn.btn-sm.btn-info(ng-href="{{samlInitPath}}?university_id={{notification.institutionId}}&auto=/project&email={{notification.email}}")
  159. | #{translate('link_account')}
  160. .alert.alert-info(
  161. ng-switch-when="notification_institution_sso_linked"
  162. )
  163. .notification-body
  164. div !{translate("account_has_been_link_to_institution_account", {appName: settings.appName, email: "{{notification.email}}", institutionName: "{{notification.institutionName}}"})}
  165. .notification-close
  166. button(ng-click="dismiss(notification)").close.pull-right
  167. span(aria-hidden="true") &times;
  168. span.sr-only #{translate("close")}
  169. .alert.alert-warning(
  170. ng-switch-when="notification_institution_sso_non_canonical"
  171. )
  172. .notification-body
  173. div
  174. i.fa.fa-fw.fa-exclamation-triangle(aria-hidden="true")
  175. | !{translate("tried_to_log_in_with_email", {email: "{{notification.requestedEmail}}"})} !{translate("in_order_to_match_institutional_metadata_associated", {email: "{{notification.institutionEmail}}"})}
  176. .notification-close
  177. button(ng-click="dismiss(notification)").close.pull-right
  178. span(aria-hidden="true") &times;
  179. span.sr-only #{translate("close")}
  180. .alert.alert-info(
  181. ng-switch-when="notification_institution_sso_already_registered"
  182. )
  183. .notification-body
  184. | !{translate("tried_to_register_with_email", {appName: settings.appName, email: "{{notification.email}}"})}
  185. | #{translate("we_logged_you_in")}
  186. .notification-action
  187. a.btn.btn-sm.btn-info(href="/learn/how-to/Institutional_Login")
  188. | #{translate("find_out_more")}
  189. .notification-close
  190. button(ng-click="dismiss(notification)").close.pull-right
  191. span(aria-hidden="true") &times;
  192. span.sr-only #{translate("close")}
  193. .alert.alert-danger(ng-switch-when="notification_institution_sso_error")
  194. .notification-body
  195. div
  196. i.fa.fa-fw.fa-exclamation-triangle(aria-hidden="true")
  197. | &nbsp;#{translate("generic_something_went_wrong")}.
  198. div(ng-if="notification.error.translatedMessage" ng-bind-html="notification.error.translatedMessage")
  199. div(ng-else="notification.error.message") {{ notification.error.message}}
  200. div(ng-if="notification.error.tryAgain") #{translate("try_again")}.
  201. .notification-close
  202. button(ng-click="dismiss(notification)").close.pull-right
  203. span(aria-hidden="true") &times;
  204. span.sr-only #{translate("close")}
  205. ul.list-unstyled(
  206. ng-controller="EmailNotificationController",
  207. ng-cloak
  208. )
  209. li.notification-entry(
  210. ng-repeat="userEmail in userEmails",
  211. ng-if="showConfirmEmail(userEmail) && projects.length > 0"
  212. )
  213. .alert.alert-warning
  214. .notification-body
  215. div(ng-if="!userEmail.confirmationInflight")
  216. | #{translate("please_confirm_email", {emailAddress: "{{ userEmail.email }}"})}
  217. |
  218. a(
  219. href
  220. ng-click="resendConfirmationEmail(userEmail)"
  221. ) (#{translate('resend_confirmation_email')})
  222. div(ng-if="userEmail.confirmationInflight")
  223. i.fa.fa-spinner.fa-spin(aria-hidden="true")
  224. |
  225. | #{translate('resending_confirmation_email')}&hellip;
  226. div(ng-if="!userEmail.confirmationInflight && userEmail.error" aria-live="polite")
  227. span(ng-if="userEmail.errorMessage") {{ userEmail.errorMessage }}
  228. span(ng-if="!userEmail.errorMessage") #{translate('generic_something_went_wrong')}
  229. ui.list-unstyled(ng-controller="UserAffiliationsReconfirmController")
  230. li.notification-entry(
  231. ng-repeat="userEmail in allInReconfirmNotificationPeriods"
  232. )
  233. .alert.alert-info()
  234. +reconfirmAffiliationNotification('/project')
  235. li.notification-entry(
  236. ng-repeat="userEmail in userEmails"
  237. ng-if="userEmail.samlIdentifier && userEmail.samlIdentifier.providerId === reconfirmedViaSAML"
  238. )
  239. +reconfirmedAffiliationNotification()
  240. - var hasPaidAffiliation = userAffiliations.some(affiliation => affiliation.licence && affiliation.licence !== 'free')
  241. if settings.enableSubscriptions && !hasSubscription && !hasPaidAffiliation
  242. ul.list-unstyled(
  243. ng-controller="DismissableNotificationsController",
  244. ng-cloak
  245. )
  246. li.notification-entry(
  247. ng-if="shouldShowNotification && projects.length > 0"
  248. )
  249. .alert.alert-info
  250. .notification-body
  251. span To help you work from home throughout 2021, we're providing discounted plans and special initiatives.
  252. .notification-action
  253. 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
  254. .notification-close
  255. button(ng-click="dismiss()").close.pull-right
  256. span(aria-hidden="true") &times;
  257. span.sr-only #{translate("close")}