From 5b8b28c9c3fb476938c2d011ce2759ab2c554cd0 Mon Sep 17 00:00:00 2001 From: dingyongliang Date: Wed, 12 Jul 2023 16:23:54 +0800 Subject: [PATCH] * zin: refactor modal padding. --- lib/zin/func.php | 5 +++++ lib/zin/wg/form/v1.php | 2 +- lib/zin/wg/hr/v1.php | 11 +++++++++++ lib/zin/wg/modal/v1.php | 2 +- lib/zin/wg/modaldialog/css/v1.css | 7 +++++++ lib/zin/wg/modaldialog/v1.php | 21 ++++++++++++++------- lib/zin/wg/modalheader/v1.php | 1 - module/bug/ui/activate.html.php | 2 +- module/bug/ui/assignto.html.php | 2 +- module/bug/ui/close.html.php | 2 +- module/bug/ui/confirm.html.php | 2 +- module/bug/ui/resolve.html.php | 2 +- module/execution/ui/activate.html.php | 2 +- module/execution/ui/close.html.php | 2 +- module/execution/ui/start.html.php | 2 +- module/execution/ui/suspend.html.php | 2 +- module/product/ui/close.html.php | 2 +- module/productplan/ui/close.html.php | 2 +- module/program/ui/activate.html.php | 2 +- module/program/ui/close.html.php | 2 +- module/program/ui/suspend.html.php | 2 +- module/project/ui/activate.html.php | 2 +- module/project/ui/close.html.php | 2 +- module/project/ui/start.html.php | 2 +- module/project/ui/suspend.html.php | 2 +- module/release/ui/notify.html.php | 2 +- module/story/ui/activate.html.php | 2 +- module/story/ui/assignto.html.php | 2 +- module/story/ui/close.html.php | 2 +- module/story/ui/submitreview.html.php | 2 +- module/task/css/recordworkhour.ui.css | 6 +++--- module/task/ui/activate.html.php | 2 +- module/task/ui/assignto.html.php | 2 +- module/task/ui/cancel.html.php | 2 +- module/task/ui/close.html.php | 2 +- module/task/ui/finish.html.php | 1 + module/task/ui/pause.html.php | 2 +- module/task/ui/restart.html.php | 1 + module/task/ui/start.html.php | 1 + module/testcase/ui/review.html.php | 2 +- module/testtask/ui/activate.html.php | 2 +- module/testtask/ui/block.html.php | 2 +- module/testtask/ui/close.html.php | 2 +- module/testtask/ui/start.html.php | 2 +- module/todo/ui/assignto.html.php | 2 +- 45 files changed, 79 insertions(+), 47 deletions(-) create mode 100644 lib/zin/wg/hr/v1.php create mode 100644 lib/zin/wg/modaldialog/css/v1.css diff --git a/lib/zin/func.php b/lib/zin/func.php index 9eba236752..1025dd08e0 100644 --- a/lib/zin/func.php +++ b/lib/zin/func.php @@ -1613,3 +1613,8 @@ function severityPicker(): severityPicker { return createWg('severityPicker', func_get_args()); } + +function hr(): hr +{ + return createWg('hr', func_get_args()); +} diff --git a/lib/zin/wg/form/v1.php b/lib/zin/wg/form/v1.php index 9896041177..467fc29195 100644 --- a/lib/zin/wg/form/v1.php +++ b/lib/zin/wg/form/v1.php @@ -32,7 +32,7 @@ class form extends formBase $defaultProps = array(); $defaultProps['submitBtnText'] = $text; - $defaultProps['class'] = 'px-3 pb-4 border-b'; + $defaultProps['class'] = 'px-3 pb-4'; $this->setDefaultProps($defaultProps); } diff --git a/lib/zin/wg/hr/v1.php b/lib/zin/wg/hr/v1.php new file mode 100644 index 0000000000..9dbf422fc5 --- /dev/null +++ b/lib/zin/wg/hr/v1.php @@ -0,0 +1,11 @@ +props->skip(array_merge(array_keys($modalProps), array_keys(static::definedPropsList())))), parent::build() ); diff --git a/lib/zin/wg/modaldialog/css/v1.css b/lib/zin/wg/modaldialog/css/v1.css new file mode 100644 index 0000000000..9873844fd5 --- /dev/null +++ b/lib/zin/wg/modaldialog/css/v1.css @@ -0,0 +1,7 @@ +.modal-dialog .modal-content {padding: 24px 32px 32px 32px;} +.modal-dialog .modal-header {padding: 0 0 24px 0;} +.modal-dialog .modal-body {padding: 0;} +.modal-dialog .modal-body .panel {padding: 0; margin: 0;} +.modal-dialog .modal-body .panel .panel-body {padding: 0; margin: 0;} +.modal-dialog .modal-body .panel .panel-body form {padding: 1px;} +.modal-dialog .modal-body .history {padding: 0;} diff --git a/lib/zin/wg/modaldialog/v1.php b/lib/zin/wg/modaldialog/v1.php index af2dd99195..5bac0c9bb6 100644 --- a/lib/zin/wg/modaldialog/v1.php +++ b/lib/zin/wg/modaldialog/v1.php @@ -25,6 +25,11 @@ class modalDialog extends wg 'footer' => array('map' => 'toolbar') ); + public static function getPageCSS(): string|false + { + return file_get_contents(__DIR__ . DS . 'css' . DS . 'v1.css'); + } + protected function buildHeader() { $title = $this->prop('title'); @@ -93,19 +98,21 @@ class modalDialog extends wg ); } - protected function build(): wg + protected function setSize(): ?directive { $size = $this->prop('size'); - if($size) - { - if(is_string($size)) $size = set('data-size', $size); - else $size = setStyle('width', "{$size}px"); - } + if(!$size) return null; + if(is_string($size)) return set('data-size', $size); + return setStyle('width', "{$size}px"); + } + + protected function build(): wg + { return div ( setClass('modal-dialog'), set($this->getRestProps()), - $size, + $this->setSize(), div ( setClass('modal-content'), diff --git a/lib/zin/wg/modalheader/v1.php b/lib/zin/wg/modalheader/v1.php index b497a5cce3..f709b75d77 100644 --- a/lib/zin/wg/modalheader/v1.php +++ b/lib/zin/wg/modalheader/v1.php @@ -45,7 +45,6 @@ class modalHeader extends wg $title ? div ( $title, - set::class('pl-3'), set::class($this->prop('titleClass')), ) : null, ($entityText || $entityID) ? entityLabel diff --git a/module/bug/ui/activate.html.php b/module/bug/ui/activate.html.php index ed63e3aaa4..328374d0d0 100644 --- a/module/bug/ui/activate.html.php +++ b/module/bug/ui/activate.html.php @@ -58,7 +58,7 @@ formPanel upload() ) ); - +hr(); history(); render(); diff --git a/module/bug/ui/assignto.html.php b/module/bug/ui/assignto.html.php index a7b23afcf8..8b972acbc8 100644 --- a/module/bug/ui/assignto.html.php +++ b/module/bug/ui/assignto.html.php @@ -46,7 +46,7 @@ formPanel set::rows(6), ), ); - +hr(); history(); render(); diff --git a/module/bug/ui/close.html.php b/module/bug/ui/close.html.php index bad53d2fe2..04507bf2fc 100644 --- a/module/bug/ui/close.html.php +++ b/module/bug/ui/close.html.php @@ -21,7 +21,7 @@ formPanel set::control('editor') ) ); - +hr(); history(); render(); diff --git a/module/bug/ui/confirm.html.php b/module/bug/ui/confirm.html.php index a58cc54f7a..d7be6d10d1 100644 --- a/module/bug/ui/confirm.html.php +++ b/module/bug/ui/confirm.html.php @@ -75,7 +75,7 @@ formPanel ) ) ); - +hr(); history(); render(); diff --git a/module/bug/ui/resolve.html.php b/module/bug/ui/resolve.html.php index 038336fa6f..ac1033578e 100644 --- a/module/bug/ui/resolve.html.php +++ b/module/bug/ui/resolve.html.php @@ -146,7 +146,7 @@ formPanel set::rows(6), ), ); - +hr(); history(); render(); diff --git a/module/execution/ui/activate.html.php b/module/execution/ui/activate.html.php index c6a2c1fb8f..97b4b152cc 100644 --- a/module/execution/ui/activate.html.php +++ b/module/execution/ui/activate.html.php @@ -64,7 +64,7 @@ formPanel ), ), ); - +hr(); history(); /* ====== Render page ====== */ diff --git a/module/execution/ui/close.html.php b/module/execution/ui/close.html.php index 4dc33a674e..36f52556a3 100644 --- a/module/execution/ui/close.html.php +++ b/module/execution/ui/close.html.php @@ -37,7 +37,7 @@ formPanel ) ), ); - +hr(); history(); /* ====== Render page ====== */ render(); diff --git a/module/execution/ui/start.html.php b/module/execution/ui/start.html.php index 55fd5226c8..83e8bcb014 100644 --- a/module/execution/ui/start.html.php +++ b/module/execution/ui/start.html.php @@ -37,7 +37,7 @@ formPanel ) ), ); - +hr(); history(); /* ====== Render page ====== */ diff --git a/module/execution/ui/suspend.html.php b/module/execution/ui/suspend.html.php index c81fe60581..769b6db185 100644 --- a/module/execution/ui/suspend.html.php +++ b/module/execution/ui/suspend.html.php @@ -29,7 +29,7 @@ formPanel ) ), ); - +hr(); history(); /* ====== Render page ====== */ diff --git a/module/product/ui/close.html.php b/module/product/ui/close.html.php index b5ecad82f5..50ea1af9b2 100644 --- a/module/product/ui/close.html.php +++ b/module/product/ui/close.html.php @@ -25,7 +25,7 @@ formPanel ) ) ); - +hr(); history(); /* ====== Render page ====== */ diff --git a/module/productplan/ui/close.html.php b/module/productplan/ui/close.html.php index 2a87edff87..edf06dbe0d 100644 --- a/module/productplan/ui/close.html.php +++ b/module/productplan/ui/close.html.php @@ -39,7 +39,7 @@ formPanel set::rows(6), ), ); - +hr(); history(); render(); diff --git a/module/program/ui/activate.html.php b/module/program/ui/activate.html.php index 7ba09d8a14..2d9dbfb04b 100644 --- a/module/program/ui/activate.html.php +++ b/module/program/ui/activate.html.php @@ -44,5 +44,5 @@ formPanel ), ), ); - +hr(); history(); diff --git a/module/program/ui/close.html.php b/module/program/ui/close.html.php index 7493fe19f1..791b7b1e66 100644 --- a/module/program/ui/close.html.php +++ b/module/program/ui/close.html.php @@ -31,5 +31,5 @@ formPanel ) ), ); - +hr(); history(); diff --git a/module/program/ui/suspend.html.php b/module/program/ui/suspend.html.php index bb914813c0..3b869567b3 100644 --- a/module/program/ui/suspend.html.php +++ b/module/program/ui/suspend.html.php @@ -23,5 +23,5 @@ formPanel ) ), ); - +hr(); history(); diff --git a/module/project/ui/activate.html.php b/module/project/ui/activate.html.php index 16e6b7bd10..349c3ac636 100644 --- a/module/project/ui/activate.html.php +++ b/module/project/ui/activate.html.php @@ -58,7 +58,7 @@ formPanel ), ), ); - +hr(); history(); /* ====== Render page ====== */ diff --git a/module/project/ui/close.html.php b/module/project/ui/close.html.php index d3cadf9f1a..41b1a4572f 100644 --- a/module/project/ui/close.html.php +++ b/module/project/ui/close.html.php @@ -31,7 +31,7 @@ formPanel ) ), ); - +hr(); history(); /* ====== Render page ====== */ diff --git a/module/project/ui/start.html.php b/module/project/ui/start.html.php index 820168590a..95f5f4f858 100644 --- a/module/project/ui/start.html.php +++ b/module/project/ui/start.html.php @@ -31,7 +31,7 @@ formPanel ) ), ); - +hr(); history(); /* ====== Render page ====== */ diff --git a/module/project/ui/suspend.html.php b/module/project/ui/suspend.html.php index 947f82f363..13882cfeff 100644 --- a/module/project/ui/suspend.html.php +++ b/module/project/ui/suspend.html.php @@ -23,7 +23,7 @@ formPanel ) ), ); - +hr(); history(); /* ====== Render page ====== */ diff --git a/module/release/ui/notify.html.php b/module/release/ui/notify.html.php index 307ef7b801..eff4712db6 100644 --- a/module/release/ui/notify.html.php +++ b/module/release/ui/notify.html.php @@ -40,7 +40,7 @@ formPanel ) ) ); - +hr(); history(); /* ====== Render page ====== */ diff --git a/module/story/ui/activate.html.php b/module/story/ui/activate.html.php index 5ad1ff8fca..22d0f64e4f 100644 --- a/module/story/ui/activate.html.php +++ b/module/story/ui/activate.html.php @@ -39,7 +39,7 @@ formPanel set::rows(6), ), ); - +hr(); history(); render(); diff --git a/module/story/ui/assignto.html.php b/module/story/ui/assignto.html.php index 4979716b28..3e7861a49a 100644 --- a/module/story/ui/assignto.html.php +++ b/module/story/ui/assignto.html.php @@ -41,7 +41,7 @@ formPanel set::rows(6), ), ); - +hr(); history(); render(); diff --git a/module/story/ui/close.html.php b/module/story/ui/close.html.php index 8987544844..2a91362a7e 100644 --- a/module/story/ui/close.html.php +++ b/module/story/ui/close.html.php @@ -48,7 +48,7 @@ formPanel set::rows(6), ), ); - +hr(); history(); render(); diff --git a/module/story/ui/submitreview.html.php b/module/story/ui/submitreview.html.php index b4709fdea3..b607044a4e 100644 --- a/module/story/ui/submitreview.html.php +++ b/module/story/ui/submitreview.html.php @@ -54,7 +54,7 @@ formPanel ) ), ); - +hr(); history(); render(); diff --git a/module/task/css/recordworkhour.ui.css b/module/task/css/recordworkhour.ui.css index 8477165b05..aade6abd90 100644 --- a/module/task/css/recordworkhour.ui.css +++ b/module/task/css/recordworkhour.ui.css @@ -1,6 +1,6 @@ .modal-body > .table-title {font-weight: 700; margin-bottom: 2px} -.panel-form{padding: 0px !important} -.panel-form .panel-heading {padding: 1.5rem 0 !important} +.panel-form {padding: 0px} +.panel-form .panel-heading {padding: 1.5rem 0} .panel-form .panel-heading .panel-title {font-size: 14px} -.panel-form .panel-body {padding: 0 0 1rem 0 !important} +.panel-form .panel-body {padding: 0 0 1rem 0} div.alert {margin: 10px 0} diff --git a/module/task/ui/activate.html.php b/module/task/ui/activate.html.php index 8c7b4b49bf..42fa0beee0 100644 --- a/module/task/ui/activate.html.php +++ b/module/task/ui/activate.html.php @@ -363,7 +363,7 @@ formPanel ) ), ); - +hr(); history(); /* ====== Render page ====== */ diff --git a/module/task/ui/assignto.html.php b/module/task/ui/assignto.html.php index 2f653d1ba1..17b8670544 100644 --- a/module/task/ui/assignto.html.php +++ b/module/task/ui/assignto.html.php @@ -55,7 +55,7 @@ formPanel set::control("editor") ) ); - +hr(); history(); render(); diff --git a/module/task/ui/cancel.html.php b/module/task/ui/cancel.html.php index c418360693..4f723f2217 100644 --- a/module/task/ui/cancel.html.php +++ b/module/task/ui/cancel.html.php @@ -25,7 +25,7 @@ formPanel ) ), ); - +hr(); history(); render(); diff --git a/module/task/ui/close.html.php b/module/task/ui/close.html.php index 134b1517e6..867ec9c3b4 100644 --- a/module/task/ui/close.html.php +++ b/module/task/ui/close.html.php @@ -25,7 +25,7 @@ formPanel ) ), ); - +hr(); history(); render(); diff --git a/module/task/ui/finish.html.php b/module/task/ui/finish.html.php index e3a27d5954..c0f65d1de9 100644 --- a/module/task/ui/finish.html.php +++ b/module/task/ui/finish.html.php @@ -167,6 +167,7 @@ else set::control("editor") ), ); + hr(); history(); } diff --git a/module/task/ui/pause.html.php b/module/task/ui/pause.html.php index d844dc36b7..810f555354 100644 --- a/module/task/ui/pause.html.php +++ b/module/task/ui/pause.html.php @@ -28,7 +28,7 @@ formPanel ) ), ); - +hr(); history(); render(); diff --git a/module/task/ui/restart.html.php b/module/task/ui/restart.html.php index 8cc750ed96..0a987af06b 100644 --- a/module/task/ui/restart.html.php +++ b/module/task/ui/restart.html.php @@ -125,6 +125,7 @@ else ) ), ); + hr(); history(); } diff --git a/module/task/ui/start.html.php b/module/task/ui/start.html.php index 5e36bcde66..4262a8b61d 100644 --- a/module/task/ui/start.html.php +++ b/module/task/ui/start.html.php @@ -129,6 +129,7 @@ else ) ), ); + hr(); history(); } diff --git a/module/testcase/ui/review.html.php b/module/testcase/ui/review.html.php index 65f183b039..6d03495e64 100644 --- a/module/testcase/ui/review.html.php +++ b/module/testcase/ui/review.html.php @@ -58,7 +58,7 @@ form ), set::actions(array('submit')), ); - +hr(); history(); render('modalDialog'); diff --git a/module/testtask/ui/activate.html.php b/module/testtask/ui/activate.html.php index 167ebc4311..6806dd3e63 100644 --- a/module/testtask/ui/activate.html.php +++ b/module/testtask/ui/activate.html.php @@ -25,7 +25,7 @@ form ), set::actions(array('submit')) ); - +hr(); history(); render(); diff --git a/module/testtask/ui/block.html.php b/module/testtask/ui/block.html.php index 8fd3248b55..8d2a8b7c52 100644 --- a/module/testtask/ui/block.html.php +++ b/module/testtask/ui/block.html.php @@ -25,7 +25,7 @@ form ), set::actions(array('submit')) ); - +hr(); history(); render(); diff --git a/module/testtask/ui/close.html.php b/module/testtask/ui/close.html.php index 939865aa56..f69da94ee0 100644 --- a/module/testtask/ui/close.html.php +++ b/module/testtask/ui/close.html.php @@ -51,7 +51,7 @@ form ), set::actions(array('submit')) ); - +hr(); history(); render(); diff --git a/module/testtask/ui/start.html.php b/module/testtask/ui/start.html.php index 23bb228675..994ecff7f3 100644 --- a/module/testtask/ui/start.html.php +++ b/module/testtask/ui/start.html.php @@ -25,7 +25,7 @@ form ), set::actions(array('submit')), ); - +hr(); history(); render(); diff --git a/module/todo/ui/assignto.html.php b/module/todo/ui/assignto.html.php index 2095f98301..af70bcfa5d 100755 --- a/module/todo/ui/assignto.html.php +++ b/module/todo/ui/assignto.html.php @@ -91,5 +91,5 @@ formPanel ) ) ); - +hr(); history();