Some style tweaks to theme editor, fixes #11563. Hat tip: Simek.

I adjusted the padding to be a little heavier and then have a negative margin, so the text stays aligned and the highlight floats around it. As an added tweak I removed the extraneous "Theme Files" heading which didn't really convey any useful information.

"Perfection is achieved perfection not when there is nothing left to add, but when there is nothing left to take away" -- Antoine de Saint-Exupery (and Merry Christmas everybody. :))

git-svn-id: http://svn.automattic.com/wordpress/trunk@12541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2009-12-25 03:16:25 +00:00
parent 5fb288d031
commit 4a91f16421
3 changed files with 17 additions and 10 deletions

View File

@ -1 +1 @@
#template textarea{font-family:Consolas,Monaco,Courier,monospace;font-size:12px;width:97%;}#template p{width:97%;}#templateside{float:right;width:190px;word-wrap:break-word;}#templateside h3,#postcustomstuff p.submit{margin:0;}#templateside h4{margin:1em 0 0;}#templateside ol,#templateside ul{margin:.5em;padding:0;}#templateside li{margin:4px 0;}.nonessential{font-size:small;}.highlight{padding:1px;}div.tablenav{margin-right:210px;}#documentation{margin-top:10px;}#documentation label{line-height:22px;vertical-align:top;font-weight:bold;}.fileedit-sub{padding:10px 0 8px;line-height:180%;}
#template textarea{font-family:Consolas,Monaco,Courier,monospace;font-size:12px;width:97%;}#template p{width:97%;}#templateside{float:right;width:190px;word-wrap:break-word;}#templateside h3,#postcustomstuff p.submit{margin:0;}#templateside h4{margin:1em 0 0;}#templateside ol,#templateside ul{margin:.5em;padding:0;}#templateside li{margin:4px 0;}.nonessential{font-size:11px;font-style:italic;padding-left:12px;}.highlight{padding:3px 3px 3px 12px;margin-left:-12px;font-weight:bold;-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;}div.tablenav{margin-right:210px;}#documentation{margin-top:10px;}#documentation label{line-height:22px;vertical-align:top;font-weight:bold;}.fileedit-sub{padding:10px 0 8px;line-height:180%;}

View File

@ -34,11 +34,19 @@
}
.nonessential {
font-size: small;
font-size: 11px;
font-style: italic;
padding-left: 12px;
}
.highlight {
padding: 1px;
padding: 3px 3px 3px 12px;
margin-left: -12px;
font-weight: bold;
-moz-border-radius: 8px;
-khtml-border-radius: 8px;
-webkit-border-radius: 8px;
border-radius: 8px;
}
div.tablenav {

View File

@ -142,12 +142,11 @@ $desc_header = ( $description != $file_show ) ? "<strong>$description</strong> (
</div>
<br class="clear" />
<div id="templateside">
<h3><?php _e("Theme Files"); ?></h3>
<?php
if ($allowed_files) :
?>
<h4><?php _e('Templates'); ?></h4>
<h3><?php _e('Templates'); ?></h3>
<ul>
<?php
$template_mapping = array();
@ -155,8 +154,8 @@ if ($allowed_files) :
foreach ( $themes[$theme]['Template Files'] as $template_file ) {
$description = trim( get_file_description($template_file) );
$template_show = basename($template_file);
$filedesc = ( $description != $template_file ) ? "$description <span class='nonessential'>($template_show)</span>" : $description;
$filedesc = ( $template_file == $file ) ? "<span class='highlight'>$description <span class='nonessential'>($template_show)</span></span>" : $filedesc;
$filedesc = ( $description != $template_file ) ? "$description<br /><span class='nonessential'>($template_show)</span>" : "$description";
$filedesc = ( $template_file == $file ) ? "<div class='highlight'>$description<br /><span class='nonessential'>($template_show)</span></div>" : $filedesc;
// If we have two files of the same name prefer the one in the Template Directory
// This means that we display the correct files for child themes which overload Templates as well as Styles
@ -174,7 +173,7 @@ if ($allowed_files) :
<li><a href="theme-editor.php?file=<?php echo "$template_file"; ?>&amp;theme=<?php echo urlencode($theme) ?>&amp;dir=theme"><?php echo $filedesc ?></a></li>
<?php endwhile; ?>
</ul>
<h4><?php /* translators: Theme stylesheets in theme editor */ echo _x('Styles', 'Theme stylesheets in theme editor'); ?></h4>
<h3><?php /* translators: Theme stylesheets in theme editor */ echo _x('Styles', 'Theme stylesheets in theme editor'); ?></h3>
<ul>
<?php
$template_mapping = array();
@ -182,8 +181,8 @@ if ($allowed_files) :
foreach ( $themes[$theme]['Stylesheet Files'] as $style_file ) {
$description = trim( get_file_description($style_file) );
$style_show = basename($style_file);
$filedesc = ( $description != $style_file ) ? "$description <span class='nonessential'>($style_show)</span>" : "$description";
$filedesc = ( $style_file == $file ) ? "<span class='highlight'>$description <span class='nonessential'>($style_show)</span></span>" : $filedesc;
$filedesc = ( $description != $style_file ) ? "$description<br /><span class='nonessential'>($style_show)</span>" : "$description";
$filedesc = ( $style_file == $file ) ? "<div class='highlight'>$description<br /><span class='nonessential'>($style_show)</span></div>" : $filedesc;
$template_mapping[ $description ] = array( _get_template_edit_filename($style_file, $stylesheet_dir), $filedesc );
}
ksort( $template_mapping );