diff --git a/docs/development/custom/framework/datatables.md b/docs/development/custom/framework/datatables.md index e1214b51..b32792f8 100644 --- a/docs/development/custom/framework/datatables.md +++ b/docs/development/custom/framework/datatables.md @@ -16,26 +16,26 @@ Given the `EveCharacter` Model as our model of choice we would define our stubs ### template/appname/stubs/icon.html -```html +```django {% load evelinks %} {% character_portrait_url row 32 %} ``` ### template/appname/stubs/name.html -```html -{{ row.character_name }} ({{row.character_ownership.user.username}}) +```django +{{ row.character_name }} ({{ row.character_ownership.user.username }}) ``` ### template/appname/stubs/corp.html -```html +```django {{ row.corporation_name }} ``` ### template/appname/list.html -```html +```django {% extends "allianceauth/base-bs5.html" %} {% load i18n %} {% block page_title %} @@ -77,7 +77,7 @@ Given the `EveCharacter` Model as our model of choice we would define our stubs $(document).ready(function() { $('#table').DataTable({ serverSide: true, - ajax: '/appname/tables/data_table', + ajax: '{% url "appname:table" %}', // This is for the column searching initComplete: function () { this.api() @@ -130,6 +130,7 @@ from allianceauth.eveonline.models import EveCharacter ## Datatables server side view class EveCharacterTable(DataTablesView): model = EveCharacter + # Columns are rendered from these templates # Templates can be a html file or template language directly in the list below templates = [ "appname/stubs/icon.html",