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] changelog2009-03-28 12:38 pm

[dw-free] Fix inbox link in nav strip

[commit: http://hg.dwscoalition.org/dw-free/rev/2708187a1a11]

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

Make unread count part of the link, and don't show it if there are zero
messages.

Patch by [personal profile] janinedog.

Files modified:
  • cgi-bin/weblib.pl
--------------------------------------------------------------------------------
diff -r 6d4924955c6d -r 2708187a1a11 cgi-bin/weblib.pl
--- a/cgi-bin/weblib.pl	Fri Mar 27 23:37:15 2009 +0000
+++ b/cgi-bin/weblib.pl	Sat Mar 28 12:38:14 2009 +0000
@@ -2956,7 +2956,11 @@ sub control_strip
                  );
 
     if ($remote) {
-        $links{'inbox'} = "<a href='$LJ::SITEROOT/inbox'>$BML::ML{'web.controlstrip.links.inbox'}</a>";
+        my $unread = $remote->notification_inbox->unread_count;
+        $links{inbox} .= "<a href='$LJ::SITEROOT/inbox/'>$BML::ML{'web.controlstrip.links.inbox'}";
+        $links{inbox} .= " ($unread)" if $unread;
+        $links{inbox} .= "</a>";
+
         $links{'view_friends_page'} = "<a href='" . $remote->journal_base . "/read/'>$BML::ML{'web.controlstrip.links.viewreadingpage'}</a>";
         $links{'add_friend'} = "<a href='$LJ::SITEROOT/manage/circle/add.bml?user=$journal->{user}'>$BML::ML{'web.controlstrip.links.addtocircle'}</a>";
         if ($journal->is_syndicated || $journal->is_news) {
@@ -3041,8 +3045,7 @@ sub control_strip
         my $logout = "<input type='submit' value=\"$BML::ML{'web.controlstrip.btn.logout'}\" id='Logout' />";
         $ret .= "$remote_display $logout";
         $ret .= "</div></form>\n";
-        my $unread = $remote->notification_inbox->unread_count;
-        $ret .= "$links{'home'}&nbsp;&nbsp; $links{'post_journal'}&nbsp;&nbsp; $links{'view_friends_page'}&nbsp;&nbsp;$links{'inbox'} ($unread)";
+        $ret .= "$links{'home'}&nbsp;&nbsp; $links{'post_journal'}&nbsp;&nbsp; $links{'view_friends_page'}&nbsp;&nbsp;$links{'inbox'}";
         $ret .= "</td>\n";
 
         $ret .= "<td id='lj_controlstrip_actionlinks' nowrap='nowrap'>";
--------------------------------------------------------------------------------

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