mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 09:12:41 +01:00
Use ChangesetListView in Phriction
Summary: Ref T2009. Upgrade this from DetailView to ListView so we get "Highlight As", "View Unified", etc., and respect the unified diff prefernce. Test Plan: Viewed diffs in Phriction. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T2009 Differential Revision: https://secure.phabricator.com/D12013
This commit is contained in:
parent
c35cafda2c
commit
100760fb31
1 changed files with 17 additions and 19 deletions
|
@ -72,10 +72,12 @@ final class PhrictionDiffController extends PhrictionController {
|
|||
|
||||
$whitespace_mode = DifferentialChangesetParser::WHITESPACE_SHOW_ALL;
|
||||
|
||||
$parser = new DifferentialChangesetParser();
|
||||
$parser->setUser($user);
|
||||
$parser->setChangeset($changeset);
|
||||
$parser->setRenderingReference("{$l},{$r}");
|
||||
$parser = id(new DifferentialChangesetParser())
|
||||
->setUser($user)
|
||||
->setChangeset($changeset)
|
||||
->setRenderingReference("{$l},{$r}");
|
||||
|
||||
$parser->readParametersFromRequest($request);
|
||||
$parser->setWhitespaceMode($whitespace_mode);
|
||||
|
||||
$engine = new PhabricatorMarkupEngine();
|
||||
|
@ -87,28 +89,25 @@ final class PhrictionDiffController extends PhrictionController {
|
|||
list($range_s, $range_e, $mask) =
|
||||
DifferentialChangesetParser::parseRangeSpecification($spec);
|
||||
|
||||
$output = $parser->render($range_s, $range_e, $mask);
|
||||
$parser->setRange($range_s, $range_e);
|
||||
$parser->setMask($mask);
|
||||
|
||||
if ($request->isAjax()) {
|
||||
return id(new PhabricatorChangesetResponse())
|
||||
->setRenderedChangeset($output);
|
||||
->setRenderedChangeset($parser->renderChangeset());
|
||||
}
|
||||
|
||||
$output = id(new DifferentialChangesetDetailView())
|
||||
$changes = id(new DifferentialChangesetListView())
|
||||
->setUser($this->getViewer())
|
||||
->setChangeset($changeset)
|
||||
->setRenderingRef("{$l},{$r}")
|
||||
->setChangesets(array($changeset))
|
||||
->setVisibleChangesets(array($changeset))
|
||||
->setRenderingReferences(array("{$l},{$r}"))
|
||||
->setRenderURI('/phriction/diff/'.$document->getID().'/')
|
||||
->appendChild($output);
|
||||
->setTitle(pht('Changes'))
|
||||
->setParser($parser);
|
||||
|
||||
require_celerity_resource('differential-changeset-view-css');
|
||||
require_celerity_resource('syntax-highlighting-css');
|
||||
require_celerity_resource('phriction-document-css');
|
||||
|
||||
Javelin::initBehavior('differential-populate', array(
|
||||
'changesetViewIDs' => array($output->getID()),
|
||||
));
|
||||
|
||||
$slug = $document->getSlug();
|
||||
|
||||
$revert_l = $this->renderRevertButton($content_l, $current);
|
||||
|
@ -198,13 +197,11 @@ final class PhrictionDiffController extends PhrictionController {
|
|||
'<table class="phriction-revert-table">'.
|
||||
'<tr><td>%s</td><td>%s</td>'.
|
||||
'</table>'.
|
||||
'%s'.
|
||||
'</div>',
|
||||
$comparison_table->render(),
|
||||
$navigation_table,
|
||||
$revert_l,
|
||||
$revert_r,
|
||||
$output);
|
||||
$revert_r);
|
||||
|
||||
|
||||
$object_box = id(new PHUIObjectBoxView())
|
||||
|
@ -215,6 +212,7 @@ final class PhrictionDiffController extends PhrictionController {
|
|||
array(
|
||||
$crumbs,
|
||||
$object_box,
|
||||
$changes,
|
||||
),
|
||||
array(
|
||||
'title' => pht('Document History'),
|
||||
|
|
Loading…
Reference in a new issue