1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 20:40:56 +01:00

[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
This commit is contained in:
Aizat Faiz 2011-05-25 00:50:20 -07:00
parent d21a056f1c
commit 6c3b1feec8

View file

@ -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) { $needs_blame, DiffusionRequest $drequest, $file_query, $selected) {
$last_rev = null; $last_rev = null;
$color = null; $color = null;
$rows = array(); $rows = array();
$n = 1; $n = 1;
$view = $this->getRequest()->getStr('view');
if ($blame_dict) { if ($blame_dict) {
$epoch_list = ipull($blame_dict, 'epoch'); $epoch_list = ipull($blame_dict, 'epoch');
@ -291,12 +292,13 @@ class DiffusionBrowseFileController extends DiffusionController {
// Create the row display. // Create the row display.
$uri_path = $drequest->getUriPath(); $uri_path = $drequest->getUriPath();
$uri_rev = $drequest->getStableCommitName(); $uri_rev = $drequest->getStableCommitName();
$uri_view = $view;
$l = phutil_render_tag( $l = phutil_render_tag(
'a', 'a',
array( array(
'class' => 'diffusion-line-link', 'class' => 'diffusion-line-link',
'href' => $uri_path.';'.$uri_rev.'$'.$n, 'href' => $uri_path.';'.$uri_rev.'$'.$n.'?view='.$view,
), ),
$n); $n);