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

[dw-free] Add option to not display userpic on entries

[commit: http://hg.dwscoalition.org/dw-free/rev/57415648a335]

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

Fix for Skittlish Dreams and Brittle which specify same side/opposite rather
than left/right. Also fix for Stepping Stones, Crossroads, Nouveau
Oleanders, which have a placeholder for an icon.

Patch by [personal profile] ninetydegrees.

Files modified:
  • bin/upgrading/s2layers/brittle/layout.s2
  • bin/upgrading/s2layers/crossroads/layout.s2
  • bin/upgrading/s2layers/nouveauoleanders/layout.s2
  • bin/upgrading/s2layers/skittlishdreams/layout.s2
  • bin/upgrading/s2layers/steppingstones/layout.s2
--------------------------------------------------------------------------------
diff -r 8f6c6a6d6324 -r 57415648a335 bin/upgrading/s2layers/brittle/layout.s2
--- a/bin/upgrading/s2layers/brittle/layout.s2	Mon Jun 13 12:38:50 2011 +0800
+++ b/bin/upgrading/s2layers/brittle/layout.s2	Mon Jun 13 13:57:23 2011 +0800
@@ -21,7 +21,7 @@
     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";
+       values = "none|None (don't show)|same|Same side as sidebar|opposite|Opposite the sidebar";
     }
     property use entry_metadata_position;
     property use use_custom_friend_colors;
@@ -294,6 +294,12 @@
     property use text_module_customtext_url;
 }
 
+function prop_init() {
+    if ( $*entryicons_position == "none" ) {
+        $*userpics_position = "none";
+    }
+}
+
 function Page::print_default_stylesheet() {
 
     var string sidebar_position = "";
diff -r 8f6c6a6d6324 -r 57415648a335 bin/upgrading/s2layers/crossroads/layout.s2
--- a/bin/upgrading/s2layers/crossroads/layout.s2	Mon Jun 13 12:38:50 2011 +0800
+++ b/bin/upgrading/s2layers/crossroads/layout.s2	Mon Jun 13 13:57:23 2011 +0800
@@ -150,19 +150,22 @@
     var string comment_noicon = $scaling{$*comment_userpic_style}{"noicon_img"};
     var string comment_noicon_size = $scaling{$*comment_userpic_style}{"noicon_size"};
 
-    var string userpic_css = """
-        .entry .contents .userpic { background: url("$entry_noicon") center no-repeat; }
-        .entry .contents .userpic, .entry .contents .userpic a {
-            width: $entry_noicon_size;
-            height: $entry_noicon_size;
-        }
+    var string userpic_css = "";
 
-        .comment .contents .userpic { background: url("$comment_noicon") center no-repeat; }
-        .comment .contents .userpic, .comment .contents .userpic a {
-            width: $comment_noicon_size;
-            height: $comment_noicon_size;
-        }
-    """;
+    if ($*userpics_position != "none") {
+        $userpic_css = """
+            .entry .contents .userpic { background: url("$entry_noicon") center no-repeat; }
+            .entry .contents .userpic, .entry .contents .userpic a {
+                width: $entry_noicon_size;
+                height: $entry_noicon_size;
+            }
+
+            .comment .contents .userpic { background: url("$comment_noicon") center no-repeat; }
+            .comment .contents .userpic, .comment .contents .userpic a {
+                width: $comment_noicon_size;
+                height: $comment_noicon_size;
+            }
+        """;
         if ($*userpics_position == "left") {
             $userpic_css = $userpic_css + """
             .entry .contents .userpic,
@@ -189,6 +192,7 @@
             .comment .poster-ip { margin-right: $comment_margin; }
             """;
         }
+    }
 
     var string navlinks_css = "";
         if ($*module_navlinks_section == "header") {
diff -r 8f6c6a6d6324 -r 57415648a335 bin/upgrading/s2layers/nouveauoleanders/layout.s2
--- a/bin/upgrading/s2layers/nouveauoleanders/layout.s2	Mon Jun 13 12:38:50 2011 +0800
+++ b/bin/upgrading/s2layers/nouveauoleanders/layout.s2	Mon Jun 13 13:57:23 2011 +0800
@@ -17,7 +17,11 @@
 ##===============================
 
 set layout_type = "two-columns-left";
-property string userpics_position { noui = 1; }
+property string userpics_position {
+    des = "Place of icons in entries and comments";
+    values = "none|None (don't show)|default|Default";
+    }
+set userpics_position = "default";
 set entry_management_links = "text";
 set comment_management_links = "text";
 
@@ -360,10 +364,62 @@
             "icon_link_size" => "50px"
         }
     };
