about summary refs log tree commit diff
path: root/web/converse/templates/search.html
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-04-05T14·55+0200
committerVincent Ambo <mail@tazj.in>2021-04-05T15·01+0200
commit8142149e28991b15affc5e4576a033e0ada9778b (patch)
tree44387ac5cae9c3a39e1810909ef2ee92e0278709 /web/converse/templates/search.html
parent386afdc794eefd5bcbc47a3fd7b898a07f69f978 (diff)
parent09168021e7405f6b83798d0b43aa6e69e744ae87 (diff)
feat(web/converse): Import repository r/2440
Imports the converse forum software I wrote a few years ago. I want to
clean this up a bit and try using Hotwire with it.

Note: The original repository was AGPL-3.0 licensed. I'm the copyright
holder and have relicensed it to GPL-3.0 in the commit that is being
merged.

Imported from: https://github.com/tazjin/converse

git-subtree-dir: web/converse
git-subtree-mainline: 386afdc794eefd5bcbc47a3fd7b898a07f69f978
git-subtree-split: 09168021e7405f6b83798d0b43aa6e69e744ae87
Change-Id: Ia8b587db5174ef5b3c52910d3d027199150c58e0
Diffstat (limited to 'web/converse/templates/search.html')
-rw-r--r--web/converse/templates/search.html67
1 files changed, 67 insertions, 0 deletions
diff --git a/web/converse/templates/search.html b/web/converse/templates/search.html
new file mode 100644
index 000000000000..a74b60e0a715
--- /dev/null
+++ b/web/converse/templates/search.html
@@ -0,0 +1,67 @@
+<!doctype html>
+<html lang="en">
+    <head>
+        <meta charset="utf-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
+        <title>Converse: Search results</title>
+
+        <!-- TODO -->
+        <meta http-equiv="Content-Security-Policy" content="script-src https://code.getmdl.io 'self';">
+        <!-- <link rel="shortcut icon" href="images/favicon.png"> -->
+
+        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu">
+        <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
+        <link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.blue_grey-orange.min.css" />
+        <link rel="stylesheet" href="/static/styles.css">
+    </head>
+    <body class="converse mdl-base mdl-color-text--grey-700 mdl-color--grey-100">
+        <div class="mdl-layout mdl-layout--fixed-header mdl-js-layout mdl-color--grey-100">
+            <header class="mdl-layout__header mdl-layout__header--scroll mdl-color--primary-dark">
+                <div class="mdl-layout__header-row">
+                    <a href="/" class="mdl-layout-title mdl-color-text--blue-grey-50 cvs-title">Converse</a>
+                    <div class="mdl-layout-spacer"></div>
+                    <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label mdl-color-text--blue-grey-50 search-field">
+                        <form method="get" action="/search">
+                            <input class="mdl-textfield__input" type="search" id="search-query" aria-label="Search" name="query">
+                            <label class="mdl-textfield__label mdl-color-text--blue-grey-100" for="search-query">Search query...</label>
+                            <input type="submit" hidden />
+                        </form>
+                    </div>
+                    &nbsp;
+                    <a href="/">
+                        <button class="mdl-button mdl-js-button mdl-button--raised mdl-button--accent mdl-js-ripple-effect">
+                            Back to index
+                        </button>
+                    </a>
+                </div>
+            </header>
+            <main class="mdl-layout__content">
+                <section class="section--center mdl-grid">
+                    <div class="mdl-cell--12-col">
+                        <h4>Search results for '{{ query }}':</h4>
+                    </div>
+                    {% for result in results %}
+                        <div class="mdl-card mdl-cell--6-col search-result mdl-shadow--2dp">
+                            <div class="mdl-card__supporting-text">
+                                <p>Posted in '{{ result.title }}' by {{ result.author }}:</p>
+                                <p>{{ result.headline|safe }}</p>
+                            </div>
+                            <div class="mdl-card__actions mdl-card--border post-actions">
+                                <div class="mdl-layout-spacer"></div>
+                                <a class="mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab mdl-button--colored" href="/thread/{{ result.thread_id }}#post-{{ result.post_id }}">
+                                    <i class="material-icons">arrow_forward</i>
+                                </a>
+                            </div>
+                        </div>
+                    {% endfor %}
+                </section>
+            </main>
+            <footer class="mdl-mini-footer">
+                <div class="mdl-mini-footer--right-section">
+                    <p>Powered by <a href="https://github.com/tazjin/converse">Converse</a></p>
+                </div>
+            </footer>
+        </div>
+        <script src="https://code.getmdl.io/1.3.0/material.min.js"></script>
+    </body>
+</html>