You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

macro.html.twig 1.4KB

3 jaren geleden
3 jaren geleden
3 jaren geleden
3 jaren geleden
12345678910111213141516171819202122232425262728293031323334353637
  1. {% macro email_contact(text, subject) %}
  2. {# rot13 : https://rot13.com/ #}
  3. <script>
  4. {% if text is empty %}
  5. var text = "ntve@ynpbbcrengvirqrfpvgblraf.se";
  6. {% else %}
  7. var text = "{{ text|rot13 }}";
  8. {% endif %}
  9. var subject = "";
  10. {% if subject is not empty %}
  11. var subject = "?fhowrpg={{ subject|rot13 }}";
  12. {% endif %}
  13. document.write(("<n uers=\"znvygb:ntve@ynpbbcrengvirqrfpvgblraf.se" + subject + "\" ery=\"absbyybj\">" + text + "</n>").replace(/[a-zA-Z]/g, function (c) {
  14. return String.fromCharCode((c <= "Z" ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26);
  15. }));
  16. </script>
  17. {% endmacro %}
  18. {% macro dropdown_search(field) %}
  19. <div class="dropdown dropdown-search allow-focus">
  20. <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton"
  21. data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  22. {{ form_label(field) }}
  23. </button>
  24. <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
  25. {% for checkbox in field.children %}
  26. <li>
  27. <label>
  28. {{ form_widget(checkbox) }}
  29. {{ form_label(checkbox) }}
  30. {{ form_errors(checkbox) }}
  31. </label>
  32. </li>
  33. {% endfor %}
  34. </ul>
  35. </div>
  36. {% endmacro %}