]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/templates/search.mako
Remove Persona since it was shut down. :(
[xonotic/xonstat.git] / xonstat / templates / search.mako
old mode 100755 (executable)
new mode 100644 (file)
index 3c4f794..69013b0
 <%inherit file="base.mako"/>
+<%namespace name="nav" file="nav.mako" />
 <%namespace file="navlinks.mako" import="navlinks" />
 
+<%block name="navigation">
+  ${nav.nav('games')}
+</%block>
+
 % if results == None:
-<h2>Advanced Search</h2>
-<form action="${request.route_url("search")}" method="get">
-    <input type="hidden" name="fs" />
-    <table style="border: none;" id="search_form" border="0">
-        <tr>
-            <td style="text-align:right; border: none;">Nick:</td>
-            <td style="border: none;"><input type="text" name="nick" /></td>
-        </tr>
-        <tr style="border: none;">
-            <td style="text-align:right; border: none;">Server:</td>
-            <td style="border: none;"><input type="text" name="server_name" /></td>
-        </tr>
-        <tr style="border: none;">
-            <td style="text-align:right; border: none;">Map:</td>
-            <td style="border: none;"><input type="text" name="map_name" /></td>
-        </tr>
-        <tr style="border: none;">
-            <td style="text-align:right; border: none;">Game Type:</td>
-            <td style="border: none;">
-                <input type="checkbox" name="dm" />Deathmatch<br/>
-                <input type="checkbox" name="duel" />Duel<br/>
-                <input type="checkbox" name="ctf" />Capture The Flag<br/>
-                <input type="checkbox" name="tdm" />Team Deathmatch<br/>
-            </td>
-        </tr>
-        <tr style="border: none;">
-            <td style="text-align:right; border: none;"></td>
-            <td style="border: none;"><input type="submit" value="search" /></td>
-        </tr>
-    </table>
-    </form>
-% elif len(results) == 0:
-    <h1>Sorry, nothing found!</h1>
-% else:
 
-##### player-only results #####
-% if result_type == "player":
-<table>
-    <tr>
-        <th>Player</th>
-        <th>Joined</th>
-    </tr>
-    % for player in results:
-    <tr>
-        <td><a href="${request.route_url("player_info", id=player.player_id)}" name="Player info page for player #${player.player_id}">${player.nick_html_colors()|n}</a></td>
-        <td>${player.joined_pretty_date()}</td>
-    </tr>
-    % endfor
-</table>
-% endif
+  <%block name="title">
+    Advanced Search
+  </%block>
 
-##### server-only results #####
-% if result_type == "server":
-<table>
-    <tr>
-        <th>Server</th>
-        <th>Created</th>
-    </tr>
-    % for server in results:
-    <tr>
-        <td><a href="${request.route_url("server_info", id=server.server_id)}" name="Server info page for server #${server.server_id}">${server.name}</a></td>
-        <td>${server.create_dt.strftime('%m/%d/%Y at %I:%M %p')}</td>
-    </tr>
-    % endfor
-</table>
-% endif
+  <div class="row">
+    <div class="small-12 large-6 large-offset-3 columns">
 
-##### map-only results #####
-% if result_type == "map":
-<table>
-    <tr>
-        <th>Map</th>
-        <th>Added</th>
-    </tr>
-    % for map in results:
-    <tr>
-        <td><a href="${request.route_url("map_info", id=map.map_id)}" name="Map info page for map #${map.map_id}">${map.name}</a></td>
-        <td>${map.create_dt.strftime('%m/%d/%Y at %I:%M %p')}</td>
-    </tr>
-    % endfor
-</table>
-% endif
+      <form class="form-horizontal">
+        <fieldset>
 
-##### game results #####
-% if result_type == "game":
-<table>
-    <tr>
-        <th></th>
-        <th>Map</th>
-        <th>Server</th>
-        <th>Played On</th>
-    </tr>
-    % for (game, server, gmap) in results:
-    <tr>
-        <td><a class="btn btn-primary btn-small" href="${request.route_url("game_info", id=game.game_id)}" name="Game info page for game #${game.game_id}">View</a></td>
-        <td><a href="${request.route_url("map_info", id=gmap.map_id)}" name="Map info page for map #${gmap.map_id}">${gmap.name}</a></td>
-        <td><a href="${request.route_url("server_info", id=server.server_id)}" name="Server info page for server #${server.server_id}">${server.name}</a></td>
-        <td>${game.create_dt.strftime('%m/%d/%Y at %I:%M %p')}</td>
-    </tr>
-    % endfor
-</table>
-% endif
+          <!-- Form submitted? -->
+          <input type="hidden" name="fs" />
 
-<!-- navigation links -->
-${navlinks("search_paged", results.page, results.last_page, _query=query)}
-% endif
+          <!-- Text input-->
+          <div class="control-group">
+            <label class="control-label">Nick</label>
+            <div class="controls">
+              <input id="nick" name="nick" type="text" placeholder="player nick" class="input-xlarge">
+              <p class="help-block"></p>
+            </div>
+          </div>
 
-<%block name="js">
-${parent.js()}
-</%block>
+          <!-- Text input-->
+          <div class="control-group">
+            <label class="control-label">Server</label>
+            <div class="controls">
+              <input id="server_name" name="server_name" type="text" placeholder="server name" class="input-xlarge">
+              <p class="help-block"></p>
+            </div>
+          </div>
 
+          <!-- Text input-->
+          <div class="control-group">
+            <label class="control-label">Map</label>
+            <div class="controls">
+              <input id="map_name" name="map_name" type="text" placeholder="map name" class="input-xlarge">
+              <p class="help-block"></p>
+            </div>
+          </div>
 
+          <!-- Multiple Checkboxes -->
+          <div class="control-group">
+            <label class="control-label">Game Types</label>
+            <div class="controls">
+              <label class="checkbox">
+                <input type="checkbox" name="dm" value="Deathmatch">
+                Deathmatch
+              </label>
+              <label class="checkbox">
+                <input type="checkbox" name="duel" value="Duel">
+                Duel
+              </label>
+              <label class="checkbox">
+                <input type="checkbox" name="ctf" value="Capture The Flag">
+                Capture The Flag
+              </label>
+              <label class="checkbox">
+                <input type="checkbox" name="tdm" value="Team Deathmatch">
+                Team Deathmatch
+              </label>
+            </div>
+          </div>
+
+          <!-- Button -->
+          <div class="control-group">
+            <label class="control-label"></label>
+            <div class="controls">
+              <button id="submit" name="submit" type="submit" class="btn btn-primary">Submit</button>
+            </div>
+          </div>
+
+        </fieldset>
+      </form>
+
+    </div>
+  </div>
+
+
+% elif len(results) == 0:
+  <div class="row">
+    <div class="small-12 large-6 large-offset-3 columns">
+      <h1 class="text-center">Sorry, nothing found!</h1>
+    </div>
+  </div>
+
+% else:
+
+  ##### player-only results #####
+  % if result_type == "player":
+    <div class="row">
+      <div class="small-12 large-8 large-offset-2 columns">
+        <table class="table-hover table-condensed">
+          <tr>
+            <th class="small-2">ID</th>
+            <th class="small-6">Nick</th>
+            <th class="small-3">Joined</th>
+            <th class="small-1"></th>
+          </tr>
+          % for player in results:
+            <tr>
+              <td>${player.player_id}</th>
+              <td class="no-stretch"><a href="${request.route_url("player_info", id=player.player_id)}" title="Go to this player's info page">${player.nick_html_colors()|n}</a></th>
+              <td><span class="abstime" data-epoch="${player.epoch()}" title="${player.create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${player.fuzzy_date()}</span></th>
+              <td class="text-center">
+                <a href="${request.route_url("player_game_index", player_id=player.player_id, page=1)}" title="View recent games by this player">
+                  <i class="fa fa-list"></i>
+                </a>
+              </td>
+            </tr>
+          % endfor
+        </table>
+  % endif
+
+  ##### server-only results #####
+  % if result_type == "server":
+    <div class="row">
+      <div class="small-12 large-8 large-offset-2 columns">
+        <table class="table-hover table-condensed">
+          <tr>
+            <th class="small-2">ID</th>
+            <th class="small-6">Name</th>
+            <th class="small-3">Added</th>
+            <th class="small-1"></th>
+          </tr>
+          % for server in results:
+            <tr>
+              <td>${server.server_id}</td>
+              <td><a href="${request.route_url("server_info", id=server.server_id)}" title="Go to this server's info page">${server.name}</a></th>
+              <td><span class="abstime" data-epoch="${server.epoch()}" title="${server.create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${server.fuzzy_date()}</span></td>
+              <td class="text-center">
+                <a href="${request.route_url("game_index", _query={'server_id':server.server_id})}" title="View recent games on this server">
+                  <i class="fa fa-list"></i>
+                </a>
+              </td>
+            </tr>
+          % endfor
+        </table>
+  % endif
+
+  ##### map-only results #####
+  % if result_type == "map":
+    <div class="row">
+      <div class="small-12 large-8 large-offset-2 columns">
+        <table class="table-hover table-condensed">
+          <tr>
+            <th class="small-2">ID</th>
+            <th class="small-6">Name</th>
+            <th class="small-3">Added</th>
+            <th class="small-1"></th>
+          </tr>
+          % for map in results:
+            <tr>
+              <td>${map.map_id}</td>
+              <td><a href="${request.route_url("map_info", id=map.map_id)}" title="Go to this map's info page">${map.name}</a></th>
+              <td><span class="abstime" data-epoch="${map.epoch()}" title="${map.create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${map.fuzzy_date()}</span></td>
+               <td class="text-center">
+                <a href="${request.route_url("game_index", _query={'map_id':map.map_id})}" title="View recent games on this map">
+                  <i class="fa fa-list"></i>
+                </a>
+              </td>
+            </tr>
+          % endfor
+        </table>
+  % endif
+
+  ##### game results #####
+  % if result_type == "game":
+  <div class="row">
+    <div class="small-12 large-8 large-offset-2 columns">
+      <table class="table-hover table-condensed">
+        <tr>
+          <th class="small-3"></th>
+          <th class="small-3 medium-6">Map</th>
+          <th class="small-3 medium-3">Server</th>
+          <th class="small-3">Time</th>
+        </tr>
+        % for (game, server, gmap) in results:
+          <tr>
+            <td class="text-center"><a class="tiny button" href="${request.route_url("game_info", id=game.game_id)}" name="Game info page for game #${game.game_id}">View</a></td>
+            <td class="no-stretch"><a href="${request.route_url("map_info", id=gmap.map_id)}" name="Map info page for map #${gmap.map_id}">${gmap.name}</a></td>
+            <td><a href="${request.route_url("server_info", id=server.server_id)}" name="Server info page for server #${server.server_id}">${server.name}</a></td>
+            <td><span class="abstime" data-epoch="${game.epoch()}" title="${game.create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${game.fuzzy_date()}</span></td>
+          </tr>
+        % endfor
+      </table>
+  % endif
+
+      <!-- navigation links -->
+      ${navlinks("search", results.page, results.last_page, search_query=query)}
+    </div>
+  </div>
+% endif