##// END OF EJS Templates
Show search button only if haystack is enabled
neko259 -
r1478:e214bc15 default
parent child Browse files
Show More
@@ -4,6 +4,7 b' from boards.models.user import Notificat'
4 4
5 5 __author__ = 'neko259'
6 6
7 import neboard
7 8 from boards import settings
8 9 from boards.models import Post, Tag, Thread
9 10
@@ -21,6 +22,7 b" CONTEXT_IMAGE_VIEWER = 'image_viewer'"
21 22 CONTEXT_HAS_FAV_THREADS = 'has_fav_threads'
22 23 CONTEXT_POW_DIFFICULTY = 'pow_difficulty'
23 24 CONTEXT_NEW_POST_COUNT = 'new_post_count'
25 CONTEXT_SEARCH_ENABLED = 'search_enabled'
24 26
25 27
26 28 def get_notifications(context, request):
@@ -76,6 +78,8 b' def user_and_ui_processor(request):'
76 78 context[CONTEXT_HAS_FAV_THREADS] =\
77 79 len(settings_manager.get_fav_threads()) > 0
78 80
81 context[CONTEXT_SEARCH_ENABLED] = 'haystack' in neboard.settings.INSTALLED_APPS
82
79 83 get_notifications(context, request)
80 84 get_new_post_count(context, request)
81 85
@@ -39,7 +39,9 b''
39 39 {% trans 'Add tags' %} →
40 40 {% endif %}
41 41 <a href="{% url 'tags' 'required'%}" title="{% trans 'Tag management' %}">{% trans "tags" %}</a>,
42 <a href="{% url 'search' %}" title="{% trans 'Search' %}">{% trans 'search' %}</a>,
42 {% if search_enabled %}
43 <a href="{% url 'search' %}" title="{% trans 'Search' %}">{% trans 'search' %}</a>,
44 {% endif %}
43 45 <a href="{% url 'feed' %}" title="{% trans 'Feed' %}">{% trans 'feed' %}</a>,
44 46 <a href="{% url 'random' %}" title="{% trans 'Random images' %}">{% trans 'random' %}</a>{% if has_fav_threads %},
45 47
General Comments 0
You need to be logged in to leave comments. Login now