Update DebugView styles

This commit is contained in:
Loz Calver 2017-05-16 17:04:10 +01:00
parent 41a268c69f
commit 713b01ebc7
7 changed files with 130 additions and 125 deletions

2
.gitignore vendored
View File

@ -4,8 +4,6 @@ npm-debug.log
/.buildpath /.buildpath
/.project /.project
/.settings /.settings
css/GridField_print.css
admin/thirdparty/chosen/node_modules
node_modules/ node_modules/
coverage/ coverage/
/**/*.js.map /**/*.js.map

View File

@ -1,159 +1,145 @@
/* This file is manually maintained, it is not generated from SCSS sources */ /* This file is manually maintained, it is not generated from SCSS sources */
body{ body {
background:#eee !important; margin: 0;
margin:0; overflow-x: hidden;
overflow-x:hidden; padding: 0;
padding:0; color: #66727d;
font-family:Helvetica,Arial,sans-serif; background: #f6f7f8;
font-size: 15px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
line-height: 1.5;
} }
.info{ h2 {
padding:18px; margin: 0 0 12px;
position:relative;
z-index:9999;
} }
.info,.info h1{ h3 {
margin:0 0 6px; margin: 0 0 12px;
color: #333;
font-size: 18px;
line-height: 24px;
} }
.info h1{ p {
padding:0 32px 0 0; margin-bottom: 6px;
font-size:24px; }
text-shadow:0 1px #002137;
line-height:30px; ul {
margin: 0 0 18px;
padding: 0 0 0 18px;
}
b {
color: #4f5861;
font-weight: bold;
}
a {
color: #4f5861;
}
a:hover,
a:active {
color: #121212;
}
/* Info block */
.info {
position: relative;
z-index: 9999;
padding: 20px;
}
.info h1 {
margin: 0 0 6px;
padding: 0 32px 0 0;
background: url("../images/logo_small.png") no-repeat right 3px; background: url("../images/logo_small.png") no-repeat right 3px;
font-size: 24px;
line-height: 30px;
} }
.info h3{ .info h3 {
color:#003050; color: #4f5861;
font-size:16px; font-size: 16px;
line-height:18px; line-height: 18px;
} }
.info p{ /* Header */
margin:0; .header {
font-size:14px; border-bottom: solid 1px #004e7f;
color: white;
background: #005a93;
} }
.info a{ .header h1 {
font-weight:700; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmdJREFUeNpiYCASxJ17p8BAAmAh0sD5QAyiFYk1mJGAoQFQQwWgQoKLjIQ+kG0w0EABqIEByOKLjYWZ/////48Yg5lwuPI+uqF/f/88TqyhKGEMdWU/ECegK/r358/Va8tnx5AceVBD9wOxAbqCX18+zbm+am7HpaktD9AcEQCNUBDYAAz7CxhhDFTYAKTqkSX+//37+N3tq4Xboh33ALmfYcEAVJsA9ZkAmhtABifCLIAZ/B5Z4Z9vX1ddXjK15srMzkdAA38iudQB6jNcAJRiFEEpBxbGAsiRtNxWLh3I/ITkSpC3QUGRTyBoYfGUiJFBmJiY/wIN/IAl2S1AdgAoQr88fdjHysMjwyks3ohkBCioEsFBEXv2zUdGRiY+JEmQIQ+hLoQZdgBo2BMmFpaYnx/e9a1yVu0AhT0QM0cefjSPhYs7DEm/IAs0TFewcvOmodmKnuSevLp0uouVi3sDMEJ3AX31GZ60uLjV0DLSJ7DB9/dsalHxDrcGukYbV+B9enJ/xu5Un2tA5i1YhCKVIwbIqQkUN+Ccd7Ip7+nlRZP9QakB3UCQwrc3LoVsDrY4BdTwF8nQAiB1HogdkNX//v5tOUpZwQgMZCDFZ906S51fQVUGmjk+7Un3vwRKRkgGYi1HYMkUmKJSQMGEUQgBLWBGyur/gIp+I6VjA2g6Rs8cDNAIbYalKIzkBvIuKDnjCGqMHAdKdi8vnCgE+uwESoQykAYc0MuRlfaKVdCg+o232MRT6AugRyjQ0BKgga/RDSUJgCI39vTrRxGHHszWzahQBfLZGagFgIaJAzE/NAXhBQABBgBJL0aZBy/F5wAAAABJRU5ErkJggg==) no-repeat right 3px;
text-decoration:none;
color:#7da4be;
} }
.info a:active,.info a:hover{ .header h3 {
text-decoration:underline; color: #7da4be;
color:#7da4be; font-weight: 400;
} }
.info li{ .header a {
font-size:14px; color: white;
margin:6px 0; text-decoration: underline;
} }
.header{ .header a:active,
background-color:#003050; .header a:hover {
background-image:-webkit-gradient(linear,left top,left bottom,from(#002137),color-stop(10%,#003050),color-stop(90%,#003050),color-stop(90%,#002137)); color: white;
background-image:-webkit-linear-gradient(#002137,#003050 10%,#003050 90%,#002137); text-decoration: none;
background-image:linear-gradient(#002137,#003050 10%,#003050 90%,#002137);
color:#fff;
} }
.header h1{ /* Content types */
background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmdJREFUeNpiYCASxJ17p8BAAmAh0sD5QAyiFYk1mJGAoQFQQwWgQoKLjIQ+kG0w0EABqIEByOKLjYWZ/////48Yg5lwuPI+uqF/f/88TqyhKGEMdWU/ECegK/r358/Va8tnx5AceVBD9wOxAbqCX18+zbm+am7HpaktD9AcEQCNUBDYAAz7CxhhDFTYAKTqkSX+//37+N3tq4Xboh33ALmfYcEAVJsA9ZkAmhtABifCLIAZ/B5Z4Z9vX1ddXjK15srMzkdAA38iudQB6jNcAJRiFEEpBxbGAsiRtNxWLh3I/ITkSpC3QUGRTyBoYfGUiJFBmJiY/wIN/IAl2S1AdgAoQr88fdjHysMjwyks3ohkBCioEsFBEXv2zUdGRiY+JEmQIQ+hLoQZdgBo2BMmFpaYnx/e9a1yVu0AhT0QM0cefjSPhYs7DEm/IAs0TFewcvOmodmKnuSevLp0uouVi3sDMEJ3AX31GZ60uLjV0DLSJ7DB9/dsalHxDrcGukYbV+B9enJ/xu5Un2tA5i1YhCKVIwbIqQkUN+Ccd7Ip7+nlRZP9QakB3UCQwrc3LoVsDrY4BdTwF8nQAiB1HogdkNX//v5tOUpZwQgMZCDFZ906S51fQVUGmjk+7Un3vwRKRkgGYi1HYMkUmKJSQMGEUQgBLWBGyur/gIp+I6VjA2g6Rs8cDNAIbYalKIzkBvIuKDnjCGqMHAdKdi8vnCgE+uwESoQykAYc0MuRlfaKVdCg+o232MRT6AugRyjQ0BKgga/RDSUJgCI39vTrRxGHHszWzahQBfLZGagFgIaJAzE/NAXhBQABBgBJL0aZBy/F5wAAAABJRU5ErkJggg==) no-repeat right 3px; .build,
.options,
.trace {
position: relative;
z-index: 9999;
padding: 20px;
background: #f6f7f8 !important;
} }
.header h3{ .options .description {
color:#7da4be; display: block;
font-weight:400; font-size: 14px;
line-height: 1.3;
} }
.header a,.header a:active,.header a:hover,.header p{ .build .success {
color:#fff; color: #3fa142;
} }
.build,.options,.trace{ .build .error {
padding:6px 12px; color: #d40404;
background:#eee !important;
position:relative;
z-index:9999;
} }
a{ .build .warning {
color:#666; color: #f0ad4e;
} }
a:hover{ .build .info {
color:#222; color: #5bc0de;
} }
a:active{ /* Backtrace styles */
color:#111; pre {
overflow: auto;
margin: 0;
padding: 12px;
background-color: #e9f0f4;
border: 1px solid #d9dee2;
color: #4f5861;
font-size: 14px;
} }
p{ pre span {
margin-bottom:6px; color: #999;
} }
pre{ pre .error {
margin-bottom:20px; color: #d40404;
background-color:#f5f5f5;
border:1px solid #eee;
border:1px solid rgba(0,0,0,.08);
color:#333;
padding:11px;
overflow:auto;
border-radius:4px;
box-shadow:inset 0 1px 1px rgba(0,0,0,.05);
}
pre span{
color:#999;
}
pre .error{
color:red;
}
h2{
margin:0 0 12px;
}
h3{
margin:0 0 6px;
color:#333;
font-size:18px;
line-height:24px;
}
ul{
margin:0 0 18px;
padding:0 0 0 18px;
}
fieldset{
border:1px solid #b2b2b2;
margin-bottom:18px;
padding:17px;
}
.pass{
color:#060;
background:#e2f9e3;
border:1px solid #8dd38d;
border-radius:4px;
}
.fail,.pass{
margin-top:18px;
padding:2px 20px 2px 40px;
}
.fail{
color:#c80700;
background:#ffe9e9;
border:1px solid #c80700;
border-radius:4px;
} }

View File

@ -178,7 +178,7 @@ class Backtrace
} }
} }
$funcName .= "(" . implode(",", $args) .")"; $funcName .= "(" . implode(", ", $args) .")";
} }
return $funcName; return $funcName;

