mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-18 17:58:37 +01:00
Changed to use getBool and fixed pagesize and offset handling.
Summary: Simplified code and now pressing 'Hide/Show' button doesn't lose the pagesize/offset information. Test Plan: Tested with different arguments in my sandbox. Tested that the old 'copies=true' and 'copies=false' are still working. Reviewed By: epriestley Reviewers: epriestley, jungejason CC: aran, epriestley, tuomaspelkonen Differential Revision: 318
This commit is contained in:
parent
36a6fcb573
commit
22b2db6c15
2 changed files with 7 additions and 4 deletions
|
@ -30,7 +30,7 @@ class DiffusionHistoryController extends DiffusionController {
|
|||
$history_query->setOffset($offset);
|
||||
$history_query->setLimit($page_size + 1);
|
||||
|
||||
if ($request->getStr('copies') !== 'true') {
|
||||
if (!$request->getBool('copies')) {
|
||||
$history_query->needDirectChanges(true);
|
||||
}
|
||||
|
||||
|
@ -68,14 +68,16 @@ class DiffusionHistoryController extends DiffusionController {
|
|||
'view' => 'history',
|
||||
));
|
||||
|
||||
if ($request->getStr('copies') === 'true') {
|
||||
$button_uri = '?copies=false';
|
||||
if ($request->getBool('copies')) {
|
||||
$button_title = 'Hide Copies/Branches';
|
||||
} else {
|
||||
$button_uri = '?copies=true';
|
||||
$button_title = 'Show Copies/Branches';
|
||||
}
|
||||
|
||||
$button_uri = $request->getRequestURI()->alter(
|
||||
'copies',
|
||||
!$request->getBool('copies'));
|
||||
|
||||
$button = phutil_render_tag(
|
||||
'a',
|
||||
array(
|
||||
|
|
|
@ -14,6 +14,7 @@ phutil_require_module('phabricator', 'view/control/pager');
|
|||
phutil_require_module('phabricator', 'view/layout/panel');
|
||||
|
||||
phutil_require_module('phutil', 'markup');
|
||||
phutil_require_module('phutil', 'parser/uri');
|
||||
phutil_require_module('phutil', 'utils');
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue