Commits

David Chambers  committed 85f1433

add `SEARCH` setting which can be set to `False` to disable site search

  • Participants
  • Parent commits 643aa12

Comments (0)

Files changed (3)

File settings/defaults.py

 # post. For example, ... is replaced with an ellipsis.
 REPLACEMENTS = True
 
+SEARCH = True
+
 SHORT_URL_BASE = None
 
 SITEMAP = True

File templates/_base.html

         </nav>
   {% endblock %}
 
+  {% if SEARCH %}
         <form action="{% url mango.views.search %}">
           <div>
             <label for="query">Search</label>
             <input type="submit" value="Search" />
           </div>
         </form>
+  {% endif %}
       </header>
 
       <div id="main">

File urls/defaults.py

         (r'^tag/([^/]+)/feed/$', atom),
     )
 
+if mango.settings.SEARCH:
+    urlpatterns += patterns('',
+        (r'^search$', search),
+    )
+
 if mango.settings.SUBSCRIPTIONS:
     urlpatterns += patterns('',
         (r'^(.+?)/unsubscribe/(\d+)/$', unsubscribe),
     (r'^feed/$', atom),
     (r'^flushcache/$', flush_cache),
     (r'^moderate/(approve|delete|spam|close)$', moderate),
-    (r'^search$', search),
     (r'^(.+?)/redirect/(.+)?$', redirect),
     (r'^(.+?)/comment/$', post),
     (r'^(.+?)/%s$' % mango.settings.SOURCE_SUFFIX, view_source),