]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Integrate searches coming in from the navbar.
authorAnt Zucaro <azucaro@gmail.com>
Sun, 5 Feb 2012 22:46:35 +0000 (17:46 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Sun, 5 Feb 2012 22:46:35 +0000 (17:46 -0500)
xonstat/templates/search.mako
xonstat/views/search.py

index f80050fc135f932ec0548f0f72f4c89d95a792ec..ea227dd0237984715dabf0e5b00038cd636cf058 100755 (executable)
@@ -4,7 +4,7 @@
 % if results == None:
 <form action="${request.route_url("search")}" method="get">
     <input type="hidden" name="fs" />
-    <table id="search_form" border="0">
+    <table id="search_form" class="table table-bordered table-condensed" border="0">
         <tr>
             <td style="text-align:right;">Nick:</td>
             <td><input type="text" name="nick" /></td>
index 6f40984c238bdab340ee8b6e40962d9e3bbf9269..f888a698eb7edcec436a03187a0cc7bc985a330f 100755 (executable)
@@ -114,6 +114,15 @@ def search(request):
         if request.params.has_key('tdm'):
                 gametypes.append('tdm')
                 query['tdm'] = ''
+        if request.params.has_key('stype') and request.params.has_key('sval'):
+            stype = request.params['stype']
+            sval = request.params['sval']
+            if stype == "players":
+                nick = sval
+            if stype == "servers":
+                server_name = sval
+            if stype == "maps":
+                map_name = sval
 
         (result_type, q) = search_q(nick=nick, server_name=server_name,
                 map_name=map_name, gametypes=gametypes)