summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Flax2022-12-03 21:47:09 -0500
committerGitHub2022-12-03 19:47:09 -0700
commit7a7907a6df66ea4fb556a1e2c2a991fa60a25d1b (patch)
treecc6689f2821270ffbf42a27e222d0151ca4bf611
parent98840e475df5e0b9d66e77d5fcef161b385a3427 (diff)
downloadtakahe-7a7907a6df66ea4fb556a1e2c2a991fa60a25d1b.tar.gz
takahe-7a7907a6df66ea4fb556a1e2c2a991fa60a25d1b.tar.bz2
takahe-7a7907a6df66ea4fb556a1e2c2a991fa60a25d1b.zip
Tweaks to search UX (#92)
-rw-r--r--activities/views/search.py3
-rw-r--r--templates/activities/search.html6
2 files changed, 8 insertions, 1 deletions
diff --git a/activities/views/search.py b/activities/views/search.py
index 4719f64..b5e5586 100644
--- a/activities/views/search.py
+++ b/activities/views/search.py
@@ -13,7 +13,8 @@ class Search(FormView):
class form_class(forms.Form):
query = forms.CharField(
- help_text="Search for a user by @username@domain or hashtag by #tagname"
+ help_text="Search for a user by @username@domain or hashtag by #tagname",
+ widget=forms.TextInput(attrs={"type": "search", "autofocus": "autofocus"}),
)
def search_identities(self, query: str):
diff --git a/templates/activities/search.html b/templates/activities/search.html
index 5137740..9081632 100644
--- a/templates/activities/search.html
+++ b/templates/activities/search.html
@@ -26,4 +26,10 @@
{% endfor %}
</section>
{% endif %}
+ {% if not results.identities and not results.hashtags %}
+ <h2>No results (yet)</h2>
+ <p>No results found — not yet, at least. The search swamphens are still
+ rooting around behind the scenes and may yet turn something up. If you try your search
+ again after a moment, you might get lucky!</p>
+ {% endif %}
{% endblock %}