+
     var string comment_datetime_padding = $scaling{$*comment_userpic_style}{"padding"};
     var string entry_icon_background = generate_background_css ($scaling{$*entry_userpic_style}{"noicon_img"}, "no-repeat", "center", new Color);
     var string comment_icon_background = generate_background_css ($scaling{$*comment_userpic_style}{"noicon_img"}, "no-repeat", "center", new Color);
 
+    var string userpic_css = "";
+
+    if ($*userpics_position != "none") {
+        $userpic_css = """
+        .entry .contents .userpic {
+            $entry_icon_background
+            height: $scaling{$*entry_userpic_style}{"icon_wrap_size"};
+            width: $scaling{$*entry_userpic_style}{"icon_wrap_size"};
+            }
+
+        .entry .contents .userpic a {
+            background-color: $*color_page_background;
+            display: block;
+            height: $scaling{$*entry_userpic_style}{"icon_link_size"};
+            width: $scaling{$*entry_userpic_style}{"icon_link_size"};
+            }
+
+        .entry-wrapper-odd .contents .userpic {
+            float: left;
+            margin: 0 1.5em .5em 0;
+            }
+
+        .entry-wrapper-even .contents .userpic {
+            float: right;
+            margin: 0 0 .5em 1.5em;
+            }
+
+        .comment .contents .userpic {
+            $comment_icon_background
+            height: $scaling{$*comment_userpic_style}{"icon_wrap_size"};
+            width: $scaling{$*comment_userpic_style}{"icon_wrap_size"};
+            }
+
+        .comment .contents .userpic a {
+            background-color: $*color_page_background;
+            display: block;
+            height: $scaling{$*comment_userpic_style}{"icon_link_size"};
+            width: $scaling{$*comment_userpic_style}{"icon_link_size"};
+            }
+
+        .comment-wrapper-odd .contents .userpic {
+            float: left;
+            margin: -1em .5em .5em 0;
+            }
+
+        .comment-wrapper-even .contents .userpic {
+            float: right;
+            margin: -1em 0 .5em .5em;
+            }
+        """;
+    }
 
     """
 
@@ -559,29 +615,6 @@
     text-align: right;
     }
 
-.entry .contents .userpic {
-    $entry_icon_background
-    height: $scaling{$*entry_userpic_style}{"icon_wrap_size"};
-    width: $scaling{$*entry_userpic_style}{"icon_wrap_size"};
-}
-
-.entry .contents .userpic a {
-    background-color: $*color_page_background;
-    display: block;
-    height: $scaling{$*entry_userpic_style}{"icon_link_size"};
-    width: $scaling{$*entry_userpic_style}{"icon_link_size"};
-    }
-
-.entry-wrapper-odd .contents .userpic {
-    float: left;
-    margin: 0 1.5em .5em 0;
-    }
-
-.entry-wrapper-even .contents .userpic {
-    float: right;
-    margin: 0 0 .5em 1.5em;
-    }
-
 .entry-wrapper-odd .contents .entry-poster {
     margin-left: -1em;
     }
@@ -791,29 +824,6 @@
     font-size: x-small;
     }
 
-.comment .contents .userpic {
-    $comment_icon_background
-    height: $scaling{$*comment_userpic_style}{"icon_wrap_size"};
-    width: $scaling{$*comment_userpic_style}{"icon_wrap_size"};
-}
-
-.comment .contents .userpic a {
-    background-color: $*color_page_background;
-    display: block;
-    height: $scaling{$*comment_userpic_style}{"icon_link_size"};
-    width: $scaling{$*comment_userpic_style}{"icon_link_size"};
-    }
-
-.comment-wrapper-odd .contents .userpic {
-    float: left;
-    margin: -1em .5em .5em 0;
-    }
-
-.comment-wrapper-even .contents .userpic {
-    float: right;
-    margin: -1em 0 .5em .5em;
-    }
-
 .comment-content {
     margin-top: 1em;
     }
@@ -1028,5 +1038,8 @@
 #footer a {
     color: $*color_footer_link;
     }
+
+    $userpic_css
+
     """;
 }
