kareila: (Default)
kareila ([personal profile] kareila) wrote in [site community profile] changelog2010-03-31 10:09 pm

[dw-free] Styles: Calendar or Archive but not both

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

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

Change journal archive links from /calendar to /archive, with redirect.

Patch by [personal profile] juliet.

Files modified:
  • cgi-bin/Apache/LiveJournal.pm
  • cgi-bin/LJ/PageStats.pm
  • cgi-bin/LJ/S2.pm
  • cgi-bin/LJ/S2/YearPage.pm
  • cgi-bin/LJ/User.pm
  • cgi-bin/ljlib.pl
  • cgi-bin/ljprotocol.pl
  • htdocs/editprivacy.bml
  • htdocs/editprivacy.bml.text
--------------------------------------------------------------------------------
diff -r 174296b8bd5d -r 48f587fb446f cgi-bin/Apache/LiveJournal.pm
--- a/cgi-bin/Apache/LiveJournal.pm	Wed Mar 31 16:40:06 2010 -0500
+++ b/cgi-bin/Apache/LiveJournal.pm	Wed Mar 31 17:09:32 2010 -0500
@@ -539,7 +539,7 @@ sub trans
 
             my %journal_pages = (
                 read => 1,
-                calendar => 1,
+                archive => 1,
                 month => 1,
                 day => 1,
                 tag => 1,
@@ -668,6 +668,10 @@ sub trans
             return redir($r, LJ::Session->setdomsess_handler($r));
         }
 
