Merge pull request #588 from willrossi/devadmin

FIX: restore and update style for DevelopmentAdmin.
This commit is contained in:
Sam Minnée 2012-06-28 21:59:07 -07:00
commit 8b98b44b02
5 changed files with 191 additions and 21 deletions

33
css/debug.css Normal file
View File

@ -0,0 +1,33 @@
body { background-color: #eee; margin: 0; overflow-x: hidden; padding: 0; font-family: Helvetica,Arial,sans-serif; }
.info { margin: 0 0 6px 0; padding: 18px; background-color: #003050; position: relative; line-height: 24px; color: #fff; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #002137), color-stop(10%, #003050), color-stop(90%, #003050), color-stop(100%, #002137)); background-image: -webkit-linear-gradient(#002137, #003050 10%, #003050 90%, #002137); background-image: -moz-linear-gradient(#002137, #003050 10%, #003050 90%, #002137); background-image: -o-linear-gradient(#002137, #003050 10%, #003050 90%, #002137); background-image: -ms-linear-gradient(#002137, #003050 10%, #003050 90%, #002137); background-image: linear-gradient(#002137, #003050 10%, #003050 90%, #002137); }
.info h1 { margin: 0 0 6px 0; padding: 0 32px 0 0; color: #fff; font-size: 24px; text-shadow: 0 1px #002137; line-height: 30px; background: url(../admin/images/logo_small.png) no-repeat right 3px; }
.info h3 { color: #7da4be; font-size: 16px; line-height: 18px; font-weight: normal; }
.info p { margin: 0; font-size: 14px; color: #fff; }
.info a { color: #fff; font-weight: bold; text-decoration: none; }
.info a:hover, .info a:active { color: #fff; text-decoration: underline; }
.header { margin: 0; border-bottom: 6px solid #ccdef3; height: 23px; background-color: #666673; padding: 4px 0 2px 6px; }
.trace, .build, .options { padding: 6px 12px; }
.trace li, .build li, .options li { font-size: 14px; margin: 6px 0; }
a { color: #666; }
a:hover { color: #222; }
a:active { color: #111; }
p { margin-bottom: 6px; }
pre { margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #eee; border: 1px solid rgba(0, 0, 0, 0.08); color: #333; padding: 11px; overflow: auto; -webkit-border-radius: 4px; -moz-border-radius: 4px; -ms-border-radius: 4px; -o-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); }
pre span { color: #999; }
pre .error { color: #f00; }
h2 { margin: 0 0 12px 0; }
h3 { margin: 0 0 6px 0; color: #333; font-size: 18px; line-height: 24px; }
ul { margin: 0 0 18px 0; padding: 0 0 0 18px; }
.pass { margin-top: 18px; padding: 2px 20px 2px 40px; color: #006600; background: #E2F9E3; border: 1px solid #8DD38D; border-radius: 4px; }
.fail { margin-top: 18px; padding: 2px 20px 2px 40px; color: #C80700; background: #FFE9E9; border: 1px solid #C80700; border-radius: 4px; }

View File

@ -90,21 +90,16 @@ class DebugView extends Object {
ENT_COMPAT,
'UTF-8'
);
$debugCSS = Controller::join_links(
Director::absoluteBaseURL(),
FRAMEWORK_DIR,
'css/debug.css'
);
echo '<!DOCTYPE html><html><head><title>' . $url . '</title>';
echo '<style type="text/css">';
echo 'body { background-color:#eee; margin:0; padding:0; font-family:Helvetica,Arial,sans-serif; }';
echo '.info { margin:15px 0 0 0; padding:6px 12px; }';
echo '.info h1 { margin:0; padding:0; color:#333; letter-spacing:-2px; }';
echo '.header { margin:0; border-bottom:6px solid #ccdef3; height:23px; background-color:#666673; padding:4px 0 2px 6px; background-image:url('.Director::absoluteBaseURL().'cms/images/mainmenu/top-bg.gif); }';
echo '.trace { padding:6px 12px; }';
echo '.trace li { font-size:14px; margin:6px 0; }';
echo 'pre { margin-left:18px; }';
echo 'pre span { color:#999;}';
echo 'pre .error { color:#f00; }';
echo '.pass { margin-top:18px; padding:2px 20px 2px 40px; color:#006600; background:#E2F9E3 url('.Director::absoluteBaseURL() .'cms/images/alert-good.gif) no-repeat scroll 7px 50%; border:1px solid #8DD38D; border-radius:4px; }';
echo '.fail { margin-top:18px; padding:2px 20px 2px 40px; color:#C80700; background:#FFE9E9 url('.Director::absoluteBaseURL() .'cms/images/alert-bad.gif) no-repeat scroll 7px 50%; border:1px solid #C80700; border-radius:4px; }';
echo '.failure span { color:#C80700; font-weight:bold; }';
echo '</style></head>';
echo '<link rel="stylesheet" type="text/css" href="'. $debugCSS .'" />';
echo '</head>';
echo '<body>';
}

View File

@ -97,8 +97,10 @@ class DevelopmentAdmin extends Controller {
$base = Director::baseURL();
echo '<div class="options"><ul>';
$evenOdd = "odd";
foreach($actions as $action => $description) {
echo "<li><a href=\"{$base}dev/$action\"><b>/dev/$action:</b> $description</a></li>\n";
echo "<li class=\"$evenOdd\"><a href=\"{$base}dev/$action\"><b>/dev/$action:</b> $description</a></li>\n";
$evenOdd = ($evenOdd == "odd") ? "even" : "odd";
}
$renderer->writeFooter();
@ -134,9 +136,8 @@ class DevelopmentAdmin extends Controller {
$renderer = DebugView::create();
$renderer->writeHeader();
$renderer->writeInfo("Environment Builder", Director::absoluteBaseURL());
echo "<div style=\"margin: 0 2em\">";
echo "<div class=\"status pending\"><h2 class='buildProgress'>Database is building.... Check below for any errors</h2><h2 class='buildCompleted'>Database has been built successfully</h2></div>";
echo "<div class=\"build\">";
$da = DatabaseAdmin::create();
return $da->handleRequest($request, $this->model);

View File

@ -39,14 +39,15 @@ class TaskRunner extends Controller {
$renderer->writeInfo("SilverStripe Development Tools: Tasks", Director::absoluteBaseURL());
$base = Director::absoluteBaseURL();
echo "<div class=\"options\">";
echo "<ul>";
foreach($tasks as $task) {
echo "<li>";
echo "<li><p>";
echo "<a href=\"{$base}dev/tasks/" . $task['class'] . "\">" . $task['title'] . "</a><br />";
echo "<span class=\"description\">" . $task['description'] . "</span>";
echo "</li>\n";
echo "</p></li>\n";
}
echo "</ul>";
echo "</ul></div>";
$renderer->writeFooter();
// CLI mode

140
scss/debug.scss Normal file
View File

@ -0,0 +1,140 @@
@import "compass/css3";
body {
background-color: #eee;
margin:0;
overflow-x: hidden;
padding:0;
font-family: Helvetica,Arial,sans-serif;
}
.info {
margin:0 0 6px 0;
padding: 18px;
background-color: #003050;
position: relative;
line-height: 24px;
color: #fff;
@include background-image(
linear-gradient(darken(#003050, 5%), #003050 10%, #003050 90%, darken(#003050, 5%))
);
h1 {
margin: 0 0 6px 0;
padding: 0 32px 0 0;
color: #fff;
font-size: 24px;
text-shadow: 0 1px darken(#003050, 5%);
line-height: 30px;
background: url(../admin/images/logo_small.png) no-repeat right 3px;
}
h3 {
color: #7da4be;
font-size: 16px;
line-height: 18px;
font-weight: normal;
}
p {
margin: 0;
font-size: 14px;
color: #fff;
}
a {
color: #fff;
font-weight: bold;
text-decoration: none;
&:hover,
&:active {
color: #fff;
text-decoration: underline;
}
}
}
.header {
margin: 0;
border-bottom: 6px solid #ccdef3;
height: 23px;
background-color: #666673;
padding: 4px 0 2px 6px;
}
.trace,
.build,
.options {
padding:6px 12px;
li {
font-size:14px; margin:6px 0;
}
}
a {
color: #666;
&:hover {
color: #222;
}
&:active {
color: #111;
}
}
p {
margin-bottom: 6px;
}
pre {
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #eee;
border: 1px solid rgba(0,0,0,.08);
color: #333;
padding: 11px;
overflow: auto;
@include border-radius(4px);
@include box-shadow(inset 0 1px 1px rgba(0,0,0,.05));
span {
color:#999;
}
.error {
color:#f00;
}
}
h2 {
margin: 0 0 12px 0;
}
h3 {
margin: 0 0 6px 0;
color: #333;
font-size: 18px;
line-height: 24px;
}
ul {
margin: 0 0 18px 0;
padding: 0 0 0 18px;
}
.pass {
margin-top:18px; padding:2px 20px 2px 40px; color:#006600; background:#E2F9E3; border: 1px solid #8DD38D;
border-radius:4px;
}
.fail {
margin-top:18px; padding:2px 20px 2px 40px; color:#C80700; background:#FFE9E9;
border:1px solid #C80700; border-radius:4px;
}