fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-09-14 08:01 am

[dw-free] Misc. Layouts: fix position options of Navigation module

[commit: http://hg.dwscoalition.org/dw-free/rev/77ab450cdfe0]

http://bugs.dwscoalition.org/show_bug.cgi?id=2624

Allow header to be moved from the header area to the other columns. Note:
this changes the source order in the page.

Patch by [personal profile] ninetydegrees.

Files modified:
  • bin/upgrading/s2layers/boxesandborders/layout.s2
  • bin/upgrading/s2layers/crossroads/layout.s2
  • bin/upgrading/s2layers/nouveauoleanders/layout.s2
--------------------------------------------------------------------------------
diff -r 495b386ed589 -r 77ab450cdfe0 bin/upgrading/s2layers/boxesandborders/layout.s2
--- a/bin/upgrading/s2layers/boxesandborders/layout.s2	Tue Sep 14 15:48:50 2010 +0800
+++ b/bin/upgrading/s2layers/boxesandborders/layout.s2	Tue Sep 14 16:00:51 2010 +0800
@@ -33,6 +33,83 @@ set color_navigation_module_background =
 set color_navigation_module_background = "";
 set color_calendar_module_emptyday_background = "";
 set color_calendar_module_hasday_background = "";
+
+##===============================
+## Navigation Module
+##===============================
+
+    property string module_navlinks_section_override {
+       values = "none|(none)|header|Header|one|Group One|two|Group Two";
+       grouped = 1;
+       }
+
+set grouped_property_override = { "module_navlinks_section" => "module_navlinks_section_override" };
+
+set module_navlinks_section = "header";
+
+##===============================
+##Layout
+##===============================
+
+function Page::print() {
+    """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n<head profile="http://www.w3.org/2006/03/hcard http://purl.org/uF/hAtom/0.1/ http://gmpg.org/xfn/11">\n""";
+    $this->print_head();
+    $this->print_stylesheets();
+    $this->print_head_title();
+    """</head>""";
+    $this->print_wrapper_start();
+    $this->print_control_strip();
+    """
+    <div id="canvas">
+        <div class="inner">
+            <div id="header">
+                <div class="inner">
+                    """;
+                    $this->print_module_section("header");
+                    $this->print_global_title();
+                    $this->print_global_subtitle();
+                    $this->print_title();
+    """
+                </div><!-- end header>inner -->
+            </div><!-- end header -->
+            <div id="content">
+                <div class="inner">
+                    <div id="primary"><div class="inner">
+                        """; 
+                        $this->print_body();
+    """
+                    </div></div><!-- end primary and primary>inner -->
+                    <div id="secondary"><div class="inner">
+                        """;
+                        $this->print_module_section("one");
+    """
+                    </div></div><!--  end secondary and secondary>inner -->
+                    <div id="invisible-separator" style="float: left; width: 1px;"></div> <!-- this is a hack for IE7 + two-columns-right -->
+                    <div id="tertiary"><div class="inner">
+                        """;
+                        $this->print_module_section("two");
+    """
+                    </div></div><!-- end tertiary and tertiary>inner -->
+                    <div id="content-footer"></div>
+                </div><!-- end content>inner -->
+            </div> <!-- end content -->
+        </div> <!-- end canvas>inner --> 
+    """;
+    
+    """
+    <div id="footer">
+        <div class="inner">
+            """;
+            print safe """
+                <div class="page-top"><a href="#">$*text_page_top</a></div>
+        </div><!-- end footer>inner -->
+    </div><!-- end footer -->
+    
+    </div> <!-- end canvas -->
+    """;
+    $this->print_wrapper_end();
+    """</html>""";
+}
 
 function Page::print_global_title() {
 
@@ -77,6 +154,54 @@ function print_stylesheet() {
                 margin: 0 0 .5em .5em; }
             """;
         }
+
+    var string navlinks_css = "";
+        if ($*module_navlinks_section == "header") {
+            $navlinks_css = """
+            .module-navlinks {
+                background: $*color_navigation_module_background;
+                border: none;
+                left: 0;
+                margin: 0;
+                padding: 0;
+                position: absolute;
+                text-align: left;
+                top: 1em;
+                width: 100%;
+                }
+
+            .module-navlinks ul {
+                background: $*color_navigation_module_background;
+                list-style: none;
+                margin: 0;
+                padding-left: 1em;
+                }
+
+            .module-navlinks ul li {
+                border-left: 1px solid $*color_page_border;
+                border-right: 1px solid $*color_page_border;
+                display: inline;
+                margin: 0;
+                padding: .25em .5em;
+                }
+
+            .module-navlinks ul li a {
+                font-size: small;
+                padding: .15em .5em;
+                text-decoration: none;
+                $module_link_colors
+                }
+
+            .module-navlinks ul li a:hover {
+                text-decoration: underline;
+                $module_link_hover_colors
+                }
+            """;
+        }
+        else {
+            $navlinks_css = "";
+        }
+
     """
 
 /* Boxes and Borders */
@@ -295,33 +420,9 @@ text-decoration: none; }
 .module-userprofile { text-align: center; }
 .module-userprofile .module-header { text-align: left; }
 
-.module-navlinks ul,
 .module-typelist ul { list-style: none; }
 
-.module-navlinks { position: absolute;
-    top: 1em;
-    left: 0;
-    margin: 0;
-    padding: 0;
-    border: none;
-    background: $*color_navigation_module_background;
-    width: 100%; }
-
-.module-navlinks ul { margin: 0;
-    padding-left: 1em;
-    background: $*color_navigation_module_background; }
-
-.module-navlinks ul li { display: inline;
-    padding: .25em .5em;
-    margin: 0;
-    border-left: 1px solid $*color_page_border;
-    border-right: 1px solid $*color_page_border; }
-.module-navlinks ul li a { font-size: small;
-    padding: .15em .5em;
-    $module_link_colors
-    text-decoration: none; }
-.module-navlinks ul li a:hover { $module_link_hover_colors
-    text-decoration: underline; }
+$navlinks_css
 
 .module-customtext .module-content { padding: .25em 0; }
 
diff -r 495b386ed589 -r 77ab450cdfe0 bin/upgrading/s2layers/crossroads/layout.s2
--- a/bin/upgrading/s2layers/crossroads/layout.s2	Tue Sep 14 15:48:50 2010 +0800
+++ b/bin/upgrading/s2layers/crossroads/layout.s2	Tue Sep 14 16:00:51 2010 +0800
@@ -36,8 +36,81 @@ set font_entry_title = "Century Gothic, 
 set font_entry_title = "Century Gothic, Verdana, sans-serif";
 
 ##===============================
+## Navigation Module
+##===============================
+
+    property string module_navlinks_section_override {
+       values = "none|(none)|header|Header|one|Group One|two|Group Two";
+       grouped = 1;
+       }
+
+set grouped_property_override = { "module_navlinks_section" => "module_navlinks_section_override" };
+
+set module_navlinks_section = "header";
+
+##===============================
 ##Layout
 ##===============================
+
+function Page::print() {
+    """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n<head profile="http://www.w3.org/2006/03/hcard http://purl.org/uF/hAtom/0.1/ http://gmpg.org/xfn/11">\n""";
+    $this->print_head();
+    $this->print_stylesheets();
+    $this->print_head_title();
+    """</head>""";
+    $this->print_wrapper_start();
+    $this->print_control_strip();
+    """
+    <div id="canvas">
+        <div class="inner">
+            <div id="header">
+                <div class="inner">
+                    """;
+                    $this->print_module_section("header");
+                    $this->print_global_title();
+                    $this->print_global_subtitle();
+                    $this->print_title();
+    """
+                </div><!-- end header>inner -->
+            </div><!-- end header -->
+            <div id="content">
+                <div class="inner">
+                    <div id="primary"><div class="inner">
+                        """; 
+                        $this->print_body();
+    """
+                    </div></div><!-- end primary and primary>inner -->
+                    <div id="secondary"><div class="inner">
+                        """;
+                        $this->print_module_section("one");
+    """
+                    </div></div><!--  end secondary and secondary>inner -->
+                    <div id="invisible-separator" style="float: left; width: 1px;"></div> <!-- this is a hack for IE7 + two-columns-right -->
+                    <div id="tertiary"><div class="inner">
+                        """;
+                        $this->print_module_section("two");
+    """
+                    </div></div><!-- end tertiary and tertiary>inner -->
+                    <div id="content-footer"></div>
+                </div><!-- end content>inner -->
+            </div> <!-- end content -->
+        </div> <!-- end canvas>inner --> 
+    """;
+    
+    """
+    <div id="footer">
+        <div class="inner">
+            """;
+            print safe """
+                <div class="page-top"><a href="#">$*text_page_top</a></div>
+        </div><!-- end footer>inner -->
+    </div><!-- end footer -->
+    
+    </div> <!-- end canvas -->
+    """;
+    $this->print_wrapper_end();
+    """</html>""";
+}
 
 function print_stylesheet () {
 
@@ -87,6 +160,73 @@ else {
             .full .comment-poster,
             .comment .poster-ip { margin-right: 110px; }
             """;
+        }
+
+    var string navlinks_css = "";
+        if ($*module_navlinks_section == "header") {
+            $navlinks_css = """
+            .module-navlinks {
+                background-color: transparent;
+                color: $*color_page_title;
+                position: absolute;
+                top: 2.5em;
+                }
+
+            .column-left .module-navlinks {
+                padding-left: 2%;
+                }
+
+            .column-right .module-navlinks {
+                padding-right: 2%;
+                }
+
+            .two-columns-left .module-navlinks,
+            .three-columns-sides .module-navlinks {
+                left: $*sidebar_width;
+                }
+
+            .two-columns-right .module-navlinks {
+                right: $*sidebar_width;
+                }
+
+            .three-columns-left .module-navlinks {
+                left: $*sidebar_width_doubled;
+                }
+
+            .three-columns-right .module-navlinks {
+                right: $*sidebar_width_doubled;
+                }
+
+            .three-columns-sides .module-navlinks {
+                padding-right: 15em;
+                }
+
+            .module-navlinks ul {
+                font-family: $*font_journal_title;
+                font-size: small;
+                list-style: none;
+                margin: .25em auto;
+                }
+
+            .module-navlinks li {
+                border-left: 1px solid;
+                display: inline;
+                padding: 0 .25em 0 .5em;
+                }
+
+            .module-navlinks ul > li:first-child {
+                border-left: none;
+                padding-left: 0;
+                }
+
+            .module-navlinks a,
+            .module-navlinks a:visited {
+                color: $*color_page_title !important;
+                }
+            """;
+        }
+        else {
+            $navlinks_css = "";
         }
 
     """
@@ -397,32 +537,7 @@ text-align: center; }
 #tertiary .module-calendar td a { background-color: $*color_page_background;
     color: $*color_page_text; }
 
-.module-navlinks { position: absolute;
-    top: 2.5em;
-    white-space: nowrap;
-    color: $*color_page_title;
-    background-color: transparent; }
-
-.module-navlinks ul { font-family: $*font_journal_title; }
-
-.two-columns-left .module-navlinks { left: $*sidebar_width; }
-.three-columns-left .module-navlinks { left: $*sidebar_width_doubled; }
-.two-columns-right .module-navlinks,
-.three-columns-right .module-navlinks { right: $*sidebar_width; }
-.three-columns-sides .module-navlinks  { left: $*sidebar_width; 
-    right: $*sidebar_width; }
-
-.module-navlinks ul { list-style: none;
-    margin: .25em auto;
-    font-size: small; }
-.module-navlinks li { display: inline;
-    padding: 0 .25em 0 .5em;
-    border-left: 1px solid; }
-.module-navlinks ul > li:first-child { border-left: none;
-    padding-left: 0; }
-.module-navlinks a,
-.module-navlinks a:visited { color: $*color_page_title !important; }
-
+$navlinks_css
 
 /* footer */
 
diff -r 495b386ed589 -r 77ab450cdfe0 bin/upgrading/s2layers/nouveauoleanders/layout.s2
--- a/bin/upgrading/s2layers/nouveauoleanders/layout.s2	Tue Sep 14 15:48:50 2010 +0800
+++ b/bin/upgrading/s2layers/nouveauoleanders/layout.s2	Tue Sep 14 16:00:51 2010 +0800
@@ -45,6 +45,18 @@ set font_module_text = "";
 
 set image_background_header_url = "nouveauoleanders/johnny_automatic_oleander_design-blk-sm-trans.png";
 
+##===============================
+## Navigation Module
+##===============================
+
+    property string module_navlinks_section_override {
+       values = "none|(none)|header|Header|one|Group One|two|Group Two";
+       grouped = 1;
+       }
+
+set grouped_property_override = { "module_navlinks_section" => "module_navlinks_section_override" };
+
+set module_navlinks_section = "header";
 
 ##===============================
 ## Layout
@@ -53,6 +65,65 @@ set layout_type = "two-columns-left";
 set layout_type = "two-columns-left";
 property string userpics_position { noui = 1; }
 
+function Page::print() {
+    """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n<head profile="http://www.w3.org/2006/03/hcard http://purl.org/uF/hAtom/0.1/ http://gmpg.org/xfn/11">\n""";
+    $this->print_head();
+    $this->print_stylesheets();
+    $this->print_head_title();
+    """</head>""";
+    $this->print_wrapper_start();
+    $this->print_control_strip();
+    """
+    <div id="canvas">
+        <div class="inner">
+            <div id="header">
+                <div class="inner">
+                    """;
+                    $this->print_module_section("header");
+                    $this->print_global_title();
+                    $this->print_global_subtitle();
+                    $this->print_title();
+    """
+                </div><!-- end header>inner -->
+            </div><!-- end header -->
+            <div id="content">
+                <div class="inner">
+                    <div id="primary"><div class="inner">
+                        """; 
+                        $this->print_body();
+    """
+                    </div></div><!-- end primary and primary>inner -->
+                    <div id="secondary"><div class="inner">
+                        """;
+                        $this->print_module_section("one");
+    """
+                    </div></div><!--  end secondary and secondary>inner -->
+                    <div id="invisible-separator" style="float: left; width: 1px;"></div> <!-- this is a hack for IE7 + two-columns-right -->
+                    <div id="tertiary"><div class="inner">
+                        """;
+                        $this->print_module_section("two");
+    """
+                    </div></div><!-- end tertiary and tertiary>inner -->
+                    <div id="content-footer"></div>
+                </div><!-- end content>inner -->
+            </div> <!-- end content -->
+        </div> <!-- end canvas>inner --> 
+    """;
+    
+    """
+    <div id="footer">
+        <div class="inner">
+            """;
+            print safe """
+                <div class="page-top"><a href="#">$*text_page_top</a></div>
+        </div><!-- end footer>inner -->
+    </div><!-- end footer -->
+    
+    </div> <!-- end canvas -->
+    """;
+    $this->print_wrapper_end();
+    """</html>""";
+}
 
 function print_stylesheet () {
 
@@ -68,6 +139,41 @@ function print_stylesheet () {
     var string comment_background_end_even = "$*STATDIR/nouveauoleanders/steren-short-rev2.png";
 
     var string no_icon_url = "$*IMGDIR/profile_icons/user.png";
+
+    var string navlinks_css = "";
+        if ($*module_navlinks_section == "header") {
+            $navlinks_css = """
+            .module-navlinks {
+                background-color: transparent;
+                color: $*color_page_title;
+                font-family: $*font_journal_title;
+                font-size: small;
+                left: 220px;
+                position: absolute;
+                right: 220px;
+                text-align: center;
+                top: 1em;
+                }
+
+            .module-navlinks ul {
+                list-style: none;
+                margin: .25em auto;
+                }
+
+            .module-navlinks li {
+                border-left: 1px solid;
+                display: inline;
+                padding: 0 .25em 0 .5em;
+                }
+
+            .module-navlinks ul > li:first-child {
+                border-left: none;
+                }
+            """;
+        }
+        else {
+            $navlinks_css = "";
+        }
 
     """
 
@@ -124,7 +230,7 @@ body { margin: 0;
     color: $*color_page_title;
     background: $*color_header_background url("$*STATDIR/$*image_background_header_url") top right no-repeat;
     padding: 1px;}
-#header .inner { background: url("$*STATDIR/$*image_background_header_url") top left no-repeat;
+#header > .inner:first-child { background: url("$*STATDIR/$*image_background_header_url") top left no-repeat;
     margin-top: -1px;
     padding: 3em 2em 1em 2em; }
 
@@ -427,22 +533,7 @@ margin-left: 0; padding-left: 0; }
 
 .module-syndicate .module-content { text-align: left; }
 
-.module-navlinks { position: absolute;
-    top: 1em;
-    left: 220px;
-    right: 220px;
-    text-align: center;
-    color: $*color_page_title;
-    background-color: transparent;
-    font-size: small;
-    font-family: $*font_journal_title; }
-.module-navlinks ul { list-style: none;
-    margin: .25em auto;  }
-.module-navlinks li { display: inline;
-    padding: 0 .25em 0 .5em;
-    border-left: 1px solid; }
-.module-navlinks ul > li:first-child { border-left: none; }
-
+$navlinks_css
 
 /* footer */
 
--------------------------------------------------------------------------------