Merge branch 'master' into zykure/approved
authorJan Behrens <zykure@web.de>
Fri, 19 Apr 2013 16:34:06 +0000 (18:34 +0200)
committerJan Behrens <zykure@web.de>
Fri, 19 Apr 2013 16:34:06 +0000 (18:34 +0200)
Conflicts:
xonstat/static/css/app.css
xonstat/static/css/app.min.css
xonstat/templates/main_index.mako
xonstat/templates/rank_index.mako

xonstat/__init__.py
xonstat/static/css/app.css
xonstat/static/css/app.min.css
xonstat/templates/game_index.mako
xonstat/templates/player_game_index.mako
xonstat/templates/search.mako
xonstat/views/game.py
xonstat/views/player.py

index 474c162553bddd206eb1b231dddf117893c8d345..08946adb2431b7f7221216ed89dbaeb0f2fc2daf 100644 (file)
@@ -41,11 +41,6 @@ def main(global_config, **settings):
     config.add_view(player_game_index,      route_name="player_game_index",      renderer="player_game_index.mako")
     config.add_view(player_game_index_json, route_name="player_game_index_json", renderer="jsonp")
 
-    config.add_route("player_game_index_filtered",      "/player/{player_id:\d+}/games/{game_type_cd:\w+}")
-    config.add_route("player_game_index_filtered_json", "/player/{player_id:\d+}/games/{game_type_cd:\w+}.json")
-    config.add_view(player_game_index,      route_name="player_game_index_filtered",      renderer="player_game_index.mako")
-    config.add_view(player_game_index_json, route_name="player_game_index_filtered_json", renderer="jsonp")
-
     config.add_route("player_info",      "/player/{id:\d+}")
     config.add_route("player_info_json", "/player/{id:\d+}.json")
     config.add_view(player_info,      route_name="player_info",      renderer="player_info.mako")
@@ -84,11 +79,6 @@ def main(global_config, **settings):
     config.add_view(game_index,      route_name="game_index",      renderer="game_index.mako")
     config.add_view(game_index_json, route_name="game_index_json", renderer="jsonp")
 
-    config.add_route("game_index_filtered",      "/games/{game_type_cd:\w+}")
-    config.add_route("game_index_filtered_json", "/games/{game_type_cd:\w+}.json")
-    config.add_view(game_index,      route_name="game_index_filtered",      renderer="game_index.mako")
-    config.add_view(game_index_json, route_name="game_index_filtered_json", renderer="jsonp")
-
     config.add_route("game_info",      "/game/{id:\d+}")
     config.add_route("game_info_json", "/game/{id:\d+}.json")
     config.add_view(game_info,      route_name="game_info",      renderer="game_info.mako")
index 584f693075d64c3524068a27cb6d155fd64aae25..64c51cc14cacc28263663ee122be1e569ee1d1db 100644 (file)
@@ -292,6 +292,7 @@ table td {
   white-space: nowrap;
 }
 
+/* elo colors */
 .eloup { color: green; }
 .elodown { color: rgb(190,0,0); }
 .eloneutral { color: gray; }
