Skip to content

Commit

Permalink
Tweaks to search UX (jointakahe#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviflax authored Dec 4, 2022
1 parent 98840e4 commit 7a7907a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion activities/views/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 6 additions & 0 deletions templates/activities/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,10 @@ <h2>Hashtags</h2>
{% 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 %}

0 comments on commit 7a7907a

Please sign in to comment.