From 6c3b1feec896510d91cbac6d74890328fc2a27b6 Mon Sep 17 00:00:00 2001 From: Aizat Faiz Date: Wed, 25 May 2011 00:50:20 -0700 Subject: [PATCH] [diffusion] keep 'view' parameter when clicking on a line number Summary: Clicking on a line number will remove the current 'view' the user is in. This patch retains the current view. Test Plan: Open a file in diffusion, and change the view to "blame", clicking on the line number should retain the same view. Reviewed By: epriestley Reviewers: epriestley, jungejason CC: aran, epriestley, aizatto Differential Revision: 344 --- .../controller/file/DiffusionBrowseFileController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/applications/diffusion/controller/file/DiffusionBrowseFileController.php b/src/applications/diffusion/controller/file/DiffusionBrowseFileController.php index 84e572b186..50eeba0f52 100644 --- a/src/applications/diffusion/controller/file/DiffusionBrowseFileController.php +++ b/src/applications/diffusion/controller/file/DiffusionBrowseFileController.php @@ -210,12 +210,13 @@ class DiffusionBrowseFileController extends DiffusionController { } - private static function buildDisplayRows($text_list, $rev_list, $blame_dict, + private function buildDisplayRows($text_list, $rev_list, $blame_dict, $needs_blame, DiffusionRequest $drequest, $file_query, $selected) { $last_rev = null; $color = null; $rows = array(); $n = 1; + $view = $this->getRequest()->getStr('view'); if ($blame_dict) { $epoch_list = ipull($blame_dict, 'epoch'); @@ -291,12 +292,13 @@ class DiffusionBrowseFileController extends DiffusionController { // Create the row display. $uri_path = $drequest->getUriPath(); $uri_rev = $drequest->getStableCommitName(); + $uri_view = $view; $l = phutil_render_tag( 'a', array( 'class' => 'diffusion-line-link', - 'href' => $uri_path.';'.$uri_rev.'$'.$n, + 'href' => $uri_path.';'.$uri_rev.'$'.$n.'?view='.$view, ), $n);