index 4f478684478753eb812a617f695e629e7b9fe787..3c41069d3862aa232ad482598e645f1efef695b3 100644 (file)
@@ -1 +1 @@
-@font-face{font-family:'XoloniumNormal';src:url('fonts/xolonium-webfont.eot');src:url('fonts/xolonium-webfont.eot?#iefix') format('embedded-opentype'),url('fonts/xolonium-webfont.woff') format('woff'),url('fonts/xolonium-webfont.ttf') format('truetype'),url('fonts/xolonium-webfont.svg#XoloniumNormal') format('svg');font-weight:normal;font-style:normal}body{background:url("img/web_background_4.jpg") no-repeat fixed center center / cover black;background-color:black;color:#d0d0d0;font-family:"XoloniumNormal","Helvetica Neue",Helvetica,Arial,sans-serif}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;color:#999}h1{font-size:30px;line-height:36px}h1 small{font-size:18px}h2{font-size:24px;line-height:36px}h2 small{font-size:18px}h3{line-height:27px;font-size:18px}h3 small{font-size:14px}h4,h5,h6{line-height:18px}h4{font-size:14px}h4 small{font-size:12px}h5{font-size:12px}h6{font-size:11px;color:#999;text-transform:uppercase}table{background:#000;background:none repeat scroll 0 0 rgba(0,0,0,0.7);border:1px solid #436688}table th{border:1px solid #436688;background-color:#001021}table td{border:1px solid #436688;font-size:10px}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#222}.table th,.table td{border:1px solid #436688}.table td{vertical-align:middle}.table .tdcenter{text-align:center}.accordion-group{border:1px solid #272525}.accordion-inner{border:0}#statline{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;position:relative;top:-25px}#xonborder{background:#000;background:none repeat scroll 0 0 rgba(0,0,0,0.5);border-radius:15px 15px 15px 15px;margin-bottom:30px;margin-left:0;padding:20px}#title{color:#08c;font-size:30px;margin-bottom:15px;position:relative;text-align:center;text-shadow:2px 2px 3px #333}.indexform{margin:20px 0 20px 0}.indexbox{width:250px}.navbar-brand{margin-left:0;padding-bottom:0;padding-top:10px;text-align:left}.navbar-inverse{background:none repeat scroll 0 0 rgba(0,0,0,0.6)}.navbar-inverse .nav>.active>a,.navbar-inverse .nav>.active>a:hover,.navbar-inverse .nav>.active>a:focus{background:none repeat scroll 0 0 rgba(49,49,49,0.6)}.navbar-inverse .nav>li>a,.navbar-brand{font-family:XoloniumNormal}.search,input[type="search"]{background-color:#606060;border:1px solid #202020;color:#aaa;width:100px}.game{float:left;margin-bottom:30px;min-width:700px;padding:10px 7px}.game a{color:#CCC}.game a:hover{color:#d95f00;text-decoration:none}.game tr{background-color:#000}.game tr.red{background-color:#4d0000}.game tr.blue{background-color:#00004d}.game tr.yellow{background-color:#4d4d00}.game tr.pink{background-color:#4d004d}.game tr:hover{background-color:#222}.weapon-nav{height:70px;margin-bottom:20px}.weapon-nav ul{display:block;list-style:none outside none}.weapon-nav li{cursor:pointer;float:left;margin-right:10px}.weapon-nav li:hover{border-bottom:2px solid #001021}.weapon-nav .weapon-active{border-bottom:2px solid #436688}.weapon-nav p{text-align:center}.flot table,.flot td{background-color:black;border:0}#gbtabcontainer{margin-top:10px}#gbtab{font-size:12px}.tabbable p{font-size:14px}.tabs-below .nav-tabs>li>a{border-radius:4px 4px 4px 4px}.nav-tabs>.active>a,.nav-tabs>.active>a:hover{background-color:#111;color:#aaa;border-color:#222}.nav-tabs>li>a{border-radius:4px 4px 4px 4px;text-align:center}.nav-tabs>li>a:hover{background-color:#111;border-color:#333}.nav-tabs{border-bottom:0 solid #000}.table .tdcenter{text-align:center}.game-detail img{float:left;margin-right:10px;margin-bottom:5px}.game img{float:left;margin-right:5px;margin-bottom:5px}.game-detail p,.game h4{float:left}.btn-toolbar .nav>li a{width:80px}.btn.dropdown-toggle,.btn.dropdown-toggle:active{background:0;border:1px solid transparent;border-radius:4px 4px 4px 4px;line-height:20px;color:#428bca;padding:10px 0 10px 0;font-size:14px;outline:0}.btn.dropdown-toggle:hover,.btn.dropdown-toggle:focus{background-color:#111;color:#2a6496;border-color:#333}.btn.dropdown-toggle>.caret{height:21px;border-top-color:#428bca;border-top-width:8px;border-left-width:8px;border-right-width:8px}.dropdown-menu{width:100px}.dropdown-menu.nav-tabs{padding:4px;background-color:#111;border:1px solid #333;width:256px}.dropdown-menu.nav-tabs>li>a{width:80px;color:inherit}.dropdown-menu.nav-tabs>li>a:hover{color:#222}.nostretch{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eloup{color:green}.elodown{color:#be0000}.eloneutral{color:gray}.pagination>li>a,.pagination>li>span{background-color:#111;border-color:#313131;color:#797979}.pagination>li>a:hover,.pagination>li>a:focus,.pagination>.active>a,.pagination>.active>span{background-color:#2b2222}@media(min-width:768px){.navbar-form{float:right}}
+@font-face{font-family:'XoloniumNormal';src:url('fonts/xolonium-webfont.eot');src:url('fonts/xolonium-webfont.eot?#iefix') format('embedded-opentype'),url('fonts/xolonium-webfont.woff') format('woff'),url('fonts/xolonium-webfont.ttf') format('truetype'),url('fonts/xolonium-webfont.svg#XoloniumNormal') format('svg');font-weight:normal;font-style:normal}body{background:url("img/web_background_4.jpg") no-repeat fixed center center / cover black;background-color:black;color:#d0d0d0;font-family:"XoloniumNormal","Helvetica Neue",Helvetica,Arial,sans-serif}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;color:#999}h1{font-size:30px;line-height:36px}h1 small{font-size:18px}h2{font-size:24px;line-height:36px}h2 small{font-size:18px}h3{line-height:27px;font-size:18px}h3 small{font-size:14px}h4,h5,h6{line-height:18px}h4{font-size:14px}h4 small{font-size:12px}h5{font-size:12px}h6{font-size:11px;color:#999;text-transform:uppercase}table{background:#000;background:none repeat scroll 0 0 rgba(0,0,0,0.7);border:1px solid #436688}table th{border:1px solid #436688;background-color:#001021}table td{border:1px solid #436688;font-size:10px}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#222}.table th,.table td{border:1px solid #436688}.table td{vertical-align:middle}.table .tdcenter{text-align:center}.accordion-group{border:1px solid #272525}.accordion-inner{border:0}#statline{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;position:relative;top:-25px}#xonborder{background:#000;background:none repeat scroll 0 0 rgba(0,0,0,0.5);border-radius:15px 15px 15px 15px;margin-bottom:30px;margin-left:0;padding:20px}#title{color:#08c;font-size:30px;margin-bottom:15px;position:relative;text-align:center;text-shadow:2px 2px 3px #333}.indexform{margin:20px 0 20px 0}.indexbox{width:250px}.navbar-brand{margin-left:0;padding-bottom:0;padding-top:10px;text-align:left}.navbar-inverse{background:none repeat scroll 0 0 rgba(0,0,0,0.6)}.navbar-inverse .nav>.active>a,.navbar-inverse .nav>.active>a:hover,.navbar-inverse .nav>.active>a:focus{background:none repeat scroll 0 0 rgba(49,49,49,0.6)}.navbar-inverse .nav>li>a,.navbar-brand{font-family:XoloniumNormal}.search,input[type="search"]{background-color:#606060;border:1px solid #202020;color:#aaa;width:100px}.game{float:left;margin-bottom:30px;min-width:700px;padding:10px 7px}.game a{color:#CCC}.game a:hover{color:#d95f00;text-decoration:none}.game tr{background-color:#000}.game tr.red{background-color:#4d0000}.game tr.blue{background-color:#00004d}.game tr.yellow{background-color:#4d4d00}.game tr.pink{background-color:#4d004d}.game tr:hover{background-color:#222}.weapon-nav{height:70px;margin-bottom:20px}.weapon-nav ul{display:block;list-style:none outside none}.weapon-nav li{cursor:pointer;float:left;margin-right:10px}.weapon-nav li:hover{border-bottom:2px solid #001021}.weapon-nav .weapon-active{border-bottom:2px solid #436688}.weapon-nav p{text-align:center}.flot table,.flot td{background-color:black;border:0}#gbtabcontainer{margin-top:10px}#gbtab{font-size:12px}.tabbable p{font-size:14px}.tabs-below .nav-tabs>li>a{border-radius:4px 4px 4px 4px}.nav-tabs>.active>a,.nav-tabs>.active>a:hover{background-color:#111;color:#aaa;border-color:#222}.nav-tabs>li>a{border-radius:4px 4px 4px 4px;text-align:center}.nav-tabs>li>a:hover{background-color:#111;border-color:#333}.nav-tabs{border-bottom:0 solid #000}.table .tdcenter{text-align:center}.game-detail img{float:left;margin-right:10px;margin-bottom:5px}.game img{float:left;margin-right:5px;margin-bottom:5px}.game-detail p,.game h4{float:left}.btn-toolbar .nav>li a{width:80px}.btn.dropdown-toggle,.btn.dropdown-toggle:active{background:0;border:1px solid transparent;border-radius:4px 4px 4px 4px;line-height:20px;color:#428bca;padding:10px 0 10px 0;font-size:14px;outline:0}.btn.dropdown-toggle:hover,.btn.dropdown-toggle:focus{background-color:#111;color:#2a6496;border-color:#333}.btn.dropdown-toggle>.caret{height:21px;border-top-color:#428bca;border-top-width:8px;border-left-width:8px;border-right-width:8px}.dropdown-menu{width:100px}.dropdown-menu.nav-tabs{padding:4px;background-color:#111;border:1px solid #333;width:256px}.dropdown-menu.nav-tabs>li>a{width:80px;color:inherit}.dropdown-menu.nav-tabs>li>a:hover{color:#222}.nostretch{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eloup{color:green}.elodown{color:#be0000}.eloneutral{color:gray}.pagination>li>a,.pagination>li>span{background-color:#111;border-color:#313131;color:#797979}.pagination>li>a:hover,.pagination>li>a:focus,.pagination>.active>a,.pagination>.active>span{background-color:#2b2222}@media(min-width:768px){.navbar-form{float:right}}
\ No newline at end of file
index 25d9bffab84e7abc8f3e2cbeb0afbd9b8c6b35ed..ceca3e34c19265315fd3c024a26184146ec894e9 100644 (file)
@@ -17,20 +17,20 @@ Game Index
 </%block>
 
 % if not games:
-  % if not game_type_cd:
-<h2>Sorry, no games yet. Get playing!</h2>
-  % else:
-<h2>Sorry, no ${game_type_cd.upper()} games yet. Get playing!</h2>
+<h2>Sorry, no 
+  % if game_type_descr:
+  ${game_type_descr.lower()}
   % endif
+  games yet. Get playing!</h2>
 
 % else:
 <div class="row">
   <div class="span12">
-    % if not game_type_cd:
-    <h2>Recent Games</h2>
-    % else:
-    <h2>Recent ${game_type_cd.upper()} Games</h2>
+    <h2>Recent 
+    % if game_type_descr:
+    ${game_type_descr}
     % endif
+      Games</h2>
   </div>
 </div>
 <div class="row">
@@ -43,7 +43,7 @@ Game Index
       % if gt == 'overall':
       <a href="${request.route_url("game_index")}" alt="${gt}" title="" data-toggle="none">
       % else:
-      <a href="${request.route_url("game_index_filtered", game_type_cd=gt)}" alt="${gt}" title="" data-toggle="none">
+      <a href="${request.route_url("game_index", _query={'game_type_cd':gt})}" alt="${gt}" title="" data-toggle="none">
       % endif
         <span class="sprite sprite-${gt}"> </span><br />
         ${gt} <br />
@@ -85,7 +85,7 @@ Game Index
 <div class="row">
   <div class="span10 offset1">
     <!-- navigation links -->
-    ${navlinks("game_index", games.page, games.last_page)}
+    ${navlinks("game_index", games.page, games.last_page, search_query=request.GET)}
   </div>
 </div>
 % endif
index f91afafa87f7ffe3dd3e4ec1f05eeed39b3cc512..5e26c588c82add6bcb0e7d00b78fd5cc5a517773 100644 (file)
@@ -16,25 +16,30 @@ Recent Games
 </%block>
 
 % if not games:
-  % if not game_type_cd:
-<h2>Sorry, no games yet. Get playing!</h2>
-  % else:
-<h2>Sorry, no ${game_type_cd.upper()} games yet. Get playing!</h2>
-  % endif
+<h2>Sorry, no 
+    % if game_type_descr:
+    ${game_type_descr.lower()}
+    % endif
+  games yet for 
+  <a href="${request.route_url('player_info', id=player.player_id)}">${player.nick_html_colors()|n}</a>. Get playing!
+</h2>
 <p><a href="${player_url}">Back to player info page</a></p>
 
 % else:
 <div class="row">
   <div class="span12">
-    % if not game_type_cd:
-    <h3>Recent Games by ${player.nick_html_colors()|n}</h3>
-    % else:
-    <h3>Recent ${game_type_cd.upper()} Games by ${player.nick_html_colors()|n}</h3>
-    % endif
-    <p><a href="${player_url}">Back to player info page</a></p>
+    <h3>Recent 
+      % if game_type_descr:
+      ${game_type_descr}
+      % endif
+      Games by 
+      <a href="${request.route_url('player_info', id=player.player_id)}">
+        ${player.nick_html_colors()|n}
+      </a>
+    </h3>
   </div>
 </div>
-<br/>
+
 <div class="row">
   <div class="span12 tabbable">
     <ul class="nav nav-tabs">
@@ -43,7 +48,7 @@ Recent Games
       % if game.game_type_cd == 'overall':
       <a href="${request.route_url("player_game_index", player_id=player.player_id)}" alt="${game.game_type_cd}" title="" data-toggle="none">
       % else:
-      <a href="${request.route_url("player_game_index_filtered", player_id=player.player_id, game_type_cd=game.game_type_cd)}" alt="${game.game_type_cd}" title="" data-toggle="none">
+      <a href="${request.route_url("player_game_index", player_id=player.player_id, _query={'game_type_cd':game.game_type_cd})}" alt="${game.game_type_cd}" title="" data-toggle="none">
       % endif
         <span class="sprite sprite-${game.game_type_cd}"> </span><br />
         ${game.game_type_cd} <br />
@@ -112,5 +117,5 @@ Recent Games
 
 
 <!-- navigation links -->
-${navlinks("player_game_index", games.page, games.last_page, player_id=player_id)}
+${navlinks("player_game_index", games.page, games.last_page, player_id=player_id, search_query=request.GET)}
 % endif
index 778e46c1a90d37fe30f242ab1e27e9a2e4094ac7..f105436c165dd868ca84381632c69e49c1daa4f7 100644 (file)
@@ -95,80 +95,110 @@ Advanced Search
 </div>
     % else:
 
-<div class="row">
-  <div class="span8 offset2">
 
 ##### player-only results #####
 % if result_type == "player":
-<table class="table table-hover table-condensed">
-  <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><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>
-  </tr>
-  % endfor
-</table>
+<div class="row">
+  <div class="span6 offset3">
+    <table class="table table-hover table-condensed">
+      <tr>
+        <th style="width:100px;">Player ID</th>
+        <th>Nick</th>
+        <th class="create-dt">Joined</th>
+        <th></th>
+      </tr>
+      % for player in results:
+      <tr>
+        <td>${player.player_id}</th>
+        <td class="player-nick"><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.joined_pretty_date()}</span></th>
+        <td class="tdcenter">
+          <a href="${request.route_url("player_game_index", player_id=player.player_id, page=1)}" title="View recent games by this player">
+            <i class="glyphicon glyphicon-list"></i>
+          </a>
+        </td>
+      </tr>
+      % endfor
+    </table>
 % endif
 
 ##### server-only results #####
 % if result_type == "server":
-<table class="table table-hover table-condensed">
-  <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><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>
-  </tr>
-  % endfor
-</table>
+<div class="row">
+  <div class="span8 offset2">
+    <table class="table table-hover table-condensed">
+      <tr>
+        <th style="width:60px;">ID</th>
+        <th>Name</th>
+        <th class="create-dt">Added</th>
+        <th></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="tdcenter">
+          <a href="${request.route_url("game_finder", _query={'server_id':server.server_id})}" title="View recent games on this server">
+            <i class="glyphicon glyphicon-list"></i>
+          </a>
+        </td>
+      </tr>
+      % endfor
+    </table>
 % endif
 
 ##### map-only results #####
 % if result_type == "map":
-<table class="table table-hover table-condensed">
-  <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><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>
-  </tr>
-  % endfor
-</table>
+<div class="row">
+  <div class="span6 offset3">
+      <table class="table table-hover table-condensed">
+        <tr>
+          <th style="width:70px;">ID</th>
+          <th>Name</th>
+          <th>Added</th>
+          <th></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="tdcenter">
+            <a href="${request.route_url("game_finder", _query={'map_id':map.map_id})}" title="View recent games on this map">
+              <i class="glyphicon glyphicon-list"></i>
+            </a>
+          </td>
+        </tr>
+        % endfor
+      </table>
 % endif
 
 ##### game results #####
 % if result_type == "game":
-<table class="table table-hover table-condensed">
-  <tr>
-    <th></th>
-    <th>Map</th>
-    <th>Server</th>
-    <th>Time</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><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>
+<div class="row">
+  <div class="span12">
+    <table class="table table-hover table-condensed">
+      <tr>
+        <th></th>
+        <th>Map</th>
+        <th>Server</th>
+        <th>Time</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><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>
 </div>
 % endif
 
index 1ed1741f52eb4cbec54bf1ccbceed7f058e9cf85..d18da8f7c3dcea28747ed1f194124b345eae753d 100644 (file)
@@ -13,16 +13,23 @@ log = logging.getLogger(__name__)
 
 
 def _game_index_data(request):
-    if request.matchdict.has_key('game_type_cd'):
-        game_type_cd  = request.matchdict['game_type_cd']
-    else:
-        game_type_cd  = None
+    game_type_cd = None
+    game_type_descr = None
+
+    if request.params.has_key('game_type_cd'):
+        game_type_cd = request.params['game_type_cd']
+        try:
+            game_type_descr = DBSession.query(GameType.descr).\
+                filter(GameType.game_type_cd == game_type_cd).\
+                one()[0]
+        except Exception as e:
+            game_type_cd = None
 
     if request.params.has_key('page'):
         current_page = request.params['page']
     else:
         current_page = 1
-    
+
     try:
         rgs_q = recent_games_q(game_type_cd=game_type_cd)
 
@@ -30,22 +37,24 @@ def _game_index_data(request):
 
         # replace the items in the canned pagination class with more rich ones
         games.items = [RecentGame(row) for row in games.items]
-            
+
         pgstats = {}
         for game in games.items:
             pgstats[game.game_id] = DBSession.query(PlayerGameStat).\
                     filter(PlayerGameStat.game_id == game.game_id).\
                     order_by(PlayerGameStat.scoreboardpos).\
                     order_by(PlayerGameStat.score).all()
-                    
+
     except Exception as e:
-        games = None
-        pgstats = None
-        game_type_cd = None
+        games           = None
+        pgstats         = None
+        game_type_cd    = None
+        game_type_descr = None
 
     return {'games':games,
             'pgstats':pgstats,
             'game_type_cd':game_type_cd,
+            'game_type_descr':game_type_descr,
             }
 
 
@@ -117,10 +126,10 @@ def _game_info_data(request):
                         pwstats[pgstat.player_game_stat_id] = []
 
                     # NOTE adding pgstat to position 6 in order to display nick.
-                    # You have to use a slice [0:5] to pass to the accuracy 
+                    # You have to use a slice [0:5] to pass to the accuracy
                     # template
-                    pwstats[pgstat.player_game_stat_id].append((weapon.descr, 
-                        weapon.weapon_cd, pwstat.actual, pwstat.max, 
+                    pwstats[pgstat.player_game_stat_id].append((weapon.descr,
+                        weapon.weapon_cd, pwstat.actual, pwstat.max,
                         pwstat.hit, pwstat.fired, pgstat))
 
     except Exception as inst:
index 952946055ba049c78362949cc16c79ae84158891..94fe8cb613d0bec6bce2cc3069f80933fbab90e3 100644 (file)
@@ -596,10 +596,22 @@ def player_info_json(request):
 
 def player_game_index_data(request):
     player_id = request.matchdict['player_id']
-    if request.matchdict.has_key('game_type_cd'):
-        game_type_cd  = request.matchdict['game_type_cd']
+
+    game_type_cd = None
+    game_type_descr = None
+
+    if request.params.has_key('game_type_cd'):
+        game_type_cd = request.params['game_type_cd']
+        try:
+            game_type_descr = DBSession.query(GameType.descr).\
+                filter(GameType.game_type_cd == game_type_cd).\
+                one()[0]
+        except Exception as e:
+            pass
+
     else:
-        game_type_cd  = None
+        game_type_cd = None
+        game_type_descr = None
 
     if request.params.has_key('page'):
         current_page = request.params['page']
@@ -618,21 +630,22 @@ def player_game_index_data(request):
 
         # replace the items in the canned pagination class with more rich ones
         games.items = [RecentGame(row) for row in games.items]
-        
+
         games_played = get_games_played(player_id)
 
     except Exception as e:
         player = None
         games = None
         game_type_cd = None
+        game_type_descr = None
         games_played = None
 
     return {
             'player_id':player.player_id,
-            'player_url':request.route_url('player_info', id=player_id),
             'player':player,
             'games':games,
             'game_type_cd':game_type_cd,
+            'game_type_descr':game_type_descr,
             'games_played':games_played,
            }