search_untube_page.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. {% extends 'base.html' %}
  2. {% load humanize %}
  3. {% load static %}
  4. {% block content %}
  5. <br>
  6. <script>
  7. window.onkeydown = function( event ) {
  8. if ( event.keyCode === 27 ) {
  9. window.close(); // closes current tab
  10. }
  11. };
  12. </script>
  13. <div id="untube-searchbar-results">
  14. <div class="d-flex justify-content-center">
  15. <h1> Search all of UnTube
  16. {% if user.profile.open_search_new_tab %}<h6>Press <kbd>Esc</kbd> to close.</h6>{% endif %}
  17. </h1>
  18. </div>
  19. <input class="form-control me-lg-2" type="text"
  20. id="untubeSearchBar"
  21. name="search" placeholder="Search UnTube"
  22. hx-post="{% url 'search_UnTube' %}"
  23. hx-trigger="keyup changed delay:700ms"
  24. hx-target="#untube-searchbar-results"
  25. hx-include="[id='searchbar-radio-form']"
  26. hx-indicator=".htmx-indicator" autofocus>
  27. <br>
  28. <div id="searchbar-radio-form">
  29. <div class="d-flex justify-content-center">
  30. <div class="form-check me-5">
  31. <input class="form-check-input" type="radio" name="search-settings" value="starts-with" id="starts-with-cb" checked>
  32. <label class="form-check-label" for="starts-with-cb">
  33. Starts with
  34. </label>
  35. </div>
  36. <div class="form-check">
  37. <input class="form-check-input" type="radio" name="search-settings" value="contains" id="contains-cb">
  38. <label class="form-check-label" for="contains-cb">
  39. Contains
  40. </label>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <div id="spinner" class="htmx-indicator d-flex justify-content-center">
  46. <div class="spinner-border text-light" role="status">
  47. </div>
  48. </div>
  49. {% endblock %}