mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-07 13:21:02 +01:00
5b15f725bd
Summary: most awesome is that differential-primary-pane no longer has a place in diffusion. less awesome is fixing the zebra striping on differential "Local Commits" view and making the font size of one of the table headers match the others. Test Plan: looks good! Reviewers: epriestley, chad Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4177
73 lines
2.1 KiB
PHP
73 lines
2.1 KiB
PHP
<?php
|
|
|
|
final class DiffusionChangeController extends DiffusionController {
|
|
|
|
public function processRequest() {
|
|
$drequest = $this->diffusionRequest;
|
|
|
|
$content = array();
|
|
|
|
$diff_query = DiffusionDiffQuery::newFromDiffusionRequest($drequest);
|
|
$changeset = $diff_query->loadChangeset();
|
|
|
|
if (!$changeset) {
|
|
// TODO: Refine this.
|
|
return new Aphront404Response();
|
|
}
|
|
|
|
$repository = $drequest->getRepository();
|
|
$callsign = $repository->getCallsign();
|
|
$commit = $drequest->getRawCommit();
|
|
$changesets = array(
|
|
0 => $changeset,
|
|
);
|
|
|
|
$changeset_view = new DifferentialChangesetListView();
|
|
$changeset_view->setTitle(DiffusionView::nameCommit($repository, $commit));
|
|
$changeset_view->setChangesets($changesets);
|
|
$changeset_view->setVisibleChangesets($changesets);
|
|
$changeset_view->setRenderingReferences(
|
|
array(
|
|
0 => $diff_query->getRenderingReference(),
|
|
));
|
|
|
|
$raw_params = array(
|
|
'action' => 'browse',
|
|
'params' => array(
|
|
'view' => 'raw',
|
|
),
|
|
);
|
|
$right_uri = $drequest->generateURI($raw_params);
|
|
$raw_params['params']['before'] = $drequest->getRawCommit();
|
|
$left_uri = $drequest->generateURI($raw_params);
|
|
$changeset_view->setRawFileURIs($left_uri, $right_uri);
|
|
|
|
$changeset_view->setRenderURI(
|
|
'/diffusion/'.$callsign.'/diff/');
|
|
$changeset_view->setWhitespace(
|
|
DifferentialChangesetParser::WHITESPACE_SHOW_ALL);
|
|
$changeset_view->setUser($this->getRequest()->getUser());
|
|
|
|
// TODO: This is pretty awkward, unify the CSS between Diffusion and
|
|
// Differential better.
|
|
require_celerity_resource('differential-core-view-css');
|
|
$content[] = $changeset_view->render();
|
|
|
|
$nav = $this->buildSideNav('change', true);
|
|
$nav->appendChild($content);
|
|
$crumbs = $this->buildCrumbs(
|
|
array(
|
|
'branch' => true,
|
|
'path' => true,
|
|
'view' => 'change',
|
|
));
|
|
$nav->setCrumbs($crumbs);
|
|
|
|
return $this->buildApplicationPage(
|
|
$nav,
|
|
array(
|
|
'title' => 'Change',
|
|
));
|
|
}
|
|
|
|
}
|