]> de.git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/templates/search.mako
Make the search page awesome.
[xonotic/xonstat.git] / xonstat / templates / search.mako
1 <%inherit file="base.mako"/>
2 <%namespace name="nav" file="nav.mako" />
3 <%namespace file="navlinks.mako" import="navlinks" />
4
5 <%block name="navigation">
6 ${nav.nav('games')}
7 </%block>
8
9 % if results == None:
10
11 <%block name="title">
12 Advanced Search
13 </%block>
14
15 <div class="row">
16   <div class="span6 offset3">
17
18
19     <form style="margin-top: 20px;" class="form-horizontal">
20       <fieldset>
21
22         <!-- Form submitted? -->
23         <input type="hidden" name="fs" />
24
25         <!-- Text input-->
26         <div class="control-group">
27           <label class="control-label">Nick</label>
28           <div class="controls">
29             <input id="nick" name="nick" type="text" placeholder="player nick" class="input-xlarge">
30             <p class="help-block"></p>
31           </div>
32         </div>
33
34         <!-- Text input-->
35         <div class="control-group">
36           <label class="control-label">Server</label>
37           <div class="controls">
38             <input id="server_name" name="server_name" type="text" placeholder="server name" class="input-xlarge">
39             <p class="help-block"></p>
40           </div>
41         </div>
42
43         <!-- Text input-->
44         <div class="control-group">
45           <label class="control-label">Map</label>
46           <div class="controls">
47             <input id="map_name" name="map_name" type="text" placeholder="map name" class="input-xlarge">
48             <p class="help-block"></p>
49           </div>
50         </div>
51
52         <!-- Multiple Checkboxes -->
53         <div class="control-group">
54           <label class="control-label">Game Types</label>
55           <div class="controls">
56             <label class="checkbox">
57               <input type="checkbox" name="dm" value="Deathmatch">
58               Deathmatch
59             </label>
60             <label class="checkbox">
61               <input type="checkbox" name="duel" value="Duel">
62               Duel
63             </label>
64             <label class="checkbox">
65               <input type="checkbox" name="ctf" value="Capture The Flag">
66               Capture The Flag
67             </label>
68             <label class="checkbox">
69               <input type="checkbox" name="tdm" value="Team Deathmatch">
70               Team Deathmatch
71             </label>
72           </div>
73         </div>
74
75         <!-- Button -->
76         <div class="control-group">
77           <label class="control-label"></label>
78           <div class="controls">
79             <button id="submit" name="submit" type="submit" class="btn btn-primary">Submit</button>
80           </div>
81         </div>
82
83       </fieldset>
84     </form>
85
86   </div>
87 </div>
88
89
90     % elif len(results) == 0:
91 <div class="row">
92   <div class="span6 offset3">
93     <h1 class="text-center">Sorry, nothing found!</h1>
94   </div>
95 </div>
96     % else:
97
98 <div class="row">
99   <div class="span8 offset2">
100
101 ##### player-only results #####
102 % if result_type == "player":
103 <table class="table table-hover table-condensed">
104   <tr>
105     <th>Player</th>
106     <th>Joined</th>
107   </tr>
108   % for player in results:
109   <tr>
110     <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>
111     <td><span class="abstime" data-epoch="${player.epoch()}" title="${player.create_dt.strftime('%a, %d %b %Y %H:%M:%S UTC')}">${player.joined_pretty_date()}</span></td>
112   </tr>
113   % endfor
114 </table>
115 % endif
116
117 ##### server-only results #####
118 % if result_type == "server":
119 <table class="table table-hover table-condensed">
120   <tr>
121     <th>Server</th>
122     <th>Created</th>
123   </tr>
124   % for server in results:
125   <tr>
126     <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>
127     <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>
128   </tr>
129   % endfor
130 </table>
131 % endif
132
133 ##### map-only results #####
134 % if result_type == "map":
135 <table class="table table-hover table-condensed">
136   <tr>
137     <th>Map</th>
138     <th>Added</th>
139   </tr>
140   % for map in results:
141   <tr>
142     <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>
143     <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>
144   </tr>
145   % endfor
146 </table>
147 % endif
148
149 ##### game results #####
150 % if result_type == "game":
151 <table class="table table-hover table-condensed">
152   <tr>
153     <th></th>
154     <th>Map</th>
155     <th>Server</th>
156     <th>Time</th>
157   </tr>
158   % for (game, server, gmap) in results:
159   <tr>
160     <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>
161     <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>
162     <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>
163     <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>
164   </tr>
165   % endfor
166 </table>
167 % endif
168
169 <!-- navigation links -->
170 ${navlinks("search", results.page, results.last_page, search_query=query)}
171 </div>
172 </div>
173 % endif
174
175 <%block name="js">
176 ${parent.js()}
177 </%block>
178
179