From e1f676f2f70464918b440ce6445b78c30da8cb73 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Nov 2019 11:30:08 +0100 Subject: [PATCH] Fix css fro website --- htdocs/theme/eldy/global.inc.php | 4 ++-- htdocs/theme/md/btn.inc.php | 2 +- htdocs/theme/md/style.css.php | 12 +++++++++--- htdocs/website/index.php | 31 ++++++++++++++++++++++++------- 4 files changed, 36 insertions(+), 13 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 37fbcbad115..0bfe3d56a76 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -3913,7 +3913,7 @@ tr.visible { .bordertransp { background-color: transparent; background-image: none; - border: 1px solid #aaa; + border: none; font-weight: normal; } .websitebar { @@ -4813,7 +4813,7 @@ div.dataTables_length select { } .select2-dropdown { border: 1px solid #ccc; - box-shadow: 5px 5px 15px #ddd; + box-shadow: 1px 2px 10px #ddd; } .select2-dropdown-open { background-color: #fff; diff --git a/htdocs/theme/md/btn.inc.php b/htdocs/theme/md/btn.inc.php index 44252c78449..9bb1dda4945 100644 --- a/htdocs/theme/md/btn.inc.php +++ b/htdocs/theme/md/btn.inc.php @@ -23,7 +23,7 @@ span.butAction, span.butActionDelete { } -.button, .butAction, .butActionDelete, .butActionRefused, .butActionNewRefused { +.button, .buttonDelete, .butAction, .butActionDelete, .butActionRefused, .butActionNewRefused { border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); display: inline-block; padding: 0.4em em; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index cc4438ebc61..fff500fba1b 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -550,7 +550,7 @@ hr { border: 0; border-top: 1px solid #ccc; } -webkit-box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); } -.button:disabled, .buttonDelete:disabled, .button.disabled { +.button:disabled, .buttonDelete:disabled, .button.disabled, .buttonDelete.disabled { opacity: 0.4; box-shadow: none; -webkit-box-shadow: none; @@ -3919,10 +3919,13 @@ tr.visible { background-image: none; border: 1px solid #aaa; font-weight: normal; + color: #444 !important; } .websitebar { border-bottom: 1px solid #ccc; background: #eee; + display: inline-block; + padding: 4px 0 4px 0; } .websitebar .button, .websitebar .buttonDelete { @@ -3930,8 +3933,12 @@ tr.visible { margin: 2px 4px 2px 4px !important; line-height: normal; } +.websitebar input.button.bordertransp, .websitebar input.buttonDelete.bordertransp { + color: #444 !important; + text-shadow: none; +} .websiteselection { - display: inline-block; + /* display: inline-block; */ padding-left: 10px; vertical-align: middle; } @@ -3943,7 +3950,6 @@ tr.visible { padding-top: 3px; padding-bottom: 3px; } - .websiteinputurl { display: inline-block; vertical-align: top; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 947336ab88c..c08ad6375b1 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -270,9 +270,24 @@ if (GETPOST('refreshsite') || GETPOST('refreshsite_x') || GETPOST('refreshsite.x } if (GETPOST('refreshsite', 'alpha') || GETPOST('refreshsite.x', 'alpha') || GETPOST('refreshsite_x', 'alpha')) // If we change the site, we reset the pageid and cancel addsite action. { - $pageid=0; if ($action == 'addsite') $action = 'preview'; if ($action == 'updatesource') $action = 'preview'; + + $pageid = $object->fk_default_home; + if (empty($pageid)) + { + $array=$objectpage->fetchAll($object->id, 'ASC,ASC', 'type_container,pageurl'); + if (! is_array($array) && $array < 0) dol_print_error('', $objectpage->error, $objectpage->errors); + $atleastonepage=(is_array($array) && count($array) > 0); + + $firstpageid=0; $homepageid=0; + foreach($array as $key => $valpage) + { + if (empty($firstpageid)) $firstpageid=$valpage->id; + if ($object->fk_default_home && $key == $object->fk_default_home) $homepageid=$valpage->id; + } + $pageid=($homepageid?$homepageid:$firstpageid); // We choose home page and if not defined yet, we take first page + } } if (GETPOST('refreshpage', 'alpha') && ! in_array($action, array('updatecss'))) $action='preview'; @@ -1967,6 +1982,9 @@ if ($action != 'preview' && $action != 'editcontent' && $action != 'editsource') if (! GETPOST('hide_websitemenu')) { + $disabled=''; + if (empty($user->rights->website->write)) $disabled=' disabled="disabled"'; + //var_dump($objectpage);exit; print '
'; @@ -1978,7 +1996,8 @@ if (! GETPOST('hide_websitemenu')) print ''; print ''; - print ' '; + print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddWebsite")).'">'; + //print ' '; print ''; // List of website @@ -2024,9 +2043,6 @@ if (! GETPOST('hide_websitemenu')) if ($websitekey && $websitekey != '-1' && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite')) { - $disabled=''; - if (empty($user->rights->website->write)) $disabled=' disabled="disabled"'; - print '   '; print ''; @@ -2146,14 +2162,15 @@ if (! GETPOST('hide_websitemenu')) print ''; print ''; - print ''; + //print ''; + print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'">'; print ''; //print ''; if ($action != 'addcontainer') { - print $formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action); + print ''.$formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action).''; } else {