Added tablesorter so the server list can be sorted.

This commit is contained in:
A. Svensson 2015-02-23 21:33:36 +01:00
parent 915905c4be
commit b6a7f28429
3 changed files with 43 additions and 7 deletions

View File

@ -13,10 +13,6 @@ body {
font-family: "Helvetica Neue", Helvetica, Arial,sans-serif; font-family: "Helvetica Neue", Helvetica, Arial,sans-serif;
} }
.right {
float: right;
}
/* Header and navbar **********************************************************/ /* Header and navbar **********************************************************/
#navbar { #navbar {
background-color: #333; background-color: #333;
@ -102,3 +98,25 @@ body {
color: #444; color: #444;
} }
/* Utils **********************************************************************/
.right {
float: right;
}
.tablesorter-head ::before {
font-family: "Glyphicons Halflings";
content: "";
margin-right: 5px;
font-size: small;
}
.tablesorter-asc ::before {
font-family: "Glyphicons Halflings";
content: "";
}
.tablesorter-desc ::before {
font-family: "Glyphicons Halflings";
content: "";
}

File diff suppressed because one or more lines are too long

View File

@ -1,15 +1,16 @@
{% extends "base_site.html" %} {% extends "base_site.html" %}
{% load staticfiles %}
{% block title %} {% block title %}
Index Index
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<table class="table table-hover"> <table id="servers" class="table table-hover tablesorter">
<thead> <thead>
<tr> <tr>
<th>Players</th> <th><span>Players</span></th>
<th>Server</th> <th><span>Server</span></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -30,4 +31,17 @@
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
<script type="text/javascript" src="{% static 'js/jquery.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/jquery.tablesorter.min.js' %}"></script>
<script>
$(document).ready(function(){
var settings = {
cssAsc: 'tablesorter-asc',
cssDesc: 'tablesorter-desc',
cssHeader: 'tablesorter-head',
};
$("#servers").tablesorter(settings);
});
</script>
{% endblock %} {% endblock %}