results.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta
  6. name="viewport"
  7. content="width=device-width, initial-scale=1.0, maximum-scale=5.0"
  8. />
  9. <title>Simo Search - {{query}}</title>
  10. <link rel="stylesheet" href="/static/main.css" />
  11. <link rel="icon" type="image/x-icon" href="/static/favicon.gif" />
  12. <link
  13. rel="search"
  14. type="application/opensearchdescription+xml"
  15. title="Simo Search"
  16. href="/opensearch.xml"
  17. />
  18. </head>
  19. <body class="results-view">
  20. <header>
  21. <a style="text-decoration: none" onclick="window.location = '/'"
  22. ><h1>Simo<span>Search</span></h1></a
  23. >
  24. <form action="/search" method="GET" class="search-form">
  25. <input
  26. name="q"
  27. type="text"
  28. class="search-box"
  29. autocomplete="off"
  30. placeholder="Search the web..."
  31. value="{{query}}"
  32. />
  33. </form>
  34. ,
  35. <script>
  36. (function () {
  37. const isEmbed =
  38. (window.location.hash || "").indexOf("#embed") !== -1;
  39. if (!isEmbed) return;
  40. function persistEmbedHash(ev) {
  41. const a =
  42. ev.target && ev.target.closest
  43. ? ev.target.closest("a[href]")
  44. : null;
  45. if (!a) return;
  46. const href = a.getAttribute("href");
  47. if (!href) return;
  48. if (href[0] === "#" || href.indexOf("#embed") !== -1)
  49. return;
  50. a.setAttribute("href", href + "#embed");
  51. }
  52. document.addEventListener("click", persistEmbedHash, true);
  53. })();
  54. </script>
  55. </header>
  56. <nav class="nav-tabs">
  57. <div class="nav-container">
  58. <a href="/search?q={{query}}" class="active"> All </a>
  59. <a href="/images?q={{query}}"> Images </a>
  60. </div>
  61. </nav>
  62. <div class="content-layout">
  63. <main class="results-container">
  64. {{for result in results}}
  65. <div class="result">
  66. <span class="url"> {{result[1]}} </span>
  67. <a href="{{result[0]}}"> {{result[2]}} </a>
  68. <p class="desc">{{result[3]}}</p>
  69. </div>
  70. {{endfor}}
  71. <nav class="pagination">
  72. <a
  73. class="pagination-btn prev"
  74. href="/search?q={{query}}&p={{prev_page}}"
  75. >
  76. &larr; Page {{prev_page}}
  77. </a>
  78. <span class="pagination-current">Page {{page}}</span>
  79. <a
  80. class="pagination-btn next"
  81. href="/search?q={{query}}&p={{next_page}}"
  82. >
  83. Page {{next_page}} &rarr;
  84. </a>
  85. </nav>
  86. </main>
  87. <aside class="infobox-sidebar">
  88. {{if exists infoboxes}} {{for info in infoboxes}}
  89. <section class="infobox">
  90. <div class="infobox-header">
  91. <h2 class="infobox-title">{{info[0]}}</h2>
  92. </div>
  93. <div class="infobox-main">
  94. <img
  95. src="{{info[1]}}"
  96. alt="{{info[0]}}"
  97. class="infobox-image"
  98. />
  99. <div class="infobox-content">
  100. <p class="infobox-summary">{{info[2]|safe}}</p>
  101. <a class="read-more" href="{{info[3]}}">
  102. Read More
  103. </a>
  104. </div>
  105. </div>
  106. </section>
  107. {{endfor}} {{endif}}
  108. </aside>
  109. </div>
  110. </body>
  111. </html>