mirror of
https://github.com/FAUSheppy/open-web-leaderboard.git
synced 2025-12-06 07:01:36 +01:00
make playerSearch results dataTable
This commit is contained in:
@@ -104,11 +104,15 @@ class DatabaseConnection:
|
||||
return [p]
|
||||
|
||||
playerRows = []
|
||||
cursor.execute("SELECT * FROM players WHERE name LIKE ?", (playerNamePrepared,))
|
||||
cursor.execute("SELECT * FROM players WHERE name LIKE ? ORDER BY games DESC", (playerNamePrepared,))
|
||||
count = 0
|
||||
for pr in cursor:
|
||||
if count > 50:
|
||||
break;
|
||||
p = player.PlayerInLeaderboard(pr)
|
||||
p.rank = self.getPlayerRank(p)
|
||||
playerRows += [p]
|
||||
count += 1
|
||||
|
||||
return playerRows
|
||||
|
||||
|
||||
@@ -36,6 +36,14 @@
|
||||
</table>
|
||||
{{ endOfBoardIndicator }}
|
||||
</div>
|
||||
{% if not doNotComputeRank %}
|
||||
<script defer>
|
||||
$(document).ready(function () {
|
||||
$('#tableMain').DataTable();
|
||||
$('.dataTables_length').addClass('bs-select');
|
||||
});
|
||||
</script>
|
||||
{% endif }
|
||||
{% include 'footer.html' %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user