From: Nicolas Boisselier Date: Tue, 2 Oct 2018 01:34:29 +0000 (+0100) Subject: www/dbq/html/default.css X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=c2717d5b8f11c4079c91e6f802041eaaf77f6bc2;p=nb.git www/dbq/html/default.css --- diff --git a/lib/php/out.php b/lib/php/out.php index 10730504..6fbc0a10 100644 --- a/lib/php/out.php +++ b/lib/php/out.php @@ -7,7 +7,7 @@ Class Out extends Nb { public static $charset = 'utf-8'; protected static $type = 'txt'; - protected static $types; + protected static $types; # out/.php protected static $header = true; protected static $mime; @@ -492,34 +492,28 @@ Class Out extends Nb { self::out_tag($o,$row); } + private static function _tag($tag,&$v) { + return '<'.$tag.'>'.$v.''; + } + public static function out_tag(&$o,&$row) { if (isset($o['tag_enclose'])) echo (NB_EOL ? ' ' : '').'<'.$o['tag_enclose'].'>'.NB_EOL; self::row_parse($row,$o); foreach ($row as $k => $v) { - if (!empty($o['tag_val'])) { - $v = '<'.$o['tag_val'].'>'.$v.''; - } + if (!empty($o['tag_val'])) $v = self::_tag($o['tag_val'],$v); - # Inside tag, ex: label - if (!empty($o['tag_key'])) { - $v = '<'.$o['tag_key'].'>'.$k.''.$v; - } + # Inside tag, ex: label + if (!empty($o['tag_key'])) $v = self::_tag($o['tag_key'],$k).$v; # Tag = o[tag] or key if (!empty($o['tag'])) { - $class = is_numeric($k) ? '' : ' class="'.$k.'"'; - $k = $o['tag']; - } else { - $class = ''; - } + $k = str_replace('',$k,$o['tag']); + } + + echo (NB_EOL ? ' ' : '')."<$k>$v".NB_EOL; - echo '' - .(NB_EOL ? ' ' : '') - ."<$k$class>$v" - .NB_EOL - ; } if (isset($o['tag_enclose'])) echo (NB_EOL ? ' ' : '').''.NB_EOL; diff --git a/lib/php/out/div.php b/lib/php/out/div.php index 5a83f25d..cb998b62 100644 --- a/lib/php/out/div.php +++ b/lib/php/out/div.php @@ -3,10 +3,10 @@ return [ 'is_html' => true, 'enclose' => ["
".NB_EOL,"
".NB_EOL], 'tag_enclose' => 'div class="db-row border rounded p-2 my-2"', - 'tag' => 'div class="row"', + 'tag' => 'div class="row db-field-"', 'row' => 'out_tag', 'tag_key' => 'label class="col col-lg-2"', - 'tag_val' => 'div class="col col-lg-10 value"', + 'tag_val' => 'div class="col col-lg-10 value"', #'tag_val' => 'span', ]; ?> diff --git a/www/dbq/html/default.css b/www/dbq/html/default.css index 5cc300e9..785a4748 100644 --- a/www/dbq/html/default.css +++ b/www/dbq/html/default.css @@ -88,11 +88,18 @@ h1, h1 a, h1 a:hover { display: inline-block; } +.db-field-view label, +.db-field-delete label, +.D-NONE { + display: none; +} + .db-rows th.view, -div._db-rows div.db-row:first-of-type label, -div._db-rows label:first-of-type, .HIDE{ + /* font: 0/0 a; + border: 0; + */ color: transparent; text-shadow: none; background-color: transparent; diff --git a/www/dbq/html/default.min.css b/www/dbq/html/default.min.css index 3bbb3b57..024b21b0 100644 --- a/www/dbq/html/default.min.css +++ b/www/dbq/html/default.min.css @@ -1 +1 @@ -@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.loader{border:16px solid #fff;border-radius:50%;border-top:16px solid #000;padding:0;margin:0 auto 0 auto;width:8em;height:8em;animation:spin 2s linear infinite;display:block}body.loader{margin-top:8em}.loader *{display:none!important}h1{margin:0 0 .2em 0;font-size:140%;padding-bottom:.3em;margin-bottom:.5em;padding:.3em;background-color:var(--dark)}h1,h1 a,h1 a:hover{color:var(--light);font-weight:400!important}.menu *{font-size:95%}.menu .form-control{max-width:5rem;height:1.5rem;padding:0 .3rem;margin-top:.4rem;margin-left:.2rem}.menu .btn-group{margin-left:.4rem;max-height:2.5rem}.edit .form-control+.media{margin-top:.25rem}#db-menu-form,#page-bottom,.CENTER,.db-results,.db-rows,.pagination{margin-left:auto;margin-right:auto;width:auto;display:table}.pagination *{display:inline-block}.HIDE,.db-rows th.view,div._db-rows div.db-row:first-of-type label,div._db-rows label:first-of-type{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent} +@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.loader{border:16px solid #fff;border-radius:50%;border-top:16px solid #000;padding:0;margin:0 auto 0 auto;width:8em;height:8em;animation:spin 2s linear infinite;display:block}body.loader{margin-top:8em}.loader *{display:none!important}h1{margin:0 0 .2em 0;font-size:140%;padding-bottom:.3em;margin-bottom:.5em;padding:.3em;background-color:var(--dark)}h1,h1 a,h1 a:hover{color:var(--light);font-weight:400!important}.menu *{font-size:95%}.menu .form-control{max-width:5rem;height:1.5rem;padding:0 .3rem;margin-top:.4rem;margin-left:.2rem}.menu .btn-group{margin-left:.4rem;max-height:2.5rem}.edit .form-control+.media{margin-top:.25rem}#db-menu-form,#page-bottom,.CENTER,.db-results,.db-rows,.pagination{margin-left:auto;margin-right:auto;width:auto;display:table}.pagination *{display:inline-block}.D-NONE,.db-field-delete label,.db-field-view label{display:none}.HIDE,.db-rows th.view{color:transparent;text-shadow:none;background-color:transparent}