View File

@ -182,7 +182,7 @@ class DevelopmentAdmin extends Controller
$renderer = DebugView::create(); $renderer = DebugView::create();
echo $renderer->renderHeader(); echo $renderer->renderHeader();
echo $renderer->renderInfo("Defaults Builder", Director::absoluteBaseURL()); echo $renderer->renderInfo("Defaults Builder", Director::absoluteBaseURL());
echo "<div style=\"margin: 0 2em\">"; echo "<div class=\"build\">";
} }
$da->buildDefaults(); $da->buildDefaults();

View File

@ -793,30 +793,30 @@ abstract class DBSchemaManager
} else { } else {
switch ($type) { switch ($type) {
case "created": case "created":
$color = "green"; $class = "success";
break; break;
case "obsolete": case "obsolete":
$color = "red"; $class = "error";
break; break;
case "notice": case "notice":
$color = "orange"; $class = "warning";
break; break;
case "error": case "error":
$color = "red"; $class = "error";
break; break;
case "deleted": case "deleted":
$color = "red"; $class = "error";
break; break;
case "changed": case "changed":
$color = "blue"; $class = "info";
break; break;
case "repaired": case "repaired":
$color = "blue"; $class = "info";
break; break;
default: default:
$color = ""; $class = "";
} }
echo "<li style=\"color: $color\">$message</li>"; echo "<li class=\"$class\">$message</li>";
} }
} }
} }

