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

[dw-free] Official styles should support placing icon right or left on entries and comments

[commit: http://hg.dwscoalition.org/dw-free/rev/0515604543b9]

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

Option to place userpic on left/right plus CSS for EasyRead.

Patch by [personal profile] ninetydegrees.

Files modified:
  • bin/upgrading/s2layers/easyread/layout.s2
--------------------------------------------------------------------------------
diff -r fd8f06f706eb -r 0515604543b9 bin/upgrading/s2layers/easyread/layout.s2
--- a/bin/upgrading/s2layers/easyread/layout.s2	Mon Jul 05 14:17:10 2010 +0800
+++ b/bin/upgrading/s2layers/easyread/layout.s2	Mon Jul 05 14:32:47 2010 +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_position;
     property use entry_metadata_position;
     property use use_shared_pic;
     property use userlite_interaction_links;
@@ -315,6 +316,45 @@ function Page::print_default_stylesheet 
     var string entry_title_font = generate_font_css($*font_entry_title, $*font_fallback, $*font_entry_title_size, $*font_entry_title_units);
     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 == "left") {
+        $userpic_css = """
+        #primary .header {
+            left: 110px;
+            }
+        .has-userpic .entry .poster {
+            left: 110px;
+            }
+        #comments .userpic a img, .comment-wrapper .userpic a img  {
+            float: left;
+            margin-right: 10px;
+            }
+        #comments .comment-content, .comment-wrapper .comment-content {
+            clear: left;
+            }
+        """;
+    }
+    elseif ($*userpics_position == "right") {
+        $userpic_css = """
+        #primary .header {
+            margin-right: 110px;
+            }
+        .has-userpic .entry .poster {
+            margin-right: 110px;
+            }
+        .has-userpic .entry .contents .userpic {
+            margin-left: auto;
+            }
+        #comments .userpic a img, .comment-wrapper .userpic a img  {
+            float: right;
+            margin-left: 10px;
+            }
+        #comments .comment-content, .comment-wrapper .comment-content {
+            clear: right;
+            }
+        """;
+    }
 
 
 """/* Globals */
@@ -491,7 +531,6 @@ h2.module-header a {
 /* Entry header */
 #primary .header {
     position: relative;
-    left: 110px;
 }
 
 .has-userpic .entry .header {
@@ -548,7 +587,6 @@ h2.module-header a {
 }
 
 .has-userpic .entry .poster {
-    left:110px;
     top:-35px;
     position:relative;
 }
@@ -624,13 +662,10 @@ ul.entry-interaction-links, ul.entry-man
  */
 #comments .userpic a img, .comment-wrapper .userpic a img  {
     border: 0;
-    float: left;
-    margin-right: 10px;
     margin-bottom: 10px;
 }
 
 #comments .comment-content, .comment-wrapper .comment-content {
-    clear: left;
     margin-top: 1em;
     margin-bottom: 1em;
 }
@@ -684,5 +719,7 @@ div.page-top {
     margin-bottom: 10px;
 }
 
+$userpic_css
+
 /* End of CSS file */""";
 }
--------------------------------------------------------------------------------

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