diff --git a/boards/context_processors.py b/boards/context_processors.py --- a/boards/context_processors.py +++ b/boards/context_processors.py @@ -4,6 +4,7 @@ from boards.models.user import Notificat __author__ = 'neko259' +import neboard from boards import settings from boards.models import Post, Tag, Thread @@ -21,6 +22,7 @@ CONTEXT_IMAGE_VIEWER = 'image_viewer' CONTEXT_HAS_FAV_THREADS = 'has_fav_threads' CONTEXT_POW_DIFFICULTY = 'pow_difficulty' CONTEXT_NEW_POST_COUNT = 'new_post_count' +CONTEXT_SEARCH_ENABLED = 'search_enabled' def get_notifications(context, request): @@ -76,6 +78,8 @@ def user_and_ui_processor(request): context[CONTEXT_HAS_FAV_THREADS] =\ len(settings_manager.get_fav_threads()) > 0 + context[CONTEXT_SEARCH_ENABLED] = 'haystack' in neboard.settings.INSTALLED_APPS + get_notifications(context, request) get_new_post_count(context, request) diff --git a/boards/templates/boards/base.html b/boards/templates/boards/base.html --- a/boards/templates/boards/base.html +++ b/boards/templates/boards/base.html @@ -39,7 +39,9 @@ {% trans 'Add tags' %} → {% endif %} {% trans "tags" %}, - {% trans 'search' %}, + {% if search_enabled %} + {% trans 'search' %}, + {% endif %} {% trans 'feed' %}, {% trans 'random' %}{% if has_fav_threads %},