+        if ($uuri =~ m#^/calendar(.*)#) {
+            return redir($r, "/archive$1");
+        }
+
         if ($uuri =~ m#^/(\d+)\.html$#) {
             my $u = LJ::load_user($user)
                 or return 404;
@@ -699,7 +703,7 @@ sub trans
             } elsif (defined $mon) {
                 $mode = "month";
             } else {
-                $mode = "calendar";
+                $mode = "archive";
             }
 
         } elsif ($uuri =~ m!
diff -r 174296b8bd5d -r 48f587fb446f cgi-bin/LJ/PageStats.pm
--- a/cgi-bin/LJ/PageStats.pm	Wed Mar 31 16:40:06 2010 -0500
+++ b/cgi-bin/LJ/PageStats.pm	Wed Mar 31 17:09:32 2010 -0500
@@ -162,7 +162,7 @@ sub codepath {
     my %s1_map = (
         'bml.talkpost'   => "reply",
         'bml.talkread'   => "entry",
-        'bml.view.index' => "calendar",
+        'bml.view.index' => "archive",
     );
 
     foreach my $s1code (keys %s1_map) {
diff -r 174296b8bd5d -r 48f587fb446f cgi-bin/LJ/S2.pm
--- a/cgi-bin/LJ/S2.pm	Wed Mar 31 16:40:06 2010 -0500
+++ b/cgi-bin/LJ/S2.pm	Wed Mar 31 17:09:32 2010 -0500
@@ -129,7 +129,7 @@ sub make_journal
 
     my $view2class = {
         lastn    => "RecentPage",
-        calendar => "YearPage",
+        archive  => "YearPage",
         day      => "DayPage",
         read     => "FriendsPage",
         month    => "MonthPage",
@@ -2080,7 +2080,7 @@ sub Page
         'view_url' => {
             recent   => "$base_url/$style_args",
             userinfo => $u->profile_url,
-            archive  => "$base_url/calendar$style_args",
+            archive  => "$base_url/archive$style_args",
             read     => "$base_url/read$style_args",
             network  => "$base_url/network$style_args",
             tags     => "$base_url/tag/$style_args",
@@ -2522,7 +2522,6 @@ sub get_url
 
     # construct URL to return
     $view = "profile" if $view eq "userinfo";
-    $view = "calendar" if $view eq "archive";
     $view = "" if $view eq "recent";
     my $base = $u->journal_base;
     return "$base/$view";
diff -r 174296b8bd5d -r 48f587fb446f cgi-bin/LJ/S2/YearPage.pm
--- a/cgi-bin/LJ/S2/YearPage.pm	Wed Mar 31 16:40:06 2010 -0500
+++ b/cgi-bin/LJ/S2/YearPage.pm	Wed Mar 31 17:09:32 2010 -0500
@@ -41,7 +41,7 @@ sub YearPage
     my $maxyear = @years ? $years[-1] : undef;
     my $year = $get->{'year'};  # old form was /users/<user>/calendar?year=1999
 
-    # but the new form is purtier:  */calendar/2001
+    # but the new form is purtier:  */archive/2001
     if (! $year && $opts->{'pathextra'} =~ m!^/(\d\d\d\d)/?\b!) {
         $year = $1;
     }
diff -r 174296b8bd5d -r 48f587fb446f cgi-bin/LJ/User.pm
--- a/cgi-bin/LJ/User.pm	Wed Mar 31 16:40:06 2010 -0500
+++ b/cgi-bin/LJ/User.pm	Wed Mar 31 17:09:32 2010 -0500
@@ -8130,7 +8130,7 @@ sub get_daycounts
         if ( defined $getargs{'viewall'} and $getargs{'viewall'} eq '1' and ( $remote && $remote->has_priv( 'canview', '*' ) ) ) {
             $viewall = 1;
             LJ::statushistory_add( $u->userid, $remote->userid,
-                "viewall", "calendar" );
+                "viewall", "archive" );
         }
 
         if ( $remote->userid == $uid || $viewall || $remote->can_manage( $u ) ) {
diff -r 174296b8bd5d -r 48f587fb446f cgi-bin/ljlib.pl
--- a/cgi-bin/ljlib.pl	Wed Mar 31 16:40:06 2010 -0500
+++ b/cgi-bin/ljlib.pl	Wed Mar 31 17:09:32 2010 -0500
@@ -156,13 +156,13 @@ LJ::MemCache::init();
 $LJ::PROTOCOL_VER = ($LJ::UNICODE ? "1" : "0");
 
 # declare views (calls into ljviews.pl)
-@LJ::views = qw(lastn read calendar day);
+@LJ::views = qw(lastn read archive day);
 %LJ::viewinfo = (
                  "lastn" => {
                      "des" => "Most Recent Events",
                  },
-                 "calendar" => {
-                     "des" => "Calendar",
+                 "archive" => {
+                     "des" => "Archive",
                  },
                  "day" => {
                      "des" => "Day View",
diff -r 174296b8bd5d -r 48f587fb446f cgi-bin/ljprotocol.pl
--- a/cgi-bin/ljprotocol.pl	Wed Mar 31 16:40:06 2010 -0500
+++ b/cgi-bin/ljprotocol.pl	Wed Mar 31 17:09:32 2010 -0500
@@ -2695,7 +2695,7 @@ sub hash_menus
                 { 'text' => "Recent Entries",
                   'url' => "$LJ::SITEROOT/users/$user/", },
                 { 'text' => "Calendar View",
-                  'url' => "$LJ::SITEROOT/users/$user/calendar", },
+                  'url' => "$LJ::SITEROOT/users/$user/archive", },
                 { 'text' => "Friends View",
                   'url' => "$LJ::SITEROOT/users/$user/read", },
                 { 'text' => "-", },
diff -r 174296b8bd5d -r 48f587fb446f htdocs/editprivacy.bml
--- a/htdocs/editprivacy.bml	Wed Mar 31 16:40:06 2010 -0500
+++ b/htdocs/editprivacy.bml	Wed Mar 31 17:09:32 2010 -0500
@@ -89,8 +89,8 @@ body<=
         $ret .= LJ::bad_input(@errors) if @errors;
         $ret .= "<?p $ML{'.intro'} p?>";
 
-        $ret .= "<?p " . BML::ml('.calendar',
-                                { aopts => "href='" . $u->journal_base() . "/calendar/'" })
+        $ret .= "<?p " . BML::ml('.archive',
+                                { aopts => "href='" . $u->journal_base() . "/archive/'" })
                 . " p?>\n";;
         $ret .= "<?p " . BML::ml( 'xpost.respected', { aopts => "href='$LJ::SITEROOT/manage/settings/?cat=othersites'" } ) . "p?>";
 
diff -r 174296b8bd5d -r 48f587fb446f htdocs/editprivacy.bml.text
--- a/htdocs/editprivacy.bml.text	Wed Mar 31 16:40:06 2010 -0500
+++ b/htdocs/editprivacy.bml.text	Wed Mar 31 17:09:32 2010 -0500
@@ -3,7 +3,7 @@
 
 .button.ya.rly=Yes, Update these Posts
 
-.calendar=Your <a [[aopts]]>journal calendar</a> provides an easy way to browse through your posts by month.
+.archive=Your <a [[aopts]]>journal archive</a> provides an easy way to browse through your posts by month.
 
 .intro=Change the privacy level of all posts in a certain timeframe by choosing the start and end dates. You can also specify that only posts of a certain privacy level should be changed.
 
--------------------------------------------------------------------------------