[dw-free] Styles: add new one-column mode to allow modules to go either above or below entries
[commit: http://hg.dwscoalition.org/dw-free/rev/59d7e3dddf36]
http://bugs.dwscoalition.org/show_bug.cgi?id=2873
Implement one-column-split mode in Negatives, with accompanying CSS.
Patch by
ninetydegrees.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=2873
Implement one-column-split mode in Negatives, with accompanying CSS.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- bin/upgrading/s2layers/negatives/layout.s2
- cgi-bin/LJ/S2Theme/negatives.pm
-------------------------------------------------------------------------------- diff -r d453470fbf0e -r 59d7e3dddf36 bin/upgrading/s2layers/negatives/layout.s2 --- a/bin/upgrading/s2layers/negatives/layout.s2 Wed Aug 03 06:00:01 2011 +0800 +++ b/bin/upgrading/s2layers/negatives/layout.s2 Wed Aug 03 06:38:02 2011 +0800 @@ -381,6 +381,17 @@ $module_background color: $*color_module_text; } + + .one-column #secondary { + border-left: 5px double $*color_module_border; + border-right: 5px double $*color_module_border; + } + + .one-column-split #secondary { + border-left: 5px double $*color_module_border; + border-right: 5px double $*color_module_border; + } + #secondary a { color:$*color_module_link; font-weight:normal; @@ -687,14 +698,15 @@ text-align: right; } - .one-column #primary {float: none;} - .one-column #secondary {float: none;} + .one-column #primary, + .one-column #secondary { + margin: 0 5%; + } + .two-columns-left #primary {float: right;} .two-columns-left #secondary { float: right; } .two-columns-right #primary { float: left; } .two-columns-right #secondary {float: left;} - .one-column #primary {left: 5%; width: 85%;} - .one-column #secondary {left: 5%; width: 15%;} .two-columns-left #primary { right: 10%; width: 70%; } .two-columns-left #secondary { right: 10%; width: 15%; } .two-columns-right #primary {left: 10%; width: 70%;} @@ -898,19 +910,30 @@ println "<div id=\"header\">"; $this->print_module_section("two"); println "</div>"; + if ($*layout_type == "one-column-split") { + println "<div id=\"secondary\">"; + if ($this.view != "archive" and $this.view != "month"){ + println "<div id='page-navigation-top' class='page-navigation'>"; + $this->print_navigation(); + println "</div>"; + } + $this->print_module_section("one"); + println "</div>"; + } println "<div id=\"primary\">"; $this->print_body(); println "<div class=\"floatclear\">.</div>"; println "</div>"; - - println "<div id=\"secondary\">"; - if ($this.view != "archive" and $this.view != "month"){ - println "<div id='page-navigation-top' class='page-navigation'>"; - $this->print_navigation(); - println "</div>"; - } - $this->print_module_section("one"); - println "</div>"; + if ($*layout_type != "one-column-split") { + println "<div id=\"secondary\">"; + if ($this.view != "archive" and $this.view != "month"){ + println "<div id='page-navigation-top' class='page-navigation'>"; + $this->print_navigation(); + println "</div>"; + } + $this->print_module_section("one"); + println "</div>"; + } println "<div id=\"footer\">"; $this->print_module_section("three"); println "<div>"; diff -r d453470fbf0e -r 59d7e3dddf36 cgi-bin/LJ/S2Theme/negatives.pm --- a/cgi-bin/LJ/S2Theme/negatives.pm Wed Aug 03 06:00:01 2011 +0800 +++ b/cgi-bin/LJ/S2Theme/negatives.pm Wed Aug 03 06:38:02 2011 +0800 @@ -2,7 +2,7 @@ use base qw( LJ::S2Theme ); use strict; -sub layouts { ( "1" => "one-column", "2l" => "two-columns-left", "2r" => "two-columns-right" ) } +sub layouts { ( "1" => "one-column", "1s" => "one-column-split", "2l" => "two-columns-left", "2r" => "two-columns-right" ) } sub layout_prop { "layout_type" } 1; --------------------------------------------------------------------------------