From 5b961be0f82a0dfd6f68bb0c99565bb254d507b4 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Mon, 28 Feb 2022 09:21:04 +0100 Subject: [PATCH] enhanced listing actions Signed-off-by: Michael Kaufmann --- admin_admins.php | 2 +- admin_cronjobs.php | 48 ++--------- lib/Froxlor/UI/Callbacks/Customer.php | 28 +++++++ lib/Froxlor/UI/Callbacks/Domain.php | 14 ++++ lib/Froxlor/UI/Callbacks/Text.php | 10 +++ lib/Froxlor/UI/Listing.php | 6 +- .../admin/tablelisting.admins.php | 34 ++++---- .../admin/tablelisting.cronjobs.php | 65 +++++++++++++++ .../admin/tablelisting.customers.php | 15 ++++ .../admin/tablelisting.domains.php | 12 +++ .../admin/tablelisting.ipsandports.php | 2 + lib/tablelisting/admin/tablelisting.plans.php | 7 +- .../admin/tablelisting.sslcertificates.php | 1 + .../customer/tablelisting.domains.php | 79 +++++++++++-------- .../customer/tablelisting.emails.php | 2 + .../customer/tablelisting.ftps.php | 2 + .../customer/tablelisting.htaccess.php | 2 + .../customer/tablelisting.htpasswd.php | 2 + .../customer/tablelisting.mysqls.php | 2 + templates/Froxlor/table/callbacks.html.twig | 79 ++++++++++--------- templates/Froxlor/table/table.html.twig | 2 +- 21 files changed, 279 insertions(+), 135 deletions(-) create mode 100644 lib/Froxlor/UI/Callbacks/Customer.php create mode 100644 lib/tablelisting/admin/tablelisting.cronjobs.php diff --git a/admin_admins.php b/admin_admins.php index e806a297..f4fef676 100644 --- a/admin_admins.php +++ b/admin_admins.php @@ -20,7 +20,7 @@ const AREA = 'admin'; require __DIR__ . '/lib/init.php'; -use Froxlor\Api\Commands\Admins as Admins; +use Froxlor\Api\Commands\Admins; use Froxlor\Database\Database; use Froxlor\Settings; use Froxlor\UI\Panel\UI; diff --git a/admin_cronjobs.php b/admin_cronjobs.php index 41aa2689..1fae1947 100644 --- a/admin_cronjobs.php +++ b/admin_cronjobs.php @@ -19,6 +19,7 @@ const AREA = 'admin'; require __DIR__ . '/lib/init.php'; use Froxlor\Api\Commands\Cronjobs; +use Froxlor\UI\Panel\UI; use Froxlor\UI\Request; $id = (int) Request::get('id'); @@ -27,51 +28,18 @@ if ($page == 'cronjobs' || $page == 'overview') { if ($action == '') { $log->logAction(\Froxlor\FroxlorLogger::ADM_ACTION, LOG_NOTICE, 'viewed admin_cronjobs'); - $fields = array( - 'c.module' => 'Module', - 'c.lastrun' => $lng['cron']['lastrun'], - 'c.interval' => $lng['cron']['interval'], - 'c.isactive' => $lng['cron']['isactive'] - ); try { - // get total count - $json_result = Cronjobs::getLocal($userinfo)->listingCount(); - $result = json_decode($json_result, true)['data']; - // initialize pagination and filtering - $paging = new \Froxlor\UI\Pagination($userinfo, $fields, $result); - // get list - $json_result = Cronjobs::getLocal($userinfo, $paging->getApiCommandParams())->listing(); + $cron_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.cronjobs.php'; + $collection = (new \Froxlor\UI\Collection(\Froxlor\Api\Commands\Cronjobs::class, $userinfo)) + ->withPagination($cron_list_data['cron_list']['columns']); } catch (Exception $e) { \Froxlor\UI\Response::dynamic_error($e->getMessage()); } - $result = json_decode($json_result, true)['data']; - $crons = ''; - $sortcode = $paging->getHtmlSortCode($lng); - $arrowcode = $paging->getHtmlArrowCode($filename . '?page=' . $page . '&s=' . $s); - $searchcode = $paging->getHtmlSearchCode($lng); - $pagingcode = $paging->getHtmlPagingCode($filename . '?page=' . $page . '&s=' . $s); - - $count = 0; - $cmod = ''; - - foreach ($result['list'] as $row) { - if ($cmod != $row['module']) { - $_mod = explode("/", $row['module']); - $module = ucfirst($_mod[1]); - eval("\$crons.=\"" . \Froxlor\UI\Template::getTemplate('cronjobs/cronjobs_cronjobmodule') . "\";"); - $cmod = $row['module']; - } - $row = \Froxlor\PhpHelper::htmlentitiesArray($row); - $row['lastrun'] = date('d.m.Y H:i', $row['lastrun']); - $row['isactive'] = ((int) $row['isactive'] == 1) ? $lng['panel']['yes'] : $lng['panel']['no']; - $description = $lng['crondesc'][$row['desc_lng_key']]; - - eval("\$crons.=\"" . \Froxlor\UI\Template::getTemplate('cronjobs/cronjobs_cronjob') . "\";"); - $count ++; - } - - eval("echo \"" . \Froxlor\UI\Template::getTemplate('cronjobs/cronjobs') . "\";"); + UI::twigBuffer('user/table.html.twig', [ + 'listing' => \Froxlor\UI\Listing::format($collection, $cron_list_data['cron_list']), + ]); + UI::twigOutputBuffer(); } elseif ($action == 'new') { /* * @TODO later diff --git a/lib/Froxlor/UI/Callbacks/Customer.php b/lib/Froxlor/UI/Callbacks/Customer.php new file mode 100644 index 00000000..33d529bc --- /dev/null +++ b/lib/Froxlor/UI/Callbacks/Customer.php @@ -0,0 +1,28 @@ + (2010-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Froxlor\UI\Callbacks + * + */ +class Customer +{ + public static function isLocked(array $attributes) + { + return $attributes['fields']['loginfail_count'] >= Settings::Get('login.maxloginattempts') + && $attributes['fields']['lastlogin_fail'] > (time() - Settings::Get('login.deactivatetime')); + } +} diff --git a/lib/Froxlor/UI/Callbacks/Domain.php b/lib/Froxlor/UI/Callbacks/Domain.php index 36164094..5d9dd152 100644 --- a/lib/Froxlor/UI/Callbacks/Domain.php +++ b/lib/Froxlor/UI/Callbacks/Domain.php @@ -62,6 +62,13 @@ class Domain && empty($attributes['fields']['domainaliasid']); } + public static function adminCanDelete(array $attributes): bool + { + return $attributes['fields']['id'] != Settings::Get('system.hostname_id') + && empty($attributes['fields']['domainaliasid']) + && $attributes['fields']['standardsubdomain'] != $attributes['fields']['id']; + } + public static function canEditDNS(array $attributes): bool { return $attributes['fields']['isbinddomain'] == '1' @@ -71,6 +78,13 @@ class Domain && Settings::Get('system.dnsenabled') == '1'; } + public static function adminCanEditDNS(array $attributes): bool + { + return $attributes['fields']['isbinddomain'] == '1' + && Settings::Get('system.bind_enable') == '1' + && Settings::Get('system.dnsenabled') == '1'; + } + public function canEditSSL(array $attributes): bool { // FIXME: https://github.com/Froxlor/Froxlor/blob/master/templates/Sparkle/customer/domains/domains_domain.tpl#L41 diff --git a/lib/Froxlor/UI/Callbacks/Text.php b/lib/Froxlor/UI/Callbacks/Text.php index b96dc3f2..79459dd3 100644 --- a/lib/Froxlor/UI/Callbacks/Text.php +++ b/lib/Froxlor/UI/Callbacks/Text.php @@ -41,4 +41,14 @@ class Text { return PhpHelper::sizeReadable($attributes['data'], null, 'bi'); } + + public static function timestamp(array $attributes): string + { + return (int)$attributes['data'] > 0 ? date('d.m.Y H:i', (int)$attributes['data']) : UI::getLng('panel.never'); + } + + public static function crondesc(array $attributes): string + { + return UI::getLng('crondesc.' . $attributes['data']); + } } diff --git a/lib/Froxlor/UI/Listing.php b/lib/Froxlor/UI/Listing.php index 1d9ca14a..f087eef3 100644 --- a/lib/Froxlor/UI/Listing.php +++ b/lib/Froxlor/UI/Listing.php @@ -3,6 +3,7 @@ namespace Froxlor\UI; use Froxlor\UI\Panel\UI; +use Exception; /** * This file is part of the Froxlor project. @@ -77,7 +78,10 @@ class Listing } $format_callback = $tabellisting['columns'][$visible_column]['format_callback'] ?? null; - $column = $tabellisting['columns'][$visible_column]['field']; + $column = $tabellisting['columns'][$visible_column]['field'] ?? null; + if (empty($column)) { + throw new Exception('Column in "visible columns" specified that is not defined in "fields"'); + } $data = self::getMultiArrayFromString($item, $column); if ($format_callback) { diff --git a/lib/tablelisting/admin/tablelisting.admins.php b/lib/tablelisting/admin/tablelisting.admins.php index cafe73ff..64520dc9 100644 --- a/lib/tablelisting/admin/tablelisting.admins.php +++ b/lib/tablelisting/admin/tablelisting.admins.php @@ -72,24 +72,26 @@ return [ ]), 'actions' => [ 'edit' => [ - 'icon' => 'fa fa-edit', + 'icon' => 'fa fa-edit', + 'title' => $lng['panel']['edit'], 'href' => [ - 'section' => 'admins', - 'page' => 'admins', - 'action' => 'edit', - 'id' => ':adminid' - ], + 'section' => 'admins', + 'page' => 'admins', + 'action' => 'edit', + 'id' => ':adminid' + ], + ], + 'delete' => [ + 'icon' => 'fa fa-trash', + 'title' => $lng['panel']['delete'], + 'class' => 'text-danger', + 'href' => [ + 'section' => 'admins', + 'page' => 'admins', + 'action' => 'delete', + 'id' => ':adminid' + ], ], - 'delete' => [ - 'icon' => 'fa fa-trash', - 'class' => 'text-danger', - 'href' => [ - 'section' => 'admins', - 'page' => 'admins', - 'action' => 'delete', - 'id' => ':adminid' - ], - ], ], 'format_callback' => [ [Style::class, 'deactivated'], diff --git a/lib/tablelisting/admin/tablelisting.cronjobs.php b/lib/tablelisting/admin/tablelisting.cronjobs.php new file mode 100644 index 00000000..cbc625a0 --- /dev/null +++ b/lib/tablelisting/admin/tablelisting.cronjobs.php @@ -0,0 +1,65 @@ + (2010-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Tabellisting + * + */ + +use Froxlor\UI\Callbacks\Text; +use Froxlor\UI\Listing; + +return [ + 'cron_list' => [ + 'title' => $lng['admin']['cron']['cronsettings'], + 'icon' => 'fa-solid fa-clock-rotate-left', + 'columns' => [ + 'c.description' => [ + 'label' => $lng['cron']['description'], + 'field' => 'desc_lng_key', + 'format_callback' => [Text::class, 'crondesc'] + ], + 'c.lastrun' => [ + 'label' => $lng['cron']['lastrun'], + 'field' => 'lastrun', + 'format_callback' => [Text::class, 'timestamp'] + ], + 'c.interval' => [ + 'label' => $lng['cron']['interval'], + 'field' => 'interval' + ], + 'c.isactive' => [ + 'label' => $lng['cron']['isactive'], + 'field' => 'isactive', + 'format_callback' => [Text::class, 'boolean'] + ], + ], + 'visible_columns' => Listing::getVisibleColumnsForListing('cron_list', [ + 'c.description', + 'c.lastrun', + 'c.interval', + 'c.isactive', + ]), + 'actions' => [ + 'edit' => [ + 'icon' => 'fa fa-edit', + 'title' => $lng['panel']['edit'], + 'href' => [ + 'section' => 'cronjobs', + 'page' => 'overview', + 'action' => 'edit', + 'id' => ':id' + ], + ] + ] + ] +]; diff --git a/lib/tablelisting/admin/tablelisting.customers.php b/lib/tablelisting/admin/tablelisting.customers.php index 6ca7ab1d..8bd926e3 100644 --- a/lib/tablelisting/admin/tablelisting.customers.php +++ b/lib/tablelisting/admin/tablelisting.customers.php @@ -16,6 +16,7 @@ * */ +use Froxlor\UI\Callbacks\Customer; use Froxlor\UI\Callbacks\Text; use Froxlor\UI\Callbacks\Impersonate; use Froxlor\UI\Callbacks\ProgressBar; @@ -65,8 +66,21 @@ return [ 'c.traffic', ]), 'actions' => [ + 'unlock' => [ + 'icon' => 'fa fa-unlock', + 'title' => $lng['panel']['unlock'], + 'class' => 'text-warning', + 'href' => [ + 'section' => 'customers', + 'page' => 'customers', + 'action' => 'unlock', + 'id' => ':customerid' + ], + 'visible' => [Customer::class, 'isLocked'] + ], 'edit' => [ 'icon' => 'fa fa-edit', + 'title' => $lng['panel']['edit'], 'href' => [ 'section' => 'customers', 'page' => 'customers', @@ -76,6 +90,7 @@ return [ ], 'delete' => [ 'icon' => 'fa fa-trash', + 'title' => $lng['panel']['delete'], 'class' => 'text-danger', 'href' => [ 'section' => 'customers', diff --git a/lib/tablelisting/admin/tablelisting.domains.php b/lib/tablelisting/admin/tablelisting.domains.php index a945fa0d..11ea64b3 100644 --- a/lib/tablelisting/admin/tablelisting.domains.php +++ b/lib/tablelisting/admin/tablelisting.domains.php @@ -16,6 +16,7 @@ * */ +use Froxlor\UI\Callbacks\Domain; use Froxlor\UI\Callbacks\Text; use Froxlor\UI\Callbacks\Impersonate; use Froxlor\UI\Listing; @@ -54,6 +55,7 @@ return [ 'actions' => [ 'edit' => [ 'icon' => 'fa fa-edit', + 'title' => $lng['panel']['edit'], 'href' => [ 'section' => 'domains', 'page' => 'domains', @@ -63,6 +65,7 @@ return [ ], 'logfiles' => [ 'icon' => 'fa fa-file', + 'title' => $lng['panel']['viewlogs'], 'href' => [ 'section' => 'domains', 'page' => 'logfiles', @@ -71,14 +74,22 @@ return [ ], 'domaindnseditor' => [ 'icon' => 'fa fa-globe', + 'title' => $lng['dnseditor']['edit'], 'href' => [ 'section' => 'domains', 'page' => 'domaindnseditor', 'domain_id' => ':id' ], + 'visible' => [Domain::class, 'adminCanEditDNS'] + ], + 'letsencrypt' => [ + 'icon' => 'fa fa-shield', + 'title' => $lng['panel']['letsencrypt'], + 'visible' => ':letsencrypt' // @fixme ], 'delete' => [ 'icon' => 'fa fa-trash', + 'title' => $lng['panel']['delete'], 'class' => 'text-danger', 'href' => [ 'section' => 'domains', @@ -86,6 +97,7 @@ return [ 'action' => 'delete', 'id' => ':id' ], + 'visible' => [Domain::class, 'adminCanDelete'] ] ] ] diff --git a/lib/tablelisting/admin/tablelisting.ipsandports.php b/lib/tablelisting/admin/tablelisting.ipsandports.php index 72528e98..b589a3d0 100644 --- a/lib/tablelisting/admin/tablelisting.ipsandports.php +++ b/lib/tablelisting/admin/tablelisting.ipsandports.php @@ -87,6 +87,7 @@ return [ 'actions' => [ 'edit' => [ 'icon' => 'fa fa-edit', + 'title' => $lng['panel']['edit'], 'href' => [ 'section' => 'ipsandports', 'page' => 'ipsandports', @@ -96,6 +97,7 @@ return [ ], 'delete' => [ 'icon' => 'fa fa-trash', + 'title' => $lng['panel']['delete'], 'class' => 'text-danger', 'href' => [ 'section' => 'ipsandports', diff --git a/lib/tablelisting/admin/tablelisting.plans.php b/lib/tablelisting/admin/tablelisting.plans.php index 15e89949..fdc9118f 100644 --- a/lib/tablelisting/admin/tablelisting.plans.php +++ b/lib/tablelisting/admin/tablelisting.plans.php @@ -16,7 +16,7 @@ * */ -use Froxlor\Settings; +use Froxlor\UI\Callbacks\Text; use Froxlor\UI\Listing; return [ @@ -39,9 +39,10 @@ return [ 'p.ts' => [ 'label' => $lng['admin']['plans']['last_update'], 'field' => 'ts', + 'format_callback' => [Text::class, 'timestamp'], ], ], - 'visible_columns' => Listing::getVisibleColumnsForListing('sslcertificates_list', [ + 'visible_columns' => Listing::getVisibleColumnsForListing('plan_list', [ 'p.name', 'p.description', 'p.adminname', @@ -50,6 +51,7 @@ return [ 'actions' => [ 'edit' => [ 'icon' => 'fa fa-edit', + 'title' => $lng['panel']['edit'], 'href' => [ 'section' => 'plans', 'page' => 'overview', @@ -59,6 +61,7 @@ return [ ], 'delete' => [ 'icon' => 'fa fa-trash', + 'title' => $lng['panel']['delete'], 'class' => 'text-danger', 'href' => [ 'section' => 'plans', diff --git a/lib/tablelisting/admin/tablelisting.sslcertificates.php b/lib/tablelisting/admin/tablelisting.sslcertificates.php index 458947d6..468ef2fe 100644 --- a/lib/tablelisting/admin/tablelisting.sslcertificates.php +++ b/lib/tablelisting/admin/tablelisting.sslcertificates.php @@ -66,6 +66,7 @@ return [ 'actions' => [ 'delete' => [ 'icon' => 'fa fa-trash', + 'title' => $lng['panel']['delete'], 'class' => 'text-danger', 'href' => [ 'section' => 'domains', diff --git a/lib/tablelisting/customer/tablelisting.domains.php b/lib/tablelisting/customer/tablelisting.domains.php index 80a345d5..9f30c529 100644 --- a/lib/tablelisting/customer/tablelisting.domains.php +++ b/lib/tablelisting/customer/tablelisting.domains.php @@ -39,45 +39,54 @@ return [ 'd.documentroot' ]), 'actions' => [ - 'edit' => [ - 'icon' => 'fa fa-edit', - 'href' => [ - 'section' => 'domains', - 'page' => 'domains', - 'action' => 'edit', - 'id' => ':id' - ], + 'edit' => [ + 'icon' => 'fa fa-edit', + 'title' => $lng['panel']['edit'], + 'href' => [ + 'section' => 'domains', + 'page' => 'domains', + 'action' => 'edit', + 'id' => ':id' + ], 'visible' => [Domain::class, 'canEdit'] - ], - 'logfiles' => [ - 'icon' => 'fa fa-file', - 'href' => [ - 'section' => 'domains', - 'page' => 'logfiles', - 'domain_id' => ':id' - ], + ], + 'logfiles' => [ + 'icon' => 'fa fa-file', + 'title' => $lng['panel']['viewlogs'], + 'href' => [ + 'section' => 'domains', + 'page' => 'logfiles', + 'domain_id' => ':id' + ], 'visible' => [Domain::class, 'canViewLogs'] - ], - 'domaindnseditor' => [ - 'icon' => 'fa fa-globe', - 'href' => [ - 'section' => 'domains', - 'page' => 'domaindnseditor', - 'domain_id' => ':id' - ], + ], + 'domaindnseditor' => [ + 'icon' => 'fa fa-globe', + 'title' => $lng['dnseditor']['edit'], + 'href' => [ + 'section' => 'domains', + 'page' => 'domaindnseditor', + 'domain_id' => ':id' + ], 'visible' => [Domain::class, 'canEditDNS'] - ], - 'delete' => [ - 'icon' => 'fa fa-trash', - 'class' => 'text-danger', - 'href' => [ - 'section' => 'domains', - 'page' => 'domains', - 'action' => 'delete', - 'id' => ':id' - ], + ], + 'letsencrypt' => [ + 'icon' => 'fa fa-shield', + 'title' => $lng['panel']['letsencrypt'], + 'visible' => ':letsencrypt' // @fixme + ], + 'delete' => [ + 'icon' => 'fa fa-trash', + 'title' => $lng['panel']['delete'], + 'class' => 'text-danger', + 'href' => [ + 'section' => 'domains', + 'page' => 'domains', + 'action' => 'delete', + 'id' => ':id' + ], 'visible' => [Domain::class, 'canDelete'] - ] + ] ] ] ]; diff --git a/lib/tablelisting/customer/tablelisting.emails.php b/lib/tablelisting/customer/tablelisting.emails.php index 372554fb..e9e0c5aa 100644 --- a/lib/tablelisting/customer/tablelisting.emails.php +++ b/lib/tablelisting/customer/tablelisting.emails.php @@ -62,6 +62,7 @@ return [ 'actions' => [ 'edit' => [ 'icon' => 'fa fa-edit', + 'title' => $lng['panel']['edit'], 'href' => [ 'section' => 'email', 'page' => 'emails', @@ -71,6 +72,7 @@ return [ ], 'delete' => [ 'icon' => 'fa fa-trash', + 'title' => $lng['panel']['delete'], 'class' => 'text-danger', 'href' => [ 'section' => 'email', diff --git a/lib/tablelisting/customer/tablelisting.ftps.php b/lib/tablelisting/customer/tablelisting.ftps.php index fd4e26f2..6cf9acec 100644 --- a/lib/tablelisting/customer/tablelisting.ftps.php +++ b/lib/tablelisting/customer/tablelisting.ftps.php @@ -52,6 +52,7 @@ return [ 'actions' => [ 'edit' => [ 'icon' => 'fa fa-edit', + 'title' => $lng['panel']['edit'], 'href' => [ 'section' => 'ftp', 'page' => 'ftps', @@ -61,6 +62,7 @@ return [ ], 'delete' => [ 'icon' => 'fa fa-trash', + 'title' => $lng['panel']['delete'], 'class' => 'text-danger', 'href' => [ 'section' => 'ftp', diff --git a/lib/tablelisting/customer/tablelisting.htaccess.php b/lib/tablelisting/customer/tablelisting.htaccess.php index d4ab77d3..605ca0a4 100644 --- a/lib/tablelisting/customer/tablelisting.htaccess.php +++ b/lib/tablelisting/customer/tablelisting.htaccess.php @@ -65,6 +65,7 @@ return [ 'actions' => [ 'edit' => [ 'icon' => 'fa fa-edit', + 'title' => $lng['panel']['edit'], 'href' => [ 'section' => 'extras', 'page' => 'htaccess', @@ -74,6 +75,7 @@ return [ ], 'delete' => [ 'icon' => 'fa fa-trash', + 'title' => $lng['panel']['delete'], 'class' => 'text-danger', 'href' => [ 'section' => 'extras', diff --git a/lib/tablelisting/customer/tablelisting.htpasswd.php b/lib/tablelisting/customer/tablelisting.htpasswd.php index dd6b74ea..c4248a7c 100644 --- a/lib/tablelisting/customer/tablelisting.htpasswd.php +++ b/lib/tablelisting/customer/tablelisting.htpasswd.php @@ -41,6 +41,7 @@ return [ 'actions' => [ 'edit' => [ 'icon' => 'fa fa-edit', + 'title' => $lng['panel']['edit'], 'href' => [ 'section' => 'extras', 'page' => 'htpasswds', @@ -50,6 +51,7 @@ return [ ], 'delete' => [ 'icon' => 'fa fa-trash', + 'title' => $lng['panel']['delete'], 'class' => 'text-danger', 'href' => [ 'section' => 'extras', diff --git a/lib/tablelisting/customer/tablelisting.mysqls.php b/lib/tablelisting/customer/tablelisting.mysqls.php index 007f1269..f2178a8b 100644 --- a/lib/tablelisting/customer/tablelisting.mysqls.php +++ b/lib/tablelisting/customer/tablelisting.mysqls.php @@ -54,6 +54,7 @@ return [ 'actions' => [ 'edit' => [ 'icon' => 'fa fa-edit', + 'title' => $lng['panel']['edit'], 'href' => [ 'section' => 'mysql', 'page' => 'mysqls', @@ -63,6 +64,7 @@ return [ ], 'delete' => [ 'icon' => 'fa fa-trash', + 'title' => $lng['panel']['delete'], 'class' => 'text-danger', 'href' => [ 'section' => 'mysql', diff --git a/templates/Froxlor/table/callbacks.html.twig b/templates/Froxlor/table/callbacks.html.twig index 421bba1e..a36a1662 100644 --- a/templates/Froxlor/table/callbacks.html.twig +++ b/templates/Froxlor/table/callbacks.html.twig @@ -1,58 +1,59 @@ {% macro progressbar(data) %} -
-
-
-
- {% if data.infotext is not empty %} - - {% endif %} - {{ data.text }} -
+
+
+
+
+ {% if data.infotext is not empty %} + + {% endif %} + {{ data.text }} +
{% endmacro %} {% macro boolean(data) %} - {% if (data) %} - - {% else %} - - {% endif %} + {% if (data) %} + + {% else %} + + {% endif %} {% endmacro %} {% macro booleanWithInfo(data) %} - {% if (data.checked) %} - - {% else %} - - {% endif %} + {% if (data.checked) %} + + {% else %} + + {% endif %} {% if data.info is not empty %} - {{ data.info }} + {{ data.info }} {% endif %} {% endmacro %} {% macro link(data) %} - {% apply spaceless %} - - {% if data.icon is defined %} - - {% endif %} - {% if data.text is defined %} - {{ data.text }} - {% endif %} - - {% endapply %} + {% apply spaceless %} + + {% if data.icon is defined %} + + {% endif %} + {% if data.text is defined %} + {{ data.text }} + {% endif %} + + {% endapply %} {% endmacro %} {% macro domainWithSan(data) %} - {{ data.domain }} - {% if data.san is not empty %} -
SAN: {{ data.san }} - {% endif %} + {{ data.domain }} + {% if data.san is not empty %} +
SAN: + {{ data.san }} + {% endif %} {% endmacro %} {% macro actions(data) %} - {% for action in data %} - {% if action.visible is not defined or action.visible is defined and action.visible %} - {{ _self.link(action) }} - {% endif %} - {% endfor %} + {% for action in data %} + {% if action.visible is not defined or action.visible is defined and action.visible %} + {{ _self.link(action) }} + {% endif %} + {% endfor %} {% endmacro %} diff --git a/templates/Froxlor/table/table.html.twig b/templates/Froxlor/table/table.html.twig index a98d0c86..2383a4f1 100644 --- a/templates/Froxlor/table/table.html.twig +++ b/templates/Froxlor/table/table.html.twig @@ -7,7 +7,7 @@ {% if listing.title is not empty %}