Add manage link for linklist module; add styling for dw-free styles.

        Patch by ninetydegrees. 

diffs (207 lines):

diff -r 5c1c10d3fd31 -r 059296bcecab bin/upgrading/s2layers/bases/layout.s2
--- a/bin/upgrading/s2layers/bases/layout.s2    Mon Feb 21 21:21:31 2011 +0800
+++ b/bin/upgrading/s2layers/bases/layout.s2    Tue Feb 22 10:30:02 2011 +0800
@@ -595,18 +595,28 @@ ul ul {list-style: circle;}
 .module-typelist .module-list .module-list-item {list-style-type: square; 
color: $*color_module_text; font-size: 0.833em; }
 .module-typelist .module-list .module-list-item a { text-align: left; 
font-size: 1.2em;}
 
-.module-tags_list .manage-tags-link {border-top: 0.083em solid 
$*color_module_border; padding-top: 0.5em; padding-bottom: 0.5em; text-align: 
center;}
-
 .module-tags_cloud .module-list {padding: 0.5em;}
 .module-tags_cloud li, .tags_cloud li {display: inline; list-style-type: none;}
-.module-tags_cloud .manage-tags-link {border-top: 0.083em solid 
$*color_module_border; margin-top: 0.5em; text-align: center;}
+
+.module-tags_cloud .manage-link {
+    border-top: .083em solid $*color_module_border;
+    margin-top: .5em;
+    text-align: center;
+    }
 
 .module-tags_multilevel .module-list { padding: 0.5em; margin: 0; }
 .module-tags_multilevel .module-list .module-list { border-top: 0.083em solid 
$*color_module_border; border-bottom: 0; padding: 1em; }
 .module-tags_multilevel .module-list .module-list-item {list-style-type: none; 
color: $*color_module_text;  border-bottom: 0.083em solid 
$*color_module_border; margin: 0;  }
 .module-tags_multilevel .module-list .module-list-item a { text-align: left; }
 
-.module-tags_multilevel .manage-tags-link {border-top: 0.083em solid 
$*color_module_border; padding-top: 0.5em; padding-bottom: 0.5em; text-align: 
center;}
+.module-typelist .manage-link,
+.module-tags_list .manage-link,
+.module-tags_multilevel .manage-link {
+    border-top: .083em solid $*color_module_border;
+    padding-bottom: .5em;
+    padding-top: .5em;
+    text-align: center;
+    }
 
 /* -------- summary -------- */
 
diff -r 5c1c10d3fd31 -r 059296bcecab bin/upgrading/s2layers/brittle/layout.s2
--- a/bin/upgrading/s2layers/brittle/layout.s2  Mon Feb 21 21:21:31 2011 +0800
+++ b/bin/upgrading/s2layers/brittle/layout.s2  Tue Feb 22 10:30:02 2011 +0800
@@ -855,9 +855,9 @@ ul.userlite-interaction-links.icon-links
 .tags_cloud li, .module-tags_cloud li { display: inline;
     list-style-type: none; }
 
-.manage-tags-link {
+.manage-link {
+    font-size: smaller;
     text-align: right;
-    font-size: smaller;
     text-transform: uppercase;
     }
 
diff -r 5c1c10d3fd31 -r 059296bcecab 
bin/upgrading/s2layers/compartmentalize/layout.s2
--- a/bin/upgrading/s2layers/compartmentalize/layout.s2 Mon Feb 21 21:21:31 
2011 +0800
+++ b/bin/upgrading/s2layers/compartmentalize/layout.s2 Tue Feb 22 10:30:02 
2011 +0800
@@ -294,8 +294,8 @@ div.module-navlinks ul.module-list {
     text-transform: uppercase;
     }
 
-div.manage-tags-link {
-    margin: .5em 0 0 0;
+div.manage-link {
+    margin: .5em 0 0;
     text-align: right;
     text-transform: uppercase;
     }
diff -r 5c1c10d3fd31 -r 059296bcecab bin/upgrading/s2layers/core2.s2
--- a/bin/upgrading/s2layers/core2.s2   Mon Feb 21 21:21:31 2011 +0800
+++ b/bin/upgrading/s2layers/core2.s2   Tue Feb 22 10:30:02 2011 +0800
@@ -287,6 +287,7 @@ class UserLite
     function builtin ljuser(Color link_color) : string "Returns an LJ user tag 
for the user.  The color of the link will be link_color.";
     function builtin get_link(string key) : Link "Returns a link based on the 
given key, or null if the link is unavailable";
     function base_url () : string "Returns URL of user's journal.";
+    function linklist_manage_url () : string "Returns URL to user's tag 
management page.";
     function tag_manage_url () : string "Returns URL to user's tag management 
page.";
     function print_interaction_links() "Print the interaction links for this 
user/journal.";
     function as_string() : string;
@@ -2514,6 +2515,11 @@ set text_tags_item_sep = ",";
 ## Text - misc strings, not popular enough to expose in wizard
 ##================================================================
 
+property string text_linklist_manage {
+    des = "Text to use to link to this journal's links list management page.";
+    example = "Manage Links";
+}
+
 property string text_default_separator {
     des = "Text used to separate items";
     maxlength = 5;
@@ -2573,6 +2579,7 @@ property string text_calendar_num_entrie
     example = "1 entry // # entries";
 }
 
+set text_linklist_manage = "Manage Links";
 set text_default_separator = " | ";
 set text_view_month = "View Subjects";
 set text_generated_on = "Page generated";
@@ -3213,6 +3220,12 @@ function UserLite::base_url() [fixed] : 
     return userlite_base_url($this);
 }
 
+function UserLite::linklist_manage_url() [fixed] : string
+"Returns a link to the user's links list management page. Overriding this 
function is NOT RECOMMENDED. Overriding this function could prevent sitewide 
improvements to styles, accessibility, or other functionality from operating in 
your layout."
+{
+    return "$*SITEROOT/customize/options?group=linkslist&authas=$.username";
+}
+
 function UserLite::tag_manage_url() [fixed] : string
 "Returns a link to the user's tag management page. Overriding this function is 
NOT RECOMMENDED. Overriding this function could prevent sitewide improvements 
to styles, accessibility, or other functionality from operating in your layout."
 {
@@ -3625,10 +3638,16 @@ function server_sig()
     """<span id="site-branding">$*text_powered_by <a 
href="$*SITEROOT/">$*SITENAME</a></span>""";
 }
 
+function print_linklist_manage_link() "Prints out a link to the links list 
management page, if the viewer can manage the list."
+{
+    var Page p = get_page();
+    print (viewer_is_owner() or viewer_is_admin()) ? "<div 
class=\"manage-link\"><a href=\"" + $p.journal->linklist_manage_url() + 
"\">$*text_linklist_manage</a></div>" : "";
+}
+
 function print_tag_manage_link() "Prints out a link to the tag management 
page, if the viewer can manage tags."
 {
     var Page p = get_page();
-    print viewer_can_manage_tags() ? "<div class=\"manage-tags-link\"><a 
href=\"" + $p.journal->tag_manage_url() + "\">$*text_tags_manage</a></div>" : 
"";
+    print viewer_can_manage_tags() ? "<div class=\"manage-link 
manage-tags-link\"><a href=\"" + $p.journal->tag_manage_url() + 
"\">$*text_tags_manage</a></div>" : "";
 }
 
 function print_list_tags(TagDetail[] tagslist, string{} opts) "Prints out a 
list of tags. Takes as arguments the taglist and a hash with optional arguments 
'list-class' and 'item-class'. 'print_uses' option can be 'number', 'text' or 
'title' to determine whether to display the uses as a number, as full text, or 
in the link title. It defaults to full text"
@@ -4217,6 +4236,7 @@ function print_module_links() {
     }
     if ($box_open) {
         print_module_list($items);
+        print_linklist_manage_link();
         close_module();
     }
 }
