Skip to content

Commit

Permalink
Make it clearer which articles are searched
Browse files Browse the repository at this point in the history
Differentiate between full search or hierarchical search
  • Loading branch information
duvholt committed Nov 23, 2017
1 parent f22b17c commit 15e8bef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/wiki/templates/wiki/base_site.html
Expand Up @@ -48,7 +48,13 @@
{% endspaceless %}"
>
<div class="input-group">
<input type="search" class="form-control search-query" name="q" placeholder="{% trans "Search..." %}" />
<input type="search" class="form-control search-query" name="q" placeholder="{% spaceless %}
{% if article or urlpath %}
{% trans "Search from current article..." %}
{% else %}
{% trans "Search whole wiki..." %}
{% endif %}
{% endspaceless %}" />
<span class="input-group-btn">
<button class="btn btn-default" type="submit">
<span class="fa fa-search"></span>
Expand Down
5 changes: 5 additions & 0 deletions src/wiki/templates/wiki/search.html
Expand Up @@ -12,6 +12,11 @@ <h1 class="page-header">{% trans "Search results for:" %} {{ search_query }}</h1
<p class="lead">
<div class="pull-right">
<div class="input-group">
{% if urlpath %}
<p>{% trans "Searching in" %} {{ urlpath.article }}</p>
{% else %}
<p>{% trans "Searching whole wiki" %}</p>
{% endif %}
<input type="search" class="form-control search-query" name="q" value="{{ search_query }}" />
<span class="input-group-btn">
<button class="btn btn-default" type="submit">
Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_views.py
Expand Up @@ -446,7 +446,7 @@ def test_empty_query_string(self):
self.assertFalse(response.context['articles'])

def test_hierarchy_search(self):

print(self.c)
c = self.c

c.post(
Expand Down

0 comments on commit 15e8bef

Please sign in to comment.