diff -r 8f6c6a6d6324 -r 57415648a335 bin/upgrading/s2layers/skittlishdreams/layout.s2
--- a/bin/upgrading/s2layers/skittlishdreams/layout.s2	Mon Jun 13 12:38:50 2011 +0800
+++ b/bin/upgrading/s2layers/skittlishdreams/layout.s2	Mon Jun 13 13:57:23 2011 +0800
@@ -33,7 +33,7 @@
     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";
+       values = "none|None (don't show)|same|Same side as sidebar|opposite|Opposite the sidebar";
     }
     property use entry_metadata_position;
     property use use_custom_friend_colors;
@@ -305,6 +305,12 @@
     property use custom_css;
 }
 
+function prop_init() {
+    if ( $*entryicons_position == "none" ) {
+        $*userpics_position = "none";
+    }
+}
+
 function Page::print()
 {
     """
diff -r 8f6c6a6d6324 -r 57415648a335 bin/upgrading/s2layers/steppingstones/layout.s2
--- a/bin/upgrading/s2layers/steppingstones/layout.s2	Mon Jun 13 12:38:50 2011 +0800
+++ b/bin/upgrading/s2layers/steppingstones/layout.s2	Mon Jun 13 13:57:23 2011 +0800
@@ -58,25 +58,29 @@
     var string comment_icon_link_size = $scaling{$*comment_userpic_style}{"icon_link_size"};
 
 
-    var string userpic_css = """
-        .entry .contents .userpic { $entry_icon_background
-            width: $entry_icon_wrap_size;
-            height: $entry_icon_wrap_size;
-        }
-        .entry .contents .userpic a {
-            width: $entry_icon_link_size;
-            height: $entry_icon_link_size;
-        }
+    var string userpic_css = "";
 
-        .comment .contents .userpic { $comment_icon_background
-            width: $comment_icon_wrap_size;
-            height: $comment_icon_wrap_size;
-        }
-        .comment .contents .userpic a {
-            width: $comment_icon_link_size;
-            height: $comment_icon_link_size;
-        }
-    """;
+    if ($*userpics_position != "none") {
+
+        $userpic_css = """
+            .entry .contents .userpic { $entry_icon_background
+                width: $entry_icon_wrap_size;
+                height: $entry_icon_wrap_size;
+            }
+            .entry .contents .userpic a {
+                width: $entry_icon_link_size;
+                height: $entry_icon_link_size;
+            }
+
+            .comment .contents .userpic { $comment_icon_background
+                width: $comment_icon_wrap_size;
+                height: $comment_icon_wrap_size;
+            }
+            .comment .contents .userpic a {
+                width: $comment_icon_link_size;
+                height: $comment_icon_link_size;
+            }
+        """;
 
         if ($*userpics_position == "left") {
             $userpic_css = $userpic_css + """
@@ -96,6 +100,8 @@
            .entry .header { padding-right: $entry_header_padding; }
             """;
         }
+
+    }
     """
 /* Stepping Stones */
 
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org