1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Added button for showing/hiding copies in Diffusion history view

Summary:
By default, indirect events in Diffusion SVN history views were visible.
Now they are invisible, but the visiblity can be changed using a button
in the top right corner.

Test Plan:
Tested on multiple different files that the history is shown correctly after
the page is loaded, after the button is clicked once and after the button is
clicked the second time.

Reviewed By: epriestley
Reviewers: epriestley
CC: jungejason, epriestley, tuomaspelkonen
Differential Revision: 106
This commit is contained in:
tuomaspelkonen 2011-04-06 17:17:47 -07:00
parent e92b1fee9f
commit a34cb4bb12
2 changed files with 24 additions and 0 deletions

View file

@ -29,6 +29,11 @@ class DiffusionHistoryController extends DiffusionController {
$drequest);
$history_query->setOffset($offset);
$history_query->setLimit($page_size + 1);
if ($request->getStr('copies') !== 'true') {
$history_query->needDirectChanges(true);
}
$history = $history_query->loadHistory();
$phids = array();
@ -63,12 +68,30 @@ class DiffusionHistoryController extends DiffusionController {
'view' => 'history',
));
if ($request->getStr('copies') === 'true') {
$button_uri = '?copies=false';
$button_title = 'Hide Copies/Branches';
} else {
$button_uri = '?copies=true';
$button_title = 'Show Copies/Branches';
}
$button = phutil_render_tag(
'a',
array(
'class' => 'button small grey',
'href' => $button_uri,
),
phutil_escape_html($button_title));
$history_table = new DiffusionHistoryTableView();
$history_table->setDiffusionRequest($drequest);
$history_table->setHandles($handles);
$history_table->setHistory($history);
$history_panel = new AphrontPanelView();
$history_panel->setHeader('History');
$history_panel->addButton($button);
$history_panel->appendChild($history_table);
$history_panel->appendChild($pager);

View file

@ -13,6 +13,7 @@ phutil_require_module('phabricator', 'applications/phid/handle/data');
phutil_require_module('phabricator', 'view/control/pager');
phutil_require_module('phabricator', 'view/layout/panel');
phutil_require_module('phutil', 'markup');
phutil_require_module('phutil', 'utils');