{% extends 'adminlte_full/base.html' %} {% import "adminlte_full/macros/widgets.html" as widgets %} {% block head %} {{ super() }} {% endblock %} {% block page_title %}{{ adminlte.gettext('Menu Dashboard') }}{% endblock %} {% block breadcrumbs %} {{ super() }} {{ bootstrap.breadcrumb(title=adminlte.gettext('Menu Dashboard'), is_active=true) }} {% endblock %} {% block page_content %}
{% call widgets.render_card(adminlte.gettext('All application menus'), color=ThemeColor.PRIMARY, outline=true, collapsable=true, maximizable=true) %}
{% call(row) widgets.render_table(all_menus, [adminlte.gettext('Title')], auto_number=true, table_id='menu_grid', table_class='table-striped table-hover') %} {{ row }} {% endcall %}
{% endcall %}
{% with title=adminlte.gettext('Create menu'), color=ThemeColor.SUCCESS, save_and_edit=true %} {% include 'adminlte_full/menus/menu_form.html' %} {% endwith %}

{{ adminlte.gettext('Links') }}

{% call widgets.render_card(adminlte.gettext('All links used in all menus'), color=ThemeColor.PRIMARY, outline=true, collapsable=true, maximizable=true) %}
{{ adminlte.gettext('Create link') }} {{ widgets.render_data_table ( auto_number=true, table_id='menu_links_grid', table_class='table-striped table-hover', headers=['Title', 'Type', 'Endpoint', 'Url'], footer=true ) }}
{% endcall %}
{% endblock %} {% block styles %} {{ super() }} {% assets 'datatables_css' %} {% endassets %} {% endblock %} {% block javascript %} {{ super() }} {% assets 'datatables_js' %} {% endassets %} {% endblock %} {% block javascript_inline %} $(() => { $("#menu_grid").DataTable({ responsive: true, searching: false, lengthChange: false, }); let grid = $("#menu_links_grid").DataTable({ responsive: true, ajax: "links", lengthChange: false, columns: [ { "data": "id" }, { data: "title", render: (data, type, row) => { return type === 'display' ? `${data}` : data; } }, { "data": "type" }, { "data": "endpoint" }, { "data": "url" }, ], /*buttons: [ { text: 'Edit', action: function ( e, dt, node, config ) { console.log( e ); } } ]*/ }); }); {% endblock %}