Guest User

Untitled

a guest
Apr 13th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.21 KB | None | 0 0
  1. {% extends "layout.html" %}
  2.  
  3. {% block extra_stylesheets %}
  4. <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.18/datatables.min.css"/>
  5. <link rel="stylesheet" type="text/css"
  6. href="https://cdn.datatables.net/rowgroup/1.1.0/css/rowGroup.dataTables.min.css"/>
  7. {% endblock %}
  8.  
  9. {% block content %}
  10. <div class="row">
  11. <div class="col-lg-12">
  12. <h1>Character List</h1>
  13. <table id="users" class="table table-hover shadow" cellspacing="0" width="100%">
  14. <thead>
  15. <th>First Name</th>
  16. <th>Last Name</th>
  17. <th>Strength</th>
  18. <th>Agility</th>
  19. <th>Intellect</th>
  20. <th>Willpower</th>
  21. <th>Constitution</th>
  22. <th>Guild Name</th>
  23. <th>Guild Role</th>
  24. <th></th>
  25. </thead>
  26. <tfoot>
  27. <tr>
  28. <th>First Name</th>
  29. <th>Last Name</th>
  30. <th>Strength</th>
  31. <th>Agility</th>
  32. <th>Intellect</th>
  33. <th>Willpower</th>
  34. <th>Constitution</th>
  35. <th>Guild Name</th>
  36. <th>Guild Role</th>
  37. <th></th>
  38. </tr>
  39. </tfoot>
  40. </table>
  41. </div>
  42. </div>
  43. {% endblock %}
  44.  
  45. {% block js %}
  46. {{ super() }}
  47. <script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.18/datatables.min.js"></script>
  48. <script type="text/javascript"
  49. src="https://cdn.datatables.net/rowgroup/1.1.0/js/dataTables.rowGroup.min.js"></script>
  50. <script type="text/javascript">
  51.  
  52. $(document).ready(function () {
  53.  
  54. var table = $('#users').DataTable({
  55. ajax: {
  56. "url": "{{ url_for('admin.data') }}"
  57. },
  58. rowGroup: {
  59. dataSrc: "account.SteamID",
  60. startRender: function (row, group, level) {
  61. return $('<tr/>')
  62. .append('<td class="text-light" colspan="3">' +
  63. '<a href="#"><img src="http://steamsignature.com/status/default/' + group +
  64. '.png" alt=' + group + '></a></td>')
  65. }
  66. },
  67. columns: [
  68. {"data": "Name"},
  69. {"data": "LastName"},
  70. {"data": "Strength"},
  71. {"data": "Agility"},
  72. {"data": "Intellect"},
  73. {"data": "Willpower"},
  74. {"data": "Constitution"},
  75. {"data": "guild.Name", defaultContent: "None"},
  76. {"data": "guild_role.Name", defaultContent: "None"},
  77. {"data": "account.SteamID", visible: true},
  78. {"data": "account.ID", visible: false},
  79. {"data": "account.IsActive", visible: false}
  80. ],
  81. order: [[1, 'asc']],
  82. });
  83. });
  84. </script>
  85. {% endblock %}
Advertisement
Add Comment
Please, Sign In to add comment