wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r18627: LJSUP-8243. search by tag incorrect work...

Committer: gprochaev
LJSUP-8243. search by tag incorrect working

U   trunk/cgi-bin/LJ/Widget/Browse.pm
U   trunk/templates/Browse/browse.tmpl
Modified: trunk/cgi-bin/LJ/Widget/Browse.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Browse.pm	2011-03-18 08:02:04 UTC (rev 18626)
+++ trunk/cgi-bin/LJ/Widget/Browse.pm	2011-03-18 08:07:51 UTC (rev 18627)
@@ -405,6 +405,10 @@
         }
     }
 
+    my $search_uri = BML::get_uri();
+    $search_uri =~ s#(.*?)tag/.*#$1#;
+    $search_uri .= "/" if $search_uri !~ m#/$#; ## add end slash if not exist
+
     $template->param(
         communities             => \@tmpl_communities,
         posts                   => \@tmpl_posts,
@@ -434,6 +438,8 @@
                                     ),
         top_posts               => \@top_posts,
         top_comms               => \@top_comms,
+        search_url              => $search_uri,
+        tag                     => $search_str,
         view                    => $view,
         poll_of_the_day         => LJ::Widget::PollOfTheDay->render(
                                         vertical_account => $vertical ? $vertical->journal : undef,

Modified: trunk/templates/Browse/browse.tmpl
===================================================================
--- trunk/templates/Browse/browse.tmpl	2011-03-18 08:02:04 UTC (rev 18626)
+++ trunk/templates/Browse/browse.tmpl	2011-03-18 08:07:51 UTC (rev 18627)
@@ -5,8 +5,8 @@
 		</div>
 		<div class="l-content">
 		<tmpl_if is_vertical_view><ul class="m-tab-switcher">
-			<li<tmpl_if expr="view eq 'recent_posts'"> class="cur"</tmpl_if>><a href="?view=recent_posts">Recent posts</a><i class="b-round-ctl"></i><i class="b-round-ctr"></i></li>
-			<li<tmpl_if expr="view eq 'communities'"> class="cur"</tmpl_if>><a href="?view=communities">Communities</a><i class="b-round-ctl"></i><i class="b-round-ctr"></i></li>
+			<li<tmpl_if expr="view eq 'recent_posts'"> class="cur"</tmpl_if>><a href="<tmpl_var search_url><tmpl_if tag>tag/<tmpl_var tag></tmpl_if>?view=recent_posts">Recent posts</a><i class="b-round-ctl"></i><i class="b-round-ctr"></i></li>
+			<li<tmpl_if expr="view eq 'communities'"> class="cur"</tmpl_if>><a href="<tmpl_var search_url><tmpl_if tag>tag/<tmpl_var tag></tmpl_if>?view=communities">Communities</a><i class="b-round-ctl"></i><i class="b-round-ctr"></i></li>
 		</ul></tmpl_if>
 		<tmpl_if is_vertical_view>
 			<tmpl_if expr="view eq 'communities'">

Tags: livejournal, pm, tmpl, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments