File tree 2 files changed +5
-1
lines changed 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -39,14 +39,16 @@ def elastic_search(request, project_slug=None):
39
39
40
40
:param project_slug: Sent when the view is a project search
41
41
"""
42
+ _type = None
42
43
43
44
if project_slug :
44
45
queryset = Project .objects .protected (request .user )
45
46
project_obj = get_object_or_404 (queryset , slug = project_slug )
47
+ _type = request .GET .get ('type' , 'file' )
46
48
47
49
user_input = UserInput (
48
50
query = request .GET .get ('q' ),
49
- type = request .GET .get ('type' , 'project' ),
51
+ type = _type or request .GET .get ('type' , 'project' ),
50
52
project = project_slug or request .GET .get ('project' ),
51
53
version = request .GET .get ('version' , LATEST ),
52
54
taxonomy = request .GET .get ('taxonomy' ),
Original file line number Diff line number Diff line change 28
28
< ul >
29
29
< h5 > {% trans 'Object Type' %}</ h5 >
30
30
{# < li class ="{% if type == 'all' %}active{% endif %} "> < a href ="?{% url_replace request 'type' 'all' %} "> {% trans 'All' %}</ a > </ li > #}
31
+ {% if not project %}
31
32
< li class ="{% if type == 'project' %}active{% endif %} "> < a href ="?{% url_replace request 'type' 'project' %} "> {% trans 'Projects' %}</ a > </ li >
33
+ {% endif %}
32
34
< li class ="{% if type == 'file' %}active{% endif %} "> < a href ="?{% url_replace request 'type' 'file' %} "> {% trans 'Files' %}</ a > </ li >
33
35
< li class ="{% if type == 'domain' %}active{% endif %} "> < a href ="?{% url_replace request 'type' 'domain' %} "> {% trans 'Code API' %}</ a > </ li >
34
36
You can’t perform that action at this time.
0 commit comments