fix: simplify autoresponder list actions
This commit is contained in:
@@ -12,8 +12,7 @@ return static function (AppContext $ctx): void {
|
||||
|
||||
if ($rules === []) {
|
||||
$body = '<div class="panel"><div class="empty-state"><div><h3>' . AppContext::e($ctx->t('No global autoresponders')) . '</h3>' .
|
||||
'<p class="muted">' . AppContext::e($ctx->t('All valid POP/IMAP mailboxes in this account')) . '</p>' .
|
||||
'<a class="btn amber" href="' . AppContext::e($ctx->url('create.html')) . '">' . AppContext::e($ctx->t('Add autoresponder')) . '</a></div></div></div>';
|
||||
'<p class="muted">' . AppContext::e($ctx->t('All valid POP/IMAP mailboxes in this account')) . '</p></div></div></div>';
|
||||
$ctx->render('Global autoresponders', $body, $ok);
|
||||
return;
|
||||
}
|
||||
@@ -35,7 +34,6 @@ return static function (AppContext $ctx): void {
|
||||
}
|
||||
|
||||
$body = '<div class="panel"><div class="panel-head"><div><h3>' . AppContext::e($ctx->t('Global autoresponders')) . '</h3><p class="muted">' . AppContext::e($ctx->t('All valid POP/IMAP mailboxes in this account')) . '</p></div>' .
|
||||
'<a class="btn amber" href="' . AppContext::e($ctx->url('create.html')) . '">' . AppContext::e($ctx->t('Add autoresponder')) . '</a></div>' .
|
||||
'<table><thead><tr><th>' . AppContext::e($ctx->t('Status')) . '</th><th>' . AppContext::e($ctx->t('Subject prefix')) . '</th><th>' . AppContext::e($ctx->t('Sending period')) . '</th><th>' . AppContext::e($ctx->t('Actions')) . '</th></tr></thead><tbody>' . $rows . '</tbody></table></div>';
|
||||
'</div><table><thead><tr><th>' . AppContext::e($ctx->t('Status')) . '</th><th>' . AppContext::e($ctx->t('Subject prefix')) . '</th><th>' . AppContext::e($ctx->t('Sending period')) . '</th><th>' . AppContext::e($ctx->t('Actions')) . '</th></tr></thead><tbody>' . $rows . '</tbody></table></div>';
|
||||
$ctx->render('Global autoresponders', $body, $ok);
|
||||
};
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@ return [
|
||||
'Global autoresponders' => 'Global autoresponders',
|
||||
'Manage automatic replies for account mailboxes' => 'Manage automatic replies for account mailboxes',
|
||||
'Dashboard' => 'Dashboard',
|
||||
'AUTORESPONDERS' => 'AUTORESPONDERS',
|
||||
'ADD AUTORESPONDER' => 'ADD AUTORESPONDER',
|
||||
'AUTORESPONDERS' => 'Global autoresponder list',
|
||||
'ADD AUTORESPONDER' => 'Add global autoresponder',
|
||||
'Add autoresponder' => 'Add autoresponder',
|
||||
'Edit autoresponder' => 'Edit autoresponder',
|
||||
'Preview autoresponder' => 'Preview autoresponder',
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@ return [
|
||||
'Global autoresponders' => 'Globalne autorespondery',
|
||||
'Manage automatic replies for account mailboxes' => 'Zarządzanie odpowiedziami dla skrzynek pocztowych konta',
|
||||
'Dashboard' => 'Pulpit',
|
||||
'AUTORESPONDERS' => 'AUTORESPONDERY',
|
||||
'ADD AUTORESPONDER' => 'DODAJ AUTORESPONDER',
|
||||
'AUTORESPONDERS' => 'Lista globalnych autoresponderów',
|
||||
'ADD AUTORESPONDER' => 'Dodaj Globalny autoresponder',
|
||||
'Add autoresponder' => 'Dodaj autoresponder',
|
||||
'Edit autoresponder' => 'Edytuj autoresponder',
|
||||
'Preview autoresponder' => 'Podgląd autorespondera',
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ name=global-autoresponder
|
||||
id=global-autoresponder
|
||||
type=user
|
||||
author=HITME.PL
|
||||
version=1.1.5
|
||||
version=1.2.1
|
||||
active=no
|
||||
installed=no
|
||||
user_run_as=root
|
||||
|
||||
@@ -29,6 +29,23 @@ test('directadmin user hooks are clickable and point to reserved icon path', fun
|
||||
assert_contains('Globalne autorespondery', $txt);
|
||||
});
|
||||
|
||||
test('top navigation uses global autoresponder labels', function (): void {
|
||||
$pl = require PLUGIN_ROOT . '/lang/pl.php';
|
||||
$en = require PLUGIN_ROOT . '/lang/en.php';
|
||||
|
||||
assert_same('Lista globalnych autoresponderów', $pl['AUTORESPONDERS'] ?? '');
|
||||
assert_same('Dodaj Globalny autoresponder', $pl['ADD AUTORESPONDER'] ?? '');
|
||||
assert_same('Global autoresponder list', $en['AUTORESPONDERS'] ?? '');
|
||||
assert_same('Add global autoresponder', $en['ADD AUTORESPONDER'] ?? '');
|
||||
});
|
||||
|
||||
test('autoresponder index keeps add button only in top navigation', function (): void {
|
||||
$source = file_get_contents(PLUGIN_ROOT . '/exec/handlers/index.php') ?: '';
|
||||
|
||||
assert_false(strpos($source, "ctx->url('create.html')") !== false);
|
||||
assert_false(strpos($source, "ctx->t('Add autoresponder')") !== false);
|
||||
});
|
||||
|
||||
test('rule form uses minute time input and no summary box in exim mode', function (): void {
|
||||
require_once PLUGIN_ROOT . '/exec/lib/Settings.php';
|
||||
require_once PLUGIN_ROOT . '/exec/lib/Lang.php';
|
||||
|
||||
Reference in New Issue
Block a user