_contact_form.html.erb 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <div id='contact_bg'>
  2. </div>
  3. <section id='contact' >
  4. <h3>
  5. <%= t("contact.title") %>
  6. <span id='contact_close'>
  7. <%=
  8. link_to(
  9. image_tag(
  10. "control/close.svg",
  11. id: "contact_close",
  12. alt: t("contact.cancel")
  13. ),
  14. #"mailto:" + @user.mail_adresses[0].address,
  15. "javascript:closeContactForm()"
  16. )
  17. %>
  18. </span>
  19. </h3>
  20. <div id='contact_menu'>
  21. <form id='contact_form' action='/<%=I18n.locale%>/contact/' method='post'>
  22. <%= hidden_field_tag :authenticity_token, form_authenticity_token %>
  23. <table>
  24. <tr>
  25. <td class='label'>
  26. <%= t("contact.name") %>
  27. </td>
  28. <td class='input'>
  29. <input type='text' name='sender_name' id='contact_sender_name'/>
  30. <br/>
  31. <span class='contact_error' id='sender_name_error'>
  32. </span>
  33. </td>
  34. </tr>
  35. <tr>
  36. <td class='label'>
  37. <%= t("contact.mail") %>
  38. </td>
  39. <td class='input'>
  40. <input type='text' name='sender_email' id='contact_sender_email'/>
  41. <br/>
  42. <span class='contact_error' id='sender_email_error'>
  43. <%= t('contact.error.invalid_email') %>
  44. </span>
  45. </td>
  46. </tr>
  47. <tr>
  48. <td class='label'>
  49. <%= t("contact.message") %>
  50. </td>
  51. <td class='input'>
  52. <textarea type='text' name='text' id='contact_text'></textarea>
  53. <br/>
  54. <span class='contact_error' id='text_error'>
  55. <%= t('contact.error.empty_text') %>
  56. </span>
  57. </td>
  58. </tr>
  59. </table>
  60. <div class='contact_buttons'>
  61. <input type='button' value='<%=t("contact.cancel")%>' onClick='closeContactForm();'>
  62. <input type='submit' value='<%=t("contact.send")%>'>
  63. </div>
  64. </form>
  65. </div>
  66. <div id='contact_progress'>
  67. <%=
  68. image_tag(
  69. "social/email.svg",
  70. alt: ""
  71. )
  72. %>
  73. </div>
  74. <div id='contact_confirmation'>
  75. <p>
  76. <%= t('contact.confirmation') %>
  77. </p>
  78. <div class='contact_buttons'>
  79. <input type='button' value='<%=t("contact.close")%>' onClick='closeContactForm();'>
  80. </div>
  81. </div>
  82. <script>
  83. var form = document.getElementById('contact_form');
  84. if (form.attachEvent) {
  85. form.attachEvent("submit", sendMessage);
  86. } else {
  87. form.addEventListener("submit", sendMessage);
  88. }
  89. </script>
  90. </section>