Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399375 )

Change subject: Add core-only search profile, improve UI
......................................................................

Add core-only search profile, improve UI

Show a listing of the different search profiles in the header, so people
know what to click on.

Change-Id: I146041bbaae0bb89a242b3ab48fd8c3509fc576b
---
M .gitignore
M app.py
M start.sh
M write_config.py
4 files changed, 30 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/codesearch 
refs/changes/75/399375/1

diff --git a/.gitignore b/.gitignore
index 826ce0b..52c000d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
 search
+core
 extensions
 skins
 things
diff --git a/app.py b/app.py
index db44571..2726300 100644
--- a/app.py
+++ b/app.py
@@ -28,22 +28,46 @@
     'extensions': 6081,
     'skins': 6082,
     'things': 6083,
+    'core': 6084,
 }
+
+
+def index_url(backend):
+    return url_for('index', backend=backend)
 
 
 @app.route('/')
 def homepage():
-    return redirect(url_for('index', backend='search'))
+    return redirect(index_url('search'))
 
 
 @app.route('/<backend>/')
 def index(backend):
     if backend not in BACKENDS:
         return 'invalid backend'
+    header = """
+<div style="text-align: center;">
+<h2>MediaWiki code search</h2>
+
+<a href="{search}">Everything</a> ·
+<a href="{core}">MediaWiki core</a> ·
+<a href="{ext}">Extensions</a> ·
+<a href="{skins}">Skins</a> ·
+<a href="{things}">Extensions & Skins</a>
+</div>
+""".format(
+        search=index_url('search'),
+        core=index_url('core'),
+        ext=index_url('extensions'),
+        skins=index_url('skins'),
+        things=index_url('things')
+    )
+    title = '<title>MediaWiki code search</title>'
 
     def mangle(text):
-        header = '<h2 style="text-align: center;">MediaWiki code search</h2>'
-        return text.replace('<body>', '<body>' + header)
+        text = text.replace('<body>', '<body>' + header)
+        text = text.replace('<title>Hound</title>', title)
+        return text
     return proxy(backend, mangle=mangle)
 
 
diff --git a/start.sh b/start.sh
index 2aa8f8f..a03d9b1 100755
--- a/start.sh
+++ b/start.sh
@@ -3,3 +3,4 @@
 docker run -d -p 6081:6080 --name hound-extensions -v 
/srv/codesearch/extensions:/data etsy/hound
 docker run -d -p 6082:6080 --name hound-skins -v /srv/codesearch/skins:/data 
etsy/hound
 docker run -d -p 6083:6080 --name hound-things -v /srv/codesearch/things:/data 
etsy/hound
+docker run -d -p 6084:6080 --name hound-core -v /srv/codesearch/core:/data 
etsy/hound
diff --git a/write_config.py b/write_config.py
index 561c236..772dca6 100755
--- a/write_config.py
+++ b/write_config.py
@@ -84,6 +84,7 @@
 
 def main():
     make_conf('search')
+    make_conf('core', exts=False, skins=False)
     make_conf('extensions', core=False, skins=False)
     make_conf('skins', core=False, exts=False)
     make_conf('things', core=False)

-- 
To view, visit https://gerrit.wikimedia.org/r/399375
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I146041bbaae0bb89a242b3ab48fd8c3509fc576b
Gerrit-PatchSet: 1
Gerrit-Project: labs/codesearch
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to