David Chambers avatar David Chambers committed 85f1433

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

Comments (0)

Files changed (3)

settings/defaults.py

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

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">
         (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),
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.