From 226170428ac950c735ef1b30dfee383b04c429eb Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 30 Jan 2024 13:40:04 +0800 Subject: [PATCH] * Fix bug #42595. --- module/testcase/ui/showscript.html.php | 53 +++++++++++++++++--------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/module/testcase/ui/showscript.html.php b/module/testcase/ui/showscript.html.php index 398cd4e0cd..4335094a43 100644 --- a/module/testcase/ui/showscript.html.php +++ b/module/testcase/ui/showscript.html.php @@ -17,29 +17,48 @@ modalHeader set::entityText($case->title) ); -$rows = array(); -$lines = explode("\n", $case->script); -foreach($lines as $key => $line) +if(empty($case->script)) { - $rows[] = h::tr + div ( - h::td + setClass('dtable-empty-tip'), + div ( - setClass('align-top text-right border-r gray-pale px-1 py-0'), - ++$key - ), - h::td - ( - setClass('px-1 py-0'), - html_entity_decode(str_replace(' ', ' ', $line)) + setClass('row gap-4 items-center'), + span + ( + setClass('text-gray'), + $lang->noData + ) ) ); } +else +{ + $rows = array(); + $lines = explode("\n", $case->script); + foreach($lines as $key => $line) + { + $rows[] = h::tr + ( + h::td + ( + setClass('align-top text-right border-r gray-pale px-1 py-0'), + ++$key + ), + h::td + ( + setClass('px-1 py-0'), + html_entity_decode(str_replace(' ', ' ', $line)) + ) + ); + } -h::table -( - setClass('border w-full'), - $rows -); + h::table + ( + setClass('border w-full'), + $rows + ); +} render();