afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2010-01-03 02:21 am

[dw-free] Inbox has tropo-red colours hard-coded

[commit: http://hg.dwscoalition.org/dw-free/rev/5b1173f1e5d1]

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

Remove hard-coding of the red colors from the inbox folder navigation, and
prevents the "All" folder from always being hilighted. Also rename the
"befriended" view to "encircled".

Patch by [personal profile] foxfirefey.

Files modified:
  • bin/upgrading/en.dat
  • cgi-bin/LJ/NotificationInbox.pm
  • cgi-bin/LJ/Widget/InboxFolderNav.pm
  • htdocs/inbox/index.bml
  • htdocs/stc/blueshift/blueshift.css
  • htdocs/stc/celerity/celerity.css
  • htdocs/stc/esn.css
  • htdocs/stc/gradation/gradation-vertical.css
--------------------------------------------------------------------------------
diff -r 611bd8ac71bf -r 5b1173f1e5d1 bin/upgrading/en.dat
--- a/bin/upgrading/en.dat	Sun Jan 03 01:25:41 2010 +0000
+++ b/bin/upgrading/en.dat	Sun Jan 03 02:19:32 2010 +0000
@@ -1973,11 +1973,11 @@ inbox.menu.bookmarks=Bookmarks
 
 inbox.menu.entries_and_comments=Entries & Comments
 
-inbox.menu.friend_updates=Friend Updates
+inbox.menu.circle_updates=Circle Updates
 
 inbox.menu.messages=Messages
 
-inbox.menu.new_friends=New Friends
+inbox.menu.encircled=New People
 
 inbox.menu.new_message.btn=New Message
 
diff -r 611bd8ac71bf -r 5b1173f1e5d1 cgi-bin/LJ/NotificationInbox.pm
--- a/cgi-bin/LJ/NotificationInbox.pm	Sun Jan 03 01:25:41 2010 +0000
+++ b/cgi-bin/LJ/NotificationInbox.pm	Sun Jan 03 02:19:32 2010 +0000
@@ -148,7 +148,7 @@ sub birthday_items {
     return $self->subset_items(@events);
 }
 
-sub befriended_items {
+sub encircled_items {
     my $self = shift;
 
     my @events = ( 'AddedToCircle' );
@@ -551,11 +551,11 @@ sub delete_all {
     } elsif ( $view eq 'circle' ) {
         @items = $self->circle_items;
         push @items, $self->birthday_items;
-        push @items, $self->befriended_items;
+        push @items, $self->encircled_items;
     } elsif ( $view eq 'birthday' ) {
         @items = $self->birthday_items;
-    } elsif ( $view eq 'befriended' ) {
-        @items = $self->befriended_items;
+    } elsif ( $view eq 'encircled' ) {
+        @items = $self->encircled_items;
     } elsif ( $view eq 'entrycomment' ) {
         @items = $self->entrycomment_items;
     } elsif ( $view eq 'bookmark' ) {
@@ -597,11 +597,11 @@ sub mark_all_read {
     } elsif ( $view eq 'circle' ) {
         @items = $self->circle_items;
         push @items, $self->birthday_items;
-        push @items, $self->befriended_items;
+        push @items, $self->encircled_items;
     } elsif ( $view eq 'birthday' ) {
         @items = $self->birthday_items;
-    } elsif ( $view eq 'befriended' ) {
-        @items = $self->befriended_items;
+    } elsif ( $view eq 'encircled' ) {
+        @items = $self->encircled_items;
     } elsif ( $view eq 'entrycomment' ) {
         @items = $self->entrycomment_items;
     } elsif ( $view eq 'bookmark' ) {
diff -r 611bd8ac71bf -r 5b1173f1e5d1 cgi-bin/LJ/Widget/InboxFolderNav.pm
--- a/cgi-bin/LJ/Widget/InboxFolderNav.pm	Sun Jan 03 01:25:41 2010 +0000
+++ b/cgi-bin/LJ/Widget/InboxFolderNav.pm	Sun Jan 03 02:19:32 2010 +0000
@@ -41,6 +41,23 @@ sub render_body {
                       : " <span class='unread_count'></span>";
     };
 
+    my $subfolder_link = sub {
+        my $link_view = shift;
+        my $link_label = shift;
+        my $class = shift || "";
+        my $unread = shift || "";
+        my $img = shift || 0;
+
+        $class .= " active" if $opts{view} eq $link_view;
+
+        my $link = qq{<a href=".?view=$link_view" class="$class" id="esn_folder_$link_view">};
+        $link .= BML::ml( $link_label );
+        $link .= " $img" if $img;
+        $link .= $unread if $unread;
+        $link .= qq{</a>\n};
+        return $link;
+    };
+
     my $remote = LJ::get_remote()
         or return "<?needlogin?>";
 
@@ -51,11 +68,6 @@ sub render_body {
     my $unread_count = $inbox->all_event_count;
     my $alert_plural = $unread_count == 1 ? 'inbox.message' : 'inbox.messages';
     $alert_plural .= $unread_count ? '!' : '.';
-    my $unread_all = $unread_html->($unread_count);
-    my $unread_usermsg_recvd = $unread_html->($inbox->usermsg_recvd_event_count);
-    my $unread_friend = $unread_html->($inbox->circle_event_count);
-    my $unread_entrycomment = $unread_html->($inbox->entrycomment_event_count);
-    my $unread_usermsg_sent = $unread_html->($inbox->usermsg_sent_event_count);
     my $message_button = "";
     $message_button = qq{
         <form action="./compose" method="GET">
@@ -66,15 +78,22 @@ sub render_body {
     $body .= qq{
             $message_button
             <div class="folders"><p>
-            <a href="." id="esn_folder_all"><?_ml inbox.menu.all _ml?>$unread_all</a>};
-    $body .= qq{<a href=".?view=usermsg_recvd" class="subs" id="esn_folder_usermsg_recvd"><?_ml inbox.menu.messages _ml?>$unread_usermsg_recvd</a>} if LJ::is_enabled('user_messaging');
-    $body .= qq{<a href=".?view=circle" class="subs" id="esn_folder_friendplus"><?_ml inbox.menu.friend_updates _ml?>$unread_friend</a>
-            <a href=".?view=birthday" class="subsubs" id="esn_folder_birthday"><?_ml inbox.menu.birthdays _ml?></a>
-            <a href=".?view=befriended" class="subsubs" id="esn_folder_befriended"><?_ml inbox.menu.new_friends _ml?></a><a href=".?view=entrycomment" class="subs" id="esn_folder_entrycomment"><?_ml inbox.menu.entries_and_comments _ml?>$unread_entrycomment</a>
-            <span class="subs">---</span>
-            <a href=".?view=bookmark" class="subs" id="esn_folder_bookmark"><?_ml inbox.menu.bookmarks _ml?> <img src="$LJ::IMGPREFIX/flag_on.gif" width="12" height="14" border="0" /></a>};
-    $body .= qq{<a href=".?view=usermsg_sent" class="subs" id="esn_folder_usermsg_sent"><?_ml inbox.menu.sent _ml?>$unread_usermsg_sent</a>\n} if LJ::is_enabled('user_messaging');
-    $body .= qq{<a href=".?view=archived" class="subs" id="esn_folder_archived"><?_ml inbox.menu.archive _ml?></a>\n} if LJ::is_enabled('esn_archive');
+    };
+    $body .= '<a href="." id="esn_folder_all"';
+    $body .= ' class="active"' unless $opts{view};
+    $body .= "><?_ml inbox.menu.all _ml?>" . $unread_html->( $unread_count ) . "</a>";
+    $body .= $subfolder_link->( "usermsg_recvd", "inbox.menu.messages", "subs", 
+        $unread_html->( $inbox->usermsg_recvd_event_count ) ) if LJ::is_enabled( 'user_messaging' );
+    $body .= $subfolder_link->( "circle", "inbox.menu.circle_updates", "subs", $unread_html->( $inbox->circle_event_count ) );
+    $body .= $subfolder_link->( "birthday", "inbox.menu.birthdays", "subsubs" );
+    $body .= $subfolder_link->( "encircled", "inbox.menu.encircled", "subsubs" );
+    $body .= $subfolder_link->( "entrycomment", "inbox.menu.entries_and_comments", "subs", $unread_html->( $inbox->entrycomment_event_count ) );
+    $body .= qq{<span class="subs">---</span>\n};
+    $body .= $subfolder_link->( "bookmark", "inbox.menu.bookmarks", "subs", "", 
+        qq{<img src="$LJ::IMGPREFIX/flag_on.gif" width="12" height="14" border="0" />} );
+    $body .= $subfolder_link->( "usermsg_sent", "inbox.menu.sent", "subs", 
+        $unread_html->( $inbox->usermsg_sent_event_count ) ) if LJ::is_enabled( 'user_messaging' );
+    $body .= $subfolder_link->( "archived", "inbox.menu.archive", "subs" ) if LJ::is_enabled( 'esn_archive' );
     $body .= qq{
             </p></div>&nbsp;<br />
     };
diff -r 611bd8ac71bf -r 5b1173f1e5d1 htdocs/inbox/index.bml
--- a/htdocs/inbox/index.bml	Sun Jan 03 01:25:41 2010 +0000
+++ b/htdocs/inbox/index.bml	Sun Jan 03 02:19:32 2010 +0000
@@ -61,12 +61,7 @@ body<=
     $selected_folder = "entrycomment" if $selected_folder eq "singleentry";
 
     $selected_folder = qq(
-        <style>#esn_folder_$selected_folder {
-        font-weight: bold;
-        background-color: #ffd8d8;
-        border: 1px solid #bbb;
-        } 
-        .filterlink_$view {display: none;}</style>
+        <style>.filterlink_$view {display: none;}</style>
         );
     $head = $selected_folder;
 
@@ -137,7 +132,7 @@ body<=
     # Inbox Nav
     $body .= qq{
         <table id="table_inbox" style="width: 100%"><tr><td id="table_inbox_folders" valign="top" style="padding-right: 12px">};
-    $body .= LJ::Widget::InboxFolderNav->render( 'page' => 1 );
+    $body .= LJ::Widget::InboxFolderNav->render( 'page' => 1, 'view' => $view );
 
     $body .= qq{
         </td>
diff -r 611bd8ac71bf -r 5b1173f1e5d1 htdocs/stc/blueshift/blueshift.css
--- a/htdocs/stc/blueshift/blueshift.css	Sun Jan 03 01:25:41 2010 +0000
+++ b/htdocs/stc/blueshift/blueshift.css	Sun Jan 03 02:19:32 2010 +0000
@@ -630,8 +630,10 @@ h2.widget-header, .theme-item.current, .
 
 /* inbox */
 
-#esn_folder_all {
-    background-color: #E6ECF9 !important;
+.folders a.active {
+    font-weight: bold;
+    background-color: #E6ECF9;
+    border: 1px solid #3960A0;
 }
 
 /* lj_settings.css */
diff -r 611bd8ac71bf -r 5b1173f1e5d1 htdocs/stc/celerity/celerity.css
--- a/htdocs/stc/celerity/celerity.css	Sun Jan 03 01:25:41 2010 +0000
+++ b/htdocs/stc/celerity/celerity.css	Sun Jan 03 02:19:32 2010 +0000
@@ -650,8 +650,10 @@ h2.widget-header, .theme-item.current, .
 
 /* inbox */
 
-#esn_folder_all {
+.folders a.active {
+    font-weight: bold;
     background-color: #EEEECC !important;
+    border: 1px solid #999966;
 }
 
 /* lj_settings.css */
diff -r 611bd8ac71bf -r 5b1173f1e5d1 htdocs/stc/esn.css
--- a/htdocs/stc/esn.css	Sun Jan 03 01:25:41 2010 +0000
+++ b/htdocs/stc/esn.css	Sun Jan 03 02:19:32 2010 +0000
@@ -251,9 +251,12 @@ span.Pages input {
     text-decoration: none;
     display: block;
     margin: 0px;
-    padding: 0px 0px 1px 2px;
+    padding: 0px 3px 1px 2px; 
 }
 .folders a:hover {
+    background-color: #eee;
+}
+.folders a.active {
     background-color: #eee;
 }
 .folders a.subs {
@@ -295,4 +298,4 @@ span.Pages input {
 
 td#table_inbox_folders { vertical-align: top; }
 
-.folders { margin-top: 1em; }
\ No newline at end of file
+.folders { margin-top: 1em; }
diff -r 611bd8ac71bf -r 5b1173f1e5d1 htdocs/stc/gradation/gradation-vertical.css
--- a/htdocs/stc/gradation/gradation-vertical.css	Sun Jan 03 01:25:41 2010 +0000
+++ b/htdocs/stc/gradation/gradation-vertical.css	Sun Jan 03 02:19:32 2010 +0000
@@ -676,15 +676,17 @@ h2.widget-header, .theme-item.current, .
 }
 
 /*s2propgroup.css */
+
 .graybg {
     background-color: #333;
 }
 
-
 /* inbox */
 
-#esn_folder_all {
-    background-color: #666666 !important;
+.folders a.active {
+    font-weight: bold;
+    background-color: #333333;
+    border: 1px solid #999999;
 }
 
 /* lj_settings.css */
--------------------------------------------------------------------------------