[dw-free] Official styles should support placing icon right or left on entries and comments
[commit: http://hg.dwscoalition.org/dw-free/rev/fd8f06f706eb]
http://bugs.dwscoalition.org/show_bug.cgi?id=1813
Option to place userpic on left/right plus CSS for Tabula Rasa and Tabula
Rasa-based layouts.
Patch by
ninetydegrees.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=1813
Option to place userpic on left/right plus CSS for Tabula Rasa and Tabula
Rasa-based layouts.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- bin/upgrading/s2layers/basicboxes/layout.s2
- bin/upgrading/s2layers/boxesandborders/layout.s2
- bin/upgrading/s2layers/colorside/layout.s2
- bin/upgrading/s2layers/core2base/layout.s2
- bin/upgrading/s2layers/crossroads/layout.s2
- bin/upgrading/s2layers/fluidmeasure/layout.s2
- bin/upgrading/s2layers/funkycircles/layout.s2
- bin/upgrading/s2layers/modish/layout.s2
- bin/upgrading/s2layers/modular/layout.s2
- bin/upgrading/s2layers/refriedtablet/layout.s2
- bin/upgrading/s2layers/steppingstones/layout.s2
- bin/upgrading/s2layers/tranquilityiii/layout.s2
-------------------------------------------------------------------------------- diff -r d835a2e7a4d9 -r fd8f06f706eb bin/upgrading/s2layers/basicboxes/layout.s2 --- a/bin/upgrading/s2layers/basicboxes/layout.s2 Mon Jul 05 13:52:07 2010 +0800 +++ b/bin/upgrading/s2layers/basicboxes/layout.s2 Mon Jul 05 14:17:10 2010 +0800 @@ -6,6 +6,7 @@ layerinfo lang = "en"; set layout_type = "three-columns-sides"; set layout_authors = [ { "name" => "branchandroot", "type" => "user" } ]; +set userpics_position = "right"; function print_stylesheet () { @@ -24,6 +25,27 @@ function print_stylesheet () { var string module_colors = generate_color_css( $*color_module_text, $*color_module_background, $*color_module_border ); var string module_header_colors = generate_color_css( $*color_module_title, $*color_module_title_background, $*color_module_border ); var string module_header_link_colors = generate_color_css( $*color_module_title, new Color, new Color ); + + var string userpic_css = ""; + if ($*userpics_position == "left") { + $userpic_css = """ + .has-userpic .entry .contents .userpic, + .has-userpic .comment .contents .userpic { float: left; + margin: -1em .25em .25em 0; } + .has-userpic .comment .contents .userpic { margin-top: 0 } + .entry .header { text-align: right; } + .entry-title, + .comment-title { text-align: left; } + """; + } + elseif ($*userpics_position == "right") { + $userpic_css = """ + .has-userpic .entry .contents .userpic, + .has-userpic .comment .contents .userpic { float: right; + margin: -1em 0 .25em .25em; } + .has-userpic .comment .contents .userpic { margin-top: 0 } + """; + } """ /* Basic Boxes */ @@ -102,9 +124,6 @@ border: none; } .entry .poster { display: block; margin: .5em 0; } -.entry .contents .userpic { float: right; - margin: -1em 0 .25em .25em;} - .entry .contents { padding: 0 .5em; } .entry-content { margin: 1em 0; } @@ -149,9 +168,6 @@ ul.entry-interaction-links { text-align: .comment .poster-ip { font-size: small; color: #999999; } - -.comment .contents .userpic { float: right; - margin: 0 0 .25em .25em;} .comment-content { margin-top: 1em; } @@ -271,6 +287,7 @@ text-align: center; } color: $*color_entry_text !important; } .module-search .search-form { text-align: right; } +$userpic_css """; } diff -r d835a2e7a4d9 -r fd8f06f706eb bin/upgrading/s2layers/boxesandborders/layout.s2 --- a/bin/upgrading/s2layers/boxesandborders/layout.s2 Mon Jul 05 13:52:07 2010 +0800 +++ b/bin/upgrading/s2layers/boxesandborders/layout.s2 Mon Jul 05 14:17:10 2010 +0800 @@ -61,6 +61,22 @@ function print_stylesheet() { var string calendar_link_colors = generate_color_css( $*color_page_background, $*color_calendar_module_hasday_background, new Color ); var string footer_colors = generate_color_css( new Color, $*color_footer_background, new Color ); + + var string userpic_css = ""; + if ($*userpics_position == "left") { + $userpic_css = """ + .has-userpic .entry .contents .userpic, + .has-userpic .comment .contents .userpic { float: left; + margin: 0 .5em .5em 0; } + """; + } + elseif ($*userpics_position == "right") { + $userpic_css = """ + .has-userpic .entry .contents .userpic, + .has-userpic .comment .contents .userpic { float: right; + margin: 0 0 .5em .5em; } + """; + } """ /* Boxes and Borders */ @@ -140,9 +156,6 @@ text-decoration: none } .entry .poster { display: block; margin: .5em 0; } -.entry .contents .userpic { float: left; - margin: 0 .5em .5em 0; } - .entry .contents { padding: 0 .5em; } .entry-content { margin: 1em 0; } @@ -184,9 +197,6 @@ ul.entry-interaction-links { text-align: .comment .poster-ip { font-size: small; color: #999999; } - -.comment .contents .userpic { float: left; - margin: 0 .5em .5em 0;} .comment-content { margin-top: 1em; } @@ -315,7 +325,7 @@ text-decoration: none; } #footer a:visited { color: $*color_footer_link_visited; } #footer a:hover { color: $*color_footer_link_hover; } - +$userpic_css """; diff -r d835a2e7a4d9 -r fd8f06f706eb bin/upgrading/s2layers/colorside/layout.s2 --- a/bin/upgrading/s2layers/colorside/layout.s2 Mon Jul 05 13:52:07 2010 +0800 +++ b/bin/upgrading/s2layers/colorside/layout.s2 Mon Jul 05 14:17:10 2010 +0800 @@ -6,6 +6,7 @@ layerinfo lang = "en"; set layout_authors = [ { "name" => "branchandroot", "type" => "user" } ]; set layout_type = "two-columns-right"; +set userpics_position = "right"; function print_stylesheet() { var string canvas_colors = generate_color_css( new Color, $*color_page_background, new Color ); @@ -25,6 +26,31 @@ function print_stylesheet() { var string module_alt_link_colors = generate_color_css( $*color_page_link, new Color, new Color ); var string footer_colors = generate_color_css( new Color, $*color_page_background, new Color ); + + var string userpic_css = ""; + if ($*userpics_position == "left") { + $userpic_css = """ + .has-userpic .entry .entry-title, + .has-userpic .comment .comment-title, + .has-userpic .comment .comment-subjecticon, + .has-userpic .comment .datetime { margin: 0 0 0 110px; } + .has-userpic .entry .access-filter, + .has-userpic .entry .restrictions, + .has-userpic .entry .datetime, + .has-userpic .entry .poster, + .has-userpic .comment .poster, + .has-userpic .comment .poster-ip { padding-left: 110px; } + .has-userpic .entry .contents .userpic, + .has-userpic .comment .contents .userpic { left: 5px; } + """; + } + elseif ($*userpics_position == "right") { + $userpic_css = """ + .has-userpic .entry .entry-title { margin: 5px 110px 5px 5px; } + .has-userpic .entry .contents .userpic, + .has-userpic .comment .contents .userpic { right: 5px; } + """; + } """ /* ColorSide */ @@ -102,8 +128,7 @@ width: 96% !important; } margin: 0 0 .5em 0;} .entry .entry-title a, .entry .entry-title a:visited { $entry_title_link_colors } -.entry .entry-title { margin: 5px 110px 5px 5px;; - padding: .15em 0; } +.entry .entry-title { margin: 5px; padding: .15em 0; } .entry .entry-title h3 { font-family: $*font_entry_title; } .entry .restrictions { display: block; @@ -124,8 +149,7 @@ margin: .75em 0; } margin: .75em 0; } .entry .contents .userpic { position: absolute; -top: -1em; -right: 5px;} +top: -1em; } .entry-content { margin-top: 2em; } @@ -173,8 +197,7 @@ ul.entry-interaction-links { text-align: color: #999999; } .comment .contents .userpic { position: absolute; -top: 0; -right: 5px;} +top: 0; } .comment-content { margin-top: 2em; } @@ -315,6 +338,7 @@ text-align: center; } width: 96% !important; padding: 1em 2%; } +$userpic_css """; diff -r d835a2e7a4d9 -r fd8f06f706eb bin/upgrading/s2layers/core2base/layout.s2 --- a/bin/upgrading/s2layers/core2base/layout.s2 Mon Jul 05 13:52:07 2010 +0800 +++ b/bin/upgrading/s2layers/core2base/layout.s2 Mon Jul 05 14:17:10 2010 +0800 @@ -14,6 +14,7 @@ propgroup presentation { property use tags_page_type; property use sidebar_width; property use sidebar_width_doubled; + property use userpics_position; property use entry_metadata_position; property use use_custom_friend_colors; property use use_shared_pic; @@ -25,6 +26,7 @@ set sidebar_width = "15em"; set sidebar_width = "15em"; set sidebar_width_doubled = "30em"; set layout_type = "one-column"; +set userpics_position = "left"; set use_custom_friend_colors = false; set custom_foreground_element = "userpic_border"; set custom_background_element = "userpic_background"; @@ -309,6 +311,16 @@ function Page::print_default_stylesheet( var string module_font = generate_font_css($*font_module_text, $*font_fallback, $*font_module_text_size, $*font_module_text_units); var string module_title_font = generate_font_css($*font_module_heading, $*font_fallback, $*font_module_heading_size, $*font_module_heading_units); + var string userpic_css = ""; + if ($*userpics_position == "right") { + $userpic_css = """ + .entry .userpic, + .comment .userpic { + text-align: right; + } + """; + } + """ H1, H2, H3 { margin: .25em 0; @@ -713,6 +725,8 @@ ul.userlite-interaction-links li { .module-syndicate .module-content { text-align: center; } + +$userpic_css """; } diff -r d835a2e7a4d9 -r fd8f06f706eb bin/upgrading/s2layers/crossroads/layout.s2 --- a/bin/upgrading/s2layers/crossroads/layout.s2 Mon Jul 05 13:52:07 2010 +0800 +++ b/bin/upgrading/s2layers/crossroads/layout.s2 Mon Jul 05 14:17:10 2010 +0800 @@ -61,6 +61,34 @@ else { $commentcolor = $*color_page_background; } + var string userpic_css = ""; + if ($*userpics_position == "left") { + $userpic_css = """ + .entry .contents .userpic, + .comment .contents .userpic { left: 0; } + .entry .header, + .comment-wrapper .header { margin-left: 110px; } + .entry .header .entry-title, + .comment-title { margin-left: -4px; } + .entry-wrapper .contents .entry-poster { margin: 0 0 25px 110px; } + .comment-poster, + .comment .poster-ip { margin-left: 110px; } + """; + } + elseif ($*userpics_position == "right") { + $userpic_css = """ + .entry .contents .userpic, + .comment .contents .userpic { right: 0; } + .entry .header, + .comment-wrapper .header { margin-right: 110px; } + .entry .header .entry-title, + .comment-title { margin-right: -4px; } + .entry-wrapper .contents .entry-poster { margin: 0 110px 25px 0; } + .comment-poster, + .comment .poster-ip { margin-right: 110px; } + """; + } + """ /* Crossroads */ @@ -118,17 +146,13 @@ body { margin: 0; } .entry { border: none; } .entry .header, -.comment-wrapper .header { margin-left: 110px; - min-height: 60px; } - -.entry .header .entry-title { margin-left: -4px; } +.comment-wrapper .header { min-height: 60px; } .entry .contents .userpic, .comment .contents .userpic {width: 106px; height: 106px; position: absolute; top: 0; - left: 0; background: url("$no_icon") center no-repeat; } .entry .contents .userpic a, .comment .contents .userpic a { display: block; @@ -136,8 +160,7 @@ body { margin: 0; } width: 106px; background-color: $*color_page_background;} -.entry-wrapper .contents .entry-poster { display: block; - margin: 0 0 25px 110px; } +.entry-wrapper .contents .entry-poster { display: block; } .page-recent .entry-wrapper .entry-poster, .page-day .entry-wrapper .entry-poster { height: 1em; } @@ -195,7 +218,7 @@ ul.entry-interaction-links { text-align: .partial .comment-title { display: inline; margin: 0; } -.comment-title { margin: 0 0 0 -4px; +.comment-title { margin: 0; padding: .25em; font-size: large; min-height: 1em; @@ -207,12 +230,10 @@ ul.entry-interaction-links { text-align: .comment .header .datetime { display: block; font-size: small;} -.comment-poster {display: block; - margin-left: 110px; } +.comment-poster { display: block; } .comment .poster-ip { font-size: x-small; - display: block; - margin-left: 110px; } + display: block; } .comment-content { margin-top: 2em; padding: .25em .25em .5em .25em; } @@ -399,5 +420,6 @@ margin-top: 1em; } #footer a { color: $*color_page_title; } +$userpic_css """; } diff -r d835a2e7a4d9 -r fd8f06f706eb bin/upgrading/s2layers/fluidmeasure/layout.s2 --- a/bin/upgrading/s2layers/fluidmeasure/layout.s2 Mon Jul 05 13:52:07 2010 +0800 +++ b/bin/upgrading/s2layers/fluidmeasure/layout.s2 Mon Jul 05 14:17:10 2010 +0800 @@ -7,6 +7,7 @@ layerinfo "lang" = "en"; set layout_type = "two-columns-right"; set layout_authors = [ { "name" => "branchandroot", "type" => "user" } ]; +set userpics_position = "right"; set all_commentsubjects = true; function print_module_navlinks() { @@ -92,6 +93,24 @@ function Page::print() function print_stylesheet() { + + var string userpic_css = ""; + if ($*userpics_position == "left") { + $userpic_css = """ + .has-userpic .entry .contents .userpic { float: left; } + .has-userpic .comment .contents .userpic { float: left; + margin: .5em .5em .5em 0; } + .has-userpic .entry .contents .entry-poster { clear: right; /* Fixes display bug in Chrome. Keeps username below entry title. */ } + """; + } + elseif ($*userpics_position == "right") { + $userpic_css = """ + .has-userpic .entry .contents .userpic { float: right; } + .has-userpic .comment .contents .userpic { float: right; + margin: .5em 0 .5em .5em; } + .has-userpic .entry .contents .entry-poster { clear: left; /* Fixes display bug in Chrome. Keeps username below entry title. */ } + """; + } """ /* Fluid Measure */ @@ -262,13 +281,11 @@ float: left; width: 100%; /*asinine IE7 .entry .contents { padding: .5em .5em 0 .5em; } -.entry .contents .userpic { float: right; - margin: 1em .5em .5em .5em; +.entry .contents .userpic { margin: 1em .5em .5em .5em; position: relative; /*more asinine IE7 hackish fixing*/ } .entry .contents .entry-poster { display: block; - margin-top: -.5em; - clear:left; /* Fixes display bug in Chrome. Keeps username below entry title. */ } + margin-top: -.5em; } .entry-content { margin: 1em .5em; } @@ -350,9 +367,6 @@ padding-top: 2em; } /*die in a fire, IE7 .comment .poster-ip { font-size: small; color: #999999; } -.comment .contents .userpic { float: right; - margin: .5em 0 .5em .5em; } - .comment-content { margin-top: 1em; } .comment .edittime { margin-top: 1em; } @@ -561,6 +575,7 @@ border-color: transparent !important; -khtml-border-radius: 1em; } #footer a { color: $*color_footer_link; } +$userpic_css """; } diff -r d835a2e7a4d9 -r fd8f06f706eb bin/upgrading/s2layers/funkycircles/layout.s2 --- a/bin/upgrading/s2layers/funkycircles/layout.s2 Mon Jul 05 13:52:07 2010 +0800 +++ b/bin/upgrading/s2layers/funkycircles/layout.s2 Mon Jul 05 14:17:10 2010 +0800 @@ -105,6 +105,87 @@ function print_stylesheet () { var string entry_footer_link_hover_colors = generate_color_css($*color_entry_footer_link_hover, new Color, new Color); var string entry_footer_link_visited_colors = generate_color_css($*color_entry_footer_link_visited, new Color, new Color); var string entry_list_background = generate_background_css ($*image_entry_list_background_url, $*image_entry_list_background_repeat, "", new Color); + + var string userpic_css = ""; + if ($*userpics_position == "left") { + $userpic_css = """ + .entry .contents .userpic, + .comment .contents .userpic { + left: -2.5em; + } + + .entry .header, + .comment .header { + padding-left: 95px; + } + + .page-recent .entry-wrapper.has-userpic.journal-type-C .entry .contents .poster, + .page-read .entry-wrapper.has-userpic .entry .contents .poster, + .page-network .entry-wrapper.has-userpic .entry .contents .poster, + .page-entry .entry-wrapper.has-userpic .entry .contents .poster, + .page-reply .entry-wrapper.has-userpic .entry .contents .poster, + .page-day .entry-wrapper.has-userpic.journal-type-C .entry .contents .poster, + .page-entry .comment-wrapper.has-userpic .comment .contents .poster, + .page-reply .comment-wrapper.has-userpic .comment .contents .poster { + margin-left: 80px; + } + + .two-columns-left #primary > .inner:first-child, + .three-columns-left #primary > .inner:first-child { + padding: 1em 2em 1em 5em; + } + + .three-columns-sides #primary > .inner:first-child { + padding: 1em 3em 1em 4.5em; + } + + .two-columns-right #primary > .inner:first-child, + .three-columns-right #primary > .inner:first-child { + padding: 1em 3.5em 1em 3.5em; + } + """; + } + elseif ($*userpics_position == "right") { + $userpic_css = """ + .entry .contents .userpic { + right: -1.1em; + } + + .comment .contents .userpic { + right: -2.5em; + } + + .entry .header, + .comment .header { + padding-right: 95px; + } + + .page-recent .entry-wrapper.has-userpic.journal-type-C .entry .contents .poster, + .page-read .entry-wrapper.has-userpic .entry .contents .poster, + .page-network .entry-wrapper.has-userpic .entry .contents .poster, + .page-entry .entry-wrapper.has-userpic .entry .contents .poster, + .page-reply .entry-wrapper.has-userpic .entry .contents .poster, + .page-day .entry-wrapper.has-userpic.journal-type-C .entry .contents .poster, + .page-entry .comment-wrapper.has-userpic .comment .contents .poster, + .page-reply .comment-wrapper.has-userpic .comment .contents .poster { + margin-right: 80px; + } + + .two-columns-left #primary > .inner:first-child, + .three-columns-left #primary > .inner:first-child { + padding: 1em 3.5em 1em 3.5em; + } + + .three-columns-sides #primary > .inner:first-child { + padding: 1em 4.5em 1em 3em; + } + + .two-columns-right #primary > .inner:first-child, + .three-columns-right #primary > .inner:first-child { + padding: 1em 5em 1em 2em; + } + """; + } """ /* Funky Circles */ @@ -199,20 +280,6 @@ h2#pagetitle { margin-top: 6.6em; } -.two-columns-left #primary > .inner:first-child, -.three-columns-left #primary > .inner:first-child { - padding: 1em 2em 1em 5em; - } - -.three-columns-sides #primary > .inner:first-child { - padding: 1em 3em 1em 4.5em; - } - -.two-columns-right #primary > .inner:first-child, -.three-columns-right #primary > .inner:first-child { - padding: 1em 3.5em 1em 2.5em; - } - #secondary > .inner:first-child { padding: 0; } @@ -314,7 +381,6 @@ h2#pagetitle { .entry .header, .comment .header { - padding-left: 95px; padding-bottom: .5em; } @@ -508,7 +574,6 @@ h2#pagetitle { .entry .contents .userpic, .comment .contents .userpic { height: 100px; - left: -2.5em; position: absolute; text-align: center; top: -.7em; @@ -557,7 +622,6 @@ h2#pagetitle { .page-day .entry-wrapper.has-userpic.journal-type-C .entry .contents .poster, .page-entry .comment-wrapper.has-userpic .comment .contents .poster, .page-reply .comment-wrapper.has-userpic .comment .contents .poster { - margin-left: 80px; margin-bottom: 20px; } @@ -1038,6 +1102,8 @@ h2#pagetitle { border-top: 1px solid $*color_footer_link_hover; text-decoration: none; } + +$userpic_css """; } diff -r d835a2e7a4d9 -r fd8f06f706eb bin/upgrading/s2layers/modish/layout.s2 --- a/bin/upgrading/s2layers/modish/layout.s2 Mon Jul 05 13:52:07 2010 +0800 +++ b/bin/upgrading/s2layers/modish/layout.s2 Mon Jul 05 14:17:10 2010 +0800 @@ -6,6 +6,7 @@ layerinfo lang = "en"; set layout_authors = [ { "name" => "branchandroot", "type" => "user" } ]; set layout_type = "two-columns-left"; +set userpics_position = "right"; function print_stylesheet() { @@ -16,6 +17,28 @@ function print_stylesheet() { var string module_navlinks_colors = generate_color_css( $*color_page_title, $*color_page_link, new Color ); var string module_navlinks_active_colors = generate_color_css( new Color, $*color_page_link_active, new Color ); var string footer_colors = generate_color_css( new Color, $*color_footer_background, new Color ); + + var string userpic_css = ""; + if ($*userpics_position == "left") { + $userpic_css = """ + .entry .contents .userpic { float: left; + margin: -1.5em .25em .25em 0; } + .comment .contents .userpic { float: left; + margin: 0 .25em .25em 0; } + .entry .header { text-align: right; } + .entry-title, + .comment-title { text-align: left; } + + """; + } + elseif ($*userpics_position == "right") { + $userpic_css = """ + .entry .contents .userpic { float: right; + margin: -1.5em 0 .25em .25em; } + .comment .contents .userpic { float: right; + margin: 0 0 .25em .25em; } + """; + } """ /* Modish */ @@ -71,9 +94,6 @@ text-decoration: none } .entry .poster { display: block; margin: .5em 0; } - -.entry .contents .userpic { float: right; - margin: -1.5em 0 .25em .25em;} .entry .contents { padding: 0 .5em; } @@ -116,9 +136,6 @@ ul.entry-interaction-links { text-align: .comment .poster-ip { font-size: small; color: #999999; } - -.comment .contents .userpic { float: right; - margin: 0 0 .25em .25em;} .comment-content { margin-top: 1em; } @@ -224,7 +241,7 @@ text-decoration: none; } #footer a:visited { color: $*color_footer_link_visited; } #footer a:hover { color: $*color_footer_link_hover; } - +$userpic_css """; diff -r d835a2e7a4d9 -r fd8f06f706eb bin/upgrading/s2layers/modular/layout.s2 --- a/bin/upgrading/s2layers/modular/layout.s2 Mon Jul 05 13:52:07 2010 +0800 +++ b/bin/upgrading/s2layers/modular/layout.s2 Mon Jul 05 14:17:10 2010 +0800 @@ -5,21 +5,7 @@ layerinfo lang = "en"; layerinfo lang = "en"; set layout_authors = [ { "name" => "branchandroot", "type" => "user" } ]; - -##=============================== -##Layout -##=============================== - set layout_type = "two-columns-left"; - -##=============================== -## Userpic -##=============================== - -propgroup presentation_child { - property use userpics_position; -} - set userpics_position = "right"; ##=============================== @@ -123,11 +109,7 @@ function print_stylesheet () { function print_stylesheet () { var string userpic_css = ""; - if ($*userpics_position == "right") { - $userpic_css = ".entry .userpic, - .comment .userpic { float: right; }"; - } - else { + if ($*userpics_position == "left") { $userpic_css = ".entry .userpic, .comment .userpic { float: left; margin-left: 0 !important; } @@ -137,6 +119,11 @@ var string userpic_css = ""; .entry-title, .comment-title { text-align: left; }"; } + elseif ($*userpics_position == "right") { + $userpic_css = ".entry .userpic, + .comment .userpic { float: right; }"; + } + var string navlinks_css = ""; if ($*module_navlinks_section == "header") { diff -r d835a2e7a4d9 -r fd8f06f706eb bin/upgrading/s2layers/refriedtablet/layout.s2 --- a/bin/upgrading/s2layers/refriedtablet/layout.s2 Mon Jul 05 13:52:07 2010 +0800 +++ b/bin/upgrading/s2layers/refriedtablet/layout.s2 Mon Jul 05 14:17:10 2010 +0800 @@ -84,6 +84,37 @@ function print_stylesheet () { var string page_link_active_colors = generate_color_css($*color_page_link_active, new Color, new Color); var string page_link_hover_colors = generate_color_css($*color_page_link_hover, new Color, new Color); var string page_link_visited_colors = generate_color_css($*color_page_link_visited, new Color, new Color); + + var string userpic_css = ""; + if ($*userpics_position == "left") { + $userpic_css = """ + .has-userpic .entry .header, .has-userpic .entry .poster { + left: 105px; + margin-right: 105px; + } + .entry .inner .userpic { + float: left; + } + .restrictions-18 .entry .userpic, .restrictions-NSFW .entry .userpic { + float: left; + } + """; + } + elseif ($*userpics_position == "right") { + $userpic_css = """ + .has-userpic .entry .header, .has-userpic .entry .poster { + right: 105px; + margin-left: 105px; + } + .entry .inner .userpic { + float: right; + right: 0; + } + .restrictions-18 .entry .userpic, .restrictions-NSFW .entry .userpic { + float: right; + } + """; + } """ /* Refried Tablet CSS */ @@ -322,18 +353,14 @@ and keep subject lines from poking into .has-userpic .entry .header, .has-userpic .entry .poster { position: relative; - left: 105px; - margin-right: 105px; } .entry .inner .userpic { - float: left; position: absolute; top: -4em; } .restrictions-18 .entry .userpic, .restrictions-NSFW .entry .userpic { - float: left; position: absolute; top: -5.25em; } /* the restricted entries have an extra line, so they need extra top space */ @@ -521,7 +548,7 @@ div h2.module-header { color: $*color_comment_text_frozen } - +$userpic_css """; } diff -r d835a2e7a4d9 -r fd8f06f706eb bin/upgrading/s2layers/steppingstones/layout.s2 --- a/bin/upgrading/s2layers/steppingstones/layout.s2 Mon Jul 05 13:52:07 2010 +0800 +++ b/bin/upgrading/s2layers/steppingstones/layout.s2 Mon Jul 05 14:17:10 2010 +0800 @@ -20,6 +20,24 @@ function print_stylesheet() { var string module_header_link_colors = generate_color_css( $*color_module_title, new Color, new Color ); var string footer_colors = generate_color_css( new Color, $*color_footer_background, new Color ); var string footer_link_colors = generate_color_css( $*color_page_title, new Color, new Color ); + + var string userpic_css = ""; + if ($*userpics_position == "left") { + $userpic_css = """ + .entry .contents .userpic { left: -1.5em; } + .comment .contents .userpic { float: left; + margin: 0 .5em .5em -1.5em; } + .entry .header { padding-left: 100px; } + """; + } + elseif ($*userpics_position == "right") { + $userpic_css = """ + .entry .contents .userpic { right: -1.5em; } + .comment .contents .userpic { float: right; + margin: 0 -1.5em .5em .5em; } + .entry .header { padding-right: 100px; } + """; + } """ /* Stepping Stones */ @@ -101,13 +119,10 @@ H1, H2, H3, H4, H5 { font-weight: normal padding: .5em; border: none;} -.entry .header { padding-left: 100px; } - .entry .contents { padding: .5em .5em 0 .5em; } .entry .contents .userpic { position: absolute; top: -3em; - left: -1.5em; width: 110px; height: 110px; $entry_userpic_background @@ -159,9 +174,7 @@ ul.entry-interaction-links { text-align: .comment .poster-ip { font-size: small; color: #999999; } -.comment .contents .userpic { float: left; - margin: 0 .5em .5em -1.5em; - $entry_userpic_background +.comment .contents .userpic { $entry_userpic_background height: 110px; width: 110px; text-align: center; } @@ -281,6 +294,7 @@ text-align: center; } margin: 1em 2em; } #footer a { $footer_link_colors } +$userpic_css """; } diff -r d835a2e7a4d9 -r fd8f06f706eb bin/upgrading/s2layers/tranquilityiii/layout.s2 --- a/bin/upgrading/s2layers/tranquilityiii/layout.s2 Mon Jul 05 13:52:07 2010 +0800 +++ b/bin/upgrading/s2layers/tranquilityiii/layout.s2 Mon Jul 05 14:17:10 2010 +0800 @@ -7,6 +7,7 @@ layerinfo "lang" = "en"; set layout_type = "two-columns-left"; set layout_authors = [ { "name" => "branchandroot", "type" => "user" } ]; +set userpics_position = "right"; ##=============================== ##Text @@ -43,6 +44,24 @@ function print_module_navlinks() { function print_stylesheet () { + + var string userpic_css = ""; + if ($*userpics_position == "left") { + $userpic_css = """ + .has-userpic .entry .contents .userpic { float: left; + margin: 0 1em .5em 0; } + .has-userpic .comment .contents .userpic { float: left; + margin: .5em .5em .5em 0; } + """; + } + elseif ($*userpics_position == "right") { + $userpic_css = """ + .has-userpic .entry .contents .userpic { float: right; + margin: 0 0 .5em 1em; } + .has-userpic .comment .contents .userpic { float: right; + margin: .5em 0 .5em .5em; } + """; + } """ @@ -106,9 +125,6 @@ body { margin: 0; .entry .header { padding: .5em 0; } .entry .header .datetime { font-size: small; } - -.entry .contents .userpic { float: right; - margin: 0 0 .5em 1em; } .entry .contents .entry-poster { display: block; margin-top: .5em; } @@ -167,9 +183,6 @@ ul.entry-interaction-links li.entry-read .comment .poster-ip { font-size: small; color: #999999; } -.comment .contents .userpic { float: right; - margin: .5em 0 .5em .5em; } - .comment-content { margin-top: 1em; } .comment .edittime { margin-top: 1em; } @@ -292,6 +305,7 @@ list-style: none; } #footer { background-color: $*color_footer_background; } #footer a { color: $*color_page_title; } +$userpic_css """; --------------------------------------------------------------------------------