base.pug 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. //-
  2. The email background color is defined in three places:
  3. 1. body tag: for most email clients
  4. 2. center tag: for Gmail and Inbox mobile apps and web versions of Gmail, GSuite, Inbox, Yahoo, AOL, Libero, Comcast, freenet, Mail.ru, Orange.fr
  5. 3. mso conditional: For Windows 10 Mail
  6. - var backgroundColor = "#fff";
  7. - var mainColor = "#f2690d";
  8. doctype html
  9. head
  10. // This template is heavily adapted from the Cerberus Fluid template. Kudos to them!
  11. meta(charset='utf-8')
  12. //- utf-8 works for most cases
  13. meta(name='viewport' content='width=device-width')
  14. //- Forcing initial-scale shouldn't be necessary
  15. meta(http-equiv='X-UA-Compatible' content='IE=edge')
  16. //- Use the latest (edge) version of IE rendering engine
  17. meta(name='x-apple-disable-message-reformatting')
  18. //- Disable auto-scale in iOS 10 Mail entirely
  19. meta(name='format-detection' content='telephone=no,address=no,email=no,date=no,url=no')
  20. //- Tell iOS not to automatically link certain text strings.
  21. meta(name='color-scheme' content='light')
  22. meta(name='supported-color-schemes' content='light')
  23. //- The title tag shows in email notifications, like Android 4.4.
  24. title #{subject}
  25. //- What it does: Makes background images in 72ppi Outlook render at correct size.
  26. //if gte mso 9
  27. xml
  28. o:officedocumentsettings
  29. o:allowpng
  30. o:pixelsperinch 96
  31. //- CSS Reset : BEGIN
  32. style.
  33. /* What it does: Tells the email client that only light styles are provided but the client can transform them to dark. A duplicate of meta color-scheme meta tag above. */
  34. :root {
  35. color-scheme: light;
  36. supported-color-schemes: light;
  37. }
  38. /* What it does: Remove spaces around the email design added by some email clients. */
  39. /* Beware: It can remove the padding / margin and add a background color to the compose a reply window. */
  40. html,
  41. body {
  42. margin: 0 auto !important;
  43. padding: 0 !important;
  44. height: 100% !important;
  45. width: 100% !important;
  46. }
  47. /* What it does: Stops email clients resizing small text. */
  48. * {
  49. -ms-text-size-adjust: 100%;
  50. -webkit-text-size-adjust: 100%;
  51. }
  52. /* What it does: Centers email on Android 4.4 */
  53. div[style*="margin: 16px 0"] {
  54. margin: 0 !important;
  55. }
  56. /* What it does: forces Samsung Android mail clients to use the entire viewport */
  57. #MessageViewBody, #MessageWebViewDiv{
  58. width: 100% !important;
  59. }
  60. /* What it does: Stops Outlook from adding extra spacing to tables. */
  61. table,
  62. td {
  63. mso-table-lspace: 0pt !important;
  64. mso-table-rspace: 0pt !important;
  65. }
  66. /* What it does: Fixes webkit padding issue. */
  67. table {
  68. border-spacing: 0 !important;
  69. border-collapse: collapse !important;
  70. table-layout: fixed !important;
  71. margin: 0 auto !important;
  72. }
  73. /* What it does: Uses a better rendering method when resizing images in IE. */
  74. img {
  75. -ms-interpolation-mode:bicubic;
  76. }
  77. /* What it does: Prevents Windows 10 Mail from underlining links despite inline CSS. Styles for underlined links should be inline. */
  78. a {
  79. text-decoration: none;
  80. }
  81. a:not(.nocolor) {
  82. color: #{mainColor};
  83. }
  84. a.nocolor {
  85. color: inherit !important;
  86. }
  87. /* What it does: A work-around for email clients meddling in triggered links. */
  88. a[x-apple-data-detectors], /* iOS */
  89. .unstyle-auto-detected-links a,
  90. .aBn {
  91. border-bottom: 0 !important;
  92. cursor: default !important;
  93. color: inherit !important;
  94. text-decoration: none !important;
  95. font-size: inherit !important;
  96. font-family: inherit !important;
  97. font-weight: inherit !important;
  98. line-height: inherit !important;
  99. }
  100. /* What it does: Prevents Gmail from displaying a download button on large, non-linked images. */
  101. .a6S {
  102. display: none !important;
  103. opacity: 0.01 !important;
  104. }
  105. /* What it does: Prevents Gmail from changing the text color in conversation threads. */
  106. .im {
  107. color: inherit !important;
  108. }
  109. /* If the above doesn't work, add a .g-img class to any image in question. */
  110. img.g-img + div {
  111. display: none !important;
  112. }
  113. /* What it does: Removes right gutter in Gmail iOS app: https://github.com/TedGoas/Cerberus/issues/89 */
  114. /* Create one of these media queries for each additional viewport size you'd like to fix */
  115. /* iPhone 4, 4S, 5, 5S, 5C, and 5SE */
  116. @media only screen and (min-device-width: 320px) and (max-device-width: 374px) {
  117. u ~ div .email-container {
  118. min-width: 320px !important;
  119. }
  120. }
  121. /* iPhone 6, 6S, 7, 8, and X */
  122. @media only screen and (min-device-width: 375px) and (max-device-width: 413px) {
  123. u ~ div .email-container {
  124. min-width: 375px !important;
  125. }
  126. }
  127. /* iPhone 6+, 7+, and 8+ */
  128. @media only screen and (min-device-width: 414px) {
  129. u ~ div .email-container {
  130. min-width: 414px !important;
  131. }
  132. }
  133. //- CSS Reset : END
  134. //- CSS for PeerTube : START
  135. style.
  136. blockquote {
  137. margin-left: 0;
  138. padding-left: 20px;
  139. border-left: 2px solid #f2690d;
  140. }
  141. //- CSS for PeerTube : END
  142. //- Progressive Enhancements : BEGIN
  143. style.
  144. /* What it does: Hover styles for buttons */
  145. .button-td,
  146. .button-a {
  147. transition: all 100ms ease-in;
  148. }
  149. .button-td-primary:hover,
  150. .button-a-primary:hover {
  151. background: #555555 !important;
  152. border-color: #555555 !important;
  153. }
  154. /* Media Queries */
  155. @media screen and (max-width: 600px) {
  156. /* What it does: Adjust typography on small screens to improve readability */
  157. .email-container p {
  158. font-size: 17px !important;
  159. }
  160. }
  161. //- Progressive Enhancements : END
  162. body(width="100%" style="margin: 0; padding: 0 !important; mso-line-height-rule: exactly; background-color: #{backgroundColor};")
  163. center(role='article' aria-roledescription='email' lang='en' style='width: 100%; background-color: #{backgroundColor};')
  164. //if mso | IE
  165. table(role='presentation' border='0' cellpadding='0' cellspacing='0' width='100%' style='background-color: #fff;')
  166. tr
  167. td
  168. //- Visually Hidden Preheader Text : BEGIN
  169. div(style='max-height:0; overflow:hidden; mso-hide:all;' aria-hidden='true')
  170. block preheader
  171. //- Visually Hidden Preheader Text : END
  172. //- Create white space after the desired preview text so email clients don’t pull other distracting text into the inbox preview. Extend as necessary.
  173. //- Preview Text Spacing Hack : BEGIN
  174. div(style='display: none; font-size: 1px; line-height: 1px; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden; mso-hide: all; font-family: sans-serif;')
  175. | ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌
  176. //- Preview Text Spacing Hack : END
  177. //-
  178. Set the email width. Defined in two places:
  179. 1. max-width for all clients except Desktop Windows Outlook, allowing the email to squish on narrow but never go wider than 600px.
  180. 2. MSO tags for Desktop Windows Outlook enforce a 600px width.
  181. .email-container(style='max-width: 600px; margin: 0 auto;')
  182. //if mso
  183. table(align='center' role='presentation' cellspacing='0' cellpadding='0' border='0' width='600')
  184. tr
  185. td
  186. //- Email Body : BEGIN
  187. table(align='center' role='presentation' cellspacing='0' cellpadding='0' border='0' width='100%' style='margin: auto;')
  188. //- 1 Column Text + Button : BEGIN
  189. tr
  190. td(style='background-color: #ffffff;')
  191. table(role='presentation' cellspacing='0' cellpadding='0' border='0' width='100%')
  192. tr
  193. td(style='padding: 20px; font-family: sans-serif; font-size: 15px; line-height: 20px; color: #555555;')
  194. table(role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%")
  195. tr
  196. td(width="40px")
  197. img(src=`${WEBSERVER.URL}/client/assets/images/icons/icon-192x192.png` width="auto" height="30px" alt="" border="0" style="height: 30px; background: #ffffff; font-family: sans-serif; font-size: 15px; line-height: 15px; color: #555555;")
  198. td
  199. h1(style='margin: 10px 0 10px 0; font-family: sans-serif; font-size: 25px; line-height: 30px; color: #333333; font-weight: normal;')
  200. block title
  201. if title
  202. | #{title}
  203. else
  204. | Something requires your attention
  205. p(style='margin: 0;')
  206. block body
  207. if action
  208. tr
  209. td(style='padding: 0 20px;')
  210. //- Button : BEGIN
  211. table(align='center' role='presentation' cellspacing='0' cellpadding='0' border='0' style='margin: auto;')
  212. tr
  213. td.button-td.button-td-primary(style='border-radius: 4px; background: #222222;')
  214. a.button-a.button-a-primary(href=action.url style='background: #222222; border: 1px solid #000000; font-family: sans-serif; font-size: 15px; line-height: 15px; text-decoration: none; padding: 13px 17px; color: #ffffff; display: block; border-radius: 4px;') #{action.text}
  215. //- Button : END
  216. //- 1 Column Text + Button : END
  217. //- Clear Spacer : BEGIN
  218. tr
  219. td(aria-hidden='true' height='20' style='font-size: 0px; line-height: 0px;')
  220. br
  221. //- Clear Spacer : END
  222. //- 1 Column Text : BEGIN
  223. if username
  224. tr
  225. td(style='background-color: #cccccc;')
  226. table(role='presentation' cellspacing='0' cellpadding='0' border='0' width='100%')
  227. tr
  228. td(style='padding: 20px; font-family: sans-serif; font-size: 15px; line-height: 20px; color: #555555;')
  229. p(style='margin: 0;')
  230. | You are receiving this email as part of your notification settings on #{instanceName} for your account #{username}.
  231. //- 1 Column Text : END
  232. //- Email Body : END
  233. //- Email Footer : BEGIN
  234. unless hideNotificationPreferences
  235. table(align='center' role='presentation' cellspacing='0' cellpadding='0' border='0' width='100%' style='margin: auto;')
  236. tr
  237. td(style='padding: 20px; padding-bottom: 0px; font-family: sans-serif; font-size: 12px; line-height: 15px; text-align: center; color: #888888;')
  238. webversion
  239. a.nocolor(href=`${WEBSERVER.URL}/my-account/notifications` style='color: #cccccc; font-weight: bold;') View in your notifications
  240. br
  241. tr
  242. td(style='padding: 20px; padding-top: 10px; font-family: sans-serif; font-size: 12px; line-height: 15px; text-align: center; color: #888888;')
  243. unsubscribe
  244. a.nocolor(href=`${WEBSERVER.URL}/my-account/settings#notifications` style='color: #888888;') Manage your notification preferences in your profile
  245. br
  246. //- Email Footer : END
  247. //if mso
  248. //- Full Bleed Background Section : BEGIN
  249. table(role='presentation' cellspacing='0' cellpadding='0' border='0' width='100%' style=`background-color: ${mainColor};`)
  250. tr
  251. td
  252. .email-container(align='center' style='max-width: 600px; margin: auto;')
  253. //if mso
  254. table(role='presentation' cellspacing='0' cellpadding='0' border='0' width='600' align='center')
  255. tr
  256. td
  257. table(role='presentation' cellspacing='0' cellpadding='0' border='0' width='100%')
  258. tr
  259. td(style='padding: 20px; text-align: left; font-family: sans-serif; font-size: 12px; line-height: 20px; color: #ffffff;')
  260. table(role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%")
  261. tr
  262. td(valign="top") #[a(href="https://github.com/Chocobozzz/PeerTube" style="color: white !important") PeerTube © 2015-#{new Date().getFullYear()}] #[a(href="https://github.com/Chocobozzz/PeerTube/blob/master/CREDITS.md" style="color: white !important") PeerTube Contributors]
  263. //if mso
  264. //- Full Bleed Background Section : END
  265. //if mso | IE