Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% extends "layout.html" %}
- {% block extra_stylesheets %}
- <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.18/datatables.min.css"/>
- <link rel="stylesheet" type="text/css"
- href="https://cdn.datatables.net/rowgroup/1.1.0/css/rowGroup.dataTables.min.css"/>
- {% endblock %}
- {% block content %}
- <div class="row">
- <div class="col-lg-12">
- <h1>Character List</h1>
- <table id="users" class="table table-hover shadow" cellspacing="0" width="100%">
- <thead>
- <th>First Name</th>
- <th>Last Name</th>
- <th>Strength</th>
- <th>Agility</th>
- <th>Intellect</th>
- <th>Willpower</th>
- <th>Constitution</th>
- <th>Guild Name</th>
- <th>Guild Role</th>
- <th></th>
- </thead>
- <tfoot>
- <tr>
- <th>First Name</th>
- <th>Last Name</th>
- <th>Strength</th>
- <th>Agility</th>
- <th>Intellect</th>
- <th>Willpower</th>
- <th>Constitution</th>
- <th>Guild Name</th>
- <th>Guild Role</th>
- <th></th>
- </tr>
- </tfoot>
- </table>
- </div>
- </div>
- {% endblock %}
- {% block js %}
- {{ super() }}
- <script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.18/datatables.min.js"></script>
- <script type="text/javascript"
- src="https://cdn.datatables.net/rowgroup/1.1.0/js/dataTables.rowGroup.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function () {
- var table = $('#users').DataTable({
- ajax: {
- "url": "{{ url_for('admin.data') }}"
- },
- rowGroup: {
- dataSrc: "account.SteamID",
- startRender: function (row, group, level) {
- return $('<tr/>')
- .append('<td class="text-light" colspan="3">' +
- '<a href="#"><img src="http://steamsignature.com/status/default/' + group +
- '.png" alt=' + group + '></a></td>')
- }
- },
- columns: [
- {"data": "Name"},
- {"data": "LastName"},
- {"data": "Strength"},
- {"data": "Agility"},
- {"data": "Intellect"},
- {"data": "Willpower"},
- {"data": "Constitution"},
- {"data": "guild.Name", defaultContent: "None"},
- {"data": "guild_role.Name", defaultContent: "None"},
- {"data": "account.SteamID", visible: true},
- {"data": "account.ID", visible: false},
- {"data": "account.IsActive", visible: false}
- ],
- order: [[1, 'asc']],
- });
- });
- </script>
- {% endblock %}
Advertisement
Add Comment
Please, Sign In to add comment