pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
Res facta quae tamen fingi potuit ([personal profile] pauamma) wrote in [site community profile] changelog2009-03-09 05:29 pm

[dw-free] Add Inbox count to navigation strip

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

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

Add link to inbox (with unread count) to logged-in navstrip.

Patch by [staff profile] denise.

Files modified:
  • bin/upgrading/en.dat
  • cgi-bin/weblib.pl
--------------------------------------------------------------------------------
diff -r 39affe0d6b77 -r f9a6baa87a1e bin/upgrading/en.dat
--- a/bin/upgrading/en.dat	Sun Mar 08 02:39:57 2009 +0000
+++ b/bin/upgrading/en.dat	Mon Mar 09 17:28:27 2009 +0000
@@ -3178,6 +3178,8 @@ web.controlstrip.btn.logout=Log out
 
 web.controlstrip.btn.view=View
 
+web.controlstrip.btn.inbox=Inbox
+
 web.controlstrip.links.addfeed=Add it to your reading page
 
 web.controlstrip.links.addtocircle=Add them to your circle
@@ -3195,6 +3197,8 @@ web.controlstrip.links.flag=Flag Journal
 web.controlstrip.links.flag=Flag Journal
 
 web.controlstrip.links.home=Home
+
+web.controlstrip.links.inbox=Inbox
 
 web.controlstrip.links.invitefriends=Invite Friends
 
diff -r 39affe0d6b77 -r f9a6baa87a1e cgi-bin/weblib.pl
--- a/cgi-bin/weblib.pl	Sun Mar 08 02:39:57 2009 +0000
+++ b/cgi-bin/weblib.pl	Mon Mar 09 17:28:27 2009 +0000
@@ -2952,6 +2952,7 @@ sub control_strip
                  );
 
     if ($remote) {
+        $links{'inbox'} = "<a href='$LJ::SITEROOT/inbox'>$BML::ML{'web.controlstrip.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) {
@@ -3036,7 +3037,8 @@ 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";
-        $ret .= "$links{'home'}&nbsp;&nbsp; $links{'post_journal'}&nbsp;&nbsp; $links{'view_friends_page'}";
+        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 .= "</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