more overview/actions-links

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-02-25 20:41:06 +01:00
parent fc4725cd61
commit 6b5cabb125
12 changed files with 130 additions and 86 deletions

View File

@@ -32,22 +32,26 @@ if ($page == 'admins' && $userinfo['change_serversettings'] == '1') {
if ($action == '') { if ($action == '') {
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_admins"); $log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_admins");
$admin_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.admins.php'; $admin_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.admins.php';
try { try {
// get filtered collection // get filtered collection
$list = (new \Froxlor\UI\Collection(\Froxlor\Api\Commands\Admins::class, $userinfo)) $list = (new \Froxlor\UI\Collection(\Froxlor\Api\Commands\Admins::class, $userinfo))
->withPagination($admin_list_data['admin_list']['columns']) ->withPagination($admin_list_data['admin_list']['columns'])
->getList(); ->getList();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
UI::twigBuffer('user/table.html.twig', [ UI::twigBuffer('user/table.html.twig', [
'listing' => \Froxlor\UI\Listing::format($list, $admin_list_data['admin_list']), 'listing' => \Froxlor\UI\Listing::format($list, $admin_list_data['admin_list']),
]); 'actions_links' => [[
UI::twigOutputBuffer(); 'href' => $linker->getLink(['section' => 'admins', 'page' => $page, 'action' => 'add']),
} elseif ($action == 'su') { 'label' => $lng['admin']['admin_add']
]]
]);
UI::twigOutputBuffer();
} elseif ($action == 'su') {
try { try {
$json_result = Admins::getLocal($userinfo, array( $json_result = Admins::getLocal($userinfo, array(

View File

@@ -33,19 +33,28 @@ if ($page == 'customers' && $userinfo['customers'] != '0') {
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_customers"); $log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_customers");
try { try {
$customer_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.customers.php'; $customer_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.customers.php';
$list = (new \Froxlor\UI\Collection(\Froxlor\Api\Commands\Customers::class, $userinfo)) $list = (new \Froxlor\UI\Collection(\Froxlor\Api\Commands\Customers::class, $userinfo))
->has('admin', \Froxlor\Api\Commands\Admins::class, 'adminid', 'adminid') ->has('admin', \Froxlor\Api\Commands\Admins::class, 'adminid', 'adminid')
->withPagination($customer_list_data['customer_list']['columns']) ->withPagination($customer_list_data['customer_list']['columns'])
->getList(); ->getList();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
UI::twigBuffer('user/table.html.twig', [ $actions_links = false;
'listing' => \Froxlor\UI\Listing::format($list, $customer_list_data['customer_list']), if ($userinfo['customers_used'] < $userinfo['customers'] || $userinfo['customers'] == '-1') {
]); $actions_links = [[
UI::twigOutputBuffer(); 'href' => $linker->getLink(['section' => 'customers', 'page' => $page, 'action' => 'add']),
'label' => $lng['admin']['customer_add']
]];
}
UI::twigBuffer('user/table.html.twig', [
'listing' => \Froxlor\UI\Listing::format($list, $customer_list_data['customer_list']),
'actions_links' => $actions_links
]);
UI::twigOutputBuffer();
} elseif ($action == 'su' && $id != 0) { } elseif ($action == 'su' && $id != 0) {
try { try {
$json_result = Customers::getLocal($userinfo, array( $json_result = Customers::getLocal($userinfo, array(

View File

@@ -33,20 +33,39 @@ if ($page == 'domains' || $page == 'overview') {
if ($action == '') { if ($action == '') {
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_domains"); $log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_domains");
try { try {
$domain_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.domains.php'; $domain_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.domains.php';
$list = (new \Froxlor\UI\Collection(\Froxlor\Api\Commands\Domains::class, $userinfo)) $list = (new \Froxlor\UI\Collection(\Froxlor\Api\Commands\Domains::class, $userinfo))
->has('customer', \Froxlor\Api\Commands\Customers::class, 'customerid', 'customerid') ->has('customer', \Froxlor\Api\Commands\Customers::class, 'customerid', 'customerid')
->withPagination($domain_list_data['domain_list']['columns']) ->withPagination($domain_list_data['domain_list']['columns'])
->getList(); ->getList();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
UI::twigBuffer('user/table.html.twig', [ $json_result = Customers::getLocal($userinfo)->listingCount();
'listing' => \Froxlor\UI\Listing::format($list, $domain_list_data['domain_list']), $countcustomers = json_decode($json_result, true)['data'];
]);
UI::twigOutputBuffer(); $actions_links = false;
if (($userinfo['domains_used'] < $userinfo['domains'] || $userinfo['domains'] == '-1') && $countcustomers != 0) {
$actions_links = [];
$actions_links[] = [
'href' => $linker->getLink(['section' => 'domains', 'page' => $page, 'action' => 'add']),
'label' => $lng['admin']['domain_add']
];
$actions_links[] = [
'href' => $linker->getLink(['section' => 'domains', 'page' => $page, 'action' => 'import']),
'label' => $lng['domains']['domain_import'],
'icon' => 'fa-solid fa-file-import',
'class' => 'btn-secondary'
];
}
UI::twigBuffer('user/table.html.twig', [
'listing' => \Froxlor\UI\Listing::format($list, $domain_list_data['domain_list']),
'actions_links' => $actions_links
]);
UI::twigOutputBuffer();
} elseif ($action == 'delete' && $id != 0) { } elseif ($action == 'delete' && $id != 0) {
try { try {
@@ -325,7 +344,7 @@ if ($page == 'domains' || $page == 'overview') {
if (in_array($domain_emails_row['email_full'], $domain_emails_row['destination'])) { if (in_array($domain_emails_row['email_full'], $domain_emails_row['destination'])) {
$email_forwarders -= 1; $email_forwarders -= 1;
$email_accounts ++; $email_accounts++;
} }
} }
} }
@@ -541,14 +560,14 @@ if ($page == 'domains' || $page == 'overview') {
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
"); ");
$c_allowed_configs = \Froxlor\Customer\Customer::getCustomerDetail($result['customerid'], 'allowed_phpconfigs'); $c_allowed_configs = \Froxlor\Customer\Customer::getCustomerDetail($result['customerid'], 'allowed_phpconfigs');
if (! empty($c_allowed_configs)) { if (!empty($c_allowed_configs)) {
$c_allowed_configs = json_decode($c_allowed_configs, true); $c_allowed_configs = json_decode($c_allowed_configs, true);
} else { } else {
$c_allowed_configs = array(); $c_allowed_configs = array();
} }
while ($phpconfigs_row = $phpconfigs_result_stmt->fetch(PDO::FETCH_ASSOC)) { while ($phpconfigs_row = $phpconfigs_result_stmt->fetch(PDO::FETCH_ASSOC)) {
$disabled = ! empty($c_allowed_configs) && ! in_array($phpconfigs_row['id'], $c_allowed_configs); $disabled = !empty($c_allowed_configs) && !in_array($phpconfigs_row['id'], $c_allowed_configs);
if ((int) Settings::Get('phpfpm.enabled') == 1) { if ((int) Settings::Get('phpfpm.enabled') == 1) {
$phpconfigs .= \Froxlor\UI\HTML::makeoption($phpconfigs_row['description'] . " [" . $phpconfigs_row['interpreter'] . "]", $phpconfigs_row['id'], $result['phpsettingid'], true, true, null, $disabled); $phpconfigs .= \Froxlor\UI\HTML::makeoption($phpconfigs_row['description'] . " [" . $phpconfigs_row['interpreter'] . "]", $phpconfigs_row['id'], $result['phpsettingid'], true, true, null, $disabled);
} else { } else {
@@ -558,8 +577,10 @@ if ($page == 'domains' || $page == 'overview') {
$result = \Froxlor\PhpHelper::htmlentitiesArray($result); $result = \Froxlor\PhpHelper::htmlentitiesArray($result);
if (Settings::Get('panel.allow_domain_change_customer') != '1') { if (Settings::Get('panel.allow_domain_change_customer') != '1') {
$result['customername'] .= ' (<a href="' . $linker->getLink(array('section' => 'customers', 'page' => 'customers', $result['customername'] .= ' (<a href="' . $linker->getLink(array(
'action' => 'su', 'id' => $customer['customerid'])) . '" rel="external">' . $customer['loginname'] . '</a>)'; 'section' => 'customers', 'page' => 'customers',
'action' => 'su', 'id' => $customer['customerid']
)) . '" rel="external">' . $customer['loginname'] . '</a>)';
} }
$domain_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/domains/formfield.domains_edit.php'; $domain_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/domains/formfield.domains_edit.php';
@@ -577,7 +598,7 @@ if ($page == 'domains' || $page == 'overview') {
$customerid = intval($_POST['customerid']); $customerid = intval($_POST['customerid']);
$allowed_phpconfigs = \Froxlor\Customer\Customer::getCustomerDetail($customerid, 'allowed_phpconfigs'); $allowed_phpconfigs = \Froxlor\Customer\Customer::getCustomerDetail($customerid, 'allowed_phpconfigs');
echo ! empty($allowed_phpconfigs) ? $allowed_phpconfigs : json_encode(array()); echo !empty($allowed_phpconfigs) ? $allowed_phpconfigs : json_encode(array());
exit(); exit();
} elseif ($action == 'import') { } elseif ($action == 'import') {
@@ -597,7 +618,7 @@ if ($page == 'domains' || $page == 'overview') {
\Froxlor\UI\Response::standard_error('domain_import_error', $e->getMessage()); \Froxlor\UI\Response::standard_error('domain_import_error', $e->getMessage());
} }
if (! empty($bulk->getErrors())) { if (!empty($bulk->getErrors())) {
\Froxlor\UI\Response::dynamic_error(implode("<br>", $bulk->getErrors())); \Froxlor\UI\Response::dynamic_error(implode("<br>", $bulk->getErrors()));
} }
@@ -606,7 +627,7 @@ if ($page == 'domains' || $page == 'overview') {
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST); \Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_VHOST);
\Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS); \Froxlor\System\Cronjob::inserttask(\Froxlor\Cron\TaskId::REBUILD_DNS);
$result_str = $result['imported'] . ' / ' . $result['all'] . (! empty($result['note']) ? ' (' . $result['note'] . ')' : ''); $result_str = $result['imported'] . ' / ' . $result['all'] . (!empty($result['note']) ? ' (' . $result['note'] . ')' : '');
\Froxlor\UI\Response::standard_success('domain_import_successfully', $result_str, array( \Froxlor\UI\Response::standard_success('domain_import_successfully', $result_str, array(
'filename' => $filename, 'filename' => $filename,
'action' => '', 'action' => '',
@@ -647,7 +668,7 @@ function formatDomainEntry(&$row, &$idna_convert)
$row['ipandport'] .= $rowip['ip'] . ':' . $rowip['port'] . "\n"; $row['ipandport'] .= $rowip['ip'] . ':' . $rowip['port'] . "\n";
} }
} }
$row['ipandport'] = substr($row['ipandport'], 0, - 1); $row['ipandport'] = substr($row['ipandport'], 0, -1);
$row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']); $row['termination_date'] = str_replace("0000-00-00", "", $row['termination_date']);
$row['termination_css'] = ""; $row['termination_css'] = "";

View File

@@ -32,18 +32,22 @@ if ($page == 'ipsandports' || $page == 'overview') {
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_ipsandports"); $log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_ipsandports");
try { try {
$ipsandports_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.ipsandports.php'; $ipsandports_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.ipsandports.php';
$list = (new \Froxlor\UI\Collection(\Froxlor\Api\Commands\IpsAndPorts::class, $userinfo)) $list = (new \Froxlor\UI\Collection(\Froxlor\Api\Commands\IpsAndPorts::class, $userinfo))
->withPagination($ipsandports_list_data['ipsandports_list']['columns']) ->withPagination($ipsandports_list_data['ipsandports_list']['columns'])
->getList(); ->getList();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
UI::twigBuffer('user/table.html.twig', [ UI::twigBuffer('user/table.html.twig', [
'listing' => \Froxlor\UI\Listing::format($list, $ipsandports_list_data['ipsandports_list']), 'listing' => \Froxlor\UI\Listing::format($list, $ipsandports_list_data['ipsandports_list']),
]); 'actions_links' => [[
UI::twigOutputBuffer(); 'href' => $linker->getLink(['section' => 'ipsandports', 'page' => $page, 'action' => 'add']),
'label' => $lng['admin']['ipsandports']['add']
]]
]);
UI::twigOutputBuffer();
} elseif ($action == 'delete' && $id != 0) { } elseif ($action == 'delete' && $id != 0) {
try { try {
$json_result = IpsAndPorts::getLocal($userinfo, array( $json_result = IpsAndPorts::getLocal($userinfo, array(

View File

@@ -33,18 +33,22 @@ if ($page == '' || $page == 'overview') {
$log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_plans"); $log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_plans");
try { try {
$plan_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.plans.php'; $plan_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.plans.php';
$list = (new \Froxlor\UI\Collection(\Froxlor\Api\Commands\HostingPlans::class, $userinfo)) $list = (new \Froxlor\UI\Collection(\Froxlor\Api\Commands\HostingPlans::class, $userinfo))
->withPagination($plan_list_data['plan_list']['columns']) ->withPagination($plan_list_data['plan_list']['columns'])
->getList(); ->getList();
} catch (Exception $e) { } catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
UI::twigBuffer('user/table.html.twig', [ UI::twigBuffer('user/table.html.twig', [
'listing' => \Froxlor\UI\Listing::format($list, $plan_list_data['plan_list']), 'listing' => \Froxlor\UI\Listing::format($list, $plan_list_data['plan_list']),
]); 'actions_links' => [[
UI::twigOutputBuffer(); 'href' => $linker->getLink(['section' => 'plans', 'page' => $page, 'action' => 'add']),
'label' => $lng['admin']['plans']['add']
]]
]);
UI::twigOutputBuffer();
} elseif ($action == 'delete' && $id != 0) { } elseif ($action == 'delete' && $id != 0) {
try { try {

View File

@@ -53,17 +53,17 @@ if ($page == 'overview' || $page == 'domains') {
$result = json_decode($json_result, true)['data']; $result = json_decode($json_result, true)['data'];
$parentdomains_count = $result['count']; $parentdomains_count = $result['count'];
$add_link = false; $actions_links = false;
if (($userinfo['subdomains_used'] < $userinfo['subdomains'] || $userinfo['subdomains'] == '-1') && $parentdomains_count != 0) { if (($userinfo['subdomains_used'] < $userinfo['subdomains'] || $userinfo['subdomains'] == '-1') && $parentdomains_count != 0) {
$add_link = [ $actions_links = [[
'href' => $linker->getLink(['section' => 'domains', 'page' => 'domains', 'action' => 'add']), 'href' => $linker->getLink(['section' => 'domains', 'page' => 'domains', 'action' => 'add']),
'label' => $lng['domains']['subdomain_add'] 'label' => $lng['domains']['subdomain_add']
]; ]];
} }
UI::twigBuffer('user/table.html.twig', [ UI::twigBuffer('user/table.html.twig', [
'listing' => \Froxlor\UI\Listing::format($list, $domain_list_data['domain_list']), 'listing' => \Froxlor\UI\Listing::format($list, $domain_list_data['domain_list']),
'add_link' => $add_link, 'actions_links' => $actions_links,
'entity_info' => $lng['domains']['description'] 'entity_info' => $lng['domains']['description']
]); ]);
UI::twigOutputBuffer(); UI::twigOutputBuffer();

View File

@@ -57,17 +57,17 @@ if ($page == 'overview' || $page == 'emails') {
)); ));
$emaildomains_count = $result2['emaildomains']; $emaildomains_count = $result2['emaildomains'];
$add_link = false; $actions_links = false;
if (($userinfo['emails_used'] < $userinfo['emails'] || $userinfo['emails'] == '-1') && $emaildomains_count !=0) { if (($userinfo['emails_used'] < $userinfo['emails'] || $userinfo['emails'] == '-1') && $emaildomains_count !=0) {
$add_link = [ $actions_links = [[
'href' => $linker->getLink(['section' => 'email', 'page' => $page, 'action' => 'add']), 'href' => $linker->getLink(['section' => 'email', 'page' => $page, 'action' => 'add']),
'label' => $lng['emails']['emails_add'] 'label' => $lng['emails']['emails_add']
]; ]];
} }
UI::twigBuffer('user/table.html.twig', [ UI::twigBuffer('user/table.html.twig', [
'listing' => \Froxlor\UI\Listing::format($list, $email_list_data['email_list']), 'listing' => \Froxlor\UI\Listing::format($list, $email_list_data['email_list']),
'add_link' => $add_link, 'actions_links' => $actions_links,
'entity_info' => $lng['emails']['description'] 'entity_info' => $lng['emails']['description']
]); ]);
UI::twigOutputBuffer(); UI::twigOutputBuffer();

View File

@@ -57,10 +57,10 @@ if ($page == 'overview' || $page == 'htpasswds') {
UI::twigBuffer('user/table.html.twig', [ UI::twigBuffer('user/table.html.twig', [
'listing' => \Froxlor\UI\Listing::format($list, $htpasswd_list_data['htpasswd_list']), 'listing' => \Froxlor\UI\Listing::format($list, $htpasswd_list_data['htpasswd_list']),
'add_link' => [ 'actions_links' => [[
'href' => $linker->getLink(['section' => 'extras', 'page' => 'htpasswds', 'action' => 'add']), 'href' => $linker->getLink(['section' => 'extras', 'page' => 'htpasswds', 'action' => 'add']),
'label' => $lng['extras']['directoryprotection_add'] 'label' => $lng['extras']['directoryprotection_add']
], ]],
'entity_info' => $lng['extras']['description'] 'entity_info' => $lng['extras']['description']
]); ]);
UI::twigOutputBuffer(); UI::twigOutputBuffer();

View File

@@ -44,17 +44,17 @@ if ($page == 'overview' || $page == 'accounts') {
\Froxlor\UI\Response::dynamic_error($e->getMessage()); \Froxlor\UI\Response::dynamic_error($e->getMessage());
} }
$add_link = false; $actions_links = false;
if ($userinfo['ftps_used'] < $userinfo['ftps'] || $userinfo['ftps'] == '-1') { if ($userinfo['ftps_used'] < $userinfo['ftps'] || $userinfo['ftps'] == '-1') {
$add_link = [ $actions_links = [[
'href' => $linker->getLink(['section' => 'ftp', 'page' => 'accounts', 'action' => 'add']), 'href' => $linker->getLink(['section' => 'ftp', 'page' => 'accounts', 'action' => 'add']),
'label' => $lng['ftp']['account_add'] 'label' => $lng['ftp']['account_add']
]; ]];
} }
UI::twigBuffer('user/table.html.twig', [ UI::twigBuffer('user/table.html.twig', [
'listing' => \Froxlor\UI\Listing::format($list, $ftp_list_data['ftp_list']), 'listing' => \Froxlor\UI\Listing::format($list, $ftp_list_data['ftp_list']),
'add_link' => $add_link, 'actions_links' => $actions_links,
'entity_info' => $lng['ftp']['description'] 'entity_info' => $lng['ftp']['description']
]); ]);
UI::twigOutputBuffer(); UI::twigOutputBuffer();

View File

@@ -59,17 +59,17 @@ if ($page == 'overview' || $page == 'mysqls') {
$sql = Database::getSqlData(); $sql = Database::getSqlData();
$lng['mysql']['description'] = str_replace('<SQL_HOST>', $sql['host'], $lng['mysql']['description']); $lng['mysql']['description'] = str_replace('<SQL_HOST>', $sql['host'], $lng['mysql']['description']);
$add_link = false; $actions_links = false;
if ($userinfo['mysqls_used'] < $userinfo['mysqls'] || $userinfo['mysqls'] == '-1') { if ($userinfo['mysqls_used'] < $userinfo['mysqls'] || $userinfo['mysqls'] == '-1') {
$add_link = [ $actions_links = [[
'href' => $linker->getLink(['section' => 'mysql', 'page' => 'mysqls', 'action' => 'add']), 'href' => $linker->getLink(['section' => 'mysql', 'page' => 'mysqls', 'action' => 'add']),
'label' => $lng['mysql']['database_create'] 'label' => $lng['mysql']['database_create']
]; ]];
} }
UI::twigBuffer('user/table.html.twig', [ UI::twigBuffer('user/table.html.twig', [
'listing' => \Froxlor\UI\Listing::format($list, $mysql_list_data['mysql_list']), 'listing' => \Froxlor\UI\Listing::format($list, $mysql_list_data['mysql_list']),
'add_link' => $add_link, 'actions_links' => $actions_links,
'entity_info' => $lng['mysql']['description'] 'entity_info' => $lng['mysql']['description']
]); ]);
UI::twigOutputBuffer(); UI::twigOutputBuffer();

View File

@@ -21,7 +21,7 @@ use Froxlor\UI\Listing;
return [ return [
'plan_list' => [ 'plan_list' => [
'title' => $lng['domains']['ssl_certificates'], 'title' => $lng['admin']['plans']['plans'],
'icon' => 'fa-solid fa-user', 'icon' => 'fa-solid fa-user',
'columns' => [ 'columns' => [
'p.name' => [ 'p.name' => [

View File

@@ -2,19 +2,21 @@
{% block content %} {% block content %}
<div class="row"> <div class="row">
<div class="col-12 {% if add_link is iterable or (entity_info is defined and entity_info is not empty) %}col-md-10 order-2 order-md-1{% endif %}"> <div class="col-12 {% if actions_links is iterable or (entity_info is defined and entity_info is not empty) %}col-md-10 order-2 order-md-1{% endif %}">
{% import "Froxlor/table/table.html.twig" as table %} {% import "Froxlor/table/table.html.twig" as table %}
{{ table.table(listing) }} {{ table.table(listing) }}
</div> </div>
{% if add_link is iterable or (entity_info is defined and entity_info is not empty) %} {% if actions_links is iterable or (entity_info is defined and entity_info is not empty) %}
<div class="col-12 col-md-2 order-1 order-md-2"> <div class="col-12 col-md-2 order-1 order-md-2">
{% if add_link is iterable %} {% if actions_links is iterable %}
<a class="btn btn-success d-block" href="{{ add_link.href|raw }}"> {% for link in actions_links %}
<i class="fa-solid fa-plus-circle"></i> <a class="btn {{ link.class|default('btn-success') }} d-block mb-2" href="{{ link.href|raw }}">
{{ add_link.label }}</a> <i class="{{ link.icon|default('fa-solid fa-plus-circle') }} me-1"></i>
{{ link.label }}</a>
{% endfor %}
{% endif %} {% endif %}
{% if entity_info is defined and entity_info is not empty %} {% if entity_info is defined and entity_info is not empty %}
<div class="alert alert-info mt-2" role="alert"> <div class="alert alert-info" role="alert">
{{ entity_info|raw }} {{ entity_info|raw }}
</div> </div>
{% endif %} {% endif %}