diff -r 5c1c10d3fd31 -r 059296bcecab bin/upgrading/s2layers/drifting/layout.s2
--- a/bin/upgrading/s2layers/drifting/layout.s2 Mon Feb 21 21:21:31 2011 +0800
+++ b/bin/upgrading/s2layers/drifting/layout.s2 Tue Feb 22 10:30:02 2011 +0800
@@ -488,7 +488,7 @@ function Page::print_default_stylesheet(
         display: inline;
         }
 
-    #secondary .manage-tags-link {
+    #secondary .manage-link {
         margin-bottom: 1em;
         text-align: center;
     }
diff -r 5c1c10d3fd31 -r 059296bcecab bin/upgrading/s2layers/easyread/layout.s2
--- a/bin/upgrading/s2layers/easyread/layout.s2 Mon Feb 21 21:21:31 2011 +0800
+++ b/bin/upgrading/s2layers/easyread/layout.s2 Tue Feb 22 10:30:02 2011 +0800
@@ -499,11 +499,15 @@ h2.module-header a {
     display: inline;
 }
 
-.module-tags_list .manage-tags-link:before {
+.module-typelist .manage-link:before,
+.module-tags_list .manage-link:before,
+.module-tags_multilevel .manage-link:before {
     content: "(";
 }
 
-.module-tags_list .manage-tags-link:after {
+.module-typelist .manage-link:after,
+.module-tags_list .manage-link:after,
+.module-tags_multilevel .manage-link:after {
     content: ")";
 }
 
diff -r 5c1c10d3fd31 -r 059296bcecab bin/upgrading/s2layers/negatives/layout.s2
--- a/bin/upgrading/s2layers/negatives/layout.s2        Mon Feb 21 21:21:31 
2011 +0800
+++ b/bin/upgrading/s2layers/negatives/layout.s2        Tue Feb 22 10:30:02 
2011 +0800
@@ -396,9 +396,11 @@ function Page::print_default_stylesheet(
     #secondary .module-header a {
         color: $*color_module_title;
     }
-    #secondary .manage-tags-link {
+
+    .manage-link {
         text-align: center;
     }
+
     .module {
         letter-spacing:.3em;
         padding: 0.5em 0;
@@ -562,10 +564,6 @@ function Page::print_default_stylesheet(
     }
     .tags-container a:active {
         color: $*color_entry_link_active !important;
-    }
-
-    .page-tags .manage-tags-link {
-        text-align: center;
     }
 
     .module-section-two .module,
diff -r 5c1c10d3fd31 -r 059296bcecab 
bin/upgrading/s2layers/practicality/layout.s2
--- a/bin/upgrading/s2layers/practicality/layout.s2     Mon Feb 21 21:21:31 
2011 +0800
+++ b/bin/upgrading/s2layers/practicality/layout.s2     Tue Feb 22 10:30:02 
2011 +0800
@@ -409,7 +409,7 @@ div.module-navlinks a {
     color: $*color_module_title;
     }
 
-div.manage-tags-link {
+div.manage-link {
     margin: 10px 0 0;
     text-align: right;
     }
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to