index.jade 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. doctype html
  2. html
  3. head
  4. meta(http-equiv="Content-Type", content="text/html; charset=utf-8")
  5. meta(name="viewport", content="width=device-width, initial-scale=1")
  6. title #{__('TITLE', community)}
  7. link(href="css/style.css", rel="stylesheet", type="text/css")
  8. link(href="//fonts.googleapis.com/css?family=Lato:300,400,700,900,700italic|Open+Sans:700italic,400,600,300,700,800", rel="stylesheet", type="text/css")
  9. body
  10. #wrapper
  11. .main
  12. .header
  13. h1
  14. strong #{community}
  15. h2 #{__('HEADER', community)}
  16. .content
  17. .information
  18. form(method="POST", action="/invite")#join-form.form
  19. input(type="email", name="email", autofocus, placeholder="#{__('ENTER_EMAIL')}")#slack-email.field
  20. if tokenRequired
  21. input(type="text", name="token", placeholder="#{__('ENTER_TOKEN')}")#slack-token.field
  22. input(type="submit", value="Join").submit
  23. if !!recaptchaSiteKey
  24. div(class="g-recaptcha", data-sitekey="#{recaptchaSiteKey}")
  25. if !!recaptchaSiteKey
  26. script(src='https://www.google.com/recaptcha/api.js')
  27. script.
  28. var tokenRequired = #{tokenRequired};
  29. var form = document.getElementById('join-form');
  30. var email = document.getElementById('slack-email');
  31. var token = document.getElementById('slack-token');
  32. form.addEventListener('submit', function(evt) {
  33. if (!email.value) {
  34. evt.preventDefault();
  35. }
  36. if (tokenRequired && !token.value) {
  37. evt.preventDefault();
  38. }
  39. var recaptcha = document.getElementById('g-recaptcha-response');
  40. if (recaptcha && recaptcha.value === '') {
  41. evt.preventDefault();
  42. }
  43. });