even better columns: CSS

This commit is contained in:
Shish 2012-02-12 09:51:25 +00:00
parent 830105193d
commit a2459da61b
2 changed files with 18 additions and 20 deletions

View file

@ -15,8 +15,6 @@ class SetupTheme extends Themelet {
public function display_page(Page $page, SetupPanel $panel) {
global $user;
$setupblock_html1 = "";
$setupblock_html2 = "";
usort($panel->blocks, "blockcmp");
@ -24,29 +22,16 @@ class SetupTheme extends Themelet {
* Try and keep the two columns even; count the line breaks in
* each an calculate where a block would work best
*/
$len1 = 0;
$len2 = 0;
$setupblock_html = "";
foreach($panel->blocks as $block) {
if($block instanceof SetupBlock) {
$html = $this->sb_to_html($block);
$len = count(explode("<br>", $html))+1;
if($len1 <= $len2) {
$setupblock_html1 .= $this->sb_to_html($block);
$len1 += $len;
}
else {
$setupblock_html2 .= $this->sb_to_html($block);
$len2 += $len;
}
}
$html = $this->sb_to_html($block);
$setupblock_html .= $this->sb_to_html($block);
}
$table = "
".make_form(make_link("setup/save"))."
<table style='max-width: 1000px;'>
<tr><td width='50%'>$setupblock_html1</td><td>$setupblock_html2</td></tr>
<tr><td colspan='2'><input type='submit' value='Save Settings'></td></tr>
</table>
<div class='setupblocks'>$setupblock_html</div>
<input type='submit' value='Save Settings'>
</form>
";

View file

@ -200,6 +200,18 @@ UL {
padding: 8px 4px 8px 4px;
}
.setupblocks {
column-width: 400px;
-moz-column-width: 400px;
-webkit-column-width: 400px;
max-width: 1200px;
margin: auto;
}
.setupblocks .rr {
column-break-inside: avoid;
-moz-column-break-inside: avoid;
-webkit-column-break-inside: avoid;
}
.setupblock {
text-align: center;
width: 100%;
@ -207,6 +219,7 @@ UL {
.setupblock TEXTAREA {
width: 100%;
font-size: 0.75em;
resize: vertical;
}
.helpable {