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

[dw-free] Funky Circles: some updates needed due to recent changes

[commit: http://hg.dwscoalition.org/dw-free/rev/8df704cb7163]

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

Add classes to core2 for easier styling of icons page; add styling for icons
page in Funky Circles (journalstyle icons page still off by default).

Refactoring: use (new) core2 functionality to put the class on the li
instead of the enclosed link and fix styling for current view.

Patch by [personal profile] ninetydegrees.

Files modified:
  • bin/upgrading/s2layers/core2.s2
  • bin/upgrading/s2layers/funkycircles/layout.s2
--------------------------------------------------------------------------------
diff -r d3cafbea9bb9 -r 8df704cb7163 bin/upgrading/s2layers/core2.s2
--- a/bin/upgrading/s2layers/core2.s2	Tue Feb 08 20:57:40 2011 +0800
+++ b/bin/upgrading/s2layers/core2.s2	Tue Feb 15 10:51:34 2011 +0800
@@ -5752,7 +5752,7 @@ function ReplyPage::print_body
 
 function IconsPage::print_body {
     print safe "<div class='icons-container'><h2>$*text_icons_page_header</h2><div class='inner'>";
-    """<div><ul>""";
+    """<div class="sorting-options"><ul>""";
     var int sort_ct = 0;
     foreach var string k ($.sort_keyseq) {
         var string text = lang_icon_sortorder_title($k);
@@ -5778,7 +5778,8 @@ function Icon::print {
     var string inactive_class = $.active ? "" : "icon-inactive";
 
     """<div class="icon $default_class $inactive_class">""";
-    """<a href="$.link_url">"""; $.image->print(); """</a>""";
+    """<div class="icon-image"><a href="$.link_url">"""; $.image->print(); """</a></div>""";
+    """<div class="icon-info">""";
     if ($.default) {
         print safe "<div class='default label'>$*text_icons_default</div>";
     }
@@ -5805,7 +5806,7 @@ function Icon::print {
     if ($.description) {
         print safe "<div class='description'><span class='description-text'>$*text_icons_description</span> $.description</div>";
     }
-    """</div>""";
+    """</div></div>""";
 }
 
 ### TagsPage functions
diff -r d3cafbea9bb9 -r 8df704cb7163 bin/upgrading/s2layers/funkycircles/layout.s2
--- a/bin/upgrading/s2layers/funkycircles/layout.s2	Tue Feb 08 20:57:40 2011 +0800
+++ b/bin/upgrading/s2layers/funkycircles/layout.s2	Tue Feb 15 10:51:34 2011 +0800
@@ -124,19 +124,10 @@ set text_comment_from = "Posted by";
 ##===============================
 
 function print_module_navlinks() {
-    var Page p = get_page();
-    open_module("navlinks", "", "");
-    var string[] links = [];
-    
-    println """<ul class="module-list">""";
-    foreach var string k ($p.views_order) {
-        var string css = """$k""";
-        if ($p.view == $k) { $css = """current $k"""; }
-        println """<li class="module-list-item $css"><a href="$p.view_url{$k}" class="$css">"""+lang_viewname($k)+"""</a></li>""";
-    }
-    println "</ul>";
-
-    close_module();
+    # prints as   <li><a class="current view...">
+    # styles may override and change to print_module_navlinks( false )
+    # to print as <li class="current view...">
+    print_module_navlinks( false );
 }
 
 ##===============================
@@ -325,7 +316,8 @@ h2#pagetitle {
     margin-top: 2em;
     }
 
-    .page-tags #primary {
+    .page-tags #primary,
+    .page-icons #primary {
         margin-top: 6.6em;
         }
 
@@ -449,7 +441,8 @@ h2#pagetitle {
     .comment-title,
     .page-tags h2,
     .page-archive h3,
-    .page-month dd h3 {
+    .page-month dd h3,
+    .page-icons h2 {
         text-transform: uppercase;
         }
 
@@ -459,7 +452,8 @@ h2#pagetitle {
         }
 
     .page-tags h2,
-    .page-archive h3 {
+    .page-archive h3,
+    .page-icons h2 {
         $entry_title_font
         }
 
@@ -479,7 +473,8 @@ h2#pagetitle {
 .comment-wrapper.partial,
 .page-month .month .inner,
 .tags-container ul,
-.tags-container .tags_cloud {
+.tags-container .tags_cloud,
+.icons-container .inner {
     $entry_colors
     border-width: 20px;
     border-left: none;
@@ -546,14 +541,83 @@ h2#pagetitle {
                         color: $*color_entry_text;
                         }
 
+.icons-container .inner {
+    margin: 0;
+    padding: 2em;
+    }
+
+.icons-container ul {
+    margin: 0;
+    padding: 0;
+    }
+
+    .icons-container ul li {
+        display: inline;
+        }
+
+.icons-container .sorting-options {
+    text-align: center;
+    }
+
+.icons-container .pages {
+    text-align: right;
+    }
+
+    .icons-container .pages b {
+        font-weight: normal;
+        }
+
+.icons-container .icon {
+    border-bottom: 1px dashed $*color_entry_poster_border;
+    margin: 2em 0;
+    padding-bottom: 2em;
+    }
+
+    .icons-container .icon:last-child {
+        border-bottom: none;
+        margin-bottom: 0;
+        padding-bottom: 0;
+        }
+
+.icons-container .icon-image {
+    display: inline-block;
+    width: 100px;
+    }
+
+.icons-container .icon-info {
+    display: inline-block;
+    margin-left: .5em;
+    vertical-align: top;
+    width: 75%;
+    }
+
+.icons-container .default {
+    font-weight: bold;
+    }
+
+.icons-container .keywords ul {
+    display: inline;
+    }
+
+.icons-container .comment-text,
+.icons-container .description-text,
+.icons-container .keywords .label {
+    font-style: italic;
+    }
+
 .contents a,
 .partial .comment a,
 .page-month .month a,
-.tags-container a {
+.tags-container a,
+.icons-container a {
     $entry_link_colors
     }
 
-    .contents a:visited {
+    .contents a:visited,
+    .partial .comment a:visited,
+    .page-month .month a:visited,
+    .tags-container a:visited,
+    .icons-container a:visited {
         $entry_link_visited_colors
         text-decoration: none;
         }
@@ -561,7 +625,8 @@ h2#pagetitle {
     .contents a:hover,
     .partial .comment a:hover,
     .page-month .month a:hover,
-    .tags-container a:hover {
+    .tags-container a:hover,
+    .icons-container a:hover {
         $entry_link_hover_colors
         text-decoration: none;
         }
@@ -948,7 +1013,7 @@ h2#pagetitle {
         list-style: url($image_module_list_active_url) disc;
         }
 
-    .module-navlinks li a.current {
+    .module-navlinks li.current a {
         $page_link_hover_colors
         text-decoration: underline;
         }
--------------------------------------------------------------------------------