View File

@ -167,9 +167,22 @@ class DatabaseAdmin extends Controller
{ {
$dataClasses = ClassInfo::subclassesFor('SilverStripe\ORM\DataObject'); $dataClasses = ClassInfo::subclassesFor('SilverStripe\ORM\DataObject');
array_shift($dataClasses); array_shift($dataClasses);
if (!Director::is_cli()) {
echo "<ul>";
}
foreach ($dataClasses as $dataClass) { foreach ($dataClasses as $dataClass) {
singleton($dataClass)->requireDefaultRecords(); singleton($dataClass)->requireDefaultRecords();
print "Defaults loaded for $dataClass<br/>"; if (Director::is_cli()) {
echo "Defaults loaded for $dataClass\n";
} else {
echo "<li>Defaults loaded for $dataClass</li>\n";
}
}
if (!Director::is_cli()) {
echo "</ul>";
} }
} }
@ -253,7 +266,7 @@ class DatabaseAdmin extends Controller
if (Director::is_cli()) { if (Director::is_cli()) {
echo "\nCREATING DATABASE TABLES\n\n"; echo "\nCREATING DATABASE TABLES\n\n";
} else { } else {
echo "\n<p><b>Creating database tables</b></p>\n\n"; echo "\n<p><b>Creating database tables</b></p><ul>\n\n";
} }
} }
@ -287,12 +300,16 @@ class DatabaseAdmin extends Controller
}); });
ClassInfo::reset_db_cache(); ClassInfo::reset_db_cache();
if (!$quiet && !Director::is_cli()) {
echo "</ul>";
}
if ($populate) { if ($populate) {
if (!$quiet) { if (!$quiet) {
if (Director::is_cli()) { if (Director::is_cli()) {
echo "\nCREATING DATABASE RECORDS\n\n"; echo "\nCREATING DATABASE RECORDS\n\n";
} else { } else {
echo "\n<p><b>Creating database records</b></p>\n\n"; echo "\n<p><b>Creating database records</b></p><ul>\n\n";
} }
} }
@ -344,6 +361,10 @@ class DatabaseAdmin extends Controller
} }
} }
} }
if (!$quiet && !Director::is_cli()) {
echo "</ul>";
}
} }
touch(TEMP_FOLDER touch(TEMP_FOLDER

View File

@ -22,7 +22,7 @@ class BacktraceTest extends SapphireTest
) )
); );
$this->assertEquals( $this->assertEquals(
'MyClass->myFunction(1,more than 20 charact...)', 'MyClass->myFunction(1, more than 20 charact...)',
Backtrace::full_func_name($func, true, 20) Backtrace::full_func_name($func, true, 20)
); );
} }