Add option to styles which don't have them. Tweak margins and other CSS as necessary. Rename property to be more consistent with the naming scheme for other properties.
Patch by ninetydegrees.
diffs (414 lines):
diff -r 02abc4b6f22f -r 16e82743fcfb bin/upgrading/s2layers/bases/layout.s2
--- a/bin/upgrading/s2layers/bases/layout.s2 Mon Apr 18 13:51:49 2011 +0800
+++ b/bin/upgrading/s2layers/bases/layout.s2 Tue Apr 19 12:07:58 2011 +0800
@@ -17,6 +17,7 @@ propgroup presentation {
property use use_journalstyle_entry_page;
property use layout_type;
property use tags_page_type;
+ property use userpics_style_group;
property use userpics_position;
property use entry_metadata_position;
property use use_custom_friend_colors;
diff -r 02abc4b6f22f -r 16e82743fcfb bin/upgrading/s2layers/blanket/layout.s2
--- a/bin/upgrading/s2layers/blanket/layout.s2 Mon Apr 18 13:51:49 2011 +0800
+++ b/bin/upgrading/s2layers/blanket/layout.s2 Tue Apr 19 12:07:58 2011 +0800
@@ -17,6 +17,7 @@ propgroup presentation {
property use use_journalstyle_entry_page;
property use layout_type;
property use tags_page_type;
+ property use userpics_style_group;
property use userpics_position;
property use entry_metadata_position;
property use use_custom_friend_colors;
@@ -29,6 +30,8 @@ propgroup presentation {
}
set layout_type = "one-column";
+set entry_userpic_style= "small";
+set comment_userpic_style= "small";
set use_custom_friend_colors = false;
set custom_foreground_element = "userpic_border";
set custom_background_element = "userpic_background";
@@ -356,8 +359,6 @@ h3.entry-title a { $entry_title_colors }
.userpic { display: block; }
.userpic img {
- height: auto;
- max-width: 80px;
padding: 5px;
$userpic_colors
}
diff -r 02abc4b6f22f -r 16e82743fcfb bin/upgrading/s2layers/brittle/layout.s2
--- a/bin/upgrading/s2layers/brittle/layout.s2 Mon Apr 18 13:51:49 2011 +0800
+++ b/bin/upgrading/s2layers/brittle/layout.s2 Tue Apr 19 12:07:58 2011 +0800
@@ -16,6 +16,7 @@ propgroup presentation {
property use layout_type;
property use tags_page_type;
property use sidebar_width;
+ property use userpics_style_group;
property string entryicons_position {
des = "Place icons on the same side or opposite the sidebar";
values = "same|Same side as sidebar|opposite|Opposite the sidebar";
@@ -32,6 +33,8 @@ propgroup presentation {
set sidebar_width = "15em";
set layout_type = "two-columns-right";
+set entry_userpic_style= "small";
+set comment_userpic_style= "small";
set entryicons_position = "opposite";
set use_custom_friend_colors = false;
set custom_foreground_element = "userpic_border";
@@ -315,17 +318,29 @@ function Page::print_default_stylesheet(
var Color blockquote_text = $*color_entry_text -> lighter(10);
var Color blockquote_background = $*color_entry_background -> darker(10);
+ var string entry_userpic_margin = "";
+ if ( $*entry_userpic_style == "" ) { $entry_userpic_margin = "130px"; }
+ elseif ( $*entry_userpic_style == "small" ) { $entry_userpic_margin = "105px"; }
+ elseif ( $*entry_userpic_style == "smaller" ) { $entry_userpic_margin = "80px"; }
+
+ var string comment_userpic_margin = "";
+ if ( $*comment_userpic_style == "" ) { $comment_userpic_margin = "140px"; }
+ elseif ( $*comment_userpic_style == "small" ) { $comment_userpic_margin = "115px"; }
+ elseif ( $*comment_userpic_style == "smaller" ) { $comment_userpic_margin = "90px"; }
+
var string entryicon_css = "";
if ($*entryicons_position == "opposite") {
$entryicon_css = """
div.entry div.userpic,
div.comment div.userpic {
float: $sidebar_position_opposite;
- margin-$sidebar_position_opposite: -100px;
text-align: $sidebar_position;
}
+ div.entry div.userpic {
+ margin-$sidebar_position_opposite: -$entry_userpic_margin;
+ }
div.comment div.userpic {
- margin-$sidebar_position_opposite: -110px;
+ margin-$sidebar_position_opposite: -$comment_userpic_margin;
}
""";
}
@@ -334,15 +349,17 @@ function Page::print_default_stylesheet(
div.entry div.userpic,
div.comment div.userpic {
float: $sidebar_position;
- margin-$sidebar_position: -100px;
text-align: $sidebar_position;
}
+ div.entry div.userpic{
+ margin-$sidebar_position: -$entry_userpic_margin;
+ }
div.comment div.userpic {
- margin-$sidebar_position: -110px;
+ margin-$sidebar_position: -$comment_userpic_margin;
}
#secondary {
- margin-$sidebar_position_opposite: 100px;
- }
+ margin-$sidebar_position_opposite: $entry_userpic_margin;
+ }
""";
}
@@ -492,14 +509,10 @@ h3.entry-title a { color: $*color_entry_
div.entry div.userpic {
display: block;
- height: auto;
margin: 0;
- width: 80px;
}
div.entry div.userpic img {
- max-width: 70px;
- height: auto;
border: 5px solid $*color_navigation_module_background;
}
@@ -717,14 +730,10 @@ textarea.textbox { width: 90%!important
div.comment div.userpic {
display: block;
- height: auto;
margin: 0;
- width: 80px;
}
div.comment div.userpic img {
- max-width: 70px;
- height: auto;
border: 5px solid $*color_navigation_module_background;
}
diff -r 02abc4b6f22f -r 16e82743fcfb bin/upgrading/s2layers/core2.s2
--- a/bin/upgrading/s2layers/core2.s2 Mon Apr 18 13:51:49 2011 +0800
+++ b/bin/upgrading/s2layers/core2.s2 Tue Apr 19 12:07:58 2011 +0800
@@ -1292,24 +1292,23 @@ property bool tags_aware {
noui = 1;
}
-property string[] userpic_style_group {
+property string[] userpics_style_group {
des = "Select the size of icons";
grouptype = "datetime";
}
-set userpic_style_group = ["entry_userpic_style", "comment_userpic_style"];
+set userpics_style_group = ["entry_userpic_style", "comment_userpic_style"];
property string entry_userpic_style {
- des = "In entries";
- doc = "Either '' for 100%, 'small' for 75% and 'smaller' for 50%";
- doc_flags = "[construct]";
- values = "|Full|small|Small|smaller|Smaller";
- grouped = 1;
-}
-
+ des = "In entries";
+ doc = "Either '' for 100%, 'small' for 75% and 'smaller' for 50%";
+ doc_flags = "[construct]";
+ values = "|Full|small|Small|smaller|Smaller";
+ grouped = 1;
+}
property string comment_userpic_style {
- des = "In comments";
- doc = "Either '' for 100%, 'small' for 75% and 'smaller' for 50%";
- doc_flags = "[construct]";
- values = "|Full|small|Small|smaller|Smaller";
+ des = "In comments";
+ doc = "Either '' for 100%, 'small' for 75% and 'smaller' for 50%";
+ doc_flags = "[construct]";
+ values = "|Full|small|Small|smaller|Smaller";
grouped = 1;
}
diff -r 02abc4b6f22f -r 16e82743fcfb bin/upgrading/s2layers/core2base/layout.s2
--- a/bin/upgrading/s2layers/core2base/layout.s2 Mon Apr 18 13:51:49 2011 +0800
+++ b/bin/upgrading/s2layers/core2base/layout.s2 Tue Apr 19 12:07:58 2011 +0800
@@ -14,7 +14,7 @@ propgroup presentation {
property use tags_page_type;
property use sidebar_width;
property use sidebar_width_doubled;
- property use userpic_style_group;
+ property use userpics_style_group;
property use userpics_position;
property use entry_metadata_position;
property use use_custom_friend_colors;
diff -r 02abc4b6f22f -r 16e82743fcfb bin/upgrading/s2layers/drifting/layout.s2
--- a/bin/upgrading/s2layers/drifting/layout.s2 Mon Apr 18 13:51:49 2011 +0800
+++ b/bin/upgrading/s2layers/drifting/layout.s2 Tue Apr 19 12:07:58 2011 +0800
@@ -27,6 +27,7 @@ propgroup presentation
property use num_items_recent;
property use num_items_reading;
property use use_journalstyle_entry_page;
+ property use userpics_style_group;
property use userpics_position;
property use entry_metadata_position;
property use use_custom_friend_colors;
diff -r 02abc4b6f22f -r 16e82743fcfb bin/upgrading/s2layers/easyread/layout.s2
--- a/bin/upgrading/s2layers/easyread/layout.s2 Mon Apr 18 13:51:49 2011 +0800
+++ b/bin/upgrading/s2layers/easyread/layout.s2 Tue Apr 19 12:07:58 2011 +0800
@@ -17,6 +17,7 @@ propgroup presentation {
property use use_journalstyle_entry_page;
property use layout_type;
property use tags_page_type;
+ property use userpics_style_group;
property use userpics_position;
property use entry_metadata_position;
property use use_custom_friend_colors;
@@ -304,17 +305,37 @@ function Page::print_default_stylesheet
var string module_font = generate_font_css($*font_module_text, $*font_base, $*font_fallback, $*font_module_text_size, $*font_module_text_units);
var string module_title_font = generate_font_css($*font_module_heading, $*font_base, $*font_fallback, $*font_module_heading_size, $*font_module_heading_units);
-var string entrytitle_padding = $*use_custom_friend_colors ? "padding: .2em;" : "";
+ var string entry_contentsfooter_shift = "";
+ if ( $*entry_userpic_style == "" ) { $entry_contentsfooter_shift = "84px"; }
+ elseif ( $*entry_userpic_style == "small" ) { $entry_contentsfooter_shift = "59px"; }
+ elseif ( $*entry_userpic_style == "smaller" ) { $entry_contentsfooter_shift = "34px"; }
+
+ var string entry_header_margin = "";
+ if ( $*entry_userpic_style == "" ) { $entry_header_margin = "110px"; }
+ elseif ( $*entry_userpic_style == "small" ) { $entry_header_margin = "85px"; }
+ elseif ( $*entry_userpic_style == "smaller" ) { $entry_header_margin = "60px"; }
+
+ var string comment_header_margin = "";
+ if ( $*comment_userpic_style == "" ) { $comment_header_margin = "110px"; }
+ elseif ( $*comment_userpic_style == "small" ) { $comment_header_margin = "85px"; }
+ elseif ( $*comment_userpic_style == "smaller" ) { $comment_header_margin = "60px"; }
+
+ var string entrytitle_padding = $*use_custom_friend_colors ? "padding: .2em;" : "";
var string userpic_css = "";
if ($*userpics_position == "left") {
$userpic_css = """
- #primary .header {
- margin-left: 110px;
+ .has-userpic .entry .header {
+ margin-left: $entry_header_margin;
}
+ .has-userpic .comment .header {
+ margin-left: $comment_header_margin;
+ }
+
.has-userpic .entry .poster {
- margin-left: 110px;
+ margin-left: $entry_header_margin;
}
+
#comments .userpic a img, .comment-wrapper .userpic a img {
float: left;
margin-right: 10px;
@@ -326,15 +347,21 @@ var string entrytitle_padding = $*use_cu
}
elseif ($*userpics_position == "right") {
$userpic_css = """
- #primary .header {
- margin-right: 110px;
+ .has-userpic .entry .header {
+ margin-right: $entry_header_margin;
}
+ .has-userpic .comment .header {
+ margin-right: $comment_header_margin;
+ }
+
.has-userpic .entry .poster {
- margin-right: 110px;
+ margin-right: $entry_header_margin;
}
+
.has-userpic .entry .contents .userpic {
- margin-left: auto;
+ text-align: right;
}
+
#comments .userpic a img, .comment-wrapper .userpic a img {
float: right;
margin-left: 10px;
@@ -578,13 +605,7 @@ h2.module-header a {
.entry .contents .userpic a img {
border: 0;
- margin-right: 10px;
margin-bottom: 10px;
-}
-
-.has-userpic .entry .contents .userpic {
- height: 100px;
- width: 100px;
}
.has-userpic .entry .poster {
@@ -596,13 +617,13 @@ h2.module-header a {
/* Pushed down in order to accomodate the header being next to the icon. */
.entry .contents {
position: relative;
- bottom: 84px;
+ bottom: $entry_contentsfooter_shift;
}
/* Single post metadata links location/etc. */
.entry .footer {
position: relative;
- bottom: 84px;
+ bottom: $entry_contentsfooter_shift;
}
/* Entry/Comment links */
diff -r 02abc4b6f22f -r 16e82743fcfb bin/upgrading/s2layers/negatives/layout.s2
--- a/bin/upgrading/s2layers/negatives/layout.s2 Mon Apr 18 13:51:49 2011 +0800
+++ b/bin/upgrading/s2layers/negatives/layout.s2 Tue Apr 19 12:07:58 2011 +0800
@@ -17,6 +17,7 @@ propgroup presentation {
property use use_journalstyle_entry_page;
property use layout_type;
property use tags_page_type;
+ property use userpics_style_group;
property use userpics_position;
property use entry_metadata_position;
property use use_custom_friend_colors;
diff -r 02abc4b6f22f -r 16e82743fcfb bin/upgrading/s2layers/skittlishdreams/layout.s2
--- a/bin/upgrading/s2layers/skittlishdreams/layout.s2 Mon Apr 18 13:51:49 2011 +0800
+++ b/bin/upgrading/s2layers/skittlishdreams/layout.s2 Tue Apr 19 12:07:58 2011 +0800
@@ -28,6 +28,7 @@ propgroup presentation {
property use layout_type;
property use sidebar_width;
property use tags_page_type;
+ property use userpics_style_group;
property string entryicons_position {
des = "Place icons on the same side or opposite the sidebar";
values = "same|Same side as sidebar|opposite|Opposite the sidebar";
@@ -464,13 +465,37 @@ function Page::print_default_stylesheet
var string navigation_colors = generate_color_css($*color_page_details_text, $*color_entry_background, new Color);
+
+ var string entry_userpic_shift = "";
+ if ( $*entry_userpic_style == "" ) { $entry_userpic_shift = "-66px"; }
+ elseif ( $*entry_userpic_style == "small" ) { $entry_userpic_shift = "-50px"; }
+ elseif ( $*entry_userpic_style == "smaller" ) { $entry_userpic_shift = "-33px"; }
+
+ var string comment_userpic_shift = "";
+ if ( $*comment_userpic_style == "" ) { $comment_userpic_shift = "-66px"; }
+ elseif ( $*comment_userpic_style == "small" ) { $comment_userpic_shift = "-50px"; }
+ elseif ( $*comment_userpic_style == "smaller" ) { $comment_userpic_shift = "-33px"; }
+
+
+ var string entry_title_margin = "";
+ if ( $*entry_userpic_style == "" ) { $entry_title_margin = "120px"; }
+ elseif ( $*entry_userpic_style == "small" ) { $entry_title_margin = "95px"; }
+ elseif ( $*entry_userpic_style == "smaller" ) { $entry_title_margin = "70px"; }
+
+ var string comment_title_margin = "";
+ if ( $*comment_userpic_style == "" ) { $comment_title_margin = "120px"; }
+ elseif ( $*comment_userpic_style == "small" ) { $comment_title_margin = "95px"; }
+ elseif ( $*comment_userpic_style == "smaller" ) { $comment_title_margin = "70px"; }
+
var string entryicon_css = "";
if ($*entryicons_position == "same") {
$entryicon_css = """
- .two-columns-right .has-userpic .entry-title,
- .two-columns-right .has-userpic .comment-title { margin: 0 120px .5em 0; }
- .two-columns-left .has-userpic .entry-title,
- .two-columns-left .has-userpic .comment-title { margin: 0 0 .5em 120px; }
+ .two-columns-right .has-userpic .entry-title { margin: 0 $entry_title_margin .5em 0; }
+ .two-columns-right .has-userpic .comment-title { margin: 0 $comment_title_margin .5em 0; }
+
+ .two-columns-left .has-userpic .entry-title { margin: 0 0 .5em $entry_title_margin; }
+ .two-columns-left .has-userpic .comment-title { margin: 0 0 .5em $comment_title_margin; }
+
.two-columns-right .entry .userpic a,
.two-columns-right .comment .userpic a { right: 10px; left: auto; }
.two-columns-left .entry .userpic a,
@@ -479,10 +504,12 @@ function Page::print_default_stylesheet
}
elseif ($*entryicons_position == "opposite") {
$entryicon_css = """
- .two-columns-right .has-userpic .entry-title,
- .two-columns-right .has-userpic .comment-title { margin: 0 0 .5em 120px; }
- .two-columns-left .has-userpic .entry-title,
- .two-columns-left .has-userpic .comment-title { margin: 0 120px .5em 0; }
+ .two-columns-right .has-userpic .entry-title { margin: 0 0 .5em $entry_title_margin; }
+ .two-columns-right .has-userpic .comment-title { margin: 0 0 .5em $comment_title_margin; }
+
+ .two-columns-left .has-userpic .entry-title { margin: 0 $entry_title_margin .5em 0; }
+ .two-columns-left .has-userpic .comment-title { margin: 0 $comment_title_margin .5em 0; }
+
.two-columns-right .entry .userpic a,
.two-columns-right .comment .userpic a { left: 10px; right: auto; }
.two-columns-left .entry .userpic a,
@@ -629,7 +656,15 @@ h1, h2, h3, h4 {font-weight: 700; font-v
.entry-wrapper-even .entry-title, .comment-wrapper-even .comment-title {border: solid 1px $*color_entry_title_border_alt; $entry_title_colors }
.userpic a {background-color: $*color_page_border; border: 0px; }
-.entry .userpic a, .comment .userpic a {background-color: $*color_entry_background; border: solid 2px $*color_page_border; display: block; position: absolute; top: -66px; padding: 5px; }
+.entry .userpic a, .comment .userpic a {background-color: $*color_entry_background; border: solid 2px $*color_page_border; display: block; position: absolute; padding: 5px; }
+
+.entry .userpic a {
+ top: $entry_userpic_shift;
+ }
+
+.comment .userpic a {
+ top: $comment_userpic_shift;
+ }
.entry .userpic img, .comment .userpic img {border: none; }
.no-userpic .comment {margin-top: 20px; }