64 lines
1.9 KiB
Twig
64 lines
1.9 KiB
Twig
{% extends 'superadmin/layout.twig' %}
|
|
|
|
{% block title %}Подписки - Суперадмин{% endblock %}
|
|
|
|
{% block styles %}
|
|
<link rel="stylesheet" href="/assets/css/modules/data-table.css">
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h1>Управление подписками</h1>
|
|
<a href="{{ base_url('/superadmin/subscriptions/create') }}" class="btn btn-primary">
|
|
<i class="fa-solid fa-plus"></i> Добавить подписку
|
|
</a>
|
|
</div>
|
|
|
|
{% if session.success %}
|
|
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
|
{{ session.success }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if session.error %}
|
|
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
|
{{ session.error }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
{{ tableHtml|raw }}
|
|
{# CSRF токен для AJAX запросов #}
|
|
{{ csrf_field()|raw }}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script src="{{ site_url('/assets/js/modules/DataTable.js') }}"></script>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
document.querySelectorAll('.data-table').forEach(function(container) {
|
|
const id = container.id;
|
|
const url = container.dataset.url;
|
|
const perPage = parseInt(container.dataset.perPage) || 10;
|
|
|
|
if (window.dataTables && window.dataTables[id]) {
|
|
return;
|
|
}
|
|
|
|
const table = new DataTable(id, {
|
|
url: url,
|
|
perPage: perPage
|
|
});
|
|
|
|
window.dataTables = window.dataTables || {};
|
|
window.dataTables[id] = table;
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|