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

[dw-free] Styles: make links display correctly when icons are switched to text and vice versa

[commit: http://hg.dwscoalition.org/dw-free/rev/1009397cf4f2]

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

Add styling classes to the ULs when the links can be displayed as either
text or icons. Fix display in Bases, Tabula Rasa-based layouts, and Drifting
in the non-default case.

Patch by [personal profile] ninetydegrees.

Files modified:
  • bin/upgrading/s2layers/bases/layout.s2
  • bin/upgrading/s2layers/core2.s2
  • bin/upgrading/s2layers/core2base/layout.s2
  • bin/upgrading/s2layers/drifting/layout.s2
  • bin/upgrading/s2layers/refriedtablet/layout.s2
--------------------------------------------------------------------------------
diff -r a4b0829dcccd -r 1009397cf4f2 bin/upgrading/s2layers/bases/layout.s2
--- a/bin/upgrading/s2layers/bases/layout.s2	Mon Aug 23 19:40:17 2010 +0800
+++ b/bin/upgrading/s2layers/bases/layout.s2	Tue Aug 24 19:16:33 2010 +0800
@@ -608,6 +608,41 @@ border-bottom: 0.083em solid $*color_ent
 .entry-management-links { margin: 0.583em 0.583em 0 0; list-style: none; display: inline; float: right;}
 .entry-management-links li {display: inline; margin: 0 0.25em 0 0.25em; }
 
+.entry-management-links.text-links {
+    border-top: .083em solid $*color_entry_background;
+    border-bottom: .083em solid $*color_module_title_background;
+    display: block;
+    float: none;
+    line-height: 2.332em;
+    list-style: none;
+    margin: 0;
+    padding-right: .583em;
+    text-align: right;
+    }
+
+.entry-management-links.text-links li {
+    border-right: .083em solid $*color_entry_background;
+    display: inline;
+    margin: 0 0 0 -0.25em;
+    padding: .583em 0 !important;
+    }
+
+.entry-management-links.text-links li:first-child {
+    border-left: .083em solid $*color_entry_background;
+    margin: 0;
+    }
+
+.entry-management-links.text-links a {
+    color: $*color_entry_interaction_links !important;
+    font-weight: bold;
+    padding: .583em .833em;
+    }
+
+.entry-management-links.text-links a:hover {
+    background: $*color_module_link_hover;
+    text-decoration: underline;
+    }
+
 .entry-management-links img { border-bottom: 0.083em solid transparent; padding: 0 0.25em 0.25em 0.25em; }
 .entry-management-links img:hover { border-bottom: 0.083em solid $*color_entry_interaction_links; opacity: 0.7; }
 
diff -r a4b0829dcccd -r 1009397cf4f2 bin/upgrading/s2layers/core2.s2
--- a/bin/upgrading/s2layers/core2.s2	Mon Aug 23 19:40:17 2010 +0800
+++ b/bin/upgrading/s2layers/core2.s2	Tue Aug 24 19:16:33 2010 +0800
@@ -3073,7 +3073,10 @@ function UserLite::print_interaction_lin
 function UserLite::print_interaction_links()
 "This function prints the \"subscribe to journal, add user to access list, post to community, track journal, etc, etc\" items, and wraps them in a standarized class."
 {
-    """<ul class="userlite-interaction-links">""";
+
+    var string display_type = ($*userlite_interaction_links == "text") ? " text-links" : " icon-links";
+
+    """<ul class="userlite-interaction-links$display_type">""";
     # FIXME: HTML is not valid if there are no items inside a list, so there should be a
     # check that there are user interaction links before opening the ul class.
     var Link link;
@@ -4515,9 +4518,12 @@ function Comment::print_management_links
 function Comment::print_management_links()
 "Prints comment management links, aka delete/screen/freeze/track."
 {
+
+    var string display_type = ($*comment_management_links == "text") ? " text-links" : " icon-links";
+
     # FIXME: HTML is not valid if there are no items inside a list, so there should
     # be a check that there are comment management links before opening the ul class.
-    """<ul class="comment-management-links">""";
+    """<ul class="comment-management-links$display_type">""";
     var Link link;
     var int count;
     var string extras;
@@ -4592,11 +4598,13 @@ function Entry::print_management_links()
     ## There's no point in showing previous/next links on pages which show
     ## multiple entries anyway, so we only print them on EntryPage and ReplyPage.
 
+    var string display_type = ($*entry_management_links == "text") ? " text-links" : " icon-links";
+
     var Page p = get_page();
     var int count;
     var string extras;
     $count = 0;
-    """<ul class="entry-management-links">""";
+    """<ul class="entry-management-links$display_type">""";
     var bool show_interentry = ($p.view == "entry" or $p.view == "reply");
     if ($show_interentry) {
         $count ++;
diff -r a4b0829dcccd -r 1009397cf4f2 bin/upgrading/s2layers/core2base/layout.s2
--- a/bin/upgrading/s2layers/core2base/layout.s2	Mon Aug 23 19:40:17 2010 +0800
+++ b/bin/upgrading/s2layers/core2base/layout.s2	Tue Aug 24 19:16:33 2010 +0800
@@ -678,14 +678,20 @@ table.month td p {
 .module-user-links .module-content {
     text-align: center;
 }
-ul.userlite-interaction-links {
+
+ul.userlite-interaction-links.icon-links {
     list-style: none;
     margin-left: 0;
     padding-left: 0;
 }
-ul.userlite-interaction-links li {
+
+ul.userlite-interaction-links.icon-links li {
     display: inline;
     padding: 0 .20em;
+}
+
+ul.userlite-interaction-links.text-links {
+    text-align: left;
 }
 
 .module-calendar .module-content {
diff -r a4b0829dcccd -r 1009397cf4f2 bin/upgrading/s2layers/drifting/layout.s2
--- a/bin/upgrading/s2layers/drifting/layout.s2	Mon Aug 23 19:40:17 2010 +0800
+++ b/bin/upgrading/s2layers/drifting/layout.s2	Tue Aug 24 19:16:33 2010 +0800
@@ -471,6 +471,15 @@ function Page::print_default_stylesheet(
         font-size: 0.8em;
         padding-right: 5px;
     }
+
+    .userlite-interaction-links.icon-links {
+        padding: 0;
+        text-align: center;
+        }
+
+    .userlite-interaction-links.icon-links li {
+        display: inline;
+        }
 
     #secondary .manage-tags-link {
         font-size: 0.8em;
diff -r a4b0829dcccd -r 1009397cf4f2 bin/upgrading/s2layers/refriedtablet/layout.s2
--- a/bin/upgrading/s2layers/refriedtablet/layout.s2	Mon Aug 23 19:40:17 2010 +0800
+++ b/bin/upgrading/s2layers/refriedtablet/layout.s2	Tue Aug 24 19:16:33 2010 +0800
@@ -467,7 +467,7 @@ div h2.module-header {
 }
 
 /* special case for the profile module, make user interaction links properly space and align */
-.module-userprofile .userlite-interaction-links {
+.module-userprofile .userlite-interaction-links.icon-links {
     margin-top: 1em;
     margin-left: 0em;
 }
--------------------------------------------------------------------------------