##// 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 __author__ = 'neko259'
5 __author__ = 'neko259'
6
6
7 import neboard
7 from boards import settings
8 from boards import settings
8 from boards.models import Post, Tag, Thread
9 from boards.models import Post, Tag, Thread
9
10
@@ -21,6 +22,7 b" CONTEXT_IMAGE_VIEWER = 'image_viewer'"
21 CONTEXT_HAS_FAV_THREADS = 'has_fav_threads'
22 CONTEXT_HAS_FAV_THREADS = 'has_fav_threads'
22 CONTEXT_POW_DIFFICULTY = 'pow_difficulty'
23 CONTEXT_POW_DIFFICULTY = 'pow_difficulty'
23 CONTEXT_NEW_POST_COUNT = 'new_post_count'
24 CONTEXT_NEW_POST_COUNT = 'new_post_count'
25 CONTEXT_SEARCH_ENABLED = 'search_enabled'
24
26
25
27
26 def get_notifications(context, request):
28 def get_notifications(context, request):
@@ -76,6 +78,8 b' def user_and_ui_processor(request):'
76 context[CONTEXT_HAS_FAV_THREADS] =\
78 context[CONTEXT_HAS_FAV_THREADS] =\
77 len(settings_manager.get_fav_threads()) > 0
79 len(settings_manager.get_fav_threads()) > 0
78
80
81 context[CONTEXT_SEARCH_ENABLED] = 'haystack' in neboard.settings.INSTALLED_APPS
82
79 get_notifications(context, request)
83 get_notifications(context, request)
80 get_new_post_count(context, request)
84 get_new_post_count(context, request)
81
85
@@ -39,7 +39,9 b''
39 {% trans 'Add tags' %} →
39 {% trans 'Add tags' %} →
40 {% endif %}
40 {% endif %}
41 <a href="{% url 'tags' 'required'%}" title="{% trans 'Tag management' %}">{% trans "tags" %}</a>,
41 <a href="{% url 'tags' 'required'%}" title="{% trans 'Tag management' %}">{% trans "tags" %}</a>,
42 {% if search_enabled %}
42 <a href="{% url 'search' %}" title="{% trans 'Search' %}">{% trans 'search' %}</a>,
43 <a href="{% url 'search' %}" title="{% trans 'Search' %}">{% trans 'search' %}</a>,
44 {% endif %}
43 <a href="{% url 'feed' %}" title="{% trans 'Feed' %}">{% trans 'feed' %}</a>,
45 <a href="{% url 'feed' %}" title="{% trans 'Feed' %}">{% trans 'feed' %}</a>,
44 <a href="{% url 'random' %}" title="{% trans 'Random images' %}">{% trans 'random' %}</a>{% if has_fav_threads %},
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